[hidden],
.hidden {
    display: none !important;
}

.page-head {
    padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.5rem);
}

.page-head-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: clamp(2rem, 5vw, 4rem);
}

.page-head-copy > * + * {
    margin-top: 1.1rem;
}

.crumb {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color 0.3s ease;
}

.crumb:hover {
    color: var(--gold);
}

.crumb .icon {
    --icon-size: 0.9rem;
}

.calc {
    padding-bottom: clamp(3rem, 7vw, 6rem);
}

.calc-grid {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    align-items: start;
    gap: clamp(1.5rem, 3vw, 2.5rem);
}

.form-panel {
    padding: clamp(1.75rem, 3vw, 2.5rem);
    position: sticky;
    top: 96px;
}

.form-panel h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.55rem;
    line-height: 1.2;
    color: var(--star);
    margin: 0.6rem 0 0.4rem;
}

.form-panel > p {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 1.8rem;
}

.field + .field {
    margin-top: 1.25rem;
}

.field label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.field input,
.field select {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(4, 6, 13, 0.6);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--star);
    font-size: 0.95rem;
    font-weight: 300;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.field select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 2.2rem;
    cursor: pointer;
}

.field select option {
    background: var(--panel-solid);
    color: var(--star);
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--gold-soft);
    background: rgba(4, 6, 13, 0.85);
}

.field input::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

.field input::-webkit-calendar-picker-indicator {
    filter: invert(0.75) sepia(0.4) saturate(2) hue-rotate(3deg);
    cursor: pointer;
    opacity: 0.7;
}

.field input[aria-invalid='true'],
.field select[aria-invalid='true'] {
    border-color: var(--rose);
    background: rgba(199, 158, 192, 0.06);
}

.field-hint {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.74rem;
    line-height: 1.5;
    color: var(--muted);
    opacity: 0.75;
}

.field-error {
    display: none;
    margin-top: 0.45rem;
    font-size: 0.76rem;
    line-height: 1.5;
    color: var(--rose);
}

.field-error.is-shown {
    display: flex;
    gap: 0.4rem;
    align-items: flex-start;
    animation: rise-in 0.35s ease both;
}

.field-error.is-shown::before {
    content: '';
    flex: none;
    width: 5px;
    height: 5px;
    margin-top: 0.55rem;
    border-radius: 50%;
    background: var(--rose);
}

.form-actions {
    margin-top: 2rem;
    display: grid;
    gap: 0.7rem;
}

.form-summary {
    margin-top: 1.2rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(199, 158, 192, 0.3);
    border-radius: var(--r-sm);
    background: rgba(199, 158, 192, 0.05);
    font-size: 0.8rem;
    color: var(--rose);
}

.form-summary:empty {
    display: none;
}

.result-stack {
    display: grid;
    gap: clamp(1.25rem, 2.5vw, 2rem);
    min-width: 0;
}

.placeholder {
    padding: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 4vw, 3rem);
    text-align: center;
}

.placeholder .icon {
    --icon-size: 2rem;
    color: var(--gold);
    opacity: 0.7;
}

.placeholder h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.5rem;
    color: var(--star);
    margin: 1.1rem 0 0.6rem;
}

.placeholder p {
    max-width: 46ch;
    margin: 0 auto;
    font-size: 0.9rem;
    color: var(--muted);
}

.card {
    padding: clamp(1.5rem, 3vw, 2.4rem);
    animation: rise-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    padding-bottom: 1.1rem;
    margin-bottom: 1.6rem;
    border-bottom: 1px solid var(--line);
}

.card-head h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.4rem, 1.1rem + 0.7vw, 1.9rem);
    line-height: 1.2;
    color: var(--star);
}

.card-head .meta {
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.identity {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.6rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 99px;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
}

.tag b {
    color: var(--gold);
    font-weight: 600;
}

.tag .glyph {
    font-family: var(--font-glyph);
    font-size: 0.95rem;
    line-height: 1;
    color: var(--gold);
}

.balance {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: clamp(1.25rem, 3vw, 2.5rem);
}

.balance h4 {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
}

.bar-track {
    height: 3px;
    background: rgba(214, 226, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
}

.bar-fill {
    display: block;
    height: 100%;
    width: var(--v, 0%);
    background: linear-gradient(90deg, var(--gold-soft), var(--gold));
    border-radius: 99px;
    transform-origin: left;
    animation: bar-grow 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.notes {
    display: grid;
    gap: 1.5rem;
}

.note {
    padding-left: 1.4rem;
    border-left: 1px solid var(--gold-soft);
}

.note h4 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--star);
    margin-bottom: 0.5rem;
}

.note p + p {
    margin-top: 0.7rem;
}

.note p {
    font-size: 0.92rem;
    font-weight: 300;
    line-height: 1.75;
}

.note b {
    color: var(--gold);
    font-weight: 600;
}

.footnote {
    margin-top: 1.6rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--line);
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--muted);
}

.footnote b {
    color: var(--text);
    font-weight: 600;
}

.matrix-layout {
    display: grid;
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    align-items: start;
    gap: clamp(1.5rem, 3vw, 2.5rem);
}

.psycho {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    overflow: hidden;
}

.psycho-cell {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.5rem;
    background: rgba(7, 11, 22, 0.92);
    text-align: center;
}

.psycho-cell .key {
    position: absolute;
    top: 0.45rem;
    left: 0.5rem;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0.7;
}

.psycho-cell .digits {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 0.6rem + 1.6vw, 1.7rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--gold);
    word-break: break-all;
    animation: number-in 0.5s ease both;
}

.psycho-cell .label {
    font-size: 0.6rem;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.psycho-cell[data-count='0'] {
    background: rgba(4, 6, 13, 0.9);
}

.psycho-cell[data-count='0'] .digits {
    color: var(--muted);
    opacity: 0.35;
    font-size: 1.1rem;
}

.psycho-cell[data-strength='high'] {
    background: rgba(228, 197, 140, 0.07);
}

.psycho-cell[data-strength='high']::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid var(--gold-soft);
    pointer-events: none;
}

.psycho-caption {
    margin-top: 0.9rem;
    font-size: 0.74rem;
    line-height: 1.6;
    color: var(--muted);
}

.axes {
    display: grid;
    gap: 1.4rem;
}

.axes-group h4 {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 0.6rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--line);
}

.axis {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: baseline;
    gap: 0.4rem 0.9rem;
    padding: 0.55rem 0;
}

.axis + .axis {
    border-top: 1px solid rgba(214, 226, 255, 0.05);
}

.axis .code {
    font-variant-numeric: tabular-nums;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: var(--gold);
    white-space: nowrap;
}

.axis .name {
    font-size: 0.88rem;
    color: var(--star);
}

.axis .score {
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.axis p {
    grid-column: 2 / -1;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text);
    opacity: 0.85;
}

.axis[data-level='strong'] .score {
    color: var(--gold);
}

.axis[data-level='weak'] .score {
    color: var(--rose);
}

.num-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    overflow: hidden;
}

.num-card {
    padding: 1.5rem 1.4rem;
    background: rgba(7, 11, 22, 0.9);
}

.num-card .key {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.num-card .value {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 600;
    line-height: 1;
    color: var(--gold);
    margin: 0.7rem 0 0.8rem;
    animation: number-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.num-card .value small {
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.num-card h4 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--star);
    margin-bottom: 0.4rem;
}

.num-card p {
    font-size: 0.83rem;
    line-height: 1.65;
    color: var(--text);
}

.num-card .trail {
    display: block;
    margin-top: 0.7rem;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    opacity: 0.8;
}

.num-card[data-master='true'] .value {
    color: var(--ice);
}

.cycles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.cycle {
    position: relative;
    padding: 1.2rem 1.1rem 1.2rem 1.3rem;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, 0.015);
}

.cycle::before {
    content: '';
    position: absolute;
    top: 1.35rem;
    left: 0;
    width: 2px;
    height: 1.1rem;
    background: var(--gold-soft);
}

.cycle .span {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.cycle .n {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--gold);
    margin: 0.35rem 0 0.3rem;
}

.cycle h5 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--star);
    margin-bottom: 0.3rem;
}

.cycle p {
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text);
    opacity: 0.85;
}

.cycle[data-current='true'] {
    border-color: var(--gold-soft);
    background: rgba(228, 197, 140, 0.05);
}

.cycle[data-current='true']::before {
    height: calc(100% - 2.7rem);
    background: var(--gold);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    list-style: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--r-xs);
    background: rgba(255, 255, 255, 0.015);
    font-size: 0.78rem;
    color: var(--text);
}

.chip b {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--gold);
}

.chip[data-tone='debt'] {
    border-color: rgba(199, 158, 192, 0.35);
}

.chip[data-tone='debt'] b {
    color: var(--rose);
}

.chip--empty {
    color: var(--muted);
    font-style: italic;
}


.derive {
    display: grid;
    gap: 0;
    counter-reset: derive-step;
    list-style: none;
}

.derive li {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 0.4rem 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(214, 226, 255, 0.06);
    counter-increment: derive-step;
    min-width: 0;
}

.derive li:last-child {
    border-bottom: none;
}

.derive .step {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
    padding-top: 0.15rem;
}

.derive .math {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--star);
    font-variant-numeric: tabular-nums;
    word-break: break-all;
    overflow-wrap: break-word;
    min-width: 0;
}

.derive .hint {
    grid-column: 2 / -1;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text);
    opacity: 0.8;
    min-width: 0;
}


.destiny-section {
    margin-bottom: 1.6rem;
}

.destiny-wrap {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
}

.destiny-svg {
    width: 100%;
    max-width: 520px;
    height: auto;
    overflow: visible;
}

.destiny-svg .ring {
    fill: none;
    stroke: var(--line-strong);
    stroke-width: 1;
}

.destiny-svg .ring--inner {
    stroke: var(--line);
    stroke-dasharray: 4 4;
    opacity: 0.6;
}

.destiny-svg .shape-line {
    fill: none;
    stroke: var(--line-strong);
    stroke-width: 0.8;
}

.destiny-svg .shape-line--accent {
    stroke: var(--gold-soft);
    stroke-width: 1;
}

.destiny-svg .diag-line {
    stroke: rgba(199, 158, 192, 0.25);
    stroke-width: 0.6;
    stroke-dasharray: 3 3;
}

.destiny-svg .node-bg {
    fill: rgba(7, 11, 22, 0.92);
    stroke: var(--line-strong);
    stroke-width: 1;
}

.destiny-svg .node-bg--center {
    fill: rgba(228, 197, 140, 0.1);
    stroke: var(--gold-soft);
    stroke-width: 1.5;
}

.destiny-svg .node-bg--corner {
    fill: rgba(157, 192, 232, 0.06);
    stroke: var(--ice);
    stroke-width: 1;
    opacity: 0.8;
}

.destiny-svg .node-bg--diamond {
    fill: rgba(199, 158, 192, 0.06);
    stroke: var(--rose);
    stroke-width: 0.8;
    opacity: 0.7;
}

.destiny-svg .node-bg--mid {
    fill: rgba(7, 11, 22, 0.85);
    stroke: var(--line);
    stroke-width: 0.8;
}

.destiny-svg .node-num {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    fill: var(--gold);
    text-anchor: middle;
    dominant-baseline: central;
}

.destiny-svg .node-num--center {
    font-size: 22px;
    fill: var(--gold);
}

.destiny-svg .node-num--corner {
    font-size: 18px;
    fill: var(--ice);
}

.destiny-svg .node-num--diamond {
    font-size: 15px;
    fill: var(--rose);
}

.destiny-svg .node-num--mid {
    font-size: 12px;
    fill: var(--text);
}

.destiny-svg .node-label {
    font-family: 'Manrope', sans-serif;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.08em;
    fill: var(--muted);
    text-anchor: middle;
    text-transform: uppercase;
}

.destiny-svg .age-label {
    font-family: 'Manrope', sans-serif;
    font-size: 7px;
    fill: var(--muted);
    text-anchor: middle;
    opacity: 0.7;
}

.destiny-caption {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.76rem;
    line-height: 1.6;
    color: var(--muted);
}


.health-map {
    margin-top: 1.8rem;
}

.health-map-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.9rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--line);
}

.health-map-head h4 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.2rem;
    color: var(--star);
}

.health-map-head .meta {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.chakra-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    overflow: hidden;
    font-size: 0.82rem;
}

.chakra-table thead th {
    padding: 0.75rem 0.9rem;
    background: rgba(7, 11, 22, 0.8);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
    border-bottom: 1px solid var(--line-strong);
}

.chakra-table thead th:not(:last-child) {
    border-right: 1px solid var(--line);
}

.chakra-table tbody td {
    padding: 0.65rem 0.9rem;
    background: rgba(7, 11, 22, 0.6);
    border-bottom: 1px solid rgba(214, 226, 255, 0.05);
    color: var(--text);
    vertical-align: middle;
}

.chakra-table tbody tr:last-child td {
    border-bottom: none;
}

.chakra-table tbody td:not(:last-child) {
    border-right: 1px solid rgba(214, 226, 255, 0.05);
}

.chakra-table .chakra-name {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
    color: var(--star);
    white-space: nowrap;
}

.chakra-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chakra-table .chakra-num {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gold);
    text-align: center;
}

.chakra-table .chakra-desc {
    font-size: 0.76rem;
    color: var(--muted);
    line-height: 1.5;
}


.card {
    overflow: hidden;
    min-width: 0;
}

.axis .name,
.axis .code,
.axis p,
.chip {
    min-width: 0;
    overflow-wrap: break-word;
}

.num-grid {
    min-width: 0;
}

.num-card {
    min-width: 0;
    overflow: hidden;
}

.num-card .trail {
    word-break: break-all;
    overflow-wrap: break-word;
}

@media (max-width: 1040px) {
    .page-head-grid {
        grid-template-columns: 1fr;
    }

    .calc-grid {
        grid-template-columns: 1fr;
    }

    .form-panel {
        position: static;
    }

    .matrix-layout {
        grid-template-columns: 1fr;
    }

    .psycho {
        max-width: 340px;
    }

    .destiny-svg {
        max-width: 400px;
    }
}

@media (max-width: 620px) {
    .card-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .num-card .value {
        font-size: 2.4rem;
    }

    .derive li {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .derive .hint {
        grid-column: 1 / -1;
    }

    .destiny-svg {
        max-width: 320px;
    }

    .destiny-svg .node-num {
        font-size: 14px;
    }

    .destiny-svg .node-num--center {
        font-size: 18px;
    }

    .destiny-svg .node-num--corner {
        font-size: 15px;
    }

    .destiny-svg .node-num--diamond {
        font-size: 13px;
    }

    .destiny-svg .node-label {
        font-size: 6.5px;
    }

    .destiny-svg .age-label {
        font-size: 6px;
    }

    .chakra-table {
        font-size: 0.74rem;
    }

    .chakra-table thead th {
        padding: 0.6rem 0.6rem;
        font-size: 0.56rem;
    }

    .chakra-table tbody td {
        padding: 0.5rem 0.6rem;
    }

    .chakra-table .chakra-name {
        font-size: 0.72rem;
    }
}
