:root {
  --navy: #183153;
  --blue: #2667ff;
  --green: #1bb98c;
  --paper: #ffffff;
  --bg: #f3f6fb;
  --text: #172033;
  --muted: #667085;
  --line: #dfe5ef;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); min-height: 100vh; }
.hidden { display: none !important; }
.center-card { width: min(430px, calc(100% - 32px)); margin: 8vh auto; background: var(--paper); border-radius: 24px; padding: 36px; box-shadow: 0 20px 70px #1831531f; text-align: center; }
.logo { width: 72px; height: 72px; margin: auto; border-radius: 22px; display: grid; place-items: center; background: var(--navy); color: white; font-size: 24px; font-weight: 800; }
h1 { margin: 20px 0 8px; }
label { display: grid; gap: 7px; text-align: left; font-size: 14px; color: var(--muted); margin: 14px 0; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); background: white; font: inherit; }
input:focus, textarea:focus { outline: 3px solid #2667ff22; border-color: var(--blue); }
button, .link-button, .file-button { border: 0; border-radius: 12px; padding: 11px 18px; cursor: pointer; font: inherit; font-weight: 650; }
.primary { background: var(--blue); color: white; }
.ghost { background: #e9eef7; color: var(--navy); }
.wide { width: 100%; margin-top: 10px; }
.error { color: #c93535; min-height: 22px; margin-top: 12px; }
header { min-height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; background: var(--paper); border-bottom: 1px solid var(--line); padding: 12px 28px; position: sticky; top: 0; z-index: 10; }
header > div { font-size: 20px; }
#userName { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
header nav { background: var(--bg); padding: 4px; border-radius: 14px; }
.nav { background: transparent; color: var(--muted); }
.nav.active { background: white; color: var(--navy); box-shadow: 0 2px 10px #18315316; }
header > .ghost { justify-self: end; }
.view { max-width: 1280px; margin: 0 auto; padding: 32px; }
.assistant-card { max-width: 720px; margin: 0 auto; background: white; border-radius: 26px; padding: 34px; text-align: center; box-shadow: 0 18px 55px #18315312; }
.hint, .status { color: var(--muted); }
.mic { width: 122px; height: 122px; border-radius: 50%; margin: 26px auto 16px; background: linear-gradient(145deg, #2e73ff, #1950db); box-shadow: 0 14px 34px #2667ff55; color: white; display: grid; place-items: center; transition: .2s; }
.mic span { font-size: 48px; }
.mic.recording { background: #d83c4b; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 18px #d83c4b22; } }
#messageText { margin-top: 24px; resize: vertical; text-align: left; }
.actions { display: flex; gap: 12px; justify-content: center; margin-top: 14px; }
.file-button { background: #e9eef7; color: var(--navy); }
.answer-card { max-width: 900px; margin: 22px auto 0; background: white; border-radius: 20px; padding: 26px; box-shadow: 0 12px 40px #18315310; }
.answer-title { color: var(--green); font-weight: 800; margin-bottom: 12px; }
#answerText { white-space: pre-wrap; line-height: 1.55; }
.record-cards { display: grid; gap: 10px; margin-top: 18px; }
.mini-record { border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; }
.mini-record strong { color: var(--navy); }
.toolbar { display: grid; grid-template-columns: minmax(230px, 1fr) auto auto auto; align-items: center; gap: 12px; margin-bottom: 18px; }
.toolbar label { display: flex; align-items: center; white-space: nowrap; margin: 0; }
.toolbar label input { width: auto; }
.link-button { text-decoration: none; text-align: center; }
.table-wrap { overflow: auto; background: white; border: 1px solid var(--line); border-radius: 18px; }
table { border-collapse: collapse; min-width: 1250px; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 12px; text-align: left; vertical-align: top; font-size: 13px; }
th { position: sticky; top: 0; color: white; background: var(--navy); white-space: nowrap; }
td.original { max-width: 330px; white-space: pre-wrap; }
tr.deleted { opacity: .55; background: #fff2f2; }
.row-actions { display: flex; gap: 6px; }
.small { padding: 7px 9px; font-size: 12px; }
dialog { border: 0; border-radius: 20px; width: min(760px, calc(100% - 30px)); box-shadow: 0 30px 100px #0005; }
dialog::backdrop { background: #10213b99; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid label:first-child, .form-grid label:nth-last-child(-n+2) { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@media (max-width: 760px) {
  header { grid-template-columns: 1fr auto; padding: 10px 14px; }
  header nav { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; }
  .view { padding: 16px; }
  .assistant-card { padding: 22px 16px; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar > input { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label { grid-column: 1 !important; }
}

