/* ===================== Design-Tokens ===================== */

:root {
    --bg: #000000;
    --panel: #ffffff;
    --ink: #242424;
    --ink-soft: #6b6b76;
    --line: #ececf1;
    --blue: #704cff;
    --blue-2: #21c8df;
    --blue-soft: rgba(117, 88, 255, .14);
    --orange: #ff836b;
    --orange-2: #f08a3c;
    --orange-soft: #fce8d2;
    --radius: 13px;
    --grad: linear-gradient(135deg, #7558ff, #21c8df);
    --grad-2: linear-gradient(135deg, #24c7df, #a94cff);
    --grad-3: linear-gradient(135deg, #ff836b, #754dff);
    --purple-bg: #e2ddf9;
    --pink-bg: #f4d9f1;
    --rose-bg: #f7d9df;
    --blue-bg: #d9eafa;
    --orange-bg: #fce8d2;
    --cyan-bg: #d9f1f8;
}

/* ===================== Reset ===================== */

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    direction: ltr;
    text-align: left;
}

/* ===================== Background ===================== */

body {
    /* Verlauf: links schwarz -> rechts bestehendes Blau */
    background: linear-gradient(
  90deg,
  #000000 0%,
  #000000 30%,
  #071525 60%,
  var(--blue) 100%
);

}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% -12%, rgba(255, 255, 255, .06), transparent 55%);
}

/* ===================== App ===================== */

.app {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ===================== Header ===================== */

.header {
    flex: 0 0 auto;
    padding: 19px 28px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, .55);
}

.system {
    color: #ffffff;
    font-weight: 650;
}

.logo {
    width: 200px;
    height: auto;
    max-height: 64px;
    object-fit: contain;
    display: block;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.install-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
    color: rgba(255, 255, 255, .82);
    font-size: 9px;
    letter-spacing: 1.5px;
}

.install-button:hover {
    background: rgba(255, 255, 255, .1);
    color: #ffffff;
    filter: none;
    transform: none;
    box-shadow: none;
}

.install-button svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.connection {
    display: flex;
    align-items: center;
    gap: 9px;
}

.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c9ccd6;
    transition: background .3s, box-shadow .3s;
}

.connection.online .connection-dot {
    background: var(--blue);
    box-shadow: 0 0 12px rgba(117, 88, 255, .55);
}

/* ===================== Stage ===================== */

.stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: row;
    gap: 24px;
    padding: 8px 28px 16px;
    align-items: stretch;
}

/* ===================== Titelleiste ===================== */

.panel-title {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--line);
}

.panel-title-text {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: .5px;
    line-height: 1.1;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--blue);
}

.login-button {
    flex: 0 0 auto;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #e6e0ff;
    border-radius: 8px;
    background: transparent;
    color: var(--blue);
    cursor: pointer;
}

.login-button:hover {
    background: var(--purple-bg);
    filter: none;
    transform: none;
    box-shadow: none;
}

/* Gemeinsame Darstellung der Icon-SVGs in Title- und Mikrofon-Buttons. */
.login-button svg,
.help-button svg,
.mic-button svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-button svg {
    width: 16px;
    height: 16px;
}

.help-button {
    flex: 0 0 auto;
    margin-left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #e6e0ff;
    border-radius: 8px;
    background: transparent;
    color: var(--blue);
    cursor: pointer;
}

.help-button:hover {
    background: var(--purple-bg);
    filter: none;
    transform: none;
    box-shadow: none;
}

.help-button svg {
    width: 16px;
    height: 16px;
}

.panel-title .login-button {
    margin-left: 0;
}

.panel-title .usage-badge {
    margin-left: auto;
}

.panel-title .user-name {
    margin-left: 0;
}

.help-card {
    max-width: 720px;
}

#detailsOverlay .login-card {
    max-width: 860px;
}

.help-levels {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 0;
    padding-left: 20px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--ink);
}

.help-levels strong {
    color: var(--blue);
}

.help-steps {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 0;
    padding-left: 20px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--ink);
}

.help-steps strong {
    color: var(--blue);
}

.help-note {
    margin: 16px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 10px;
    line-height: 1.55;
    color: var(--ink-soft);
}

.help-heading {
    margin: 18px 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--blue);
}

.help-text {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    color: var(--ink);
}

.help-accept {
    display: block;
    width: 100%;
    margin-top: 18px;
}

.user-name {
    flex: 0 0 auto;
    margin-left: auto;
    max-width: 150px;
    padding: 7px 12px;
    border-radius: 8px;
    background: var(--purple-bg);
    color: var(--blue);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.user-name:hover {
    background: #d6cdf7;
}

/* ===================== Anmelde-Overlay ===================== */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .7);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.overlay.open {
    display: flex;
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 360px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 26px 24px 22px;
    background: #ffffff;
    color: var(--ink);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}

.login-card h2 {
    margin: 0 0 18px;
    font-size: 18px;
    font-weight: 750;
    letter-spacing: .5px;
}

.sc-account {
    max-width: 420px;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-card label {
    margin-top: 6px;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 2.5px;
    color: var(--ink-soft);
}

.login-card input {
    width: 100%;
    padding: 11px 13px;
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    background: #f7f8fc;
    border: 1px solid var(--line);
    border-radius: 9px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.login-card input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-soft);
    background: #ffffff;
}

.login-card form button {
    width: 100%;
    margin-top: 14px;
}

.login-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
    color: var(--ink-soft);
    background: transparent;
    border-radius: 8px;
}

.login-close:hover {
    color: var(--ink);
    background: #f0f0f5;
    filter: none;
    transform: none;
    box-shadow: none;
}

/* ===================== Nutzer-/Verlaufs-Overlays ===================== */

.sc-history {
    max-width: 520px;
}

.sc-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.sc-tab {
    flex: 1 1 0;
    padding: 9px 10px;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: var(--ink-soft);
    background: #f1f2f7;
    border-radius: 8px;
    box-shadow: none;
}

.sc-tab:hover {
    transform: none;
    box-shadow: none;
    filter: none;
    background: #e9eaf2;
}

.sc-tab.active {
    color: #ffffff;
    background: var(--grad);
}

.sc-message {
    min-height: 14px;
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--ink-soft);
}

.sc-message.error {
    color: #b42318;
}

.sc-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: #f7f8fc;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.sc-balance-label {
    display: block;
    font-size: 7px;
    letter-spacing: 2.5px;
    color: var(--ink-soft);
}

.sc-balance-value {
    display: block;
    margin-top: 3px;
    font-size: 18px;
    font-weight: 750;
    color: var(--ink);
}

.sc-badge {
    flex: 0 0 auto;
    padding: 5px 9px;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #b42318;
    background: var(--rose-bg);
    border-radius: 999px;
    white-space: nowrap;
}

.sc-badge.unlocked {
    color: #0f7a3d;
    background: #d6f5e3;
}

.sc-payment {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.sc-pay-btn {
    display: block;
    width: 100%;
    padding: 11px 14px;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 1.5px;
    text-align: center;
    color: #ffffff;
    background: var(--grad);
    border: none;
    border-radius: 9px;
}

.sc-qr {
    display: block;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    padding: 8px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.sc-credit-rate {
    margin: 0 0 12px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--ink-soft);
}

.sc-pay-options {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.sc-pay-option {
    flex: 1 1 0;
    padding: 10px 8px;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: 1.5px;
    text-align: center;
    color: var(--ink-soft);
    background: #f1f2f7;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
}

.sc-pay-option:hover {
    background: #e9eaf2;
    filter: none;
    transform: none;
    box-shadow: none;
}

.sc-pay-option.active {
    color: #ffffff;
    background: var(--grad);
    border-color: transparent;
}

.sc-pay-detail {
    margin-bottom: 12px;
}

#scPayConfirm {
    margin-bottom: 4px;
}

.sc-bank {
    margin: 0;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 11px;
    line-height: 1.5;
    white-space: pre-wrap;
    color: var(--ink);
    background: #f7f8fc;
    border: 1px solid var(--line);
    border-radius: 9px;
}

.sc-hint {
    margin: 0;
    font-size: 10px;
    color: var(--ink-soft);
}

.sc-logout-btn {
    width: 100%;
    margin-bottom: 8px;
}

.sc-logout-btn {
    margin-top: 12px;
    color: #b42318;
    border-color: #f3c9c4;
}

.sc-logout-btn:hover {
    background: var(--rose-bg);
    color: #b42318;
}

.sc-history-list,
.sc-history-detail {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sc-history-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    padding: 11px 13px;
    white-space: normal;
    text-align: left;
    color: var(--ink);
    background: #f7f8fc;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.sc-history-item:hover {
    transform: none;
    box-shadow: none;
    filter: none;
    border-color: var(--blue);
    background: #ffffff;
}

.sc-history-item-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.sc-history-item-meta {
    font-size: 10px;
    color: var(--ink-soft);
    letter-spacing: 0;
}

.sc-back {
    align-self: flex-start;
    margin-bottom: 4px;
}

.sc-detail-head {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
}

.sc-detail-conv-title {
    margin-top: 10px;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 2.5px;
    color: var(--ink-soft);
}

.sc-detail-conv-line {
    font-size: 11px;
    line-height: 1.5;
    color: var(--ink);
}

.usage-badge {
    flex: 0 0 auto;
    padding: 4px 9px;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--ink-soft);
    background: #f1f2f7;
    border-radius: 999px;
    white-space: nowrap;
}

.usage-badge.unlocked {
    color: #0f7a3d;
    background: #d6f5e3;
}

/* ===================== Status (in der Kopfzeile) ===================== */

.status {
    font-size: 10px;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, .7);
}

.status.listening {
    color: #b7a8ff;
}

.status.thinking {
    color: #ffb199;
}

.status.speaking {
    color: #7fe3f2;
}

/* ===================== Panel ===================== */

.panel {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 5px solid var(--blue);
    border-radius: var(--radius);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
    overflow: hidden;
    color: var(--ink);
}

.panel-head {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 13px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.field label {
    font-size: 8px;
    letter-spacing: 3px;
    color: var(--ink-soft);
    font-weight: 600;
}

select {
    width: 100%;
    appearance: none;
    background: #f7f8fc;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 10px 11px;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: .4px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-soft);
}

select:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ===================== Conversation ===================== */

.conversation {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.conversation::-webkit-scrollbar {
    width: 8px;
}

.conversation::-webkit-scrollbar-thumb {
    background: #d7d9e2;
    border-radius: 8px;
}

.message {
    max-width: 82%;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
    border: 1px solid var(--line);
    background: #f7f8fc;
    border-radius: 12px;
    direction: ltr;
    text-align: left;
}

.message .label {
    display: block;
    margin-bottom: 5px;
    font-size: 7px;
    letter-spacing: 2.5px;
    color: var(--ink-soft);
    font-weight: 700;
}

.message.assistant {
    align-self: flex-start;
    background: var(--blue-bg);
    border-color: rgba(112, 76, 255, .14);
}

.message.user {
    align-self: flex-end;
    background: var(--orange-bg);
    border-color: rgba(240, 138, 60, .22);
}

.message.error {
    align-self: center;
    color: #b42318;
    background: var(--rose-bg);
    border-color: rgba(180, 35, 24, .15);
}

.message.system {
    align-self: center;
    color: var(--ink-soft);
    font-size: 11px;
    letter-spacing: .5px;
    background: transparent;
    border-color: transparent;
}

.message.evaluation {
    align-self: stretch;
    max-width: 100%;
    background: var(--purple-bg);
    border-color: rgba(112, 76, 255, .18);
}

.score-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(112, 76, 255, .18);
}

.score-name {
    font-weight: 650;
}

.score-value {
    font-weight: 700;
    color: var(--blue);
    white-space: nowrap;
}

.score-comment {
    padding: 6px 0 2px;
    font-size: 12px;
    color: var(--ink-soft);
}

.score-summary {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(112, 76, 255, .18);
    font-size: 12px;
    color: var(--ink);
}

/* .cursor deaktiviert: kein blinkender Marker mehr. */

/* ===================== Foot ===================== */

.panel-foot {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--line);
}

.foot-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.text-input {
    flex: 1 1 auto;
    min-width: 0;
    background: #f7f8fc;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 11px 15px;
    font-family: inherit;
    font-size: 12px;
    direction: ltr;
    text-align: left;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.text-input::placeholder {
    color: #94a3b8;
}

.text-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-soft);
    background: #ffffff;
}

.mic-button {
    flex: 0 0 auto;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 66px;
    padding: 8px 12px;
    border: 1px solid #e6e0ff;
    border-radius: 9px;
    background: #ffffff;
    color: var(--blue);
    cursor: pointer;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: 1.5px;
    line-height: 1;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.mic-button:hover {
    background: var(--purple-bg);
    filter: none;
    transform: none;
    box-shadow: none;
}

.mic-button.active {
    color: #ffffff;
    background: var(--grad-3);
    border-color: transparent;
}

.mic-button svg {
    width: 18px;
    height: 18px;
}

.mic-label {
    display: block;
    pointer-events: none;
}

.level {
    flex: 1 1 auto;
    height: 6px;
    border-radius: 999px;
    background: #eceef6;
    overflow: hidden;
}

.level-bar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: var(--grad);
    box-shadow: 0 0 10px rgba(117, 88, 255, .35);
    transition: width .05s;
}

/* ===================== Buttons ===================== */

button {
    appearance: none;
    border: none;
    background: var(--grad);
    color: #ffffff;
    padding: 11px 21px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 1.5px;
    border-radius: 9px;
    cursor: pointer;
    transition: filter .2s, box-shadow .15s, transform .15s, background .2s;
    white-space: nowrap;
}

button:hover {
    filter: brightness(1.06);
    box-shadow: 0 5px 16px rgba(0, 0, 0, .12);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

button.active {
    background: var(--grad-3);
    box-shadow: 0 5px 16px rgba(255, 131, 107, .35);
}

button.ghost {
    padding: 10px 16px;
    letter-spacing: 1.5px;
    color: var(--blue);
    background: #ffffff;
    border: 1px solid #e6e0ff;
}

button.ghost:hover {
    background: var(--purple-bg);
    color: var(--blue);
    filter: none;
}

button.evaluate {
    background: var(--grad-3);
    border: none;
    color: #ffffff;
}

button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ===================== Debug ===================== */

.status-bar {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0 28px 13px;
}

.debug {
    color: #8a8f9e;
    font-size: 7px;
    letter-spacing: 1px;
}

.disclaimer {
    color: #8a8f9e;
    font-size: 8px;
    letter-spacing: .3px;
    text-align: right;
}

/* ===================== Mobile ===================== */

@media (max-width: 900px) {
    .stage {
        flex-direction: column;
        gap: 10px;
        padding: 6px 18px 14px;
    }

    .header {
        padding: 18px 18px 6px;
    }

    .status-bar {
        padding: 0 18px 12px;
    }
}

        @media (max-width: 640px) {
            .logo {
                width: 150px;
                max-height: 48px;
            }

    .header-actions {
        gap: 10px;
    }

    .install-button {
        width: 30px;
        height: 30px;
        padding: 0;
        justify-content: center;
    }

    .install-button span {
        display: none;
    }

    .conversation {
        padding: 14px;
        gap: 12px;
    }

    .message {
        max-width: 92%;
    }

    .panel-foot {
        padding: 14px;
        gap: 10px;
    }

    .foot-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Eingabefeld zuerst, volle Breite und groß genug */
    .foot-row .text-input {
        order: -1;
        flex: 1 1 100%;
        width: 100%;
        font-size: 16px;
        padding: 16px;
    }

    .foot-row #sendButton {
        flex: 1 1 0;
        padding: 16px 12px;
        letter-spacing: 1px;
    }

    .foot-row .mic-button {
        flex: 0 0 auto;
        padding: 12px 14px;
    }

    .panel-head {
        flex-wrap: nowrap;
        gap: 8px;
        align-items: flex-end;
    }

    .panel-head .field {
        flex: 1 1 auto;
        min-width: 0;
    }

    .panel-head button {
        flex: 0 0 auto;
        padding: 10px 12px;
        letter-spacing: 1px;
    }
}

/* Titelzeile auf schmalen Geräten: Nutzername darf nicht abgeschnitten werden. */
@media (max-width: 640px) {
    .panel-title {
        gap: 8px;
        padding: 14px;
    }

    .panel-title-text {
        min-width: 0;
        font-size: 18px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .usage-badge {
        font-size: 7px;
        padding: 3px 7px;
    }

    .login-button,
    .help-button {
        width: 30px;
        height: 30px;
    }

    .user-name {
        max-width: 96px;
        padding: 6px 9px;
        font-size: 10px;
    }
}

/* ===================== FutureSkillCoach ===================== */

.function-description {
    flex: 0 0 auto;
    padding: 11px 18px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--line);
    min-height: 36px;
    max-height: 155px;
    overflow-y: auto;
    transition: max-height .2s ease;
}

.function-description.expanded {
    max-height: 45vh;
}

.function-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.function-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.function-toggle {
    flex: 0 0 auto;
}

.function-meta {
    display: block;
    margin-top: 3px;
    color: var(--ink-soft);
}

.function-price {
    display: inline-block;
    margin-top: 5px;
    color: var(--orange-2);
    font-weight: 650;
}

.function-collapsed-hint,
.function-level-help {
    margin-top: 6px;
    font-size: 10px;
    color: var(--ink-soft);
}

.function-level-help {
    margin-bottom: 6px;
}

.function-competencies {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 7px 0 0;
    padding: 0;
}

.competency-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f8fc;
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    text-align: left;
    white-space: normal;
}

.competency-button:hover {
    background: var(--purple-bg);
    color: var(--ink);
    filter: none;
    transform: none;
    box-shadow: none;
}

.competency-name {
    flex: 1 1 auto;
    min-width: 0;
}

.soll-badge {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
}

.progress-wrap {
    flex: 0 0 auto;
    padding: 9px 18px 11px;
    border-bottom: 1px solid var(--line);
    background: #fbfbff;
}

.progress-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 10px;
    letter-spacing: .3px;
    color: var(--ink-soft);
}

.progress-info #progressText {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-track {
    height: 6px;
    margin-top: 6px;
    border-radius: 999px;
    background: #eceef6;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: var(--grad);
    transition: width .3s;
}

.link-button {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--blue);
    padding: 0;
    font-family: inherit;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .5px;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
}

.link-button:hover {
    filter: none;
    transform: none;
    box-shadow: none;
    color: var(--blue-2);
}

.message.intro {
    align-self: stretch;
    max-width: 100%;
    background: var(--cyan-bg);
    border-color: rgba(33, 200, 223, .25);
}

.message.intro .intro-details {
    display: block;
    margin-top: 8px;
}

.details-meta {
    margin: -4px 0 10px;
    font-size: 11px;
    color: var(--ink-soft);
}

.details-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--ink);
}

.details-heading {
    margin: 16px 0 6px;
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--blue);
}

.details-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.6;
}

.level-intro {
    margin: 0 0 10px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--ink-soft);
}

.level-card {
    margin-bottom: 10px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--line);
    border-radius: 9px;
    background: #fbfbff;
}

.level-card.is-soll {
    border-color: rgba(112, 76, 255, .35);
    border-left-color: var(--blue);
    background: #f7f5ff;
}

.level-card.is-active {
    border-left-color: var(--orange-2);
    background: #fff9f4;
}

.level-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.level-number {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--blue);
}

.level-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
}

.level-bloom {
    font-size: 10px;
    color: var(--ink-soft);
}

.level-flag {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.level-flag.soll {
    background: var(--blue);
    color: #ffffff;
}

.level-flag.active {
    background: var(--orange-2);
    color: #ffffff;
}

.level-hint {
    margin: 0 0 6px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--ink-soft);
}

.level-behavior {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    color: var(--ink);
}

.level-label {
    margin-top: 7px;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.level-goals {
    margin: 3px 0 0;
    padding-left: 18px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--ink);
}

.eval-summary {
    margin: 4px 0 10px;
    font-size: 13px;
    line-height: 1.5;
}

.eval-section-title {
    margin-top: 14px;
    font-size: 9px;
    letter-spacing: 2px;
    font-weight: 700;
    color: var(--ink-soft);
}

.recommendation {
    margin-top: 12px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid rgba(112, 76, 255, .16);
    border-radius: 10px;
}

.recommendation-title {
    font-size: 13px;
    font-weight: 700;
}

.recommendation-meta {
    margin: 2px 0 6px;
    font-size: 11px;
    font-weight: 650;
    color: var(--blue);
}

.recommendation-why {
    margin-bottom: 8px;
    font-size: 12px;
    font-style: italic;
    color: var(--ink-soft);
}

.recommendation-action {
    margin: 6px 0;
    font-size: 12px;
    line-height: 1.55;
}

.recommendation-label {
    margin-top: 8px;
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.recommendation-list {
    margin: 4px 0 0;
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.5;
}

.recommendation-list a {
    color: var(--blue);
}

.recommendation-success {
    margin-top: 8px;
    font-size: 12px;
    color: var(--ink);
}

.competency-icon {
    flex: 0 0 auto;
    font-size: 14px;
    line-height: 1;
}

.level-symbol {
    font-size: 14px;
    line-height: 1;
    color: var(--blue);
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 12px;
}

.result-stat {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #ffffff;
}

.result-stat.is-ok {
    border-color: rgba(26, 127, 55, .2);
    background: #f3fbf5;
}

.result-stat.is-gap {
    border-color: rgba(180, 35, 24, .18);
    background: #fff6f4;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    background: #e8eaf3;
    color: var(--ink);
}

.result-stat.is-ok .stat-icon {
    background: #d7f5df;
    color: #1a7f37;
}

.result-stat.is-gap .stat-icon {
    background: #fde2dd;
    color: #b42318;
}

.stat-value {
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 10px;
    line-height: 1.25;
    color: var(--ink-soft);
}

.result-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(112, 76, 255, .18);
}

.result-row:last-child {
    border-bottom: none;
}

.result-icon {
    flex: 0 0 auto;
    width: 28px;
    font-size: 20px;
    line-height: 1.2;
    text-align: center;
}

.result-main {
    flex: 1 1 auto;
    min-width: 0;
}

.result-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.result-name {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.result-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
}

.result-badge.is-ok {
    background: #d7f5df;
    color: #1a7f37;
}

.result-badge.is-gap {
    background: #fde2dd;
    color: #b42318;
}

.result-badge.is-strength {
    background: #fff1c2;
    color: #8a5a00;
}

.result-meta {
    margin-top: 2px;
    font-size: 10px;
    color: var(--ink-soft);
}

.result-level-bar {
    display: flex;
    gap: 3px;
    margin-top: 6px;
}

.result-level-seg {
    flex: 1 1 0;
    height: 6px;
    border-radius: 999px;
    background: #e6e8f2;
}

.result-level-seg.is-filled {
    background: var(--grad);
}

.result-level-seg.is-soll {
    box-shadow: 0 0 0 2px rgba(240, 138, 60, .45);
}

.result-status {
    margin-top: 4px;
    font-size: 10px;
    font-weight: 650;
}

.result-status.is-ok {
    color: #1a7f37;
}

.result-status.is-gap {
    color: #b42318;
}

.result-status.is-strength {
    color: #8a5a00;
}

.recommendation-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.priority-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--blue);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
}

.recommendation-icon {
    flex: 0 0 auto;
    font-size: 16px;
    line-height: 1;
}

.recommendation-head .recommendation-title {
    flex: 1 1 auto;
    min-width: 0;
}

.email-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--blue-bg);
    color: var(--blue);
    font-size: 13px;
    font-weight: 700;
}

.email-icon.is-error {
    background: #fde2dd;
    color: #b42318;
}

.email-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(112, 76, 255, .18);
    font-size: 12px;
    color: var(--ink);
}

.email-status button {
    display: block;
    width: 100%;
    margin-top: 8px;
}

.eval-disclaimer {
    margin-top: 10px;
    font-size: 10px;
    color: var(--ink-soft);
}

.text-input:disabled,
button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

button:disabled:hover {
    filter: none;
    transform: none;
    box-shadow: none;
}

@media (max-width: 760px) {
    #functionSelect {
        font-size: 11px;
        padding: 9px 8px;
        text-overflow: ellipsis;
    }

    .function-competencies {
        grid-template-columns: 1fr;
    }

    .function-description {
        max-height: 145px;
    }

    .function-description.expanded {
        max-height: 40vh;
    }

    .result-stats {
        grid-template-columns: 1fr;
    }
}
