:root {
  color-scheme: light;
  font: 100%/1.5 "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color: #173126;
  background: #f4f5eb;
  --forest: #174a35;
  --forest-2: #276449;
  --leaf: #8ca868;
  --lime: #dce8b6;
  --copper: #8b6129;
  --muted: #52675b;
  --line: #d4decf;
  --line-strong: #a9bcaa;
  --ivory: #f8f8ef;
  --card: #fffef8;
  --danger: #9a302b;
  --shadow: 0 18px 52px #17312612;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: clip; }
body { margin: 0; min-width: 0; min-height: 100svh; overflow-x: clip; background: var(--ivory); }
button, input, textarea { font: inherit; color: inherit; }
button {
  min-height: 42px;
  padding: .5rem .8rem;
  border: 1px solid var(--line-strong);
  border-radius: .72rem;
  background: #fbfff7;
  cursor: pointer;
  font-weight: 700;
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
button:hover:not(:disabled) { background: #eef5e8; border-color: #879f88; transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(0); }
button:disabled { opacity: .52; cursor: default; }
:focus-visible { outline: 3px solid #789958; outline-offset: 3px; }
.primary { color: white; border-color: var(--forest); background: var(--forest); box-shadow: 0 8px 20px #174a3522; }
.primary:hover:not(:disabled) { color: white; background: var(--forest-2); border-color: var(--forest-2); box-shadow: 0 10px 25px #174a3533; }
input, textarea {
  min-height: 44px;
  padding: .62rem .72rem;
  border: 1px solid var(--line-strong);
  border-radius: .7rem;
  background: #fff;
}
input:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: #829a84; }
input:focus, textarea:focus { border-color: #618364; box-shadow: 0 0 0 3px #9fbd7630; outline: 0; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .3rem; font-size: clamp(1.55rem, 3vw, 2.15rem); line-height: 1.12; letter-spacing: -.045em; overflow-wrap: anywhere; }
h2 { margin-bottom: .25rem; font-size: 1.27rem; line-height: 1.2; letter-spacing: -.035em; }
h3 { margin-bottom: 0; font-size: .98rem; }
.muted, .privacy { color: var(--muted); }
.muted { margin-bottom: 0; }
.privacy { max-width: 48rem; margin: 1rem auto 0; font-size: .78rem; text-align: center; }
.notice { margin: 0; color: var(--muted); font-size: .88rem; }
.notice:empty { display: none; }
.error { color: var(--danger); }
.success { color: var(--forest-2); }
.danger { color: white; border-color: #8b2b27; background: #9a302b; }
.danger:hover:not(:disabled) { color: white; border-color: #76231f; background: #842824; }
.boot { padding: 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.eyebrow { margin: 0 0 .5rem; color: var(--copper); font-size: .72rem; font-weight: 850; letter-spacing: .16em; }
.pending { margin-top: .75rem; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: .7rem; background: #f0f4e8; }

.login-view {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background:
    radial-gradient(circle at 18% 12%, #dce8b7 0, transparent 33rem),
    radial-gradient(circle at 88% 86%, #d4e6d5 0, transparent 30rem),
    #f6f6ed;
}
.login-shell {
  display: grid;
  grid-template-columns: minmax(20rem, .93fr) minmax(22rem, 1.07fr);
  width: min(100%, 60rem);
  min-height: 34rem;
  overflow: hidden;
  border: 1px solid #bdcdb8;
  border-radius: 1.5rem;
  background: var(--card);
  box-shadow: 0 28px 85px #14332626;
}
.login-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: clamp(1.6rem, 4vw, 2.8rem);
  overflow: hidden;
  color: #f8faed;
  background:
    radial-gradient(circle at 62% 38%, #5a805c 0, transparent 18rem),
    linear-gradient(145deg, #0d3d2d, #1b5039 60%, #254b36);
}
.login-brand-panel::after { content: ""; position: absolute; right: -6rem; bottom: -8rem; width: 18rem; height: 18rem; border: 1px solid #dce8b63b; border-radius: 50%; }
.login-brand-panel h1 { max-width: 17ch; font-size: clamp(2rem, 4vw, 3.25rem); }
.login-brand-panel p:last-child { max-width: 34rem; margin-bottom: 0; color: #e6ecdc; }
.login-brand-panel .eyebrow { color: #dae8ad; }
.login-mascot-halo { align-self: center; width: min(76%, 16.5rem); filter: drop-shadow(0 24px 35px #061b1355); animation: mascot-float 5.5s ease-in-out infinite; }
.login-mascot-halo img { display: block; width: 100%; height: auto; object-fit: contain; }
.wordmark { color: var(--forest); font-weight: 900; letter-spacing: .13em; white-space: nowrap; }
.wordmark span, .wordmark strong { color: var(--copper); font-weight: inherit; }
.wordmark-light { position: relative; z-index: 1; color: white; }
.wordmark-light span { color: #dce8b6; }
.login-card { align-self: center; min-width: 0; padding: clamp(1.8rem, 5vw, 4rem); background: var(--card); }
.login-card h2 { margin-bottom: .4rem; font-size: clamp(1.6rem, 3vw, 2.15rem); }
.home-link { display: inline-block; margin-bottom: 2.4rem; color: var(--muted); font-size: .82rem; font-weight: 750; }
.home-link:hover { color: var(--forest); }
.login-mobile-brand { display: none; }
.login-card form, .add-tester { display: grid; gap: .8rem; margin: 1.55rem 0 .85rem; }
.field { display: grid; gap: .3rem; }
.field label, .add-tester label { font-size: .85rem; font-weight: 750; }
.login-submit { margin-top: .25rem; }
.login-security { margin: 1rem 0 0; color: var(--muted); font-size: .75rem; text-align: center; }

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  min-height: 62px;
  padding: .48rem max(1rem, calc((100vw - 82rem) / 2));
  border-bottom: 1px solid var(--line);
  background: #fffef8e8;
  backdrop-filter: blur(16px);
}
.app-brand { display: flex; align-items: center; gap: .55rem; min-width: 0; color: inherit; text-decoration: none; }
.app-brand img { display: block; width: 32px; height: 36px; object-fit: contain; filter: drop-shadow(0 4px 8px #17312620); }
.app-brand > span { display: grid; line-height: 1.08; }
.app-brand .wordmark { font-size: .82rem; }
.app-brand small { color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .06em; }
.header-actions, .account { display: flex; align-items: center; justify-content: end; gap: .55rem; min-width: 0; }
.new-dialog { border-color: #739172; background: #eef5e6; color: var(--forest); }
.new-dialog > span:first-child { margin-right: .22rem; font-size: 1.1rem; }
.user-profile { display: flex; align-items: center; gap: .45rem; max-width: 14rem; padding: .26rem .5rem; border: 1px solid var(--line); border-radius: .72rem; background: #f5f6ec; }
.user-profile img { display: block; width: 25px; height: 28px; object-fit: contain; filter: drop-shadow(0 3px 7px #17312618); }
.profile-copy { display: grid; min-width: 0; line-height: 1.15; }
.profile-copy strong { overflow: hidden; font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { color: var(--muted); font-size: .66rem; }

.layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); width: min(100%, 100rem); min-height: calc(100svh - 62px); margin: 0 auto; }
.history { min-width: 0; padding: 1.2rem .85rem; border-inline-end: 1px solid var(--line); background: #f0f3e9; }
.history-heading, .section-heading, .upload-heading, .label-row { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.history-heading { align-items: center; padding: 0 .25rem; }
.history-heading h2 { color: #405a4c; font-size: .92rem; letter-spacing: -.015em; }
.history nav { display: grid; gap: .3rem; margin-top: .75rem; }
.history-item { display: grid; grid-template-columns: minmax(0, 1fr) 2.35rem; align-items: stretch; min-width: 0; border: 1px solid transparent; border-radius: .78rem; }
.history-item:hover { border-color: #c0d0b9; background: #e7eee0; }
.history-item[data-current="true"] { border-color: #9ab493; background: #dce8d5; box-shadow: inset 3px 0 #416c4d; }
.history-open { display: grid; gap: .12rem; min-width: 0; width: 100%; min-height: 0; padding: .62rem .35rem .62rem .68rem; text-align: start; border: 0; background: transparent; box-shadow: none; }
.history-open:hover:not(:disabled), .history-open:focus-visible { border-color: transparent; background: transparent; transform: none; }
.history-more { display: grid; place-items: center; align-self: center; width: 2.15rem; height: 2.15rem; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--forest); font-size: 1.1rem; letter-spacing: .06em; line-height: 1; box-shadow: none; }
.history-more:hover:not(:disabled), .history-more:focus-visible { border-color: transparent; background: #f8fbf4b8; transform: none; }
.history-item-title, .history-item-date { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item-title { font-size: .84rem; font-weight: 750; }
.history-item-date { color: var(--muted); font-size: .75rem; font-weight: 600; }
.history-rename { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .3rem; grid-column: 1 / -1; padding: .35rem; }
.history-rename input { min-width: 0; min-height: 40px; padding: .46rem .55rem; font-size: .87rem; }
.history-rename button { min-height: 40px; padding: .35rem .5rem; font-size: .78rem; }
.history-rename-error { grid-column: 1 / -1; margin: 0; padding-inline: .25rem; color: var(--danger); font-size: .78rem; }
.conversation-menu-portal { position: fixed; z-index: 50; inset: 0; pointer-events: none; }
.conversation-menu-panel { position: fixed; display: grid; gap: .2rem; width: min(10rem, calc(100vw - 1rem)); padding: .35rem; border: 1px solid var(--line); border-radius: .8rem; background: #fffefbf5; box-shadow: 0 16px 42px #10291e2b; backdrop-filter: blur(14px); pointer-events: auto; }
.conversation-menu-panel button { min-height: 38px; padding: .42rem .65rem; border: 0; border-radius: .58rem; background: transparent; text-align: start; box-shadow: none; }
.conversation-menu-panel button:hover:not(:disabled), .conversation-menu-panel button:focus-visible { background: #e9f0e3; transform: none; }
.conversation-menu-panel .menu-delete { color: var(--danger); }
#open-history, #close-history { display: none; }
.main { min-width: 0; padding: clamp(.8rem, 1.6vw, 1.35rem); background: radial-gradient(circle at 50% 0, #eef4e5 0, transparent 34rem), var(--ivory); }
.main > button, .main > .notice { margin-bottom: .75rem; }
.card { min-width: 0; padding: clamp(1rem, 2.5vw, 1.5rem); border: 1px solid var(--line); border-radius: 1.15rem; background: #fffefb; box-shadow: var(--shadow); }
.empty { display: grid; justify-items: center; max-width: 42rem; margin: clamp(2rem, 10vh, 7rem) auto 0; text-align: center; }
.empty img { width: 74px; height: auto; margin-bottom: .7rem; object-fit: contain; filter: drop-shadow(0 10px 18px #17312624); animation: mascot-float 5.5s ease-in-out infinite; }
.dialog-card { margin-bottom: 1rem; }
.section-heading { align-items: center; }
.dialog-card .section-heading > div { min-width: 0; }
.dialog-card #conversation-title {
  display: -webkit-box;
  max-width: min(42rem, 72vw);
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.voice-language { flex: 0 0 auto; padding: .26rem .58rem; border: 1px solid #b6c8ae; border-radius: 2rem; color: var(--forest); background: #edf3e5; font-size: .72rem; font-weight: 800; }

.voice { position: relative; display: grid; place-items: center; width: 12.4rem; height: 12.4rem; margin: .35rem auto 0; }
.voice-orbit { position: absolute; inset: 1.1rem; border: 1px solid #779b7455; border-radius: 50%; box-shadow: 0 0 0 .65rem #dfeacb3a, 0 0 52px #74a16d2b; }
.voice-orbit::before { content: ""; position: absolute; top: -.3rem; left: 50%; width: .58rem; height: .58rem; border-radius: 50%; background: var(--copper); box-shadow: 0 0 0 .32rem #f4e8cf; transform: translateX(-50%); animation: orbit 7s linear infinite; transform-origin: .29rem calc(6.2rem - .8rem); }
.voice-mascot { position: relative; z-index: 1; width: 7.65rem; filter: drop-shadow(0 14px 20px #183d2c2e); animation: mascot-breathe 4.2s ease-in-out infinite; }
.voice-mascot img { display: block; width: 100%; height: auto; object-fit: contain; }
.wave { position: absolute; z-index: 2; right: 1.25rem; bottom: 1.8rem; display: flex; align-items: center; gap: 2px; height: 2.2rem; padding: .35rem .5rem; border: 1px solid #acc0a3; border-radius: 2rem; background: #fffef8e8; box-shadow: 0 7px 18px #14342620; backdrop-filter: blur(6px); }
.wave i { display: block; width: 3px; height: 1.45rem; border-radius: 10px; background: var(--forest-2); transform: scaleY(var(--amplitude, .14)); transition: transform 45ms linear; }
.voice[data-state="connecting"] .voice-orbit, .voice[data-state="thinking"] .voice-orbit { animation: orbit-pulse 1.35s ease-in-out infinite; }
.voice[data-state="connecting"] .wave i, .voice[data-state="thinking"] .wave i { animation: wave-pulse .9s ease-in-out infinite alternate; }
.voice[data-state="listening"] .voice-orbit { border-color: #7e9d52; box-shadow: 0 0 0 .8rem #dbe9b94d, 0 0 58px #7ea05e4d; }
.voice[data-state="listening"] .voice-mascot { animation-duration: 2.2s; }
.voice[data-state="speaking"] .voice-mascot { animation: mascot-speak .72s ease-in-out infinite alternate; }
.voice[data-state="speaking"] .wave { border-color: #819e70; background: #f2f7e9; }
.voice[data-state="muted"] .voice-orbit { border-style: dashed; opacity: .7; }
.voice[data-state="muted"] .voice-mascot, .voice[data-state="ended"] .voice-mascot { animation: none; transform: scale(.97); opacity: .82; }
.voice[data-state="ended"] .voice-orbit { opacity: .45; }
.voice[data-state="error"] { filter: saturate(.55); }
.voice-status, .voice-detail { text-align: center; }
.voice-status { margin: -.1rem 0 .12rem; font-size: 1.05rem; font-weight: 850; }
.voice-detail { min-height: 1.35rem; max-width: 34rem; margin-inline: auto; }
.voice-actions { display: grid; grid-template-columns: repeat(2, minmax(9.5rem, 13rem)); justify-content: center; gap: .5rem; width: min(100%, 27rem); margin: .62rem auto 0; }
.voice-actions #start-voice, .voice-actions #sound { grid-column: 1 / -1; }
.voice-actions button { min-height: 44px; }
#mic[aria-pressed="true"] { border-color: #b39b68; background: #f4ead7; }
#interrupt-voice:not(:disabled) { border-color: #ad7c47; color: #70451f; background: #fbefdd; }
.end-dialog { border-color: #c3a9a0; color: #7b3d36; background: #fbf1ee; }
.text-form { display: flex; gap: .45rem; width: min(100%, 38rem); margin: .75rem auto 0; }
.text-form input { flex: 1; min-width: 0; }

.transcript-card { background: #fbfcf6; }
.upload-panel { margin: 1rem 0; padding: .85rem; border: 1px solid var(--line); border-radius: .9rem; background: #f1f4e9; }
.upload-heading { align-items: center; }
.upload-heading .muted { font-size: .78rem; }
.feature-badge { flex: 0 0 auto; padding: .2rem .48rem; border: 1px solid #c6b598; border-radius: 2rem; color: #70552d; background: #f6eddb; font-size: .68rem; font-weight: 800; }
.feature-badge.active { border-color: #8da27f; color: var(--forest); background: #e3ecd7; }
.upload-form { display: grid; grid-template-columns: auto minmax(8rem, 1fr) auto; align-items: center; gap: .55rem; margin-top: .72rem; }
.file-picker { display: inline-flex; align-items: center; min-height: 40px; padding: .48rem .7rem; border: 1px solid var(--line-strong); border-radius: .7rem; background: #fff; cursor: pointer; font-size: .82rem; font-weight: 750; }
.file-picker:hover { border-color: #829a84; background: #f8fbf4; }
.file-picker:has(input:disabled) { opacity: .55; cursor: default; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-name { min-width: 0; overflow: hidden; color: var(--muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.upload-form .pending { grid-column: 1 / -1; }
.transcript-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .9rem; }
.label-row { align-items: center; margin-bottom: .42rem; }
.label-row label { font-weight: 700; }
.label-row button { min-height: 34px; padding: .3rem .58rem; font-size: .75rem; }
.transcript-columns pre, .transcript-columns textarea { width: 100%; min-height: 13rem; height: 13rem; margin: 0; padding: .72rem; overflow: auto; border: 1px solid var(--line-strong); border-radius: .72rem; font: inherit; font-size: .9rem; }
.transcript-columns pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #eef2e8; }
.transcript-columns textarea { resize: vertical; background: #fff; }
.save-row { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin-top: .72rem; }

.workspace-conversation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 18.5rem);
  align-items: start;
  gap: 1rem;
}
.conversation-center {
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - 62px - 2.7rem);
  max-height: calc(100svh - 62px - 2.7rem);
  padding: 0;
  overflow: hidden;
}
.conversation-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.15rem .8rem;
  border-bottom: 1px solid var(--line);
  background: #fffefbf2;
}
.conversation-heading > div { min-width: 0; }
.conversation-heading .eyebrow { margin-bottom: .22rem; }
.conversation-heading h1 {
  display: -webkit-box;
  max-width: 42rem;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: clamp(1.28rem, 2vw, 1.72rem);
}
.conversation-onboarding {
  margin: .85rem 1rem 0;
  padding: .9rem 1rem;
  border: 1px solid #c8d7bd;
  border-radius: .9rem;
  background: linear-gradient(135deg, #f1f6e9, #fbfcf5);
}
.conversation-onboarding h2 { font-size: 1rem; }
.conversation-onboarding p, .conversation-onboarding li { font-size: .84rem; }
.conversation-onboarding p { margin-bottom: .45rem; }
.conversation-onboarding ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem 1.2rem; margin: .4rem 0; padding-left: 1.15rem; }
.conversation-onboarding .onboarding-limit { margin: .55rem 0 0; color: var(--muted); font-size: .76rem; }
.message-timeline {
  flex: 1 1 auto;
  min-height: 8rem;
  padding: 1rem;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}
.timeline-empty { display: grid; place-items: center; min-height: 100%; color: var(--muted); text-align: center; }
.message-row { display: flex; align-items: flex-start; gap: .55rem; margin: 0 0 .8rem; }
.message-row[data-source="user"] { flex-direction: row-reverse; }
.message-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid #b9cab2;
  border-radius: 50%;
  color: var(--forest);
  background: #eef4e7;
  font-size: .66rem;
  font-weight: 900;
}
.message-row[data-source="user"] .message-avatar { color: #fff; border-color: var(--forest); background: var(--forest); }
.message-bubble { max-width: min(42rem, 82%); }
.message-meta { display: flex; gap: .45rem; margin: 0 .2rem .18rem; color: var(--muted); font-size: .68rem; font-weight: 750; }
.message-row[data-source="user"] .message-meta { justify-content: flex-end; }
.message-text {
  margin: 0;
  padding: .72rem .85rem;
  border: 1px solid #d2ddca;
  border-radius: .35rem .95rem .95rem .95rem;
  background: #f2f6ec;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message-row[data-source="user"] .message-text { color: #fff; border-color: #22563f; border-radius: .95rem .35rem .95rem .95rem; background: #245b42; }
.message-row[data-source="file"] .message-text { background: #f5eee2; }
.message-row[data-progress="true"] .message-text::after { content: ""; display: inline-block; width: .42rem; height: 1em; margin-left: .2rem; vertical-align: -.12em; border-radius: .15rem; background: currentColor; opacity: .55; animation: cursor-blink .85s ease-in-out infinite; }
.text-form {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: .75rem 1rem;
  border-top: 1px solid var(--line);
  background: #fffefbf2;
}
.text-form input { min-height: 48px; }
.text-form button { min-width: 6.2rem; }
.conversation-center > .pending { margin: 0 1rem .75rem; }
.transcript-tools { flex: 0 0 auto; border-top: 1px solid var(--line); background: #f7f9f1; }
.transcript-tools summary { padding: .72rem 1rem; cursor: pointer; color: var(--forest); }
.transcript-tools summary span { display: inline-grid; margin-left: .3rem; }
.transcript-tools summary small { color: var(--muted); font-weight: 500; }
.transcript-tools-body { max-height: min(52svh, 34rem); padding: .2rem 1rem 1rem; overflow: auto; }
.transcript-tools .upload-panel { margin-top: .5rem; }

.assistant-panel {
  position: sticky;
  top: 78px;
  min-width: 0;
  padding: 1rem;
  overflow: hidden;
}
.assistant-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .55rem; }
.assistant-heading .eyebrow { margin-bottom: .18rem; }
.assistant-heading h2 { font-size: 1.05rem; }
.assistant-online { padding: .18rem .45rem; border: 1px solid #a9c09d; border-radius: 2rem; color: var(--forest); background: #edf4e5; font-size: .66rem; font-weight: 850; }
.assistant-panel .voice { width: 10.5rem; height: 10.5rem; margin-top: .15rem; }
.assistant-panel .voice-mascot { width: 6.45rem; }
.assistant-panel .voice-orbit::before { transform-origin: .29rem calc(5.25rem - .8rem); }
.assistant-panel .wave { right: .45rem; bottom: 1.2rem; }
.assistant-panel .voice-detail { min-height: 2.6rem; font-size: .78rem; }
.assistant-panel .voice-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.assistant-panel .voice-actions button { min-width: 0; padding: .46rem .5rem; font-size: .78rem; }
.assistant-panel .privacy { margin-top: .7rem; font-size: .68rem; }

@keyframes cursor-blink { 50% { opacity: .08; } }

dialog { width: min(30rem, calc(100% - 1.25rem)); max-height: calc(100% - 1.25rem); padding: 1rem; color: inherit; border: 1px solid var(--line); border-radius: 1.15rem; background: var(--card); }
dialog::backdrop, .scrim { background: #10291ea3; }
.delete-dialog { width: min(28rem, calc(100% - 1.25rem)); padding: 0; }
.delete-dialog-card { padding: clamp(1.15rem, 5vw, 1.65rem); }
.delete-dialog-card h2 { margin-bottom: .55rem; }
.delete-dialog-card > p:not(.eyebrow) { color: var(--muted); }
.delete-dialog-actions { display: flex; justify-content: flex-end; gap: .55rem; margin-top: 1.25rem; }
.account-row { display: flex; justify-content: space-between; align-items: center; gap: .45rem; padding: .55rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }

@keyframes mascot-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes mascot-breathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-4px) scale(1.012); } }
@keyframes mascot-speak { from { transform: translateY(-2px) scale(1); } to { transform: translateY(-5px) scale(1.025); } }
@keyframes orbit { to { transform: translateX(-50%) rotate(360deg); } }
@keyframes orbit-pulse { 50% { transform: scale(1.045); opacity: .72; } }
@keyframes wave-pulse { from { transform: scaleY(.13); } to { transform: scaleY(.58); } }
.wave i:nth-child(3n) { animation-delay: .16s !important; }
.wave i:nth-child(3n + 1) { animation-delay: .28s !important; }

@media (max-width: 1100px) {
  .login-shell { grid-template-columns: minmax(0, 1fr); width: min(100%, 31rem); min-height: 0; }
  .login-brand-panel { display: none; }
  .login-card { padding: clamp(1.4rem, 7vw, 2.5rem); }
  .login-mobile-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.5rem; }
  .login-mobile-brand img { width: 40px; height: 50px; object-fit: contain; }
  .home-link { margin-bottom: 1.4rem; }
  .layout { display: block; }
  #open-history, #close-history { display: inline-block; }
  .history { position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(19rem, 86vw); overflow: auto; visibility: hidden; transform: translateX(-100%); transition: transform .2s ease, visibility .2s ease; box-shadow: 18px 0 48px #0f2c2050; }
  .history.open { visibility: visible; transform: translateX(0); }
  .scrim { position: fixed; z-index: 20; inset: 0; width: 100%; border: 0; border-radius: 0; }
  .scrim:hover:not(:disabled) { background: #10291ea3; transform: none; }
  .transcript-columns { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .workspace-conversation { display: block; }
  .conversation-center { min-height: calc(100svh - 62px - 1.7rem); max-height: none; padding-bottom: 10.8rem; }
  .message-timeline { min-height: 18rem; max-height: 58svh; }
  .assistant-panel {
    position: fixed;
    z-index: 15;
    inset: auto .55rem .55rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .25rem .65rem;
    padding: .65rem;
    border-radius: 1rem;
    box-shadow: 0 16px 46px #0d2b2052;
  }
  .assistant-heading { grid-column: 2; align-self: end; }
  .assistant-heading .eyebrow, .assistant-heading .assistant-online, .assistant-panel .privacy { display: none; }
  .assistant-heading h2 { margin: 0; font-size: .85rem; }
  .assistant-panel .voice { grid-row: 1 / span 2; width: 4.5rem; height: 4.5rem; margin: 0; }
  .assistant-panel .voice-orbit { inset: .3rem; }
  .assistant-panel .voice-orbit::before, .assistant-panel .wave { display: none; }
  .assistant-panel .voice-mascot { width: 3.15rem; }
  .assistant-panel .voice-status { grid-column: 2; align-self: start; margin: 0; font-size: .76rem; text-align: left; }
  .assistant-panel .voice-detail { display: none; }
  .assistant-panel .voice-actions { grid-column: 1 / -1; display: flex; width: 100%; margin: .25rem 0 0; overflow-x: auto; }
  .assistant-panel .voice-actions button { flex: 1 0 auto; min-height: 38px; }
  .assistant-panel .voice-actions #start-voice, .assistant-panel .voice-actions #sound { grid-column: auto; }
}

@media (max-width: 590px) {
  .topbar { gap: .45rem; padding-inline: .65rem; }
  .app-brand small, .user-profile img { display: none; }
  .header-actions { gap: .35rem; }
  .new-dialog span:last-child, #logout { font-size: 0; }
  .new-dialog span:first-child { margin: 0; font-size: 1.25rem; }
  #logout::after { content: "Odhlásit"; font-size: .72rem; }
  .user-profile { max-width: 8.4rem; padding: .34rem .45rem; }
  #admin { padding-inline: .55rem; font-size: .72rem; }
  .main { padding: .85rem .7rem 1.4rem; }
  .section-heading { align-items: flex-start; }
  .conversation-heading { padding: .85rem; }
  .conversation-heading #conversation-title { max-width: 68vw; font-size: 1.3rem; }
  .voice-language { padding: .2rem .42rem; font-size: .66rem; }
  .conversation-onboarding { margin: .65rem .7rem 0; padding: .75rem; }
  .conversation-onboarding ul { grid-template-columns: minmax(0, 1fr); }
  .message-timeline { padding: .75rem .7rem; }
  .message-bubble { max-width: 88%; font-size: .9rem; }
  .text-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: .65rem .7rem; }
  .text-form button { min-width: 0; padding-inline: .65rem; }
  .upload-heading { align-items: flex-start; }
  .upload-form { grid-template-columns: minmax(0, 1fr) auto; }
  .file-picker { justify-content: center; }
  .file-name { grid-column: 1 / -1; grid-row: 2; }
  .save-row .notice { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .voice-mascot, .voice-orbit, .voice-orbit::before, .login-mascot-halo, .empty img, .wave i { animation: none !important; }
}
