/* Dictate — one loud object (the record button), everything else quiet.
   Interface in Alegreya Sans, transcripts in Alegreya so the output reads like writing. */
:root {
  color-scheme: light;
  --ground: #f3f6f9;      /* snjór */
  --sheet: #ffffff;
  --ink: #14202b;         /* blek */
  --fog: #63748a;         /* þoka: muted text */
  --rule: #d6dee7;
  --blue: #0a4f9e;        /* fánablár */
  --blue-ink: #ffffff;
  --blue-wash: #e4edf8;
  --red: #dc1e35;         /* fánarauður: record only */
  --red-glow: rgba(220, 30, 53, 0.32);
  --danger: #b3122a;
  --danger-wash: #fbe6e9;
  --ok: #1d7a55;
  --field: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #10171f;    /* hraun */
    --sheet: #18222d;
    --ink: #e9eef3;       /* mjöll */
    --fog: #97a6b6;
    --rule: #2a3643;
    --blue: #79b4f2;
    --blue-ink: #0b1b2b;
    --blue-wash: #1a2a3c;
    --red: #e83a4f;
    --red-glow: rgba(232, 58, 79, 0.4);
    --danger: #ff8a97;
    --danger-wash: #3b1b22;
    --ok: #5ccf98;
    --field: #121a23;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 17px/1.45 "Alegreya Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding-inline: max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right));
  padding-block: 0 max(28px, env(safe-area-inset-bottom));
  min-height: 100vh;
}
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0 0 6px; font-weight: 500; letter-spacing: -0.005em; line-height: 1.2; }
h1 { font-size: 26px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; margin-top: 22px; }
p { margin: 0 0 12px; }
.muted { color: var(--fog); }
.small { font-size: 15px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 680px;
  margin: 0 auto;
  padding-block: max(14px, env(safe-area-inset-top)) 6px;
}
.wordmark {
  font-family: "Alegreya", Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0;
  white-space: nowrap;
}
.foot-links { display: inline-flex; flex-wrap: wrap; gap: 4px 16px; }
.top-tools { display: flex; align-items: center; gap: 6px; }
.lang {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--fog);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 6px 9px;
  cursor: pointer;
}
.icon-btn {
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--fog);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { color: var(--ink); }

.view { max-width: 680px; margin: 0 auto; }
.tagline {
  font-family: "Alegreya", Georgia, serif;
  font-size: 26px;
  line-height: 1.25;
  margin: 22px 0 18px;
  max-width: 22em;
  white-space: pre-line;
  text-wrap: balance;
}

/* sheets: the two forms and every transcript */
.sheet {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 20px 18px;
}
label { display: block; font-size: 15px; color: var(--fog); margin: 14px 0 6px; }
input[type="email"], input[type="password"], input[type="number"], input[type="text"], input:not([type]) {
  width: 100%;
  font: inherit;
  padding: 11px 12px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
}

/* buttons */
.btn, button.btn {
  font: inherit;
  font-size: 16px;
  border: 1px solid var(--rule);
  background: var(--sheet);
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 15px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--blue); color: var(--blue-ink); border-color: var(--blue); width: 100%; margin-top: 18px; font-weight: 500; }
.btn.quiet { background: transparent; }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.tiny { padding: 5px 9px; font-size: 14px; }
.btn.done { color: var(--ok); border-color: var(--ok); }
.error { color: var(--danger); background: var(--danger-wash); padding: 10px 12px; border-radius: 6px; font-size: 15px; }
.hint { color: var(--fog); font-size: 15px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.spread { justify-content: space-between; margin-top: 20px; }
.row input { flex: 1 1 200px; }

ul.plain { padding-left: 20px; margin: 0 0 14px; }
ul.plain li { margin-bottom: 8px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; color: var(--ink); margin: 18px 0 4px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--blue); }

/* the stage: record button, timer, choices */
.stage {
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 0 8px;
}
.rec {
  width: 112px; height: 112px; border-radius: 50%;
  background: var(--red); border: 0; padding: 0; cursor: pointer;
  box-shadow: 0 10px 28px var(--red-glow);
  transition: transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.rec:active { transform: scale(0.96); }
.rec-glyph {
  display: block; width: 36px; height: 36px; border-radius: 50%; background: #fff; margin: 0 auto;
  transition: border-radius 0.2s ease, width 0.2s ease, height 0.2s ease;
}
.rec.recording { animation: breathe 1.6s ease-in-out infinite; }
.rec.recording .rec-glyph { border-radius: 5px; width: 30px; height: 30px; }
@keyframes breathe { 0%, 100% { box-shadow: 0 10px 28px var(--red-glow); } 50% { box-shadow: 0 10px 44px var(--red-glow), 0 0 0 10px rgba(220, 30, 53, 0.08); } }
.timer {
  font-family: "Alegreya", Georgia, serif;
  font-variant-numeric: tabular-nums;
  font-size: 40px; line-height: 1;
  margin-top: 16px;
}
.rec-status { color: var(--fog); margin: 12px 0 18px; text-align: center; }

.choice { width: 100%; display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.choice-name { flex: 0 0 52px; color: var(--fog); font-size: 15px; }
.seg { display: flex; flex: 1; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--sheet); }
.seg button {
  flex: 1; font: inherit; font-size: 15px; border: 0; border-radius: 0; background: transparent;
  padding: 9px 4px; color: var(--fog); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.seg button + button { border-left: 1px solid var(--rule); }
.seg button.on { background: var(--blue-wash); color: var(--blue); font-weight: 500; }
.file-btn { margin-top: 10px; }
.progress { width: 100%; margin-top: 16px; }
.bar { height: 6px; background: var(--blue-wash); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--blue); border-radius: 999px; transition: width 0.2s ease; }
.bar > div.indeterminate { width: 40% !important; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
#progress-text { margin-top: 6px; }
#app-error { width: 100%; margin-top: 14px; }

/* install hint */
.install { background: var(--blue-wash); border-radius: 6px; padding: 14px 16px 12px; margin-top: 18px; }
.install p { margin: 0 0 8px; font-size: 16px; }
.install-title { font-weight: 500; }
.share-glyph { vertical-align: -4px; margin: 0 2px; color: var(--blue); }
.btn.primary.compact { width: auto; margin: 4px 0 8px; }
.install .tiny { margin-top: 2px; }

/* entries */
.entries { margin-top: 26px; display: flex; flex-direction: column; gap: 26px; }
.entry-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.meta { color: var(--fog); font-size: 15px; margin: 0; }
.block + .block { margin-top: 14px; }
.block-name { color: var(--fog); font-size: 15px; margin: 0 0 6px; }
.txt {
  width: 100%;
  font-family: "Alegreya", Georgia, "Times New Roman", serif;
  font-size: 19px; line-height: 1.55;
  padding: 16px 18px;
  border: 1px solid var(--rule); border-radius: 6px;
  background: var(--sheet); color: var(--ink);
  resize: none; min-height: 80px;
}
.actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.actions .btn { padding: 7px 13px; font-size: 15px; }
.empty {
  font-family: "Alegreya", Georgia, serif;
  font-size: 21px; line-height: 1.4;
  color: var(--fog);
  padding: 12px 0;
  max-width: 20em;
}
.note-trunc { color: var(--danger); margin: 8px 0 0; }
.foot { margin-top: 32px; }

/* settings dialog */
dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: min(92vw, 520px); width: 100%; }
dialog::backdrop { background: rgba(6, 12, 20, 0.55); }
dialog .sheet { margin: 0; }
.token { white-space: pre-wrap; word-break: break-all; background: var(--blue-wash); color: var(--ink); padding: 12px; border-radius: 6px; font-size: 14px; }
.tokens { list-style: none; padding: 0; margin: 10px 0 0; }
.tokens li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  .rec.recording { animation: none; }
  .rec, .rec-glyph, .bar > div { transition: none; }
  .bar > div.indeterminate { animation: none; width: 100% !important; }
}
