/* Glyphcall Studio workspace. Light design system: bg #fbfaf7, text #16161d, accent gradient #4f46e5 -> #0f766e,
   dark pill buttons. Phone first; the sidebar becomes a drawer plus a bottom tab bar below 900 px. */
:root {
  color-scheme: light;
  --bg: #fbfaf7; --panel: #ffffff; --fg: #16161d; --muted: #5d5d6b; --faint: #8a8a96; --line: #e9e6df; --line2: #f1efe9;
  --c1: #4f46e5; --c2: #0f766e; --grad: linear-gradient(135deg, #4f46e5 0%, #0f766e 100%);
  --soft: #f3f1fb; --ok: #0f766e; --warn: #9a3412;
  --r: 16px; --side: 260px; --tab: 64px;
  --shadow: 0 1px 2px rgba(22,22,29,.04), 0 8px 24px -12px rgba(22,22,29,.12);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--c1); }
button { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--fg); color: #fff; padding: 8px 14px; border-radius: 999px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--c1); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- workspace inside the site page ---------- */
.studio-page header.site, .studio-page footer.site { max-width: 1240px; }
.ws { max-width: 1240px; margin: 8px auto 0; padding: 0 16px; display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 28px; align-items: start; }
.ws button { box-shadow: none; }
.side { position: sticky; top: 12px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); display: flex; flex-direction: column; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow-y: auto; }
.searchbox { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line) !important; border-radius: 12px; background: #fbfaf7 !important; color: var(--muted) !important; font: inherit; font-size: 14px; cursor: pointer; margin-bottom: 6px; }
.searchbox kbd { margin-left: auto; }
nav#nav { display: flex; flex-direction: column; gap: 2px; }
.navgroup { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; }
.navitem { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 12px; color: var(--fg); text-decoration: none; font-size: 15px; font-weight: 550; position: relative; }
.navitem svg { color: var(--muted); }
.navitem:hover { background: var(--line2); }
.navitem[aria-current="page"] { background: var(--soft); }
.navitem[aria-current="page"] svg { color: var(--c1); }
.navitem[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--grad); }
.tag { display: inline-block; margin-left: auto; font-size: 11px; font-weight: 700; color: #fff; background: var(--grad); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.navitem .kbd { margin-left: auto; font-size: 11px; color: var(--faint); opacity: 0; transition: opacity .15s; }
.side:hover .navitem .kbd, .side:focus-within .navitem .kbd { opacity: 1; }
.side-pro { margin-top: auto; padding-top: 14px; display: grid; gap: 8px; }
.mini { display: block; text-decoration: none; color: var(--fg); border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; background: radial-gradient(240px 90px at 100% 0, rgba(79,70,229,.08), transparent 70%), var(--panel); }
.mini:hover { border-color: #d9d4ff; }
.mini .k { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.mini .k svg { width: 16px; height: 16px; }
.mini .v { font-size: 13.5px; font-weight: 650; margin-top: 2px; }
.upgrade-side { width: 100%; }
.meter { height: 8px; border-radius: 999px; background: var(--line2); overflow: hidden; margin-top: 8px; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--grad); width: 0; transition: width .6s ease; }
.tabs { display: none; }
.wsmain { max-width: none !important; margin: 0 !important; padding: 0 !important; min-width: 0; }
.wstop { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 4px 0 14px; }
.titles { min-width: 0; flex: 1 1 260px; }
.titles h1 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -.015em; outline: none; }
.titles p { margin: 3px 0 0; color: var(--muted); font-size: 14.5px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.usage { display: grid; grid-template-columns: auto; min-width: 170px; text-decoration: none; color: var(--fg); border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 6px 12px; }
.usage .k { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.usage .v { font-size: 13.5px; font-weight: 650; white-space: nowrap; }
.usage .meter { height: 5px; margin-top: 4px; }
.view { outline: none; padding-bottom: 40px; }
/* ---------- buttons, cards ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--fg); background: var(--fg); color: #fff; font-weight: 650; font-size: 15px; text-decoration: none; cursor: pointer; }
.btn:hover { background: #2a2a35; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { border-color: #cfcabf; background: var(--panel); }
.btn.grad { border: 0; background: var(--grad); }
.btn.sm { min-height: 36px; padding: 7px 14px; font-size: 14px; }
.btn.big { min-height: 52px; padding: 13px 26px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: default; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
h2.sec { font-size: 15px; margin: 30px 0 12px; letter-spacing: -.005em; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h2.sec a { font-size: 14px; font-weight: 600; text-decoration: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--ok); background: #e9f5f3; border-radius: 999px; padding: 3px 10px; }
.badge svg { width: 14px; height: 14px; }
.badge.pro { color: #fff; background: var(--grad); }

/* ---------- home ---------- */
.hero { margin: 6px 0 4px; padding: 26px; border-radius: 22px; border: 1px solid var(--line); background: radial-gradient(600px 220px at 100% 0, rgba(79,70,229,.09), transparent 70%), radial-gradient(500px 220px at 0 100%, rgba(15,118,110,.07), transparent 70%), var(--panel); }
.hero h2 { margin: 0 0 6px; font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -.02em; line-height: 1.15; }
.hero p { margin: 0; color: var(--muted); max-width: 60ch; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 18px; }
.tile { display: flex; flex-direction: column; gap: 10px; text-align: left; cursor: pointer; text-decoration: none; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; min-height: 150px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #dcd7ff; }
.tile .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--grad); }
.tile .ic svg { width: 22px; height: 22px; }
.tile b { font-size: 16px; }
.tile span { font-size: 14px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .tile, .meter > i { transition: none; } .tile:hover { transform: none; } }

/* ---------- files ---------- */
.filebar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 14px; }
.filebar input[type=search] { flex: 1 1 220px; min-width: 0; font: inherit; border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; background: var(--panel); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--fg); color: #fff; border-color: var(--fg); }
.flist { display: flex; flex-direction: column; gap: 8px; }
.frow { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.frow .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--c1); }
.frow .nm { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .meta { font-size: 13px; color: var(--muted); }
.frow .acts { display: flex; gap: 6px; }
.frow audio { grid-column: 1 / -1; width: 100%; height: 40px; }
.frow .iconbtn { width: 36px; height: 36px; }
.frow .iconbtn svg { width: 18px; height: 18px; }
.storage { margin-top: 18px; font-size: 13.5px; color: var(--muted); }

/* ---------- empty states ---------- */
.empty { text-align: center; padding: 42px 20px; border: 1px dashed #dcd8ce; border-radius: 22px; background: var(--panel); }
.empty .art { width: 132px; height: 92px; margin: 0 auto 14px; display: block; }
.empty h3 { margin: 0 0 6px; font-size: 19px; }
.empty p { margin: 0 auto 16px; max-width: 44ch; color: var(--muted); }
.empty .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- tool frames ---------- */
.toolwrap { display: flex; flex-direction: column; gap: 12px; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--line2); border: 1px solid var(--line); align-self: flex-start; max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 8px 16px; font-weight: 650; font-size: 14px; cursor: pointer; white-space: nowrap; }
.seg button[aria-selected="true"] { background: var(--panel); box-shadow: 0 1px 3px rgba(22,22,29,.12); }
.toolnote { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.frames { position: relative; }
iframe.tool { display: block; width: 100%; border: 0; min-height: 70vh; background: transparent; }
.loading { display: flex; align-items: center; gap: 12px; padding: 28px; color: var(--muted); }
.orb { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); position: relative; overflow: hidden; flex: none; }
.orb.pulse { animation: orbp 1.6s ease-in-out infinite; }
@keyframes orbp { 50% { transform: scale(.88); opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .orb.pulse { animation: none; } }

/* ---------- studio voices (native) ---------- */
.sv label { display: block; font-size: 14px; font-weight: 650; margin: 0 0 6px; }
.sv textarea, .sv select, .sv input, .field { width: 100%; font: inherit; color: var(--fg); background: #fbfaf7; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; }
.sv textarea { min-height: 160px; resize: vertical; }
.sv .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.sv .acts { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.sv audio { width: 100%; margin-top: 14px; }
.msg { font-size: 14px; color: var(--muted); min-height: 1.4em; margin: 10px 0 0; }
.msg.err { color: var(--warn); }
.lock { display: flex; gap: 14px; align-items: flex-start; margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--soft); }
.lock p { margin: 0 0 10px; }

/* ---------- voices ---------- */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.vcard { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.vcard .orb { width: 36px; height: 36px; }
.vcard b { display: block; font-size: 15px; }
.vcard small { color: var(--muted); font-size: 12.5px; }
.vcard .acts { display: flex; gap: 4px; }
.star[aria-pressed="true"] { color: #b45309; }
.star[aria-pressed="true"] svg { fill: #f59e0b; stroke: #b45309; }

/* ---------- pro ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.plan { display: flex; flex-direction: column; gap: 8px; }
.plan h3 { margin: 0; font-size: 17px; }
.plan .price { font-size: 30px; font-weight: 760; letter-spacing: -.02em; }
.plan .price small { font-size: 14px; font-weight: 600; color: var(--muted); }
.plan ul { margin: 4px 0 8px; padding-left: 18px; color: var(--muted); font-size: 14.5px; }
.plan .btn { margin-top: auto; }
.plan.best { border: 2px solid transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--grad) border-box; }
.paymeth { font-size: 12.5px; color: var(--muted); text-align: center; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { width: 16px; height: 16px; color: var(--ok); }
.statusline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.big-num { font-size: 34px; font-weight: 760; letter-spacing: -.02em; line-height: 1.1; }
details.fold { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 4px 18px; }
details.fold summary { cursor: pointer; font-weight: 650; padding: 12px 0; }
details.fold .opts { display: grid; gap: 12px; padding: 4px 0 16px; }
.opt { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; }
.opt p { margin: 0; font-size: 13.5px; color: var(--muted); }
.qr { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid var(--line); width: max-content; margin-top: 8px; }
.qr img { width: 196px; height: 196px; image-rendering: pixelated; }

/* ---------- welcome ---------- */
.welcome { display: grid; gap: 16px; }
.celebrate { text-align: center; padding: 34px 20px 28px; border-radius: 24px; border: 1px solid var(--line); background: radial-gradient(420px 200px at 50% 0, rgba(79,70,229,.12), transparent 70%), var(--panel); }
.celebrate .worb { width: 96px; height: 96px; margin: 0 auto 16px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; position: relative; overflow: hidden; box-shadow: 0 14px 40px -14px rgba(79,70,229,.6); }
.celebrate .worb svg { width: 44px; height: 44px; stroke: #fff; stroke-width: 2.6; }
.celebrate .worb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); transform: translateX(-120%); animation: shimmer 1s ease-out .3s 1 forwards; }
@keyframes shimmer { to { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) { .celebrate .worb::after { animation: none; display: none; } }
.celebrate h2 { margin: 0; font-size: clamp(26px, 4vw, 34px); letter-spacing: -.02em; outline: none; }
.celebrate p { margin: 6px 0 0; color: var(--muted); }
.wcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.wcard { display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.wcard .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--grad); }
.wcard h3 { margin: 0; font-size: 17px; }
.wcard p { margin: 0; color: var(--muted); font-size: 14.5px; }
.wcard .btn { margin-top: auto; min-height: 48px; }

/* ---------- palette, toast, tour ---------- */
.palette { position: fixed; inset: 0; z-index: 60; background: rgba(22,22,29,.32); display: grid; place-items: start center; padding: 12vh 16px 16px; }
.palette-box { width: min(560px, 100%); background: var(--panel); border-radius: 18px; box-shadow: 0 24px 60px -20px rgba(22,22,29,.45); overflow: hidden; border: 1px solid var(--line); }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; font: inherit; font-size: 17px; outline: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.palette li[aria-selected="true"] { background: var(--soft); }
.palette li svg { color: var(--muted); }
.palette li .kbd { margin-left: auto; font-size: 12px; color: var(--faint); }
.palette-hint { margin: 0; padding: 8px 14px 10px; font-size: 12px; color: var(--faint); border-top: 1px solid var(--line2); }
kbd { font: 600 11.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 5px; background: #fff; color: var(--muted); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 70; background: var(--fg); color: #fff; border-radius: 999px; padding: 11px 18px; font-size: 14.5px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast a { color: #c7d2fe; margin-left: 6px; }
.coach { position: fixed; z-index: 80; width: min(320px, calc(100vw - 32px)); background: var(--panel); border-radius: 18px; padding: 18px; box-shadow: 0 24px 60px -18px rgba(22,22,29,.5); border: 1px solid var(--line); }
.coach .step { font-size: 12px; font-weight: 700; color: var(--c1); letter-spacing: .04em; text-transform: uppercase; }
.coach h3 { margin: 4px 0 6px; font-size: 18px; outline: none; }
.coach p { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
.coach .row { display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.coach .dots { display: flex; gap: 6px; }
.coach .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.coach .dots i.on { background: var(--c1); }
.coach-ring { position: fixed; z-index: 79; border-radius: 14px; box-shadow: 0 0 0 4px rgba(79,70,229,.45), 0 0 0 9999px rgba(22,22,29,.28); pointer-events: none; transition: all .25s ease; }
@media (prefers-reduced-motion: reduce) { .coach-ring { transition: none; } }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14.5px; }

/* ---------- phones: the sidebar becomes tabs inside the page ---------- */
@media (max-width: 899px) {
  .ws { display: block; padding: 0; margin-top: 4px; }
  .side { display: none; }
  .tabs { display: flex; gap: 6px; position: sticky; top: 0; z-index: 20; overflow-x: auto; scrollbar-width: none; padding: 8px 16px; background: rgba(251,250,247,.96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); text-decoration: none; font-size: 14px; font-weight: 650; }
  .tabs a svg { width: 17px; height: 17px; color: var(--muted); }
  .tabs a[aria-current="page"] { background: var(--fg); color: #fff; border-color: var(--fg); }
  .tabs a[aria-current="page"] svg { color: #fff; }
  .tabs .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grad); }
  .wsmain { padding: 0 16px !important; }
  .wstop { padding: 12px 0 10px; gap: 10px; }
  .titles h1 { font-size: 20px; }
  .titles p { font-size: 13.5px; }
  .top-actions { width: 100%; }
  .usage { flex: 1; min-width: 0; }
  .hero { padding: 20px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { min-height: 124px; padding: 14px; }
  .tile span { font-size: 13px; }
  .sv .row2 { grid-template-columns: 1fr; }
  .celebrate { padding: 22px 16px 18px; }
  .celebrate .worb { margin-bottom: 10px; }
  .welcome { gap: 12px; }
  .welcome .card { padding: 16px; }
  .wcard { min-height: 0; }
  .opt { grid-template-columns: 1fr; }
  .opt .btn { justify-self: start; }
  .frow { grid-template-columns: 44px 1fr; }
  .frow .acts { grid-column: 1 / -1; justify-content: flex-end; margin-top: -4px; }
}
@media (max-width: 330px) { .tiles { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .meter > i { transition: none; } }
/* ---------- unlock panel ---------- */
.unlock { max-width: 560px; text-align: center; margin: 8px auto 0; padding: 30px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.unlock h2 { margin: 4px 0 0; font-size: 24px; letter-spacing: -.015em; }
.unlock p { margin: 0; }
.unlock .btn { margin-top: 8px; }
.unlock-art { position: relative; width: 72px; height: 72px; }
.unlock-art .orb { display: block; width: 72px; height: 72px; }
.unlock-art svg { position: absolute; inset: 0; margin: auto; width: 28px; height: 28px; stroke: #fff; }
/* ---------- free limit ---------- */
.mini .v2 { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.mini.out { border-color: #f1c7a6; background: #fff8f1; }
.limitbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 0 0 14px; padding: 12px 16px; border-radius: 14px; border: 1px solid #f1c7a6; background: #fff8f1; font-size: 14.5px; }
.limitbar-act { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.limitbar .paymeth { text-align: left; }
