.kelly-page .tool-header-block {
    max-width: none;
    position: relative;
    padding-right: 84px;
}

.kelly-page .tool-frame {
    position: relative;
    overflow: hidden;
}

.kelly-page .tool-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(120deg, rgba(82, 181, 255, 0.07), transparent 28%),
        radial-gradient(circle at 82% 14%, rgba(71, 215, 173, 0.12), transparent 18%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: auto, auto, 28px 28px, 28px 28px;
    opacity: 0.48;
}

.kelly-page .tool-header-block,
.kelly-page .tool-shell,
.kelly-page .tool-notes {
    position: relative;
    z-index: 1;
}

.kelly-page .tool-shell {
    margin-top: -10px;
}

.kelly-toolbar {
    margin-bottom: 6px;
}

.kelly-title-stack {
    max-width: 42rem;
}

.kelly-language-toggle {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid rgba(43, 55, 71, 0.9);
    background: rgba(10, 16, 24, 0.88);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.kelly-language-button {
    border: 0;
    border-radius: 999px;
    padding: 7px 11px;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    background: transparent;
    cursor: pointer;
    transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.kelly-language-button:hover {
    color: var(--color-text);
}

.kelly-language-button.is-active {
    color: #edf6ff;
    background: linear-gradient(135deg, rgba(82, 181, 255, 0.25), rgba(71, 215, 173, 0.16));
    box-shadow: 0 8px 20px rgba(7, 12, 18, 0.26);
}

.kelly-page .page-title {
    margin: 0 0 4px;
    font-size: clamp(2.625rem, 4vw, 2.7rem);
}

.kelly-page .page-subtitle {
    margin: 0;
    max-width: 36rem;
    font-size: 17px;
    line-height: 1.45;
}

.kelly-bench {
    display: grid;
    gap: 10px;
}

.kelly-bench__rail {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kelly-chip,
.kelly-badge,
.kelly-metric,
.kelly-spectrum__tone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.2;
}

.kelly-chip,
.kelly-metric {
    border: 1px solid rgba(82, 181, 255, 0.17);
    padding: 5px 9px;
    color: var(--color-text-muted);
    background: rgba(16, 25, 37, 0.78);
}

.kelly-badge {
    border: 1px solid rgba(71, 215, 173, 0.22);
    padding: 6px 9px;
    color: #c7e8d7;
    background: rgba(71, 215, 173, 0.08);
}

.kelly-badge--quiet {
    border-color: rgba(148, 169, 188, 0.16);
    color: var(--color-text-muted);
    background: rgba(148, 169, 188, 0.08);
}

.kelly-bench__layout {
    display: flex;
    gap: 12px;
    align-items: start;
}

.kelly-panel--inputs {
    flex: 1 1 0;
}

.kelly-panel--result {
    flex: 1 1 0;
}

.kelly-panel {
    display: grid;
    align-content: start;
    align-self: start;
    gap: 14px;
    grid-auto-rows: min-content;
    min-width: 0;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(35, 48, 64, 0.92);
    background:
        linear-gradient(180deg, rgba(19, 24, 33, 0.98) 0%, rgba(13, 18, 25, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.kelly-panel--result {
    background:
        radial-gradient(circle at top right, rgba(82, 181, 255, 0.1), transparent 36%),
        linear-gradient(180deg, rgba(18, 23, 31, 0.98) 0%, rgba(12, 17, 24, 0.98) 100%);
}

.kelly-panel__header,
.kelly-spectrum__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}

.kelly-panel__eyebrow,
.kelly-panel__hint,
.kelly-field__label,
.kelly-field__meta,
.kelly-field__note,
.kelly-field__help,
.kelly-result__title,
.kelly-result__detail,
.kelly-band__label,
.kelly-band__copy,
.kelly-spectrum__title,
.kelly-spectrum__signal,
.kelly-spectrum__detail {
    margin: 0;
}

.kelly-panel__eyebrow {
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
    font-weight: 700;
}

.kelly-panel__hint,
.kelly-field__help,
.kelly-result__detail,
.kelly-band__copy,
.kelly-spectrum__detail {
    color: var(--color-text-muted);
    font-size: 14px;
    line-height: 1.45;
}

.kelly-panel__hint,
.kelly-band__copy {
    display: none;
}

.kelly-fields {
    display: grid;
    align-items: start;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kelly-field {
    display: grid;
    gap: 5px;
}

.kelly-field__label {
    font-size: 15px;
    font-weight: 700;
}

.kelly-field__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.kelly-field__note {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(36, 49, 64, 0.92);
    background: rgba(11, 18, 27, 0.72);
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 1.2;
}

.kelly-input-wrap {
    position: relative;
}

.kelly-input {
    padding-block: 11px;
    padding-right: 44px;
    font-size: 16px;
}

.kelly-input-unit {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    pointer-events: none;
}

.kelly-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    gap: 10px 12px;
}

.kelly-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
}

.kelly-actions__minor {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.kelly-actions .button-primary {
    min-height: 44px;
    min-width: 184px;
    padding: 11px 24px;
    background:
        linear-gradient(135deg, rgba(88, 150, 224, 0.92), rgba(102, 144, 214, 0.9));
    border-color: rgba(113, 167, 232, 0.86);
    box-shadow: 0 10px 24px rgba(14, 33, 58, 0.2);
    font-size: 16px;
}

.kelly-actions .button-secondary {
    min-height: 38px;
    padding: 9px 16px;
    background: rgba(9, 14, 21, 0.88);
    border-color: rgba(36, 50, 68, 0.92);
    color: var(--color-text-muted);
    font-size: 15px;
}

.kelly-actions .button-secondary:hover,
.kelly-actions .button-secondary:focus-visible {
    background: rgba(13, 20, 30, 0.96);
    color: var(--color-text);
}

.kelly-actions .button-primary:hover,
.kelly-actions .button-primary:focus-visible {
    box-shadow: 0 12px 26px rgba(14, 33, 58, 0.24);
}

.kelly-feedback-slot {
    min-height: 18px;
}

.kelly-feedback {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.45;
}

.kelly-feedback[data-state="success"] {
    color: var(--color-success);
}

.kelly-feedback[data-state="error"] {
    color: var(--color-danger);
}

.kelly-feedback[data-state="warning"] {
    color: #f3bf72;
}

.kelly-result {
    display: grid;
    gap: 7px;
    padding: 16px;
    min-height: 128px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(82, 181, 255, 0.18);
    background:
        linear-gradient(180deg, rgba(9, 14, 21, 0.92) 0%, rgba(8, 12, 18, 0.92) 100%);
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.kelly-result::after {
    content: "";
    width: 72px;
    height: 1px;
    background: linear-gradient(90deg, rgba(82, 181, 255, 0.6), transparent);
}

.kelly-result--positive {
    border-color: rgba(71, 215, 173, 0.24);
    background:
        linear-gradient(180deg, rgba(10, 18, 17, 0.95) 0%, rgba(9, 13, 18, 0.95) 100%);
}

.kelly-result--warning {
    border-color: rgba(248, 81, 73, 0.26);
    background:
        linear-gradient(180deg, rgba(29, 14, 16, 0.92) 0%, rgba(16, 12, 17, 0.92) 100%);
}

.kelly-result__title {
    font-size: 17px;
    font-weight: 700;
}

.kelly-result__value,
.kelly-band__value {
    margin: 0;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
}

.kelly-result__value {
    font-size: clamp(32px, 5.5vw, 44px);
    line-height: 0.95;
    font-weight: 700;
}

.kelly-result[data-signal="assertive"] {
    transform: translateY(-1px);
}

.kelly-bands {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kelly-band {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(38, 50, 66, 0.9);
    background: rgba(10, 15, 22, 0.76);
}

.kelly-band__label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
}

.kelly-band__value {
    font-size: 24px;
    line-height: 1;
    font-weight: 700;
}

.kelly-band__copy {
    min-height: 15px;
}

.kelly-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kelly-spectrum {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(36, 49, 64, 0.92);
    background:
        linear-gradient(180deg, rgba(9, 14, 21, 0.92) 0%, rgba(8, 11, 17, 0.92) 100%);
}

.kelly-spectrum__copy {
    max-width: 28rem;
}

.kelly-spectrum__title,
.kelly-spectrum__signal {
    font-size: 16px;
    font-weight: 700;
    color: #edf6ff;
}

.kelly-spectrum__tone {
    min-width: 96px;
    padding: 6px 10px;
    border: 1px solid rgba(82, 181, 255, 0.16);
    color: #dcecff;
    background: rgba(26, 38, 54, 0.72);
}

.kelly-spectrum__track {
    display: grid;
    gap: 8px;
}

.kelly-spectrum__meter {
    --kelly-spectrum-position: 0%;
    position: relative;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid rgba(56, 71, 89, 0.88);
    background:
        linear-gradient(90deg,
            rgba(148, 169, 188, 0.2) 0%,
            rgba(148, 169, 188, 0.2) 24.75%,
            rgba(33, 45, 60, 0.9) 24.75%,
            rgba(33, 45, 60, 0.9) 25.25%,
            rgba(103, 208, 139, 0.2) 25.25%,
            rgba(103, 208, 139, 0.2) 49.75%,
            rgba(33, 45, 60, 0.9) 49.75%,
            rgba(33, 45, 60, 0.9) 50.25%,
            rgba(82, 181, 255, 0.22) 50.25%,
            rgba(82, 181, 255, 0.22) 74.75%,
            rgba(33, 45, 60, 0.9) 74.75%,
            rgba(33, 45, 60, 0.9) 75.25%,
            rgba(255, 176, 97, 0.2) 75.25%,
            rgba(255, 176, 97, 0.2) 100%);
}

.kelly-spectrum__fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01));
}

.kelly-spectrum__marker {
    position: absolute;
    top: 50%;
    left: var(--kelly-spectrum-position);
    width: 11px;
    height: 11px;
    border-radius: 999px;
    border: 2px solid rgba(237, 246, 255, 0.96);
    background: #0f1620;
    box-shadow: 0 0 0 3px rgba(9, 14, 21, 0.86), 0 0 12px rgba(82, 181, 255, 0.16);
    transform: translate(-50%, -50%);
}

.kelly-spectrum__labels {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    color: var(--color-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.kelly-spectrum__labels span:nth-child(2),
.kelly-spectrum__labels span:nth-child(3) {
    text-align: center;
}

.kelly-spectrum__labels span:last-child {
    text-align: right;
}

.kelly-spectrum__meter[data-signal="skip"] .kelly-spectrum__marker,
.kelly-spectrum__meter[data-signal="idle"] .kelly-spectrum__marker {
    box-shadow: 0 0 0 3px rgba(9, 14, 21, 0.86), 0 0 10px rgba(148, 169, 188, 0.12);
}

.kelly-spectrum__meter[data-signal="cautious"] .kelly-spectrum__marker {
    box-shadow: 0 0 0 3px rgba(9, 14, 21, 0.86), 0 0 11px rgba(103, 208, 139, 0.14);
}

.kelly-spectrum__meter[data-signal="measured"] .kelly-spectrum__marker {
    box-shadow: 0 0 0 3px rgba(9, 14, 21, 0.86), 0 0 12px rgba(82, 181, 255, 0.16);
}

.kelly-spectrum__meter[data-signal="assertive"] .kelly-spectrum__marker {
    box-shadow: 0 0 0 3px rgba(9, 14, 21, 0.86), 0 0 12px rgba(255, 176, 97, 0.16);
}

.kelly-notes {
    max-width: none;
    grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.75fr);
    align-items: start;
    gap: 14px 28px;
}

.kelly-notes .card-title {
    grid-column: 1 / -1;
}

.kelly-notes .card-text {
    font-size: 15px;
    line-height: 1.65;
}

.kelly-notes .card-text:first-of-type {
    grid-column: 1 / 2;
}

.kelly-notes .card-text:not(:first-of-type) {
    grid-column: 2 / 3;
}

.kelly-notes .card-text strong {
    color: var(--color-text);
}

@media (max-width: 960px) {
    .kelly-bench__layout {
        gap: 9px;
    }

    .kelly-panel--inputs {
        flex-basis: 0;
        flex-grow: 1;
    }

    .kelly-panel--result {
        flex-basis: 0;
        flex-grow: 1;
    }

    .kelly-notes {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .kelly-notes .card-text:first-of-type,
    .kelly-notes .card-text:not(:first-of-type) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .kelly-bench__layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .kelly-panel--inputs,
    .kelly-panel--result {
        flex: initial;
    }
}

@media (max-width: 720px) {
    .kelly-toolbar,
    .kelly-spectrum__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .kelly-fields,
    .kelly-bands {
        grid-template-columns: minmax(0, 1fr);
    }

    .kelly-actions__minor {
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .kelly-page .tool-header-block {
        padding-right: 0;
    }

    .kelly-language-toggle {
        position: static;
        margin-bottom: 8px;
    }

    .kelly-bench__rail {
        display: none;
    }

    .kelly-page .page-title {
        font-size: clamp(1.95rem, 7.5vw, 2.2rem);
    }

    .kelly-page .page-subtitle {
        max-width: 24rem;
        font-size: 15px;
        line-height: 1.5;
    }

    .kelly-panel {
        padding: 14px;
    }

    .kelly-panel__hint,
    .kelly-band__copy,
    .kelly-spectrum__detail {
        display: none;
    }

    .kelly-spectrum__header {
        align-items: center;
    }

    .kelly-result__value {
        font-size: 38px;
    }

    .kelly-field__label {
        font-size: 14px;
    }

    .kelly-field__note,
    .kelly-chip,
    .kelly-badge,
    .kelly-metric,
    .kelly-spectrum__tone,
    .kelly-spectrum__labels {
        font-size: 12px;
    }

    .kelly-feedback,
    .kelly-panel__hint,
    .kelly-result__detail,
    .kelly-band__copy,
    .kelly-spectrum__detail,
    .kelly-notes .card-text {
        font-size: 14px;
    }
}

@media (max-width: 900px) {
    .kelly-spectrum__detail {
        display: none;
    }
}

@media (max-width: 520px) {
    .kelly-actions {
        gap: 8px;
    }

    .kelly-actions .button-primary {
        min-width: 0;
        padding-inline: 20px;
    }

    .kelly-actions__minor {
        gap: 6px;
    }
}
