/* Visual language of manarbenkraouda.com: warm paper, ink, thin rules, Instrument Serif and Sans. */
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/instrument-serif-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/instrument-serif-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #faf9f7;
  --ink: #161616;
  --muted: #6f6c67;
  --line: #d8d4cd;
  --error: #b3261e;
  --success: #1e6f4a;
  --ease-out: ease-out;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  /* Like an app: no text selection or link callout, except where copying is useful. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.turn-text, input, textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
}

/* App layout: the page never scrolls. Each tab fills the space above the tab bar, and only its
   scroll areas move, so headers, search and filters stay in place. */
html, body { height: 100%; overflow: hidden; }
body { display: flex; flex-direction: column; height: 100dvh; }
.tab { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view-header { flex: none; padding: 3.5rem 1.5rem 0.25rem; }
.scroll-frame { position: relative; flex: 1; min-height: 0; }
/* Content fades out under the fixed header instead of being cut. */
.scroll-frame::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  height: 1rem;
  background: linear-gradient(var(--paper), rgba(250, 249, 247, 0));
  pointer-events: none;
}
.scroll-area {
  height: 100%;
  padding: 0 1.5rem 2.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.scroll-area::-webkit-scrollbar { display: none; }
#detail-scroll, #term-scroll { padding-top: 3rem; }
.scroll-thumb {
  position: absolute;
  top: 0;
  right: 3px;
  width: 4px;
  border-radius: 999px;
  background: rgba(22, 22, 22, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s var(--ease-out);
}
.scroll-thumb.is-visible { opacity: 1; transition-duration: 0.06s; }

h1.title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.875rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.note { margin-top: 0.75rem; font-size: 15px; line-height: 1.625; color: var(--muted); }
.note:empty { display: none; }
.error-text { color: var(--error); overflow-wrap: anywhere; }
.meta { margin-top: 1rem; font-size: 15px; color: var(--muted); }

a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; transition: text-decoration-color 0.1s; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }

.back { display: inline-block; margin-bottom: 2.5rem; font-size: 15px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }

/* Recorder */
/* The Record tab: centred, nothing but the greeting, the title and the buttons. */
.recorder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 1.5rem;
  overflow: hidden;
}
.recorder > [hidden] { display: none !important; }

.hello {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 4.5rem;
  line-height: 1;
  letter-spacing: -0.03em;
}
.subtitle { margin-top: 0.75rem; font-size: 17px; color: var(--muted); min-height: 1.5em; }

.title-input {
  width: 100%;
  margin-top: 2.5rem;
  padding: 0.7rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 19px;
  transition: border-color 0.1s;
}
.title-input::placeholder { color: #a9a59e; }
.title-input:focus { outline: none; border-bottom-color: var(--ink); }
.title-input:disabled { color: var(--ink); opacity: 1; border-bottom-color: transparent; }

#start-buttons { margin-top: 1rem; }

.connection { display: flex; align-items: baseline; gap: 0.6rem; margin-top: 1.5rem; font-size: 15px; line-height: 1.5; color: var(--muted); }
.connection-label { font-weight: 500; color: var(--ink); }

/* Recordings being transcribed, under the record buttons. Tapping opens the list. */
.processing {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  animation: appear 0.11s var(--ease-out) both;
}
.processing .arrow { margin-left: auto; }
.processing:hover .arrow { transform: translateX(4px); color: var(--ink); }
.spinner {
  flex: none;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  /* A loader turns at a constant speed. */
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.dot { flex: none; width: 0.55rem; height: 0.55rem; border-radius: 999px; background: var(--success); transform: translateY(-1px); }
.connection[data-state="offline"] .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--error); }
.connection[data-state="offline"] .connection-label { color: var(--error); }
.connection[data-state="reconnected"] .dot { animation: pulse 1.2s var(--ease-out) infinite; }
.connection[data-state="reconnected"] .connection-label { color: var(--success); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(30, 111, 74, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(30, 111, 74, 0); }
}

.field { display: block; margin-top: 1.25rem; }
.field-label { display: block; font-size: 13px; color: var(--muted); }
.field input, .field select {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.6rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  transition: border-color 0.1s;
}
.field input::placeholder { color: #a9a59e; }
.field input:focus, .field select:focus { outline: none; border-bottom-color: var(--ink); }
.field select { appearance: none; cursor: pointer; }

.timer {
  margin-top: 1.5rem;
  font-family: var(--serif);
  font-size: 4.5rem;
  line-height: 1;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  transition: color 0.1s;
}
.is-recording .timer { color: var(--ink); }
/* Live preview: the last lines only, older ones fade out at the top. */
.live {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  max-height: 8rem;
  margin-top: 1.25rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 2.5rem);
  mask-image: linear-gradient(transparent, #000 2.5rem);
  animation: appear 0.11s var(--ease-out) both;
}
.live-text { font-size: 17px; line-height: 1.6; color: var(--muted); }

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  height: 3.25rem;
  margin-top: 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.1s var(--ease-out), background-color 0.1s var(--ease-out), box-shadow 0.1s var(--ease-out);
}
.button:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -12px rgba(22, 22, 22, 0.6); }
.button:active { transform: scale(0.98); box-shadow: none; }
.button:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }
.button.secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.button.secondary:hover { box-shadow: inset 0 0 0 1px var(--ink); }

.button.stop { background: var(--error); }
.button.stop::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  background: var(--paper);
}

/* Lists */
.list { margin-top: 4rem; }
.list ul, .list-rows { margin-top: 1.25rem; list-style: none; }
.list li, .list-rows li { border-top: 1px solid var(--line); }
.list li:last-child, .list-rows li:last-child { border-bottom: 1px solid var(--line); }
#pending.list { margin-top: 2.5rem; }

.row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 0;
  text-decoration: none;
}
.row-title { display: block; font-size: 17px; font-weight: 500; overflow-wrap: anywhere; }
.row-meta { display: block; margin-top: 0.25rem; font-size: 15px; color: var(--muted); }
.row-snippet { display: block; margin-top: 0.4rem; font-size: 15px; line-height: 1.5; color: var(--ink); }
mark { background: rgba(179, 38, 30, 0.12); color: inherit; border-radius: 2px; padding: 0 0.1em; }
.arrow { padding-top: 0.1rem; color: var(--muted); transition: transform 0.1s var(--ease-out), color 0.1s; }
.row:hover .arrow { transform: translateX(4px); color: var(--ink); }

.pending-row { padding: 1rem 0; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 0.75rem; }
.stats div { display: flex; flex-direction: column; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.stats dt { order: 2; margin-top: 0.35rem; font-size: 13px; color: var(--muted); }
.stats dd { order: 1; font-family: var(--serif); font-size: 2rem; line-height: 1; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }

/* Filters: search bar, scrolling pills, bottom sheet */
.filters { margin-top: 1.5rem; }
.searchbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1rem;
  border-radius: 999px;
  background: #f0ede8;
  color: var(--muted);
  transition: box-shadow 0.1s var(--ease-out);
}
.searchbar:focus-within { box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); }
.searchbar svg { flex: none; }
.searchbar input {
  flex: 1;
  min-width: 0;
  height: 3rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.searchbar input::placeholder { color: #9d998f; }
.searchbar input:focus { outline: none; }
input[type="search"]::-webkit-search-cancel-button { filter: grayscale(1); }

.pills {
  display: flex;
  gap: 0.5rem;
  margin: 0.9rem -1.5rem 0;
  padding: 0 1.5rem 0.2rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 15rem;
  height: 2.4rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.1s var(--ease-out), color 0.1s var(--ease-out), box-shadow 0.1s var(--ease-out), transform 0.075s var(--ease-out);
}
.pill:active { transform: scale(0.96); }
.pill-label { overflow: hidden; text-overflow: ellipsis; }
.pill .chevron { width: 0.45rem; height: 0.45rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.pill.is-active { background: var(--ink); color: var(--paper); box-shadow: none; }
.pill-clear { color: var(--muted); box-shadow: none; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.result-count { margin-top: 1.25rem; font-size: 13px; color: var(--muted); }
.result-count:empty { display: none; }

.sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 34rem;
  max-height: 85dvh;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 20px 20px 0 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 -12px 40px rgba(22, 22, 22, 0.14);
}
.sheet[open] { animation: sheet-in 0.13s var(--ease-out) both; }
.sheet::backdrop { background: rgba(22, 22, 22, 0.32); animation: fade-in 0.13s var(--ease-out) both; }
@keyframes sheet-in {
  from { transform: translateY(100%); }
  to { transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.sheet-inner { display: flex; flex-direction: column; max-height: 85dvh; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem 0.5rem; }
.sheet-close { width: 2.25rem; height: 2.25rem; border: 0; border-radius: 999px; background: #f0ede8; color: var(--ink); font-size: 14px; cursor: pointer; }
.sheet-body { min-height: 6rem; padding: 0.5rem 1.5rem 1rem; overflow-y: auto; }
.sheet-footer { display: flex; gap: 0.75rem; padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sheet-footer .button { margin-top: 0; }
.sheet-footer .button.secondary { flex: 0 0 7rem; }
.sheet-input {
  width: 100%;
  height: 3rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 12px;
  background: #f0ede8;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.sheet-input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--ink); }
.suggestions { margin-top: 0.5rem; }
.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  text-align: left;
  cursor: pointer;
}
.option[aria-pressed="true"] { font-weight: 500; }
.option[aria-pressed="true"]::after { content: ""; width: 0.4rem; height: 0.75rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }

/* Bottom navigation */
/* Row gestures */
/* Rows reach 0.75rem past the text on each side, so the long-press fill and the swipe colours have
   room around the text. The separators keep the width of the text column. */
.list-rows li.swipe-row { position: relative; overflow: hidden; margin-inline: -0.75rem; border: 0; }
.list-rows li.swipe-row::before,
.list-rows li.swipe-row:last-child::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  border-top: 1px solid var(--line);
  pointer-events: none;
}
.list-rows li.swipe-row::before { top: 0; }
.list-rows li.swipe-row:last-child::after { bottom: 0; }
.swipe-row .row {
  position: relative;
  z-index: 1;
  padding-inline: 0.75rem;
  background: var(--paper);
  touch-action: pan-y;
  -webkit-user-drag: none;
  transition: transform 0.11s var(--ease-out);
}
.swipe-row.is-swiping .row { transition: none; }
/* Long press: the row fills from the left while the finger stays down. The fill lasts as long as
   LONG_PRESS_MILLISECONDS in app.js, so it is full when the menu opens. */
.swipe-row .row::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #ebe8e3;
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s var(--ease-out), transform 0s 0.1s;
}
.swipe-row.is-pressing .row::after {
  transform: none;
  opacity: 1;
  transition: transform 0.5s var(--ease-out), opacity 0.05s var(--ease-out);
}
/* Room for the arrow's hover nudge, which the row's clipping would cut. */
.swipe-row .arrow { margin-right: 0.4rem; }
.swipe-action {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  color: var(--paper);
  font-size: 15px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.075s var(--ease-out);
}
.swipe-archive { justify-content: flex-start; background: var(--ink); }
.swipe-delete { justify-content: flex-end; background: var(--error); }
.swipe-row[data-direction="right"] .swipe-archive,
.swipe-row[data-direction="left"] .swipe-delete { opacity: 0.75; }
.swipe-row.will-commit[data-direction="right"] .swipe-archive,
.swipe-row.will-commit[data-direction="left"] .swipe-delete { opacity: 1; }

/* Long-press actions and the undo toast */
.action-title {
  overflow: hidden;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.action-list { padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
.action {
  display: block;
  width: 100%;
  padding: 1rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  text-align: left;
  cursor: pointer;
  transition: opacity 0.075s var(--ease-out);
}
.action:active { opacity: 0.55; }
.action:last-child { border-bottom: 0; }
.action-danger { color: var(--error); }
/* Single-choice options in the action sheet show their check mark on the right. */
.action.option { display: flex; align-items: center; justify-content: space-between; }
.action-list .button { margin-top: 1rem; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(5.75rem + env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: 0.65rem 0.65rem 0.65rem 1.1rem;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  box-shadow: 0 12px 30px -12px rgba(22, 22, 22, 0.5);
  transform: translateX(-50%);
  animation: toast-in 0.11s var(--ease-out) both;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
#toast-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#toast-undo {
  flex: none;
  padding: 0.35rem 0.6rem;
  border: 0;
  border-radius: 8px;
  background: rgba(250, 249, 247, 0.14);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Bottom navigation */
/* Glossary */
.heading-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.heading-row .pill { text-decoration: none; }
.lead { margin-top: 1rem; font-size: 15px; line-height: 1.6; color: var(--muted); }
.glossary-search { margin-top: 1.75rem; }
#glossary-list { margin-top: 1.5rem; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.field textarea {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 12px;
  background: #f0ede8;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
}
.field textarea:focus { outline: none; box-shadow: inset 0 0 0 1px var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.tags:empty { display: none; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 2.2rem;
  padding: 0 0.4rem 0 0.9rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
}
.tag.appear { animation: appear 0.11s var(--ease-out) both; }
.tag-remove { width: 1.6rem; height: 1.6rem; border: 0; border-radius: 999px; background: transparent; color: inherit; font-size: 12px; opacity: 0.7; cursor: pointer; }
.tag-remove:hover { opacity: 1; }
.tag-add { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.tag-add .sheet-input { flex: 1; min-width: 0; }
.tag-add .pill { height: 3rem; }
.history { margin-top: 3.5rem; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; }
.saved-note { color: var(--success); }

/* Bottom navigation */
.tabbar {
  position: relative;
  z-index: 10;
  flex: none;
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0.35rem 1rem calc(0.35rem + env(safe-area-inset-bottom));
  background: rgba(250, 249, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  position: relative;
  display: flex;
  flex: 1;
  max-width: 12rem;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.45rem 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.1s;
}
.tabbar svg {
  box-sizing: content-box;
  padding: 0.2rem 1.1rem;
  border-radius: 999px;
  transition: background-color 0.1s var(--ease-out), color 0.1s var(--ease-out), transform 0.075s var(--ease-out);
}
/* The active tab: inverted icon on an ink pill, ink and bold label. */
.tabbar a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tabbar a[aria-current="page"] svg { background: var(--ink); color: var(--paper); }
.recording-dot {
  position: absolute;
  top: 0.3rem;
  left: calc(50% + 1.45rem);
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--error);
  opacity: 0;
  transition: opacity 0.1s;
}
.tabbar a.is-recording .recording-dot { opacity: 1; animation: blink 1.4s ease-in-out infinite; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Detail */
.notice { margin-top: 2rem; padding: 1.25rem 0; border-top: 1px solid var(--error); border-bottom: 1px solid var(--line); }
.player { display: block; width: 100%; margin-top: 2rem; }
.names { margin-top: 3.5rem; }
.transcript { margin-top: 3.5rem; }
.turn { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.turn:first-of-type { margin-top: 1.25rem; }
.turn-head { display: flex; justify-content: space-between; gap: 1rem; font-size: 13px; }
.speaker { font-weight: 600; letter-spacing: 0.01em; }
.time { color: var(--muted); font-variant-numeric: tabular-nums; }
.turn-text { margin-top: 0.35rem; font-size: 17px; line-height: 1.625; overflow-wrap: anywhere; }

/* Edit pages: the actions stay at the bottom of the screen, above the tab bar. */
#detail-scroll, #term-scroll { padding-bottom: 0; }
.action-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding: 0.75rem 0 1rem;
  background: var(--paper);
}
/* Content fades out under the bar instead of being cut. */
.action-bar::before {
  content: "";
  position: absolute;
  inset: -1rem 0 auto 0;
  height: 1rem;
  background: linear-gradient(rgba(250, 249, 247, 0), var(--paper));
  pointer-events: none;
}
.action-bar .button { margin-top: 0; }
.action-bar .more-button { flex: 0 0 3.25rem; font-size: 20px; letter-spacing: 0.05em; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.rise { animation: rise 0.25s var(--ease-out) both; }

/* Micro-interactions: short, ease-out only. */
@keyframes appear {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.tab:not([hidden]), #list-view:not([hidden]), #detail-view:not([hidden]) { animation: appear 0.12s var(--ease-out) both; }
.list-rows li.appear { animation: appear 0.14s var(--ease-out) both; animation-delay: calc(var(--order, 0) * 18ms); }
#timer:not([hidden]), #stop:not([hidden]), #start-buttons:not([hidden]) { animation: appear 0.11s var(--ease-out) both; }
.tabbar a:active svg { transform: scale(0.92); }

/* Loading placeholders */
@keyframes shimmer {
  from { opacity: 1; }
  to { opacity: 0.45; }
}
.skeleton { list-style: none; }
.skeleton li { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.skeleton span, .skeleton-block span {
  display: block;
  height: 0.85rem;
  border-radius: 4px;
  background: #ebe8e3;
  animation: shimmer 0.45s var(--ease-out) infinite alternate;
}
.skeleton span + span, .skeleton-block span + span { margin-top: 0.6rem; }
.skeleton-block { margin-top: 1rem; }
.skeleton-block .heading { height: 2.6rem; width: 70%; }

@media (min-width: 640px) {
  .view-header { padding-top: 5rem; }
  h1.title { font-size: 3.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
  * { transition: none !important; }
}
