:root {
  color-scheme: light;
  --blue: #1659ac;
  --blue-dark: #0d3668;
  --blue-deep: #073164;
  --blue-soft: #eaf3ff;
  --blue-pale: #f4f8fd;
  --ink: #10233a;
  --muted: #66778c;
  --line: #dce5ef;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --success: #19845d;
  --danger: #b83a4b;
  --shadow: 0 16px 40px rgba(13, 54, 104, 0.09);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.04; letter-spacing: -.045em; }
h2 { margin-bottom: 8px; font-size: 1.35rem; letter-spacing: -.025em; }
p { line-height: 1.6; }

.eyebrow, .overline {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.eyebrow.light { color: #9dc8ff; }
.muted { color: var(--muted); }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, .88fr) minmax(480px, 1.12fr); }
.login-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: 100vh;
  padding: clamp(40px, 7vw, 86px);
  color: white;
  background:
    radial-gradient(circle at 10% 90%, rgba(54, 143, 245, .35), transparent 34%),
    linear-gradient(145deg, var(--blue-deep), var(--blue-dark) 55%, #124985);
  flex-direction: column;
  justify-content: space-between;
}
.login-brand::after { content: ""; position: absolute; width: 420px; height: 420px; right: -230px; top: 18%; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.03), 0 0 0 140px rgba(255,255,255,.025); }
.login-logo { position: relative; z-index: 1; width: 176px; height: auto; filter: brightness(0) invert(1); }
.brand-copy { position: relative; z-index: 1; max-width: 520px; }
.brand-copy h1 { margin-bottom: 22px; font-size: clamp(3rem, 6vw, 5.8rem); }
.brand-copy > p:last-child { max-width: 450px; color: #d9e8fa; font-size: 1.1rem; }
.sound-wave { display: flex; align-items: center; gap: 8px; height: 56px; }
.sound-wave span { width: 4px; border-radius: 10px; background: #79b5ff; animation: wave 1.7s ease-in-out infinite; }
.sound-wave span:nth-child(1), .sound-wave span:nth-child(7) { height: 14px; }
.sound-wave span:nth-child(2), .sound-wave span:nth-child(6) { height: 28px; animation-delay: .12s; }
.sound-wave span:nth-child(3), .sound-wave span:nth-child(5) { height: 44px; animation-delay: .24s; }
.sound-wave span:nth-child(4) { height: 54px; animation-delay: .36s; }
@keyframes wave { 50% { transform: scaleY(.4); opacity: .6; } }

.login-panel { display: grid; min-height: 100vh; padding: 48px; background: white; place-items: center; }
.login-card { width: min(100%, 440px); }
.login-card h2 { margin-bottom: 12px; font-size: clamp(2rem, 4vw, 2.7rem); }
.auth-tabs { display: grid; margin: 28px 0 20px; padding: 4px; border-radius: 11px; background: #edf2f8; grid-template-columns: 1fr 1fr; }
.auth-tabs button { min-height: 39px; color: var(--muted); border: 0; border-radius: 8px; background: transparent; font-size: .82rem; font-weight: 750; }
.auth-tabs button.active { color: var(--blue-dark); background: white; box-shadow: 0 3px 10px rgba(13,54,104,.09); }
.button.google { display: flex; color: var(--ink); border-color: var(--line); background: white; align-items: center; justify-content: center; gap: 11px; }
.button.google:hover { border-color: #aec3dd; background: var(--blue-pale); }
.google-mark { display: grid; width: 24px; height: 24px; color: #4285f4; border: 1px solid #d9e2ed; border-radius: 50%; background: white; font-family: Arial, sans-serif; font-size: .9rem; font-weight: 800; place-items: center; }
.language-switch { position: fixed; z-index: 40; top: 18px; right: 22px; display: inline-flex; padding: 3px; border: 1px solid rgba(185, 206, 232, .9); border-radius: 999px; background: rgba(255, 255, 255, .94); box-shadow: 0 8px 25px rgba(13, 54, 104, .1); backdrop-filter: blur(10px); }
.language-switch button { min-width: 70px; padding: 7px 11px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font: inherit; font-size: .78rem; font-weight: 750; cursor: pointer; }
.language-switch button[aria-pressed="true"] { color: white; background: var(--blue-dark); }
.language-switch button:focus-visible { outline: 3px solid rgba(49, 136, 219, .32); outline-offset: 2px; }
.auth-divider { display: flex; margin: 19px 0; color: var(--muted); font-size: .72rem; align-items: center; gap: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.form-stack { display: flex; margin-top: 0; flex-direction: column; }
label, legend { margin-bottom: 8px; color: var(--ink); font-size: .88rem; font-weight: 700; }
input[type="email"], input[type="password"], input[type="text"], input:not([type]) {
  width: 100%; min-height: 52px; padding: 0 15px; color: var(--ink); border: 1px solid var(--line); border-radius: 11px; outline: none; background: #fbfcfe; transition: .2s;
}
input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(22,89,172,.1); background: white; }
.form-stack > input, .password-wrap { margin-bottom: 21px; }
#confirm-password-wrap { margin-bottom: 17px; }
#confirm-password-wrap label { display: block; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 58px; }
.text-button { position: absolute; top: 0; right: 4px; height: 52px; padding: 0 12px; color: var(--blue); border: 0; background: transparent; font-size: .84rem; font-weight: 800; }
.forgot-link { align-self: flex-end; margin: -9px 0 17px; padding: 3px 0; color: var(--blue); border: 0; background: transparent; font-size: .75rem; font-weight: 750; }
.terms { margin: 13px 8px 0; color: var(--muted); text-align: center; font-size: .7rem; line-height: 1.45; }
.button { min-height: 45px; padding: 0 19px; border: 1px solid transparent; border-radius: 10px; font-weight: 750; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .nav-link:focus-visible, .quick-link:focus-visible { outline: 3px solid rgba(22,89,172,.25); outline-offset: 3px; }
.button.primary { color: white; background: var(--blue); box-shadow: 0 8px 18px rgba(22,89,172,.18); }
.button.primary:hover { background: #0f4d99; box-shadow: 0 10px 22px rgba(22,89,172,.25); }
.button.secondary { color: var(--blue-dark); border-color: #bcd0e8; background: white; }
.button.secondary:hover { background: var(--blue-soft); }
.button.ghost { color: var(--blue-dark); border-color: var(--line); background: transparent; }
.button.wide { width: 100%; }
.button.small { min-height: 36px; padding: 0 13px; font-size: .82rem; }
.button:disabled { cursor: wait; opacity: .58; transform: none; }
.demo-box { margin-top: 26px; padding: 18px; border: 1px dashed #9abce3; border-radius: 14px; background: var(--blue-pale); }
.demo-box > span { color: var(--blue); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.demo-box p { margin: 7px 0 13px; color: var(--muted); font-size: .86rem; }
.form-help { margin: 25px 0 0; color: var(--muted); text-align: center; font-size: .78rem; }

.portal { min-height: 100vh; }
.sidebar { position: fixed; z-index: 10; inset: 0 auto 0 0; display: flex; width: 270px; padding: 30px 22px 22px; color: white; background: linear-gradient(180deg, var(--blue-deep), var(--blue-dark)); flex-direction: column; }
.sidebar-logo { display: block; width: 148px; margin: 0 14px 42px; }
.sidebar-logo img { display: block; width: 100%; filter: brightness(0) invert(1); }
.nav { display: grid; gap: 7px; }
.nav-link { display: flex; min-height: 48px; padding: 0 14px; color: #c8d9ed; border-radius: 10px; text-decoration: none; font-size: .92rem; font-weight: 650; align-items: center; gap: 12px; transition: .16s; }
.nav-link:hover { color: white; background: rgba(255,255,255,.07); }
.nav-link.active { color: white; background: rgba(80,157,248,.22); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.nav-mark { width: 7px; height: 7px; border: 2px solid currentColor; border-radius: 50%; }
.nav-link.active .nav-mark { background: #79b5ff; border-color: #79b5ff; box-shadow: 0 0 0 4px rgba(121,181,255,.12); }
.sidebar-account { display: grid; margin-top: auto; padding: 18px 4px 0; border-top: 1px solid rgba(255,255,255,.12); grid-template-columns: 38px 1fr 28px; align-items: center; gap: 10px; }
.avatar { display: grid; width: 38px; height: 38px; color: var(--blue-dark); border-radius: 50%; background: #b9d8ff; font-weight: 850; place-items: center; }
.avatar.large { width: 54px; height: 54px; font-size: 1.15rem; }
.account-mini { min-width: 0; }
.account-mini strong, .account-mini span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-mini strong { font-size: .82rem; }
.account-mini span { margin-top: 3px; color: #9eb5d0; font-size: .69rem; }
.logout { width: 28px; height: 28px; color: #b9cce2; border: 0; background: transparent; font-size: 1.1rem; }
.content { min-height: 100vh; margin-left: 270px; padding: 48px clamp(28px, 5vw, 76px) 80px; }
.verification-banner { display: flex; width: min(100%, 1180px); margin: 0 auto 26px; padding: 17px 19px; color: #554614; border: 1px solid #eadba0; border-radius: 14px; background: #fffbed; align-items: center; justify-content: space-between; gap: 22px; }
.verification-banner strong, .verification-banner span { display: block; }
.verification-banner strong { margin-bottom: 4px; font-size: .86rem; }
.verification-banner span { font-size: .76rem; }
.verification-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.page-section { width: min(100%, 1180px); margin: 0 auto; animation: enter .28s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } }
.page-heading { display: flex; margin-bottom: 34px; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading h1 { font-size: clamp(2.25rem, 4vw, 3.25rem); }
.dashboard-heading { align-items: center; }
.status-pill { display: inline-flex; padding: 10px 14px; color: #166748; border: 1px solid #bfe5d5; border-radius: 999px; background: #effaf5; font-size: .8rem; font-weight: 750; align-items: center; gap: 8px; }
.status-pill span { width: 7px; height: 7px; border-radius: 50%; background: #21a16f; box-shadow: 0 0 0 4px rgba(33,161,111,.12); }
.status-pill.inactive { color: #8d3a45; border-color: #f0c5cb; background: #fff3f4; }
.status-pill.inactive span { background: var(--danger); }

.usage-grid { display: grid; margin-bottom: 24px; grid-template-columns: 1fr 1fr; gap: 22px; }
.usage-card { position: relative; overflow: hidden; min-height: 210px; padding: 28px; color: white; border-radius: var(--radius); box-shadow: var(--shadow); }
.usage-card::after { content: ""; position: absolute; right: -70px; bottom: -130px; width: 270px; height: 270px; border: 30px solid rgba(255,255,255,.055); border-radius: 50%; }
.asr-card { background: linear-gradient(135deg, var(--blue-dark), var(--blue)); }
.tts-card { background: linear-gradient(135deg, #14487f, #2679cd); }
.usage-card-top { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; }
.usage-card .overline { color: #b9dafd; }
.usage-card h2 { margin: 2px 0 30px; font-size: 2.25rem; }
.percent-badge { padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.13); font-size: .76rem; font-weight: 800; }
.progress { position: relative; z-index: 1; overflow: hidden; height: 8px; border-radius: 20px; background: rgba(255,255,255,.17); }
.progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: #fff; transition: width .7s ease; }
.usage-meta { position: relative; z-index: 1; display: flex; margin-top: 12px; color: #d8e9fb; font-size: .76rem; justify-content: space-between; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.card { padding: 28px; border: 1px solid rgba(13,54,104,.08); border-radius: var(--radius); background: var(--surface); box-shadow: 0 10px 30px rgba(13,54,104,.055); }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.profile-list { margin: 22px 0; }
.profile-list > div { display: grid; padding: 13px 0; border-bottom: 1px solid #edf1f6; grid-template-columns: 145px 1fr; gap: 16px; }
.profile-list dt { color: var(--muted); font-size: .81rem; }
.profile-list dd { margin: 0; overflow-wrap: anywhere; font-size: .86rem; font-weight: 700; text-align: right; }
.quick-card { display: flex; flex-direction: column; }
.quick-link { display: flex; width: 100%; padding: 17px 0; color: var(--ink); border: 0; border-bottom: 1px solid #edf1f6; background: transparent; text-align: left; align-items: center; justify-content: space-between; }
.quick-link:last-child { border-bottom: 0; }
.quick-link span strong, .quick-link span small { display: block; }
.quick-link span strong { margin-bottom: 4px; font-size: .9rem; }
.quick-link span small { color: var(--muted); font-size: .75rem; }
.quick-link b { color: var(--blue); font-size: 1.25rem; transition: transform .15s; }
.quick-link:hover b { transform: translateX(4px); }
.dashboard-library-card { grid-column: 1 / -1; }
.dashboard-library-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dashboard-library-item { display: flex; min-width: 0; padding: 14px; color: var(--ink); border: 1px solid #e4ebf3; border-radius: 11px; background: #fbfcfe; text-align: left; align-items: center; gap: 11px; }
.dashboard-library-item:hover { border-color: #bfd3e9; background: var(--blue-pale); }
.dashboard-library-item b { display: grid; width: 34px; height: 34px; color: white; border-radius: 9px; background: var(--blue); font-size: .61rem; place-items: center; flex: 0 0 auto; }
.dashboard-library-item b.tts { color: var(--blue-dark); background: #cde3ff; }
.dashboard-library-item span { min-width: 0; }
.dashboard-library-item strong, .dashboard-library-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-library-item strong { font-size: .76rem; }
.dashboard-library-item small { margin-top: 4px; color: var(--muted); font-size: .65rem; }
.dashboard-library-empty { padding: 18px; color: var(--muted); border: 1px dashed #bdcce0; border-radius: 11px; text-align: center; font-size: .76rem; grid-column: 1 / -1; }
.period-box { min-width: 180px; padding: 13px 17px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.period-box span, .period-box strong { display: block; }
.period-box span { color: var(--muted); font-size: .7rem; }
.period-box strong { margin-top: 4px; font-size: .82rem; }
.detail-grid { display: grid; margin-bottom: 24px; grid-template-columns: 1fr 1fr; gap: 22px; }
.detail-card { padding: 28px; border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.detail-head { display: flex; align-items: start; justify-content: space-between; }
.detail-head strong { font-size: 1.2rem; }
.detail-card .progress { margin: 24px 0 20px; background: #e8eef5; }
.detail-card .progress span { background: var(--blue); }
.number-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.number-grid div { padding: 13px; border-radius: 10px; background: var(--blue-pale); }
.number-grid span, .number-grid strong { display: block; }
.number-grid span { color: var(--muted); font-size: .69rem; }
.number-grid strong { margin-top: 5px; font-size: .84rem; }
.info-card { display: grid; grid-template-columns: .8fr 1.2fr; gap: 34px; align-items: center; }
.info-card p:last-child { margin: 0; color: var(--muted); font-size: .88rem; }
.activity-card { margin-bottom: 24px; }
.activity-heading { display: flex; margin-bottom: 12px; align-items: center; justify-content: space-between; gap: 18px; }
.activity-count { padding: 7px 10px; color: var(--blue-dark); border-radius: 999px; background: var(--blue-soft); font-size: .72rem; font-weight: 750; }
.activity-list { display: grid; }
.activity-row { display: grid; padding: 16px 0; border-top: 1px solid #edf1f6; grid-template-columns: 42px minmax(140px, 1fr) minmax(120px, .7fr) minmax(125px, .7fr); align-items: center; gap: 14px; }
.activity-kind { display: grid; width: 36px; height: 36px; color: white; border-radius: 10px; background: var(--blue); font-size: .65rem; font-weight: 850; place-items: center; }
.activity-kind.tts { color: var(--blue-dark); background: #cde3ff; }
.activity-main strong, .activity-main small, .activity-meta strong, .activity-meta small { display: block; }
.activity-main strong, .activity-meta strong { font-size: .8rem; }
.activity-main small, .activity-meta small { margin-top: 4px; color: var(--muted); font-size: .68rem; }
.activity-main small { display: -webkit-box; overflow: hidden; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.security-note { display: flex; margin-bottom: 22px; padding: 16px 19px; color: #554614; border: 1px solid #eadba0; border-radius: 13px; background: #fffbed; font-size: .82rem; gap: 8px; }
.keys-list { display: grid; gap: 12px; }
.key-row { display: grid; padding: 20px 22px; border: 1px solid var(--line); border-radius: 15px; background: white; grid-template-columns: minmax(160px, 1fr) minmax(180px, .8fr) minmax(140px, .7fr) auto; align-items: center; gap: 18px; }
.key-row.revoked { opacity: .55; }
.key-title strong, .key-title code, .key-meta span, .key-meta small { display: block; }
.key-title strong { margin-bottom: 5px; font-size: .9rem; }
.key-title code { color: var(--muted); font-size: .75rem; }
.key-meta span { font-size: .77rem; font-weight: 700; }
.key-meta small { margin-top: 4px; color: var(--muted); font-size: .68rem; }
.scope-list { display: flex; flex-wrap: wrap; gap: 5px; }
.scope-tag { padding: 5px 7px; color: var(--blue-dark); border-radius: 6px; background: var(--blue-soft); font-size: .65rem; font-weight: 700; }
.danger-link { padding: 8px; color: var(--danger); border: 0; background: transparent; font-size: .75rem; font-weight: 800; }
.empty-state { padding: 54px 26px; border: 1px dashed #bdcce0; border-radius: var(--radius); background: rgba(255,255,255,.65); text-align: center; }
.empty-state h2 { margin-bottom: 6px; }
.empty-state p { margin: 0 auto; max-width: 440px; color: var(--muted); font-size: .85rem; }
.packs-grid { display: grid; margin-bottom: 24px; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pack-card { position: relative; overflow: hidden; display: flex; min-height: 300px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: white; flex-direction: column; }
.pack-card::before { content: ""; position: absolute; width: 100px; height: 100px; top: -55px; right: -45px; border: 20px solid var(--blue-soft); border-radius: 50%; }
.pack-card h2 { font-size: 1.45rem; }
.pack-card .pack-description { color: var(--muted); font-size: .83rem; }
.pack-amount { margin: 14px 0 4px; color: var(--blue-dark); font-size: 2rem; font-weight: 850; letter-spacing: -.04em; }
.pack-price { margin-bottom: 24px; color: var(--muted); font-size: .84rem; }
.pack-card .button { margin-top: auto; }
.billing-card { margin-bottom: 28px; }
.billing-section-heading { display: flex; margin: 30px 0 16px; align-items: end; justify-content: space-between; gap: 18px; }
.billing-section-heading h2 { margin-bottom: 5px; font-size: 1.35rem; }
.billing-list { display: grid; }
.billing-row { display: flex; padding: 18px 0; border-top: 1px solid #edf1f6; align-items: center; justify-content: space-between; gap: 24px; }
.billing-row:first-child { border-top: 0; }
.billing-row strong, .billing-row span { display: block; }
.billing-row strong { font-size: .88rem; }
.billing-row span { margin-top: 5px; color: var(--muted); font-size: .74rem; }
.billing-row-meta { flex: 0 0 auto; text-align: right; }
.plan-card { min-height: 280px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; margin: -1px; padding: 0; border: 0; clip: rect(0 0 0 0); white-space: nowrap; }
.library-heading { align-items: center; }
.privacy-pill { display: inline-flex; padding: 10px 14px; color: #166748; border: 1px solid #bfe5d5; border-radius: 999px; background: #effaf5; font-size: .78rem; font-weight: 750; align-items: center; gap: 8px; white-space: nowrap; }
.privacy-pill i { display: grid; width: 21px; height: 21px; color: white; border-radius: 50%; background: var(--success); font-size: .8rem; font-style: normal; place-items: center; }
.library-stats { display: grid; margin-bottom: 22px; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.library-stats article { display: flex; min-height: 82px; padding: 18px 20px; border: 1px solid rgba(13,54,104,.08); border-radius: 14px; background: white; box-shadow: 0 7px 22px rgba(13,54,104,.045); align-items: center; justify-content: space-between; gap: 16px; }
.library-stats span { color: var(--muted); font-size: .76rem; }
.library-stats strong { color: var(--blue-dark); font-size: 1.55rem; }
.library-toolbar { display: flex; margin-bottom: 20px; align-items: center; justify-content: space-between; gap: 16px; }
.library-search { position: relative; width: min(100%, 440px); }
.library-search span { position: absolute; top: 50%; left: 15px; color: var(--muted); font-size: 1.25rem; transform: translateY(-52%); pointer-events: none; }
.library-search input { width: 100%; min-height: 48px; padding: 0 15px 0 43px; color: var(--ink); border: 1px solid var(--line); border-radius: 11px; outline: none; background: white; }
.library-search input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(22,89,172,.1); }
.filter-tabs { display: flex; padding: 4px; border-radius: 11px; background: #e9eff6; }
.filter-tabs button { min-height: 39px; padding: 0 13px; color: var(--muted); border: 0; border-radius: 8px; background: transparent; font-size: .73rem; font-weight: 750; }
.filter-tabs button.active { color: white; background: var(--blue); box-shadow: 0 4px 12px rgba(22,89,172,.18); }
.library-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.library-item { display: flex; min-width: 0; min-height: 232px; padding: 22px; border: 1px solid rgba(13,54,104,.09); border-radius: 17px; background: white; box-shadow: 0 8px 25px rgba(13,54,104,.05); flex-direction: column; transition: transform .16s, box-shadow .16s, border-color .16s; }
.library-item:hover { border-color: #bfd3e9; box-shadow: 0 14px 34px rgba(13,54,104,.09); transform: translateY(-2px); }
.library-item-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.library-kind { display: inline-flex; padding: 6px 8px; color: var(--blue-dark); border-radius: 7px; background: var(--blue-soft); font-size: .64rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.library-kind.asr { color: white; background: var(--blue); }
.library-date { color: var(--muted); font-size: .68rem; }
.library-item h2 { overflow: hidden; margin: 17px 0 8px; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.library-preview { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.library-item-bottom { display: flex; margin-top: auto; padding-top: 17px; align-items: center; justify-content: space-between; gap: 12px; }
.library-item-meta { display: flex; min-width: 0; color: var(--muted); font-size: .66rem; gap: 10px; }
.library-item-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-open { min-height: 36px; padding: 0 13px; color: var(--blue-dark); border: 1px solid #bcd0e8; border-radius: 9px; background: white; font-size: .72rem; font-weight: 800; flex: 0 0 auto; }
.library-open:hover { background: var(--blue-soft); }
.privacy-note { display: flex; margin-top: 22px; padding: 18px 20px; border: 1px solid #c8e5d9; border-radius: 14px; background: #f3fbf7; align-items: center; gap: 14px; }
.privacy-mark { display: grid; width: 34px; height: 34px; color: white; border-radius: 50%; background: var(--success); font-weight: 900; place-items: center; flex: 0 0 auto; }
.privacy-note strong { font-size: .82rem; }
.privacy-note p { margin: 4px 0 0; color: #4e7164; font-size: .73rem; }
.library-list > .empty-state { grid-column: 1 / -1; }

.try-heading { align-items: center; }
.model-status { display: inline-flex; padding: 10px 14px; color: var(--blue-dark); border: 1px solid #bdd4ed; border-radius: 999px; background: var(--blue-pale); font-size: .78rem; font-weight: 750; align-items: center; gap: 8px; white-space: nowrap; }
.model-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(33,161,111,.12); }
.trial-lock { display: flex; margin-bottom: 22px; padding: 17px 19px; color: #554614; border: 1px solid #eadba0; border-radius: 14px; background: #fffbed; align-items: center; justify-content: space-between; gap: 20px; }
.trial-lock strong, .trial-lock span { display: block; }
.trial-lock strong { margin-bottom: 4px; font-size: .86rem; }
.trial-lock span { font-size: .76rem; }
.try-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.try-card { min-width: 0; }
.try-card-heading { display: flex; align-items: center; gap: 13px; }
.service-icon { display: grid; width: 46px; height: 46px; color: white; border-radius: 13px; background: linear-gradient(135deg, var(--blue-dark), var(--blue)); font-size: .66rem; font-weight: 850; letter-spacing: .05em; place-items: center; box-shadow: 0 8px 18px rgba(22,89,172,.16); }
.service-icon.tts { color: var(--blue-dark); background: #cde3ff; box-shadow: none; }
.try-card-heading h2 { font-size: 1.45rem; }
.try-intro { min-height: 44px; margin: 17px 0 21px; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.try-form { display: grid; gap: 16px; }
.field-heading { display: flex; margin-bottom: -8px; align-items: center; justify-content: space-between; gap: 12px; }
.field-heading label { margin: 0; }
.field-heading span { color: var(--muted); font-size: .7rem; font-variant-numeric: tabular-nums; }
.try-form textarea, .try-form select { width: 100%; color: var(--ink); border: 1px solid var(--line); border-radius: 11px; outline: none; background: #fbfcfe; font: inherit; transition: .2s; }
.try-form textarea { min-height: 150px; padding: 14px 15px; resize: vertical; line-height: 1.55; }
.try-form select { min-height: 48px; padding: 0 38px 0 13px; }
.try-form textarea:focus, .try-form select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(22,89,172,.1); background: white; }
.try-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.try-options label { display: block; }
.upload-zone { display: grid; min-height: 214px; margin: 0; padding: 25px; color: var(--muted); border: 1.5px dashed #aac4e1; border-radius: 14px; background: var(--blue-pale); text-align: center; cursor: pointer; place-items: center; align-content: center; gap: 5px; transition: .18s; }
.upload-zone:hover, .upload-zone.dragging { color: var(--blue-dark); border-color: var(--blue); background: #e5f1ff; }
.upload-zone:focus-within { outline: 3px solid rgba(22,89,172,.2); outline-offset: 2px; }
.upload-zone strong { color: var(--blue-dark); font-size: .95rem; }
.upload-zone span { font-size: .78rem; }
.upload-zone small { margin-top: 8px; font-size: .68rem; }
.upload-zone input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.upload-symbol { display: grid; width: 42px; height: 42px; margin-bottom: 5px; color: white; border-radius: 50%; background: var(--blue); font-size: 1.2rem !important; font-weight: 800; place-items: center; }
.file-selection { display: flex; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; align-items: center; justify-content: space-between; gap: 12px; }
.file-selection strong, .file-selection span { display: block; }
.file-selection strong { overflow: hidden; max-width: 320px; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.file-selection span { margin-top: 3px; color: var(--muted); font-size: .67rem; }
.audio-preview, .try-result audio { width: 100%; height: 42px; }
.try-result { display: grid; margin-top: 20px; padding: 17px; border: 1px solid #bfd7ef; border-radius: 14px; background: var(--blue-pale); gap: 14px; }
.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-heading strong { color: var(--blue-dark); font-size: .84rem; }
.result-heading span { color: var(--muted); font-size: .67rem; text-align: right; }
.download-button { display: flex; text-decoration: none; align-items: center; justify-content: center; }
.transcript { min-height: 110px; max-height: 260px; overflow: auto; padding: 14px; color: var(--ink); border: 1px solid #d0deed; border-radius: 10px; background: white; font-size: .86rem; line-height: 1.6; white-space: pre-wrap; }
.transcript:empty::before { content: "Eingin tekstur varð funnin í ljóðinum."; color: var(--muted); font-style: italic; }
.trial-note { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: .76rem; }
.trial-note button { padding: 0; color: var(--blue); border: 0; background: transparent; font: inherit; font-weight: 750; text-decoration: underline; }
.try-card.is-locked { opacity: .62; }

.modal { width: min(calc(100% - 32px), 540px); padding: 30px; color: var(--ink); border: 0; border-radius: 20px; box-shadow: 0 24px 80px rgba(5,34,68,.28); }
.modal::backdrop { background: rgba(5,31,60,.58); backdrop-filter: blur(3px); }
.modal-heading { display: flex; margin-bottom: 24px; justify-content: space-between; }
.modal-close { width: 36px; height: 36px; color: var(--muted); border: 1px solid var(--line); border-radius: 50%; background: white; font-size: 1.45rem; }
.modal input:not([type="checkbox"]) { margin-bottom: 23px; }
.modal fieldset { display: grid; margin: 0; padding: 0; border: 0; gap: 8px; }
.check-row { display: flex; margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; align-items: center; gap: 12px; }
.check-row input { width: 17px; height: 17px; accent-color: var(--blue); }
.check-row span strong, .check-row span small { display: block; }
.check-row span strong { font-size: .83rem; }
.check-row span small { margin-top: 3px; color: var(--muted); font-size: .7rem; }
.modal-actions { display: flex; margin-top: 25px; justify-content: flex-end; gap: 10px; }
.secret-modal { text-align: center; }
.success-mark { display: grid; width: 54px; height: 54px; margin: 0 auto 18px; color: white; border-radius: 50%; background: var(--success); font-size: 1.4rem; font-weight: 900; place-items: center; }
.secret-box { display: flex; margin: 24px 0; padding: 12px; border: 1px solid #b9cee8; border-radius: 12px; background: var(--blue-pale); align-items: center; gap: 10px; }
.secret-box code { overflow: hidden; color: var(--blue-dark); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.artifact-modal { width: min(calc(100% - 32px), 720px); text-align: left; }
.artifact-modal-heading h2 { max-width: 560px; overflow: hidden; font-size: 1.45rem; text-overflow: ellipsis; white-space: nowrap; }
.artifact-loading { padding: 48px 20px; color: var(--muted); text-align: center; font-size: .85rem; }
.artifact-meta { display: flex; margin: -8px 0 20px; color: var(--muted); font-size: .7rem; flex-wrap: wrap; gap: 7px 14px; }
.artifact-meta span::before { content: "·"; margin-right: 14px; }
.artifact-meta span:first-child::before { display: none; }
.artifact-audio { display: grid; margin-bottom: 22px; padding: 17px; border: 1px solid #c4d9ef; border-radius: 13px; background: var(--blue-pale); grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.artifact-audio > span { color: var(--blue-dark); font-size: .75rem; font-weight: 800; }
.artifact-audio audio { width: 100%; height: 42px; grid-column: 1 / -1; }
.artifact-audio .download-button { grid-column: 2; grid-row: 1; }
.artifact-text-heading { display: flex; margin-bottom: 8px; align-items: center; justify-content: space-between; }
.artifact-text-heading span, .artifact-text-heading label { margin: 0; font-size: .78rem; font-weight: 800; }
.text-copy { padding: 4px; color: var(--blue); border: 0; background: transparent; font-size: .72rem; font-weight: 800; }
.artifact-full-text { max-height: 310px; min-height: 125px; overflow: auto; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; font-size: .88rem; line-height: 1.65; white-space: pre-wrap; }
.artifact-full-text:empty::before { content: "Eingin tekstur er goymdur við hesum innihaldinum."; color: var(--muted); font-style: italic; }
.workspace-toolbar { display: flex; margin: -5px 0 18px; align-items: center; flex-wrap: wrap; gap: 10px; }
.workspace-toolbar > label { margin: 0; }
select, textarea { color: var(--ink); border: 1px solid var(--line); border-radius: 10px; outline: none; background: white; font: inherit; }
select { min-height: 42px; padding: 0 34px 0 11px; }
select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(22,89,172,.1); }
.bulk-toolbar { display: flex; margin-left: auto; padding: 7px; border: 1px solid #c9daed; border-radius: 12px; background: white; align-items: center; flex-wrap: wrap; gap: 7px; }
.bulk-toolbar strong { padding-inline: 7px; color: var(--blue-dark); font-size: .75rem; }
.artifact-select { margin: 0; }
.artifact-select input { width: 17px; height: 17px; accent-color: var(--blue); }
.favorite-button { padding: 2px 5px; color: #d58a00; border: 0; background: transparent; font-size: 1.2rem; }
.library-item.selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,89,172,.1); }
.artifact-edit-form { display: grid; gap: 9px; }
.artifact-edit-form > input, .artifact-fields input { width: 100%; min-height: 44px; padding: 0 12px; }
.artifact-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.artifact-fields label { display: block; }
.artifact-fields select { width: 100%; }
.artifact-edit-form .artifact-full-text { width: 100%; min-height: 165px; resize: vertical; }
.artifact-save-row, .artifact-export-row { display: flex; margin-top: 11px; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.artifact-export-row { justify-content: flex-start; padding-top: 13px; border-top: 1px solid var(--line); }
.switch-row { display: flex; margin: 0; align-items: center; gap: 8px; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--blue); }
.insight-grid { display: grid; margin-bottom: 24px; grid-template-columns: 1fr 1fr; gap: 16px; }
.insight-card { padding: 22px; border: 1px solid #c6dbef; border-radius: 16px; background: linear-gradient(135deg, #f8fbff, #edf6ff); }
.insight-card h2 { font-size: 1rem; }
.insight-card > strong, .insight-card > span, .insight-card > small { display: block; }
.insight-card > strong { color: var(--blue-dark); font-size: 1.7rem; }
.insight-card > span { margin-top: 4px; color: var(--muted); font-size: .74rem; }
.insight-card > small { margin-top: 12px; font-weight: 750; }
.preference-card { display: flex; margin-bottom: 24px; align-items: center; justify-content: space-between; gap: 24px; }
.preference-card p { margin-bottom: 0; }
.inline-form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.inline-form label { margin: 0; }
.inline-form input { min-height: 44px; padding: 0 12px; }
.workspace-tabs, .code-tabs { display: flex; margin-bottom: 20px; padding: 5px; border-radius: 12px; background: #e9eff6; gap: 4px; }
.workspace-tabs button, .code-tabs button { min-height: 40px; padding: 0 15px; color: var(--muted); border: 0; border-radius: 9px; background: transparent; font-size: .76rem; font-weight: 800; }
.workspace-tabs button.active, .code-tabs button.active { color: white; background: var(--blue); }
.workspace-panel { display: grid; gap: 22px; }
.feature-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; }
.code-tabs { margin: 18px 0 10px; overflow-x: auto; }
.code-tabs button { min-height: 34px; padding-inline: 10px; }
#code-sample { min-height: 170px; overflow: auto; margin: 0 0 13px; padding: 16px; color: #dcecff; border-radius: 12px; background: #071f3c; font: .72rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.feature-list { padding-left: 20px; color: var(--muted); font-size: .83rem; line-height: 1.7; }
.data-list { display: grid; }
.data-row { display: grid; min-width: 0; padding: 14px 0; border-top: 1px solid #edf1f6; grid-template-columns: 40px minmax(150px, 1fr) minmax(120px, .65fr) auto; align-items: center; gap: 12px; }
.data-row strong, .data-row small { display: block; }
.data-row strong { font-size: .78rem; }
.data-row small, .data-row time { overflow: hidden; color: var(--muted); font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.organization-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.member-list { display: grid; margin: 10px 0 17px; }
.member-row { display: flex; padding: 12px 0; border-top: 1px solid #edf1f6; align-items: center; justify-content: space-between; gap: 10px; }
.member-row strong, .member-row small { display: block; }
.member-row strong { font-size: .8rem; }
.member-row small { margin-top: 3px; color: var(--muted); font-size: .69rem; }
.invite-form { display: grid; grid-template-columns: minmax(130px, 1fr) auto auto; gap: 8px; }
.invite-form input { min-width: 0; min-height: 42px; padding: 0 10px; }
.trust-card p { color: var(--muted); font-size: .84rem; }
.security-actions { display: flex; margin: 18px 0; flex-wrap: wrap; gap: 9px; }
.small-copy { font-size: .73rem; }
.security-row { grid-template-columns: 34px 1fr auto; }
.security-check { display: grid; width: 28px; height: 28px; color: white; border-radius: 50%; background: var(--success); font-size: .72rem; place-items: center; }
.onboarding-modal { text-align: center; }
.onboarding-mark { display: grid; width: 58px; height: 58px; margin: 0 auto 18px; color: white; border-radius: 17px; background: linear-gradient(135deg, var(--blue-dark), var(--blue)); font-size: 1.45rem; font-weight: 900; place-items: center; }
.onboarding-features { display: grid; margin: 23px 0; text-align: left; gap: 10px; }
.onboarding-features span { display: flex; padding: 12px; border-radius: 10px; background: var(--blue-pale); align-items: center; gap: 12px; font-size: .8rem; font-weight: 700; }
.onboarding-features b { color: var(--blue); }
.project-manager-list { display: grid; margin-top: 24px; border-top: 1px solid var(--line); }
.project-manager-row { display: grid; padding: 12px 0; border-bottom: 1px solid #edf1f6; grid-template-columns: 12px 1fr auto auto; align-items: center; gap: 9px; }
.project-manager-row strong, .project-manager-row small { display: block; }
.project-manager-row strong { font-size: .78rem; }
.project-manager-row small { color: var(--muted); font-size: .66rem; }
.project-color { width: 10px; height: 28px; border-radius: 7px; background: var(--blue); }
.project-color.sky { background: #5fa9df; } .project-color.green { background: #29906a; } .project-color.violet { background: #7c63c4; } .project-color.orange { background: #d78132; }
.artifact-actions { display: flex; margin-top: 22px; align-items: center; justify-content: space-between; gap: 12px; }
.button.danger { color: var(--danger); border-color: #efc3c9; background: #fff7f8; }
.button.danger:hover { background: #ffedef; }
.toast { position: fixed; z-index: 100; top: 70px; right: 22px; max-width: min(390px, calc(100% - 44px)); padding: 14px 17px; color: white; border-radius: 11px; background: var(--blue-dark); box-shadow: var(--shadow); font-size: .83rem; font-weight: 650; animation: toast-in .2s ease-out; }
.toast.error { background: #8e2f3c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.mobile-header, .mobile-nav { display: none; }

@media (max-width: 1050px) {
  .sidebar { width: 226px; }
  .content { margin-left: 226px; padding-inline: 28px; }
  .key-row { grid-template-columns: 1fr 1fr auto; }
  .key-row .key-meta { display: none; }
  .packs-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 800px) {
  body.portal-open .language-switch { top: 24px; right: 94px; }
  .language-switch button { min-width: 57px; padding-inline: 8px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { padding: 30px 22px; }
  .sidebar { display: none; }
  .content { margin-left: 0; padding: 28px 20px 105px; }
  .mobile-header { display: flex; margin-bottom: 42px; align-items: center; justify-content: space-between; }
  .mobile-header img { width: 116px; }
  .mobile-nav { position: fixed; z-index: 20; inset: auto 10px 10px; display: grid; padding: 7px; border: 1px solid rgba(13,54,104,.12); border-radius: 16px; background: rgba(255,255,255,.94); box-shadow: 0 14px 40px rgba(13,54,104,.16); backdrop-filter: blur(12px); grid-template-columns: repeat(7, 1fr); }
  .mobile-nav a { padding: 10px 2px; color: var(--muted); border-radius: 10px; text-align: center; text-decoration: none; font-size: .63rem; font-weight: 750; }
  .mobile-nav a.active { color: white; background: var(--blue); }
  .usage-grid, .dashboard-grid, .detail-grid, .try-grid, .insight-grid, .feature-grid, .organization-list { grid-template-columns: 1fr; }
  .dashboard-library-list { grid-template-columns: 1fr; }
  .library-list { grid-template-columns: 1fr; }
  .library-toolbar { align-items: stretch; flex-direction: column; }
  .library-search { width: 100%; }
  .packs-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .dashboard-heading { align-items: flex-start; }
  .page-heading .button { width: 100%; }
  .period-box { width: 100%; }
  .info-card { grid-template-columns: 1fr; gap: 10px; }
  .verification-banner { align-items: stretch; flex-direction: column; }
  .verification-actions { flex-wrap: wrap; }
  .library-stats { grid-template-columns: 1fr 1fr 1fr; }
  .library-stats article { min-height: 76px; padding: 14px; align-items: flex-start; flex-direction: column; gap: 5px; }
  .trial-lock { align-items: stretch; flex-direction: column; }
  .preference-card { align-items: stretch; flex-direction: column; }
  .bulk-toolbar { width: 100%; margin-left: 0; }
  .try-intro { min-height: 0; }
  .activity-row { grid-template-columns: 42px 1fr auto; }
  .activity-row .activity-model { display: none; }
}

@media (max-width: 540px) {
  .content { padding-inline: 15px; }
  .usage-card, .card, .detail-card, .pack-card { padding: 22px; border-radius: 17px; }
  .usage-card { min-height: 195px; }
  .usage-card h2 { font-size: 1.9rem; }
  .key-row { padding: 18px; grid-template-columns: 1fr auto; }
  .key-row .scope-list { grid-column: 1 / -1; grid-row: 2; }
  .security-note { flex-direction: column; }
  .profile-list > div { grid-template-columns: 110px 1fr; }
  .number-grid { grid-template-columns: 1fr; }
  .activity-row { grid-template-columns: 38px 1fr; }
  .activity-row .activity-time { grid-column: 2; }
  .modal { padding: 22px; }
  .secret-box { align-items: stretch; flex-direction: column; }
  .secret-box code { padding: 8px; white-space: normal; overflow-wrap: anywhere; }
  .library-stats { grid-template-columns: 1fr; }
  .library-stats article { align-items: center; flex-direction: row; }
  .filter-tabs { width: 100%; }
  .filter-tabs button { flex: 1; padding-inline: 6px; }
  .privacy-note { align-items: flex-start; }
  .artifact-actions { align-items: stretch; flex-direction: column-reverse; }
  .artifact-actions .button { width: 100%; }
  .try-options { grid-template-columns: 1fr; }
  .artifact-fields { grid-template-columns: 1fr; }
  .invite-form { grid-template-columns: 1fr; }
  .workspace-tabs { overflow-x: auto; }
  .model-status { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
