@import url("https://fonts.bunny.net/css?family=outfit:400,500,600,700,800|fraunces:600,700");

:root {
  --ink: #07080b; --ink2: #101218; --panel: #171a22; --chrome: #0b0c10; --elev: #22262f;
  --sunken: #0a0d12; --paper: #f4f6ef; --muted: #8d937f;
  --accent: #d4ff3f; --accent2: #f0ff9a; --ok: #7ddaa4; --danger: #ff8b8b; --on-accent: #141800;
  --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .16);
  --wash: rgba(255, 255, 255, .06); --track: rgba(255, 255, 255, .12); --glow: #7b5cff;
  --orange: #ff9f43; --play: #7ddaa4; --pause: #e6c07b; --stop: #6b849e;
  --radius-sm: 10px; --radius: 16px; --radius-lg: 22px; --radius-pill: 999px;
  --gap: 16px; --touch: 44px;
  --shadow: 0 24px 60px rgba(0, 0, 0, .55); --shadow-sm: 0 8px 24px rgba(0, 0, 0, .35);
  --font: "Outfit", "Segoe UI", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  color-scheme: dark;
  scrollbar-color: var(--muted) var(--sunken);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html[data-theme=clair] { color-scheme: light; }
html[data-theme=lisible] { color-scheme: dark; }
body {
  background:
    radial-gradient(80vw 50vh at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 58%),
    radial-gradient(50vw 40vh at 100% 100%, color-mix(in srgb, var(--glow) 12%, transparent), transparent 55%),
    var(--ink);
  color: var(--paper);
  font: 16px/1.45 var(--font);
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}
::selection { background: color-mix(in srgb, var(--accent) 40%, var(--ink2)); color: var(--on-accent); }
::placeholder { color: var(--muted); opacity: 1; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--sunken); }
*::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 70%, var(--sunken)); border-radius: 99px; }
button, input, select, textarea { font: inherit; color: inherit; color-scheme: inherit; }
h1, h2, h3 { margin: 0 0 6px; line-height: 1.12; letter-spacing: -.03em; font-family: var(--display); }
h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 700; }
h2 { font-size: 1.28rem; } h3 { font-size: 1rem; font-family: var(--font); }
p { margin: 6px 0; }
.muted { color: var(--muted); } .small { font-size: .84rem; } .center { text-align: center; }
.ok { color: var(--ok); } .bad, .warn { color: var(--danger); } .pad { padding: 16px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

#app { height: 100dvh; }
.shell { display: flex; flex-direction: column; height: 100%; }
.shell.studio > .main { min-height: 0; }
.main { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.main > .panel { flex: 1; }
.panel { padding: var(--gap); overflow: auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 80; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: var(--radius-sm); }
.skip:focus { left: 8px; }
.btn {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  padding: 8px 14px; cursor: pointer; min-height: var(--touch);
  transition: border-color .15s, background-color .15s, color .15s, transform .15s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); background: var(--elev); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.btn.primary:hover:not(:disabled) { background: var(--accent2); border-color: var(--accent2); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 8%, var(--panel)); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--wash); border-color: var(--line); }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: .88rem; }
.btn.big { min-width: 56px; min-height: 48px; font-size: 1.2rem; }
.btn.big-w { width: 100%; margin-top: 8px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.link { background: none; border: 0; color: var(--accent2); cursor: pointer; padding: 2px 0; text-align: left; }
.link.title { font-weight: 700; font-size: 1.05rem; color: var(--paper); } .link.sub { margin-left: 14px; }
input[type=text], input[type=password], input[type=search], input[type=number], select, textarea {
  appearance: none; -webkit-appearance: none;
  background: var(--sunken); background-color: var(--sunken);
  color: var(--paper); caret-color: var(--paper);
  border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 10px 12px; width: 100%; min-height: 44px;
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
select { width: auto; max-width: 100%; }
textarea { resize: vertical; }
input[type=range] { width: 100%; accent-color: var(--accent); }
progress { width: 100%; height: 10px; accent-color: var(--accent); }
.field { display: block; margin: 10px 0; } .field > span { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; }
.inline { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: .88rem; }
.check, .radio { display: inline-flex; gap: 8px; align-items: center; min-height: 36px; }
.radios { display: grid; gap: 4px; }

.card {
  background: var(--ink2);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin: 12px 0;
  box-shadow: inset 0 1px 0 var(--wash);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card.active { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.card.picked { box-shadow: inset 3px 0 0 var(--accent); }
.card.listen.ready { border-left: 4px solid var(--ok); }
.card.listen.is-play, .card.listen.ready.is-play {
  background: color-mix(in srgb, var(--play) 22%, var(--ink2));
  border-color: var(--play);
  box-shadow: 0 0 0 1px var(--play);
}
.card.listen.is-pause, .card.listen.ready.is-pause {
  background: color-mix(in srgb, var(--pause) 26%, var(--ink2));
  border-color: var(--pause);
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.foot { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.home { max-width: 1180px; margin: 0 auto; width: 100%; padding: 36px 24px 56px; }
.page-head, .home-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h2 { margin: 0 0 4px; }
.home-head h1, .home-title { font-size: clamp(2.4rem, 5vw, 4.2rem); margin: 0 0 8px; font-family: var(--display); }
.page-head .muted, .home-head .muted { margin: 0; max-width: 42ch; }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-head .row { min-width: 0; flex: 1; }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.files-tablist .btn, .drive-tabs .btn, .files-tabs > .btn { border-radius: var(--radius-pill); }
.kicker, .home-kicker { text-transform: uppercase; letter-spacing: .22em; font-size: .68rem; color: var(--accent); font-weight: 800; margin-bottom: 8px; }
.home-stats { display: flex; gap: 10px; }
.stat {
  background: var(--sunken); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 16px; min-width: 96px;
}
.stat b { display: block; font-size: 1.45rem; line-height: 1.1; letter-spacing: -.03em; }
.stat span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.quota { min-width: 168px; }
.quota progress { display: block; width: 100%; height: 6px; margin: 6px 0; }
.quota.mini { min-width: 118px; max-width: 160px; }
.quota.mini p { display: none; }
.quota.project.mini { min-width: 104px; max-width: 148px; }
.quota.hot progress { accent-color: var(--pause); }
.quota.full progress { accent-color: var(--danger); }
button.quota.click {
  cursor: pointer; background: var(--sunken); border: 1px solid var(--line);
  color: inherit; font: inherit; text-align: left; padding: 8px 10px; border-radius: 14px;
}
button.quota.click:hover, button.quota.click:focus-visible {
  border-color: var(--accent); background: var(--elev);
}
@media (max-width: 720px) { .topbar .quota.mini { min-width: 92px; max-width: 128px; } }
.home-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dialog.create-dlg { width: min(94vw, 480px); }
.create-dlg .dlg-body { padding: 18px 18px 10px; }
.create-dlg .field > span { font-weight: 600; color: var(--paper); }
.create-dlg input { font-size: 1.05rem; }
.empty-board { text-align: center; padding: 56px 24px; margin: 0; background: var(--sunken); }
.home-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.home-toolbar input { max-width: 320px; }
.project-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.project-card { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; overflow: hidden; background: var(--ink2); }
.project-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-4px); }
.project-card.last { border-color: var(--accent); }
.project-cover {
  height: 128px; display: flex; align-items: flex-end; justify-content: space-between;
  padding: 14px 16px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 55%, var(--ink2)) 0%, var(--ink2) 72%);
}
.project-card.last .project-cover { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 80%, var(--ink2)), var(--ink2)); }
.project-open { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; width: 100%; background: none; border: 0; padding: 0 16px 10px; margin-top: 12px; cursor: pointer; text-align: left; color: inherit; }
.project-open .title { font-weight: 750; font-size: 1.22rem; letter-spacing: -.02em; font-family: var(--display); }
.project-mark { width: 44px; height: 44px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 22%, var(--ink)); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; flex: none; background-color: var(--accent); }
.badge { display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--accent); padding: 4px 8px; border-radius: var(--radius-pill); }
.project-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .84rem; }
.project-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 12px 14px; }
.project-actions .btn.primary { flex: 1; }
@media (max-width: 560px) {
  .home-head, .page-head { align-items: flex-start; }
  .home-head-actions { width: 100%; }
  .home-head-actions .btn.primary { flex: 1; }
  .home-toolbar { flex-direction: column; align-items: stretch; }
  .home-toolbar input { max-width: none; }
}

.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 18px;
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  padding-top: max(10px, env(safe-area-inset-top));
  min-height: 64px;
}
.shell.studio > .topbar { border-bottom-color: var(--line); min-height: 56px; }
.brand { display: flex; gap: 10px; align-items: center; flex: none; min-width: 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 0; min-height: 44px; }
button.who { background: var(--sunken); border: 1px solid var(--line); color: inherit; font: inherit; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px 4px 4px; border-radius: var(--radius-pill); }
button.who:hover, button.who:focus-visible { border-color: var(--accent); }
.tab-hint { margin: 0; padding: 6px var(--gap) 0; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 10px 0; }
.type-card { margin: 0; padding: 0; display: flex; flex-direction: column; }
.type-card.on { border-color: var(--accent); }
.type-open { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; background: none; border: 0; color: inherit; font: inherit; text-align: left; padding: 10px 10px 6px; cursor: pointer; min-height: 44px; }
.type-card .btn { margin: 0 10px 10px; }
.type-empty { padding: 0 10px 10px; }
.brand-name { font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--display); }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); display: inline-block; margin-right: 8px; flex: none; }
.brand-mark {
  width: auto; height: 32px; max-width: 96px; flex: none; display: block;
  object-fit: contain; object-position: left center; border-radius: 8px;
}
.brand-line { display: flex; align-items: center; gap: 10px; }
.brand > div { min-width: 0; } .brand .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-left: auto; }
.topbar .actions .btn {
  border-radius: var(--radius-pill); min-height: 36px; padding: 4px 12px; font-size: .84rem;
  background: var(--sunken); border-color: var(--line);
}
.pill { border-radius: var(--radius-pill); padding: 4px 12px; border: 1px solid var(--line); background: var(--sunken); cursor: pointer; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; min-height: 32px; }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 55%, transparent); } .pill.bad { color: var(--danger); border-color: var(--danger); } .pill.wait { color: var(--muted); }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 100%; z-index: 30; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); min-width: 210px; padding: 6px; box-shadow: var(--shadow); }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 12px; border-radius: 12px; cursor: pointer; }
.menu button:hover { background: var(--elev); }
.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-pill);
}
.chrome-tabs {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  flex: none; width: 100%; box-sizing: border-box;
  padding: 6px 18px;
  background: var(--chrome);
  border-bottom: 1px solid var(--line);
}
.chrome-tabs .quota { flex: none; margin: 0; }
.tabs.chrome {
  flex: 1; width: auto; min-width: 0;
  margin: 0; padding: 0; gap: 6px;
  justify-content: flex-start;
  background: transparent; border: 0; border-radius: 0;
}
.tabs.chrome .tab {
  min-height: 40px;
  padding: 8px 20px;
  font-size: .95rem;
}
.tabs.in-chrome { margin: 0 auto; padding: 4px; }
.tab {
  background: transparent; border: 0; border-radius: var(--radius-pill);
  padding: 8px 18px; cursor: pointer; min-height: 38px; color: var(--muted); font-weight: 650;
}
.tab.on { background: var(--accent); color: var(--on-accent); font-weight: 800; }
.files-types-head { margin: 12px 0 0; font-size: .92rem; }
.files-tablist { gap: 6px; }
.type-card .btn { width: calc(100% - 20px); }

.stream { flex: 1; min-height: 0; display: flex; }
.stream.cols { display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px; }
body[data-mode=desktop] .stream.cols { grid-template-columns: 320px minmax(0, 1fr) 340px; }
.stream.cols > .panel, .center-col > .panel { border-right: 1px solid var(--line); background: color-mix(in srgb, var(--sunken) 70%, transparent); }
.center-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--line); }
.center-col .reader { flex: 1; display: flex; flex-direction: column; border: 0; background: transparent; }
.stream.mobile { flex-direction: column; }
.stream-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.stream-main > .panel { flex: 1; }
.subtabs {
  display: flex; gap: 4px; background: var(--sunken); border-top: 1px solid var(--line);
  order: 2; padding: 8px 8px max(8px, env(safe-area-inset-bottom));
}
.subtab {
  flex: 1; background: none; border: 1px solid transparent; padding: 10px 4px; cursor: pointer;
  color: var(--muted); border-radius: var(--radius-pill); font-weight: 650;
}
.subtab.on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); font-weight: 800; }
body.land .stream.mobile { flex-direction: row; }
body.land .subtabs { flex-direction: column; order: 0; width: 92px; border-top: 0; border-right: 1px solid var(--line); justify-content: center; padding: 8px 6px; }
body.land .subtab { flex: 0; padding: 14px 4px; }
body.land { --gap: 8px; }

.reader-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.reader-head h2 { margin: 0 0 4px; }
.text { flex: 1; min-height: 0; overflow: auto; font-family: Georgia, "Times New Roman", serif; font-size: 1.18rem; line-height: 1.75; user-select: none; -webkit-touch-callout: none; padding-bottom: 20px; }
body[data-mode=tablet] .reader { padding: 28px; } body[data-mode=mobile] .reader { padding: 14px; }
.para { margin: 0 0 1em; }
.sent { cursor: pointer; border-radius: 4px; padding: 1px 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
body:not([data-mode=desktop]) .sent { display: inline; }
.sent:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.sent.inblk { background: color-mix(in srgb, var(--accent) 16%, transparent); } .sent.anchor { box-shadow: -3px 0 0 var(--accent); }
.sent.sel { outline: 1px dashed var(--accent2); }
.sent.cur { background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: underline; }
.editor { flex: 1; width: 100%; min-height: 240px; font: 1.25rem/1.6 Georgia, serif; resize: none; }

.tree { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
.tree-sec { margin: 4px 0; } .tree-sec .link { display: block; font-size: .9rem; }
.qitem { padding: 8px 0; border-bottom: 1px solid var(--line); } .qitem.playing { outline: 1px solid var(--accent); border-radius: 10px; padding: 8px; }
.note-card { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0; background: var(--ink2); }
.note-card.on { border-color: var(--accent); }
.note-main { flex: 1; text-align: left; background: none; border: 0; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; }

.graph { border: 1px solid var(--line); border-radius: 12px; overflow: auto; margin: 8px 0; background: repeating-linear-gradient(0deg, transparent 0 21px, var(--wash) 21px 22px); }
.graph-in { position: relative; }
.graph svg { pointer-events: none; } .edge { fill: none; stroke: var(--muted); stroke-opacity: .5; stroke-width: 1.2; }
.node { position: absolute; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: .8rem; padding: 0 6px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.node.n-block { border-color: color-mix(in srgb, var(--accent) 35%, #6a8ab5); } .node.n-line { background: var(--ink2); }
.node.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.player, .playbar, .scene-player, .gen-dock {
  background: var(--sunken);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.player-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-width: 0; }
.player-head b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.02em; }
.playbar, .scene-player {
  border-top: 1px solid var(--line);
  padding: 12px 18px max(14px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
}
.playbar .ctrls, .scene-player .ctrls { justify-content: center; gap: 8px; }
.playbar .ctrls .btn, .scene-player .ctrls .btn { min-width: 44px; min-height: 44px; }
.playbar .btn.big, .scene-player .btn.primary[data-scene-btn] {
  width: 56px; height: 56px; min-width: 56px; border-radius: 50%; font-size: 1.05rem;
}
body[data-mode=mobile] .playbar .btn.big { min-width: 56px; }
body[data-mode=tablet] .playbar .btn, body[data-mode=desktop] .playbar .btn { min-width: 48px; min-height: 44px; }
body[data-mode=tablet] .playbar .btn.big, body[data-mode=desktop] .playbar .btn.big { min-width: 56px; }
.playbar.one { flex-direction: row; align-items: center; }
.vol { display: inline-flex; align-items: center; gap: 4px; } .vol input { width: 90px; }
.playbar [data-play-count] { white-space: nowrap; }
.status { color: var(--muted); min-height: 1.2em; } .cases { gap: 12px; }

.listen-view { max-width: 920px; margin: 0 auto; width: 100%; }
.playlist { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--sunken); }
.card.listen.track {
  display: grid; grid-template-columns: 40px 48px minmax(0, 1fr);
  grid-template-areas: "pick play body" "act act act";
  gap: 4px 10px;
  margin: 0; padding: 12px 14px; border-radius: 0; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; box-shadow: none;
}
.card.listen.track:last-child { border-bottom: 0; }
.card.listen.track.ready { border-left: 0; }
.card.listen.track.picked { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.track-play {
  width: 48px; height: 48px; min-width: 48px; min-height: 48px; border-radius: 50%;
  grid-area: play; align-self: center; font-size: 1rem; padding: 0;
}
.card.listen.track .pick-wrap { grid-area: pick; align-self: center; justify-self: center; margin: 0; min-width: 40px; min-height: 40px; }
.card.listen.track .track-body { grid-area: body; min-width: 0; }
.card.listen.track .card-actions { grid-area: act; margin-top: 4px; }
.card.listen.track .cur-sent { min-height: 0; }
.card.listen.track:not(.is-play):not(.is-pause) .cur-sent:empty { display: none; }
.pick-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; cursor: pointer; flex: none;
}
.pick-box { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.seg { gap: 6px; }
.seg .btn.on {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700;
}
.export-dlg .kicker { margin-top: 14px; }
.export-list {
  margin: 8px 0 4px; border: 1px solid var(--line); border-radius: 12px; padding: 8px;
  max-height: min(36dvh, 320px); overflow: auto;
}
.export-list .row { margin-bottom: 8px; align-items: center; }
.export-list input[type=search] { flex: 1; min-width: 140px; }
.export-item { display: flex; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 10px; min-height: 44px; }
.export-item:hover { background: var(--wash); }
.export-item .check { margin: 0; width: 100%; }
.export-sum {
  margin: 12px 0 0; padding: 10px 12px; background: var(--sunken); border: 1px solid var(--line);
  border-radius: 12px; font-size: .92rem;
}
.chunk-field { margin: 8px 0 4px; }
.chunk-field input { max-width: 140px; }
.chunk-presets { margin-bottom: 4px; }
.cur-sent { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 4px 0; }
.seek { margin: 8px 0; }

.scene-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.scene-wrap > .scene { flex: 1; }
.shell.with-scene-player > .scene-player { flex: none; z-index: 25; }
.scene-player .seek { width: 100%; min-height: 32px; }
.scene-player .cur-sent { min-height: 2.2em; font-size: 1.02rem; color: var(--paper); -webkit-line-clamp: 4; }
.scene-player .ctrls .btn { min-width: 44px; min-height: 44px; }
.scene-player.mini {
  position: relative; flex-direction: row; align-items: center; gap: 8px;
  padding: 12px 12px max(12px, env(safe-area-inset-bottom));
  min-height: 64px;
}
.scene-player.mini .mini-seek {
  position: absolute; left: 0; right: 0; top: 0; width: 100%;
  height: 8px; min-height: 8px; margin: 0; padding: 0; z-index: 1;
}
.scene-player.mini .btn.primary {
  width: 48px; height: 48px; min-width: 48px; min-height: 48px; border-radius: 50%; padding: 0; flex: none;
}
.scene-player.mini .mini-hit {
  flex: 1; min-width: 0; background: none; border: 0; color: inherit; font: inherit;
  text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-height: 44px; padding: 4px 6px;
}
.scene-player.sheet {
  position: fixed; inset: 0; z-index: 55; border-radius: 0; border: 0;
  padding: max(12px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  background: var(--sunken); justify-content: flex-end; gap: 14px;
}
.scene-player.sheet .player-title { font-size: 1.35rem; font-family: var(--display); }
.scene-player.sheet .cur-sent { -webkit-line-clamp: 8; min-height: 4.5em; font-size: 1.12rem; }
.scene-player.sheet .btn.primary[data-scene-btn] { width: 64px; height: 64px; min-width: 64px; border-radius: 50%; }
body.player-sheet { overflow: hidden; }
.scene { flex: 1; min-height: 0; display: flex; }
.scene.cols2 > div { overflow: auto; padding: var(--gap); min-height: 0; }
.scene-left { flex: none; border-right: 1px solid var(--line); background: var(--sunken); } .scene-right { flex: 1; min-width: 0; }
body[data-mode=tablet] .scene-left { width: 300px !important; }
.resizer { width: 6px; cursor: col-resize; background: var(--line); flex: none; } .resizer:hover { background: var(--accent); }
.char { --c: var(--accent); border: 1px solid var(--c); border-radius: var(--radius); padding: 10px; margin: 8px 0; background: color-mix(in srgb, var(--c) 12%, var(--ink2)); display: grid; gap: 6px; }
.char.brush { outline: 2px solid var(--c); outline-offset: 2px; }
.dot { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 2px solid var(--paper); cursor: pointer; }
.char .row.swatches { gap: 4px; } .sw { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--paper); cursor: pointer; padding: 0; }
input[type=color] { width: 34px; height: 28px; padding: 0; border: 0; background: none; }
.clip-row { display: flex; gap: 6px; align-items: center; padding: 8px; border-radius: 12px; cursor: pointer; flex-wrap: wrap; } .clip-row:hover { background: var(--wash); }
.clip-row.sel, .bubble.sel { outline: 2px solid var(--accent2); }
.group { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 10px 0; background: var(--ink2); }
.bubbles { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.bubble { --c: var(--muted); max-width: 85%; padding: 10px 12px; border-radius: 18px; background: color-mix(in srgb, var(--c) 28%, var(--ink2)); border: 1px solid var(--c); }
.bubble.left { align-self: flex-start; border-bottom-left-radius: 4px; } .bubble.right { align-self: flex-end; border-bottom-right-radius: 4px; }
.clip-row.is-play, .clip-row.sel.is-play { background: color-mix(in srgb, var(--play) 40%, var(--ink2)); outline: 2px solid var(--play); }
.clip-row.is-pause, .clip-row.sel.is-pause { background: color-mix(in srgb, var(--pause) 44%, var(--ink2)); outline: 2px solid var(--pause); }
.bubble.is-play, .bubble.sel.is-play { background: color-mix(in srgb, var(--play) 42%, var(--ink2)); border-color: var(--play); box-shadow: 0 0 0 2px var(--play); outline: none; }
.bubble.is-pause, .bubble.sel.is-pause { background: color-mix(in srgb, var(--pause) 46%, var(--ink2)); border-color: var(--pause); box-shadow: 0 0 0 2px var(--pause); outline: none; }
.drop { outline: 2px dashed var(--accent2); outline-offset: 2px; }
.card.toolbar { margin-top: 0; }

.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 8px; backdrop-filter: blur(8px); }
.dialog { background: var(--panel); border: 1px solid var(--line-strong); border-radius: 22px; width: min(94vw, 460px); max-height: 94dvh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
body[data-mode=mobile] .dialog { width: 95vw; } body[data-mode=tablet] .dialog.wide { width: 62vw; } body[data-mode=desktop] .dialog.wide { width: min(70vw, 720px); }
body[data-mode=desktop] .dialog.clips, body[data-mode=tablet] .dialog.clips { width: min(90vw, 820px); }
body[data-mode=desktop] .dialog.files-dlg, body[data-mode=tablet] .dialog.files-dlg { width: min(92vw, 860px); }
.files-list { margin-top: 8px; max-height: 52dvh; overflow: auto; }
.file-row { margin: 8px 0; }
.file-row .check { flex: 1; min-width: 0; }
.files-bulk { min-height: 34px; margin: 6px 0 0; gap: 8px; }
.files-tabs { margin-top: 8px; }
.clip-list { display: grid; gap: 8px; margin-top: 8px; }
.clip-edit { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; background: var(--sunken); }
.clip-edit.ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.clip-edit.over { border-color: var(--danger); }
.clip-edit textarea { min-height: 72px; font-family: Georgia, serif; margin: 6px 0; }
input.clip-target { width: 5.5em; min-height: 34px; padding: 4px 8px; }
.drive-list { display: grid; gap: 4px; margin-top: 8px; max-height: 50dvh; overflow: auto; }
.drive-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.drive-item:hover { border-color: var(--accent); }
.drive-item.is-folder { background: color-mix(in srgb, #f5c542 14%, var(--panel)); border-color: color-mix(in srgb, #f5c542 45%, var(--line)); }
.drive-item.is-folder:hover { border-color: #f5c542; }
.drive-item input { width: auto; min-height: 0; }
.drive-folder { display: grid; place-items: center; flex: none; width: 28px; height: 28px; }
.drive-folder svg { display: block; }
.drive-tabs { gap: 6px; margin: 8px 0; }
.drive-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 8px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.drive-sep { color: var(--muted); padding: 0 2px; }
.drive-here { font-weight: 650; }
.drive-type { flex: 0 0 auto; font-size: 11px; font-weight: 650; letter-spacing: .02em; text-transform: uppercase; color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: var(--radius-pill); padding: 2px 8px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dlg-body { padding: 16px 18px; overflow: auto; flex: 1; } .dlg-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line); }
.sel-list { max-height: 55dvh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; }
.sel-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px; cursor: pointer; font-family: Georgia, serif; }
.sel-item.in { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.quote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--accent); font-family: Georgia, serif; }
.take { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; } .take > span { flex: 1; }
.row-pick { display: flex; justify-content: space-between; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 6px 0; cursor: pointer; }
.pick-list { display: grid; gap: 4px; margin-top: 8px; } .pick { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; } .pick.on { border-color: var(--accent); }
.token { display: block; word-break: break-all; background: var(--sunken); padding: 8px; border-radius: 10px; user-select: all; }
.help section { margin-bottom: 12px; }
#toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); background: var(--panel); border: 1px solid var(--accent); padding: 10px 16px; border-radius: var(--radius); opacity: 0; pointer-events: none; transition: .2s; z-index: 80; max-width: 92vw; box-shadow: var(--shadow); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.login {
  min-height: 100dvh; display: grid; grid-template-columns: minmax(300px, 1.15fr) minmax(340px, .85fr);
  background: var(--ink);
}
.login-hero {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
  padding: 56px; min-height: 100dvh; position: relative; overflow: hidden;
  background:
    radial-gradient(900px 520px at 18% 8%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 60%),
    linear-gradient(180deg, var(--ink2) 0%, var(--ink) 100%);
}
.login-logo {
  width: min(100%, 460px); height: auto; display: block;
  margin: 0 0 12px; filter: drop-shadow(0 16px 32px rgba(0, 0, 0, .35));
}
.login-hero h1 { font-size: clamp(3rem, 7vw, 5.4rem); margin: 0; font-family: var(--display); }
.login-hero p { font-size: 1.2rem; max-width: 28ch; color: var(--muted); }
.login .card, .login-card {
  width: min(420px, calc(100% - 48px)); margin: auto; padding: 32px 28px;
  box-shadow: var(--shadow); border-radius: 24px; background: var(--panel); border: 1px solid var(--line-strong);
}
.login h1 { font-size: 1.55rem; margin: 4px 0 8px; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-hero { min-height: 38vh; padding: 28px 24px; }
  .login-hero h1 { font-size: 2.4rem; }
  .login-logo { width: min(100%, 280px); margin-bottom: 8px; }
}
.user-card { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.user-meta { min-width: 0; }
.user-pic { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--panel); flex: none; }
.user-pic.sm, .project-mark.sm { width: 28px; height: 28px; font-size: .8rem; }
.who { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 220px; }
.who-name { font-weight: 650; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity .user-card { background: var(--sunken); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 12px 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

progress { -webkit-appearance: none; appearance: none; border: 0; border-radius: 99px; background: var(--track); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--track); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--stop); border-radius: 99px; transition: width .2s, background-color .2s; }
progress::-moz-progress-bar { background: var(--stop); }
progress.gen::-webkit-progress-value, progress.is-gen::-webkit-progress-value { background: var(--orange); }
progress.gen::-moz-progress-bar, progress.is-gen::-moz-progress-bar { background: var(--orange); }
progress.is-play::-webkit-progress-value { background: var(--play); }
progress.is-play::-moz-progress-bar { background: var(--play); }
progress.is-pause::-webkit-progress-value { background: var(--pause); }
progress.is-pause::-moz-progress-bar { background: var(--pause); }
progress.is-stop::-webkit-progress-value { background: var(--stop); }
progress.is-stop::-moz-progress-bar { background: var(--stop); }
progress.is-load::-webkit-progress-value { background: var(--accent); }
progress.is-load::-moz-progress-bar { background: var(--accent); }
.seek { accent-color: var(--stop); }
.seek.is-play { accent-color: var(--play); }
.seek.is-pause { accent-color: var(--pause); }
.seek.is-stop { accent-color: var(--stop); }
.seek.is-load { accent-color: var(--accent); }

.listen-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.listen-wrap > .panel { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.minw0 { min-width: 0; }
.gen-dock { position: fixed; right: 16px; bottom: 16px; z-index: 42; border: 1px solid color-mix(in srgb, var(--orange) 60%, var(--line));
  border-radius: 20px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px;
  width: min(420px, calc(100vw - 32px)); background: var(--panel); }
.gen-dock.min { flex-direction: row; align-items: center; gap: 8px; padding: 8px 10px; }
.gen-dock.min progress { width: 88px; flex: none; }
.gen-dock-hit { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; padding: 4px; min-height: 44px; }
.gen-dock.open { max-height: min(52dvh, 460px); }
.gen-list { overflow: auto; min-height: 0; display: grid; gap: 6px; }
.gen-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--sunken); }
.gen-item.on { border-color: var(--orange); }
.gen-item progress { width: 100%; }
.btn.on-file { border-color: var(--orange); color: var(--orange); background: color-mix(in srgb, var(--orange) 12%, transparent); }
.shell.with-scene-player .gen-dock { bottom: 210px; }
body[data-mode=mobile] .shell.with-scene-player .gen-dock,
body[data-mode=tablet] .shell.with-scene-player .gen-dock { bottom: 88px; }
body[data-mode=mobile] .gen-dock { left: 8px; right: 8px; width: auto; bottom: max(8px, env(safe-area-inset-bottom)); }
body[data-mode=mobile] .shell.with-scene-player .gen-dock { bottom: max(84px, env(safe-area-inset-bottom)); }
body[data-mode=mobile] .tabs { overflow-x: auto; flex-wrap: nowrap; }
body[data-mode=mobile] .tab { flex: 1; text-align: center; }
body[data-mode=mobile] .chrome-tabs {
  padding: 6px 12px; flex-direction: column; align-items: stretch; gap: 6px;
}
body[data-mode=mobile] .chrome-tabs .quota { align-self: flex-end; }
@media (max-width: 720px) {
  .chrome-tabs { padding: 6px 12px; flex-direction: column; align-items: stretch; gap: 6px; }
  .chrome-tabs .quota { align-self: flex-end; }
}
body[data-mode=tablet] .topbar .actions .btn { padding: 4px 10px; }
body[data-mode=tablet] .card.listen.track .card-actions { gap: 6px; }
body:not([data-mode=desktop]) .shell.with-scene-player > .main { padding-bottom: 0; }

.theme-pick { display: grid; gap: 8px; margin-top: 8px; }
.theme-pick.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.theme-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; min-height: 52px; white-space: normal; line-height: 1.25;
}
.theme-pick.compact .theme-opt { min-height: 48px; padding: 8px 8px; align-items: center; text-align: center; }
.theme-opt b { font-weight: 700; }
.theme-opt.on,
.theme-opt.on:hover:not(:disabled) {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent);
}
.theme-opt.on .muted { color: var(--on-accent); opacity: .85; }

html[data-theme=lisible], html[data-theme=lisible] body, body[data-theme=lisible] {
  --ink: #000; --ink2: #111; --panel: #1a1a1a; --chrome: #000; --elev: #2a2a2a;
  --sunken: #111; --paper: #fffef6; --muted: #ddd6c0;
  --accent: #ffe44d; --accent2: #fff3a0; --on-accent: #111;
  --ok: #9dffc2; --danger: #ffb4b4;
  --line: rgba(255, 255, 255, .32); --line-strong: rgba(255, 255, 255, .58);
  --wash: rgba(255, 255, 255, .1); --track: rgba(255, 255, 255, .22); --glow: #ffe44d;
  --play: #9dffc2; --pause: #ffd36a; --stop: #c5d0dc;
  font-size: 18px; line-height: 1.55;
}
html[data-theme=clair], html[data-theme=clair] body, body[data-theme=clair] {
  --ink: #f4f1e6; --ink2: #ece6d4; --panel: #fffdf6; --chrome: #e4dcc8; --elev: #fff;
  --sunken: #e8e0cc; --paper: #16140e; --muted: #4a4538;
  --accent: #5c4a00; --accent2: #3d3200; --on-accent: #fffbe8;
  --ok: #0b6b3a; --danger: #a31414;
  --line: rgba(22, 20, 14, .2); --line-strong: rgba(22, 20, 14, .42);
  --wash: rgba(22, 20, 14, .07); --track: rgba(22, 20, 14, .16); --glow: #8a7020;
  --play: #0b6b3a; --pause: #8a5a00; --stop: #3d4a5c;
  --shadow: 0 18px 40px rgba(40, 30, 10, .18); --shadow-sm: 0 6px 16px rgba(40, 30, 10, .12);
  font-size: 18px; line-height: 1.55; color-scheme: light;
}

html[data-theme=lisible] .btn,
html[data-theme=clair] .btn { min-height: 48px; border-width: 2px; }
html[data-theme=lisible] .btn.small,
html[data-theme=clair] .btn.small { min-height: 42px; }
html[data-theme=lisible] .link,
html[data-theme=clair] .link { text-decoration: underline; text-underline-offset: 3px; }
html[data-theme=lisible] .small,
html[data-theme=clair] .small { font-size: .95rem; }
html[data-theme=lisible] .kicker,
html[data-theme=clair] .kicker { font-size: .78rem; letter-spacing: .14em; }
html[data-theme=lisible] :focus-visible,
html[data-theme=clair] :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
html[data-theme=lisible] .reader,
html[data-theme=lisible] .sent,
html[data-theme=clair] .reader,
html[data-theme=clair] .sent { font-size: 1.18em; line-height: 1.65; }
html[data-theme=lisible] .cur-sent,
html[data-theme=clair] .cur-sent { -webkit-line-clamp: 5; font-size: 1.05rem; }

html[data-theme=clair] .backdrop { background: color-mix(in srgb, var(--paper) 48%, transparent); }
html[data-theme=clair] .card.listen.track.picked,
html[data-theme=lisible] .card.listen.track.picked {
  background: color-mix(in srgb, var(--accent) 16%, var(--ink2));
}
html[data-theme=clair] input:-webkit-autofill,
html[data-theme=clair] textarea:-webkit-autofill,
html[data-theme=clair] select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--sunken) inset;
  -webkit-text-fill-color: var(--paper);
  caret-color: var(--paper);
}
