/* Shared look for every prototype view. Accents come from html[data-app]. */

:root {
  --bg0: #121a2c;
  --bg1: #1a2438;
  --bg2: #223044;
  --ink: #eef3ff;
  --muted: #93a0bd;
  --accent: #8ea2ff;
  --accent-dim: #5c72e0;
  --listen: #7ec8ff;
  --glow: rgba(120, 150, 255, 0.32);
  --glow-2: rgba(70, 110, 220, 0.18);
  --user: #1a2744;
  --assistant: #121a2c;
  --danger: #f07167;
  --ok: #7ddea8;
  --line: rgba(226, 232, 255, 0.12);
  --on-accent: #071018;
  --radius: 16px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

html[data-app="qwen"] {
  --accent: #7ec8ff;
  --accent-dim: #3d8fd4;
  --glow: rgba(70, 170, 255, 0.3);
  --user: #16304a;
}

html[data-app="julya"],
html[data-app="todos"] {
  --bg0: #122028;
  --bg1: #1a2c36;
  --bg2: #203848;
  --ink: #eef6f4;
  --muted: #93ada6;
  --accent: #5ee0b5;
  --accent-dim: #1f8f6e;
  --listen: #7ec8ff;
  --glow: rgba(40, 180, 140, 0.3);
  --glow-2: rgba(60, 120, 200, 0.18);
  --line: rgba(226, 242, 236, 0.14);
}

html[data-app="lora"] {
  --bg0: #16182c;
  --bg1: #201c38;
  --bg2: #2c2848;
  --ink: #f2f0ff;
  --muted: #a39bbd;
  --accent: #c4b5fd;
  --accent-dim: #6d5bd0;
  --listen: #7ec8ff;
  --glow: rgba(140, 110, 255, 0.32);
  --glow-2: rgba(60, 120, 200, 0.16);
  --line: rgba(232, 226, 255, 0.14);
}

html[data-app="image"] {
  --accent: #8ee0b8;
  --accent-dim: #2f8f68;
  --glow: rgba(80, 200, 150, 0.24);
  --glow-2: rgba(40, 90, 160, 0.16);
}

html[data-app="whisper"] {
  --accent: #5ee0d0;
  --accent-dim: #1f8f84;
  --glow: rgba(60, 200, 190, 0.26);
  --glow-2: rgba(40, 90, 140, 0.16);
}

html[data-app="vision"] {
  --accent: #8eb6ff;
  --accent-dim: #3d74c8;
  --glow: rgba(90, 140, 255, 0.28);
}

html[data-app="seals"] {
  --bg0: #121c16;
  --bg1: #1a2a20;
  --bg2: #24382c;
  --ink: #eef6f0;
  --muted: #93b5a4;
  --accent: #7ddea0;
  --accent-dim: #1f8f5a;
  --glow: rgba(80, 200, 130, 0.28);
  --glow-2: rgba(40, 90, 70, 0.18);
  --line: rgba(226, 242, 232, 0.14);
}

html[data-app="dictate"] {
  --bg0: #12241c;
  --bg1: #1a3026;
  --bg2: #204234;
  --ink: #e8f6ef;
  --muted: #93b5a6;
  --accent: #3dcf9a;
  --accent-dim: #1f8f68;
  --glow: rgba(40, 180, 120, 0.28);
  --glow-2: rgba(20, 80, 120, 0.16);
  --line: rgba(226, 242, 234, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  background:
    radial-gradient(1000px 560px at 8% -18%, var(--glow) 0%, transparent 55%),
    radial-gradient(800px 480px at 100% -8%, var(--glow-2) 0%, transparent 50%),
    var(--bg0);
}

html[data-layout="shell"] body {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

html[data-layout="stage"] body {
  background:
    radial-gradient(900px 560px at 12% -12%, var(--glow) 0%, transparent 55%),
    radial-gradient(700px 480px at 100% 18%, var(--glow-2) 0%, transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 62%, #141c28);
  background-attachment: fixed;
}

header,
main,
footer,
.stage > header,
.panel,
.orb-block,
.mic-block,
.gate-card {
  animation: view-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.panel:nth-child(2),
main {
  animation-delay: 0.06s;
}

.panel:nth-child(3),
footer {
  animation-delay: 0.12s;
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

html[data-layout="shell"] header,
html[data-layout="shell"] footer {
  padding: 1.15rem 1.5rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

html[data-layout="shell"] footer {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  background: linear-gradient(to top, rgba(18, 26, 44, 0.94), rgba(18, 26, 44, 0.72));
}

html[data-layout="shell"] header h1,
.panel h2 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
}

.panel h2 {
  margin-bottom: 0.85rem;
  font-size: 1.12rem;
}

html[data-layout="shell"] header p,
.lede {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

header code,
footer code {
  color: var(--accent);
  font-size: 0.88em;
}

.stage {
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.25rem 0 3.5rem;
}

.brand {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
}

html[data-app="dictate"] .brand {
  margin-bottom: 0.35rem;
  font-size: clamp(2rem, 5vw, 2.6rem);
  line-height: 1.05;
}

html[data-app="dictate"] h1 {
  margin: 0;
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

html[data-layout="stage"] .lede {
  margin: 0.75rem 0 1rem;
  max-width: 40rem;
}

.todos-link {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}

.todos-link:hover {
  text-decoration: underline;
}

#status,
#web-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.84rem;
}

#status .dot,
#web-status .dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent-dim);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
}

#status.ok .dot,
#web-status.ok .dot {
  background: var(--ok);
  animation: status-pulse 2.2s ease-in-out infinite;
}

#status.err .dot,
#web-status.err .dot {
  background: var(--danger);
  animation: none;
}

#status.busy .dot {
  background: var(--accent);
  animation: blink 0.9s step-end infinite;
}

@keyframes status-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent);
  }
  50% {
    box-shadow: 0 0 0 8px transparent;
  }
}

main {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2rem;
  display: grid;
  gap: 1rem;
}

#chat {
  overflow-y: auto;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 1.25rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.panel {
  background: color-mix(in srgb, var(--bg1) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.hint,
.note,
.meta,
.filename,
.result-meta {
  color: var(--muted);
}

.hint {
  font-size: 0.84rem;
}

footer .hint {
  max-width: 52rem;
  margin: 0.35rem auto 0;
}

.hint.err,
.answer .err {
  color: var(--danger);
}

button,
.btn,
a.ghost {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--on-accent);
  background: linear-gradient(160deg, var(--accent), var(--accent-dim));
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

button:hover:not(:disabled),
.btn:hover:not(:disabled),
a.ghost:hover,
.tab:hover,
.preset:hover,
.tabs button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

button:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.ghost,
button.ghost,
.btn.secondary,
a.ghost,
.copy-btn,
.tabs button,
.tab,
.preset {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
  font-weight: 600;
  filter: none;
}

.tabs button[aria-selected="true"],
.tab.active,
.preset.active {
  color: var(--on-accent);
  background: var(--accent);
  border-color: transparent;
}

.btn {
  color: var(--ink);
  background: var(--bg2);
  border-radius: var(--radius);
}

.btn.accent,
#send,
#run,
#run-ref,
#ask {
  color: var(--on-accent);
  background: linear-gradient(160deg, var(--accent), var(--accent-dim));
  border-color: transparent;
}

.btn.recording {
  color: #1a1010;
  background: linear-gradient(160deg, #f07167, #a94a38);
}

.linkish {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  width: fit-content;
  max-width: 100%;
  margin: 0.85rem 0 1.15rem;
  padding: 0.22rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
}

html[data-layout="shell"] .tabs {
  margin-top: 0.9rem;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 0;
}

.tabs button,
.tab {
  padding: 0.48rem 1rem;
}

.actions,
.row,
.todo-actions,
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.actions {
  margin: 0.9rem 0 1.15rem;
}

.orb-block .actions,
html[data-layout="shell"] .actions {
  margin: 0;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.field span,
.field-label,
.io label,
.row label {
  color: var(--muted);
  font-size: 0.82rem;
}

.io label {
  display: block;
  margin-bottom: 0.4rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

textarea,
input[type="text"],
input[type="number"],
input[type="password"],
input[type="file"],
select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font: inherit;
  padding: 0.7rem 0.85rem;
}

textarea {
  resize: vertical;
  min-height: 4.5rem;
  line-height: 1.45;
}

textarea:focus,
input:focus,
select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 1px;
}

.row {
  align-items: end;
  margin-bottom: 0.85rem;
}

.row .field.tight {
  width: 6.5rem;
  margin-bottom: 0;
}

.row .field.grow {
  flex: 1 1 14rem;
  min-width: 12rem;
  margin-bottom: 0;
}

.row .field.grow-seed {
  flex: 1 1 10rem;
  min-width: 8rem;
  margin-bottom: 0;
}

.hint-inline {
  font-style: normal;
  font-weight: 500;
  font-size: 0.78em;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
  cursor: pointer;
  font-weight: 650;
}

.check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
}

.openpose-panel {
  margin: 0.25rem 0 0.9rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: rgba(0, 0, 0, 0.2);
}

.openpose-panel.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.drop {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 0.5rem;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  cursor: pointer;
  text-align: center;
}

.drop.drag {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.drop-hint {
  margin: 0;
  color: var(--muted);
}

kbd {
  display: inline-block;
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.82em;
  font-family: inherit;
}

.preview-wrap,
.ref-preview-wrap {
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}

.ref-preview-wrap {
  max-width: 220px;
  margin-bottom: 0.85rem;
}

.preview-wrap img,
.ref-preview-wrap img,
#preview {
  display: block;
  max-width: 100%;
  height: auto;
}

html[data-app="vision"] .preview-wrap {
  width: 100%;
  max-height: 280px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
}

html[data-app="vision"] #preview {
  max-height: 280px;
  object-fit: contain;
  border-radius: 10px;
}

audio#preview {
  width: 100%;
  margin-top: 0.35rem;
  background: transparent;
  border: 0;
}

.hidden,
[hidden] {
  display: none !important;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

#out {
  margin: 0;
  min-height: 8rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  font-family: var(--font);
  font-size: 1.02rem;
}

html[data-app="vision"] #out {
  background: rgba(0, 0, 0, 0.28);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  white-space: normal;
}

html[data-app="vision"] #out:not(.md) {
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 0.92rem;
}

.msg {
  max-width: min(46rem, 100%);
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  line-height: 1.55;
  word-break: break-word;
  animation: view-enter 0.35s ease both;
}

.msg.user {
  align-self: flex-end;
  background: var(--user);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}

.msg.assistant {
  align-self: flex-start;
  background: var(--assistant);
  border: 1px solid var(--line);
}

.msg.user .body {
  white-space: pre-wrap;
}

.msg .role {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.msg .body.md,
.md,
.answer {
  white-space: normal;
}

.msg .body.md > :first-child,
.md > :first-child,
.answer > :first-child {
  margin-top: 0;
}

.msg .body.md > :last-child,
.md > :last-child,
.answer > :last-child {
  margin-bottom: 0;
}

.msg .body.md :is(p, ul, ol, pre, blockquote, table),
.md :is(p, ul, ol, pre, blockquote, table),
.answer :is(p, ul, ol, pre, blockquote, table) {
  margin: 0.55rem 0;
}

.msg .body.md :is(h1, h2, h3, h4),
.md :is(h1, h2, h3, h4),
.answer :is(h1, h2, h3, h4) {
  margin: 0.85rem 0 0.4rem;
  font-weight: 700;
  line-height: 1.25;
}

.msg .body.md h1,
.md h1,
.answer h1 {
  font-size: 1.25rem;
}

.msg .body.md h2,
.md h2,
.answer h2 {
  font-size: 1.12rem;
}

.msg .body.md h3,
.md h3,
.answer h3 {
  font-size: 1.02rem;
}

.msg .body.md :is(ul, ol),
.md :is(ul, ol),
.answer :is(ul, ol) {
  padding-left: 1.25rem;
}

.msg .body.md a,
.md a,
.answer a {
  color: var(--accent);
}

.msg .body.md blockquote,
.md blockquote,
.answer blockquote {
  margin-left: 0;
  padding: 0.15rem 0 0.15rem 0.85rem;
  border-left: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--muted);
}

.msg .body.md hr,
.md hr,
.answer hr {
  border: 0;
  border-top: 1px solid var(--line);
}

.msg .body.md table,
.md table,
.answer table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.msg .body.md :is(th, td),
.md :is(th, td),
.answer :is(th, td) {
  border: 1px solid var(--line);
  padding: 0.35rem 0.55rem;
  text-align: left;
}

.msg .body.md th,
.md th,
.answer th {
  background: rgba(0, 0, 0, 0.2);
}

.msg .body.md code,
.md code,
.answer code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.28);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.msg .body.md pre,
.md pre,
.answer pre {
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
}

.msg .body.md pre code,
.md pre code,
.answer pre code,
.code-block pre code {
  background: none;
  padding: 0;
  font-size: 0.86rem;
  line-height: 1.45;
}

.code-block {
  margin: 0.7rem 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #0b1220;
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--line);
}

.code-lang {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.copy-btn {
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
}

.copy-btn.copied {
  border-color: color-mix(in srgb, var(--ok) 55%, transparent);
  color: var(--ok);
}

.code-block pre {
  margin: 0 !important;
  padding: 0.75rem 0.85rem;
  overflow-x: auto;
}

.msg.assistant.streaming:not(.is-thinking) .body.md::after,
.msg.assistant.streaming:not(.is-thinking) .body:not(.md)::after,
.answer.streaming::after {
  content: "";
  display: inline-block;
  width: 0.55ch;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 0.9s step-end infinite;
}

.thinking {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.15rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.thinking-orb {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    color-mix(in srgb, var(--accent) 35%, white),
    var(--accent) 45%,
    var(--accent-dim)
  );
  animation: think-pulse 1.2s ease-in-out infinite;
}

.thinking-dots {
  display: inline-flex;
  gap: 0.22rem;
}

.thinking-dots i {
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  animation: think-dot 1.1s ease-in-out infinite;
}

.thinking-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.thinking-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes think-pulse {
  0%,
  100% {
    transform: scale(0.92);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes think-dot {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

#composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  max-width: 52rem;
  margin: 0 auto;
}

#input {
  resize: none;
  min-height: 3.2rem;
  max-height: 10rem;
}

#send {
  align-self: end;
  border-radius: var(--radius);
}

.tab-panel[hidden] {
  display: none;
}

.orb-block,
.mic-block {
  margin: 2.2rem 0 1.6rem;
  text-align: center;
}

.mic-block {
  display: grid;
  justify-items: center;
  gap: 1rem;
}

.orb {
  width: min(220px, 56vw);
  height: min(220px, 56vw);
  margin: 0 auto 1.2rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 42%, white) 0%, transparent 42%),
    radial-gradient(circle at 70% 70%, var(--listen) 0%, transparent 50%),
    linear-gradient(145deg, var(--accent-dim), #16324a);
  transition: transform 0.35s ease, box-shadow 0.35s ease, filter 0.35s ease;
}

.orb.idle {
  animation: breathe 4.5s ease-in-out infinite;
}

.orb.calling,
.orb.speaking {
  animation: pulse-speak 1.6s ease-in-out infinite;
  box-shadow: 0 0 0 18px color-mix(in srgb, var(--accent) 16%, transparent);
}

.orb.listening,
.orb.ok {
  animation: pulse-listen 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 14px color-mix(in srgb, var(--listen) 18%, transparent);
}

.orb.thinking {
  animation: pulse-think 1.1s ease-in-out infinite;
}

.orb.err {
  filter: saturate(0.7);
}

.orb-block .phase {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.orb-block .hint {
  margin: 0.45rem 0 1.2rem;
  font-size: 0.95rem;
}

html[data-app="dictate"] .phase {
  margin: 0;
  min-height: 1.4em;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

#rec {
  position: relative;
}

html[data-app="dictate"] #rec {
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  color: var(--ink);
  background: linear-gradient(145deg, #245244, #16362c);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-app="dictate"] #rec:hover {
  transform: translateY(-2px);
}

html[data-app="dictate"] #rec:active,
html[data-app="dictate"] #rec[aria-pressed="true"] {
  transform: scale(0.97);
  background: linear-gradient(145deg, #2f6b57, #1a4336);
}

html[data-app="dictate"] #rec[aria-pressed="true"] .rec-ring {
  opacity: 1;
  animation: ring 1.1s ease-out infinite;
}

.rec-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 65%, transparent);
  opacity: 0;
  pointer-events: none;
}

.rec-label {
  position: relative;
  z-index: 1;
  display: block;
  width: 6.5rem;
  margin: 0 auto;
  font-size: 0.95rem;
  line-height: 1.25;
}

@keyframes ring {
  from {
    transform: scale(0.92);
    opacity: 0.9;
  }
  to {
    transform: scale(1.18);
    opacity: 0;
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.035);
  }
}

@keyframes pulse-speak {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes pulse-listen {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.07);
  }
}

@keyframes pulse-think {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.04) rotate(2deg);
  }
}

html[data-app="julya"] .compose,
html[data-app="lora"] .compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  align-items: end;
  margin: 0 0 1.5rem;
}

html[data-app="todos"] .compose {
  display: flex;
  gap: 0.55rem;
  margin: 0 0 1.25rem;
}

html[data-app="todos"] .compose input {
  flex: 1;
  min-width: 0;
}

html[data-app="todos"] .compose.compose-due input[type="date"],
html[data-app="todos"] .due-edit {
  flex: 0 0 auto;
  width: 10.5rem;
  min-width: 9rem;
}

html[data-app="todos"] .todo-main {
  display: grid;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

html[data-app="todos"] .todo-due {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}

html[data-app="todos"] .todo-due:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

html[data-app="todos"] .logout {
  margin: 0.55rem 0 0;
}

html[data-app="todos"] .logout button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

#web-text:disabled {
  opacity: 0.55;
}

.log {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.4rem;
  max-height: min(55vh, 520px);
  overflow-y: auto;
}

.bubble,
.todo {
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.22);
  animation: view-enter 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bubble {
  line-height: 1.45;
}

.bubble.you {
  color: var(--muted);
}

.todos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.todo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.todo.done .title {
  color: var(--muted);
  text-decoration: line-through;
}

.title {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  cursor: text;
  filter: none;
  transform: none;
}

.title:hover {
  transform: none;
  filter: none;
}

.title-edit {
  flex: 1;
  min-width: 0;
}

.todo-actions {
  justify-content: flex-end;
}

.todo-actions button {
  padding: 0.4rem 0.75rem;
  font-size: 0.88rem;
}

.todo-actions button.danger {
  color: var(--ink);
  background: transparent;
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}

.answer {
  min-height: 4rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
  line-height: 1.55;
  font-size: 1.05rem;
}

.answer:empty::before {
  content: "Antwort erscheint hier.";
  color: var(--muted);
}

.file-btn {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  place-items: center;
  padding: 1.25rem;
  background: rgba(5, 8, 16, 0.72);
  backdrop-filter: blur(10px);
}

html.needs-auth .gate {
  display: grid;
}

html.needs-auth .stage {
  visibility: hidden;
}

.gate-card {
  width: min(420px, 100%);
  padding: 1.4rem 1.3rem 1.2rem;
  border-radius: 1.25rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg1) 88%, black);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.gate-card .brand {
  font-size: 2.2rem;
}

.gate-card .lede {
  margin: 0.45rem 0 1rem;
}

.gate-card button {
  width: 100%;
  margin-top: 0.85rem;
}

@media (max-width: 720px) {
  html[data-layout="shell"] header,
  html[data-layout="shell"] footer,
  main,
  #chat {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .stage {
    width: min(720px, calc(100% - 1.15rem));
    padding-top: 1.35rem;
  }

  #composer,
  html[data-app="julya"] .compose,
  html[data-app="lora"] .compose,
  html[data-app="todos"] .compose {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  #send,
  .compose > button,
  .actions,
  .actions button,
  .todo-actions {
    width: 100%;
  }

  .actions,
  .todo-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tabs {
    width: 100%;
  }

  .tabs button,
  .tab {
    flex: 1 1 auto;
  }

  .row .field.tight {
    width: auto;
    flex: 1 1 7.5rem;
  }

  .todo {
    flex-direction: column;
  }

  html[data-app="dictate"] #rec {
    width: 8.25rem;
    height: 8.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
