:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #17202a;
  --muted: #647184;
  --border: #d9dee7;
  --accent: #246bfe;
  --accent-dark: #164fc4;
  --danger: #b42318;
  --ok: #087443;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { font-weight: 800; font-size: 20px; }
.topbar-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar nav { display: flex; gap: 18px; color: var(--muted); font-size: 14px; }
.topbar nav a:hover { color: var(--text); }
.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 5px 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fbfcfe;
}
.account-pill span {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.account-pill form { margin: 0; }
.account-pill button {
  min-height: 28px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef1f6;
  border-color: transparent;
  color: var(--muted);
  font-size: 12px;
}
.language-switcher {
  position: relative;
}
.language-trigger {
  gap: 7px;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #eef3ff;
  border-color: #d8e4ff;
  color: var(--accent-dark);
}
.language-trigger svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.language-trigger span {
  font-size: 12px;
  font-weight: 900;
}
.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  min-width: 150px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 20;
}
.language-switcher.open .language-menu,
.language-switcher:focus-within .language-menu {
  display: grid;
  gap: 4px;
}
.language-menu button {
  justify-content: flex-start;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  min-height: 36px;
}
.language-menu button.active {
  background: #eef3ff;
  color: var(--accent-dark);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 56px;
}

.hero {
  background: linear-gradient(135deg, #ffffff 0%, #eef3ff 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 34px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}

h1, h2, h3 { margin: 0 0 12px; line-height: 1.15; }
h1 { font-size: 34px; }
h2 { font-size: 22px; }
h3 { font-size: 16px; margin-top: 20px; }
p { color: var(--muted); line-height: 1.6; }

.panel, .conversation-card, .tab-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.form-grid { display: grid; gap: 18px; max-width: 760px; }
label, legend { font-weight: 700; display: grid; gap: 8px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 13px;
  font: inherit;
  background: #fff;
}
textarea { resize: vertical; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.choice { font-weight: 500; grid-template-columns: auto 1fr; align-items: center; margin: 10px 0; }
.choice input { width: auto; }
.hint, small { color: var(--muted); font-size: 13px; font-weight: 400; }

button, .button, .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: 700 14px/1.2 inherit;
  padding: 10px 14px;
  min-height: 40px;
  cursor: pointer;
}
.primary, button[type="submit"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
button:hover, .button:hover { border-color: var(--accent); }
.primary:hover, button[type="submit"]:hover { background: var(--accent-dark); }

.section-head, .conversation-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
  min-width: min(620px, 100%);
}
.meta-grid span {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
}
.meta-grid b { display: block; color: var(--text); margin-bottom: 4px; }

.result-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.result-hero h1 { font-size: 30px; margin-bottom: 8px; }
.eyeline {
  color: var(--accent);
  font-weight: 800;
  margin: 0 0 8px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  gap: 28px;
  align-items: stretch;
  min-height: 430px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 245, 255, 0.94)),
    #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 38px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.home-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
}
.home-greeting {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-weight: 900;
}
.home-copy h1 {
  font-size: clamp(40px, 6vw, 68px);
  letter-spacing: 0;
  line-height: 0.98;
  margin-bottom: 18px;
}
.home-copy p {
  max-width: 720px;
  font-size: 18px;
  color: #465365;
  margin: 0;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.home-actions .primary,
.home-actions .button {
  min-height: 48px;
  padding: 13px 18px;
}
.language-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #d8e4ff;
  border-radius: 8px;
  background: #f4f7ff;
  color: #465365;
}
.language-note b {
  color: var(--accent-dark);
}
.call-upload-hero,
.context-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 28px;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 34px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
.context-hero {
  grid-template-columns: 1fr;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 246, 0.94)),
    #ffffff;
}
.call-upload-copy h1,
.context-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: 0;
  line-height: 1;
}
.call-upload-copy p,
.context-hero p {
  max-width: 720px;
  font-size: 17px;
  color: #465365;
}
.call-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.call-flow span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border-radius: 999px;
  background: #eef3ff;
  color: var(--accent-dark);
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 900;
}
.call-flow span:nth-child(2) {
  background: #e8f7ef;
  color: var(--ok);
}
.call-flow span:nth-child(3) {
  background: #fff3d8;
  color: #8a5b00;
}
.call-visual {
  position: relative;
  min-height: 240px;
  display: grid;
  place-items: center;
  perspective: 900px;
}
.signal-ring {
  position: absolute;
  width: 188px;
  height: 188px;
  border-radius: 999px;
  border: 1px solid rgba(36, 107, 254, 0.22);
  animation: spinSignal 9s linear infinite;
}
.ring-two {
  width: 142px;
  height: 142px;
  border-color: rgba(8, 116, 67, 0.28);
  animation-direction: reverse;
  animation-duration: 7s;
}
.signal-core {
  position: relative;
  width: 118px;
  height: 118px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-items: end;
  padding: 22px;
  border-radius: 8px;
  background: #17202a;
  box-shadow: 0 22px 45px rgba(23, 32, 42, 0.22);
  transform: rotateX(58deg) rotateZ(-28deg);
  animation: floatSignal 4.5s ease-in-out infinite;
}
.signal-core span {
  display: block;
  border-radius: 999px;
  background: #2dd4bf;
  animation: equalize 1.2s ease-in-out infinite;
}
.signal-core span:nth-child(1) { height: 36px; }
.signal-core span:nth-child(2) { height: 58px; background: #f5b84b; animation-delay: 160ms; }
.signal-core span:nth-child(3) { height: 46px; background: #75a7ff; animation-delay: 320ms; }
.upload-workspace {
  margin-bottom: 20px;
}
.upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 18px;
}
.upload-card,
.upload-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.upload-card {
  display: grid;
  gap: 18px;
  padding: 24px;
}
.upload-side {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 22px;
}
.upload-side h2 {
  margin-bottom: 2px;
}
.upload-step {
  display: grid;
  gap: 5px;
  border-left: 3px solid #2dd4bf;
  padding: 4px 0 4px 12px;
}
.upload-step:nth-child(3) { border-left-color: #f5b84b; }
.upload-step:nth-child(4) { border-left-color: #75a7ff; }
.upload-step span {
  color: var(--muted);
  line-height: 1.5;
}
.file-drop {
  position: relative;
  place-items: center;
  min-height: 190px;
  text-align: center;
  border: 1px dashed #b8c6dc;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 26px 18px;
  cursor: pointer;
}
.file-drop:hover {
  border-color: var(--accent);
  background: #f4f7ff;
}
.file-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-drop-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 32px;
  line-height: 1;
}
.file-drop b {
  font-size: 20px;
}
.upload-submit {
  min-height: 52px;
}
.context-panel {
  max-width: 920px;
}
.voice-tools {
  display: grid;
  grid-template-columns: minmax(260px, auto) 1fr;
  gap: 10px;
  align-items: center;
}
.voice-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid #d8e4ff;
  background: #eef3ff;
  color: var(--accent-dark);
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}
.voice-button.recording {
  background: #fff0ef;
  border-color: #ffd0cc;
  color: var(--danger);
}
.voice-button.ready {
  background: #e8f7ef;
  border-color: #bde7cf;
  color: var(--ok);
}
.voice-button.disabled {
  opacity: 0.65;
}
.mic-icon {
  position: relative;
  width: 16px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 999px;
}
.mic-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 16px;
  height: 9px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
}
.mic-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 2px;
  height: 7px;
  background: currentColor;
  transform: translateX(-50%);
}
.voice-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.processing-overlay[hidden] {
  display: none;
}
.processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(246, 247, 249, 0.88);
  backdrop-filter: blur(12px);
}
.processing-card {
  width: min(460px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 34px 26px;
  box-shadow: 0 26px 70px rgba(23, 32, 42, 0.2);
}
.processing-card p {
  margin: 0;
}
.processing-orbit {
  position: relative;
  width: 170px;
  height: 170px;
  display: grid;
  place-items: center;
  perspective: 900px;
}
.orbit-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #2dd4bf;
  animation: orbitDot 2.8s linear infinite;
}
.dot-two {
  background: #f5b84b;
  animation-delay: -900ms;
}
.dot-three {
  background: #75a7ff;
  animation-delay: -1800ms;
}
.processing-cube {
  width: 82px;
  height: 82px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 16px;
  align-items: end;
  border-radius: 8px;
  background: #17202a;
  transform: rotateX(54deg) rotateZ(45deg);
  animation: floatSignal 3.2s ease-in-out infinite;
}
.processing-cube span {
  display: block;
  border-radius: 999px;
  background: #2dd4bf;
  animation: equalize 1s ease-in-out infinite;
}
.processing-cube span:nth-child(1) { height: 24px; }
.processing-cube span:nth-child(2) { height: 46px; background: #f5b84b; animation-delay: 120ms; }
.processing-cube span:nth-child(3) { height: 34px; background: #75a7ff; animation-delay: 240ms; }
.processing-pulse {
  display: flex;
  gap: 7px;
}
.processing-pulse span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  animation: pulseDot 1s ease-in-out infinite;
}
.processing-pulse span:nth-child(2) { animation-delay: 140ms; }
.processing-pulse span:nth-child(3) { animation-delay: 280ms; }
.is-processing {
  overflow: hidden;
}
@keyframes spinSignal {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(360deg) scale(1.02); }
}
@keyframes floatSignal {
  0%, 100% { transform: rotateX(58deg) rotateZ(-28deg) translateY(0); }
  50% { transform: rotateX(58deg) rotateZ(-28deg) translateY(-10px); }
}
@keyframes equalize {
  0%, 100% { transform: scaleY(0.72); opacity: 0.78; }
  50% { transform: scaleY(1.08); opacity: 1; }
}
@keyframes orbitDot {
  from { transform: rotate(0deg) translateX(72px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(72px) rotate(-360deg); }
}
@keyframes pulseDot {
  0%, 100% { transform: translateY(0); opacity: 0.45; }
  50% { transform: translateY(-5px); opacity: 1; }
}
.home-preview {
  align-self: center;
  display: grid;
  gap: 14px;
  background: #17202a;
  color: #ffffff;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 22px 45px rgba(23, 32, 42, 0.18);
}
.preview-top {
  display: flex;
  gap: 7px;
}
.preview-top span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #d7dde7;
  opacity: 0.82;
}
.preview-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 6px;
}
.preview-line,
.preview-row span {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}
.preview-line.strong {
  width: 78%;
  height: 18px;
  background: #ffffff;
}
.preview-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
}
.preview-row b {
  display: block;
  height: 30px;
  border-radius: 6px;
  background: #2dd4bf;
}
.preview-row span { width: 100%; }
.preview-row.accent b { background: #f5b84b; }
.preview-row.accent span { width: 70%; }
.preview-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.preview-footer span {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 9px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #e6edf7;
}
.today-panel {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 10px 2px 8px;
  margin-bottom: 10px;
}
.today-panel h2 { margin: 0; font-size: 26px; }
.today-panel p {
  max-width: 620px;
  margin: 0;
  text-align: right;
}
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.scenario-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 13px;
  min-height: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.scenario-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 16px 36px rgba(17, 24, 39, 0.12);
}
.scenario-card b {
  font-size: 21px;
  line-height: 1.2;
}
.scenario-card > span:last-child {
  color: var(--muted);
  line-height: 1.55;
}
.scenario-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 900;
  font-size: 13px;
  color: #17202a;
}
.call-mark { background: #cfe0ff; color: #164fc4; }
.thoughts-mark { background: #d7f4ed; color: #087443; }
.meeting-mark { background: #ffe8b8; color: #8a5b00; }
.active-card {
  border-color: rgba(36, 107, 254, 0.5);
}
.active-card::after {
  content: "Готово";
  position: absolute;
  top: 18px;
  right: 18px;
  border-radius: 999px;
  background: #e8f7ef;
  color: var(--ok);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}
.muted-card {
  background: #fbfcfe;
  color: #334155;
}
.muted-card::after {
  content: "Скоро";
  position: absolute;
  top: 18px;
  right: 18px;
  border-radius: 999px;
  background: #eef1f6;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}
.result-status {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 220px;
}
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.quick-actions button,
.quick-actions .button {
  min-height: 52px;
}
.decision-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 18px;
  margin-bottom: 18px;
}
.main-result pre,
.output-grid pre {
  max-height: 380px;
  overflow: auto;
}
.clean-list {
  display: grid;
  gap: 8px;
  padding-left: 20px;
  margin-bottom: 18px;
}
.next-list {
  display: grid;
  gap: 10px;
}
.next-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}
.next-item span {
  color: var(--muted);
  font-size: 13px;
}
.output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}
.advanced-details {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.advanced-details > summary {
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 800;
}
.advanced-details[open] > summary {
  border-bottom: 1px solid var(--border);
}
.advanced-details > section,
.advanced-details > .technical-grid {
  margin: 18px;
}
.compact-actions button,
.compact-actions .button {
  background: #eef1f6;
  color: var(--text);
  border-color: transparent;
}
.technical-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 12px;
}
.tabs button {
  background: #eef1f6;
  color: var(--text);
  border-color: transparent;
}
.tabs button.active { background: var(--text); color: #fff; }
.tab-panel { display: none; margin-top: 0; }
.tab-panel.active { display: block; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-head h2 { margin: 0; }

pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  line-height: 1.55;
  overflow-x: auto;
}

.list { display: grid; gap: 10px; }
.row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.row:hover { border-color: var(--accent); }
.row span:first-child { display: grid; gap: 4px; }

.status {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef1f6;
  font-size: 13px;
  color: var(--muted);
}
.status.completed, .status.archived { background: #e8f7ef; color: var(--ok); }
.status.failed { background: #fff0ef; color: var(--danger); }

.search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px auto;
  gap: 10px;
  margin-bottom: 18px;
}

.ask-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; }
.alert {
  background: #fff0ef;
  border: 1px solid #ffd0cc;
  color: var(--danger);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 16px 0;
}
.empty { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { border: 1px solid var(--border); padding: 10px; text-align: left; vertical-align: top; }
th { background: #f8fafc; }
.custom-response { margin-top: 16px; }
.speaker-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1.2fr);
  gap: 16px;
  margin-bottom: 18px;
}
.speaker-grid article {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfe;
}
.speaker-card {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.speaker-card:last-child { border-bottom: 0; }
.speaker-card span { color: var(--muted); }
.term-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 18px;
}
.term-list span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fbfcfe;
  padding: 8px 11px;
  color: var(--muted);
}
.term-list b { color: var(--text); }

.archive-categories {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.archive-category {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.archive-category.active {
  border-color: var(--accent);
  color: var(--accent);
}
.archive-category span {
  min-width: 32px;
  text-align: center;
  border-radius: 999px;
  background: #eef1f6;
  padding: 5px 9px;
  color: var(--text);
  font-weight: 800;
}
.archive-list {
  display: grid;
  gap: 12px;
}
.archive-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.archive-card:hover { border-color: var(--accent); }
.archive-card h2 { margin: 6px 0 8px; }
.archive-type {
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
}
.archive-meta {
  display: grid;
  gap: 8px;
  justify-items: end;
  min-width: 160px;
}
.empty-archive {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 42px 24px;
  box-shadow: var(--shadow);
}

.welcome {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.welcome p:last-child {
  max-width: 760px;
  margin-bottom: 0;
}
.login-shell {
  min-height: calc(100vh - 170px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 24px;
  align-items: center;
}
.login-copy {
  display: grid;
  gap: 10px;
  max-width: 680px;
}
.login-copy h1 {
  font-size: clamp(40px, 6vw, 68px);
  line-height: 0.98;
  margin: 0;
}
.login-copy p:last-child {
  max-width: 620px;
  font-size: 18px;
  margin: 0;
}
.login-card {
  display: grid;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.login-card button {
  min-height: 50px;
}
.credential-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: start;
  background: #e8f7ef;
  border: 1px solid #bde7cf;
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 18px;
}
.credential-card p { margin-bottom: 0; }
.credential-card pre {
  margin: 0;
  background: #ffffff;
}
.admin-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.user-create-form {
  display: grid;
  gap: 16px;
}
.users-list {
  display: grid;
  gap: 10px;
}
.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 13px;
}
.user-row div {
  display: grid;
  gap: 4px;
}
.user-row span {
  color: var(--muted);
  font-size: 13px;
}
.role-badge {
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  background: #eef1f6;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.role-badge.admin { background: #eef3ff; color: var(--accent-dark); }

@media (max-width: 760px) {
  .topbar, .section-head, .conversation-card, .welcome { flex-direction: column; }
  .topbar { align-items: flex-start; padding: 16px; }
  .topbar-tools {
    width: 100%;
    justify-content: space-between;
  }
  .language-menu {
    right: 0;
  }
  .meta-grid, .search, .ask-form, .row, .speaker-grid, .quick-actions, .decision-layout, .output-grid, .technical-grid, .archive-categories, .home-hero, .scenario-grid, .call-upload-hero, .upload-form, .voice-tools, .login-shell, .admin-layout, .credential-card, .user-row { grid-template-columns: 1fr; }
  .page { width: min(100% - 24px, 1180px); margin-top: 18px; }
  .call-upload-hero, .context-hero { padding: 22px; }
  .call-visual { min-height: 190px; }
  .upload-card, .upload-side { padding: 18px; }
  .voice-button { width: 100%; }
  .voice-status { text-align: center; }
  .home-hero { min-height: auto; padding: 22px; }
  .home-copy h1 { font-size: 42px; }
  .home-copy p { font-size: 16px; }
  .home-actions .primary,
  .home-actions .button { width: 100%; }
  .home-preview { align-self: stretch; }
  .account-pill { width: 100%; justify-content: space-between; }
  .account-pill span { max-width: 210px; }
  .login-shell { align-items: stretch; min-height: auto; }
  .login-copy h1 { font-size: 42px; }
  .today-panel { align-items: flex-start; flex-direction: column; gap: 8px; }
  .today-panel p { text-align: left; }
  .scenario-card { min-height: 185px; }
  .result-hero { flex-direction: column; }
  .result-status { justify-items: start; }
  .archive-card { flex-direction: column; }
  .archive-meta { justify-items: start; }
  h1 { font-size: 28px; }
  .hero, .panel, .conversation-card, .tab-panel { padding: 18px; }
}
