/* giveaway — Studio (admin)
   Cozy schrijfomgeving met EB Garamond als body-font (Vogue-achtig). */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=Bodoni+Moda:ital,opsz,wght@0,6..96,700;0,6..96,900;1,6..96,400;1,6..96,700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  /* Apple-Journal-stijl: zachte, licht-warme neutrale kleuren met genoeg
     contrast zonder hard te zijn. Pure wit voor kaarten, zachte tint voor bg. */
  --bg:        #f3f1ec;          /* zacht warm off-white achtergrond */
  --bg-paper:  #ffffff;          /* paper (body-input, kaarten) */
  --bg-card:   #ffffff;          /* card surface */
  --bg-soft:   #ebe8e1;          /* iets dieper voor secondary surfaces */
  --ink:       #1d1d1f;          /* Apple's text-zwart */
  --ink-soft:  #6e6e73;          /* Apple's text-secondary */
  --ink-faint: #a1a1a6;          /* Apple's text-tertiary */
  --line:      rgba(0, 0, 0, 0.08);
  --line-soft: rgba(0, 0, 0, 0.05);
  --accent:    #2f4a3d;

  --status-concept:     #b07a2c;
  --status-concept-bg:  rgba(176, 122, 44, 0.11);
  --status-working:     #3a6a96;
  --status-working-bg:  rgba(58, 106, 150, 0.11);
  --status-finished:    #3e7048;
  --status-finished-bg: rgba(62, 112, 72, 0.12);

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 0 0 0.5px rgba(0,0,0,0.05);
  --shadow:    0 4px 14px -4px rgba(0,0,0,0.08), 0 0 0 0.5px rgba(0,0,0,0.04);
  --shadow-lg: 0 14px 40px -10px rgba(0,0,0,0.12), 0 4px 12px -4px rgba(0,0,0,0.06);

  --serif-display: "Bodoni Moda", "Didot LT Pro", serif;
  --serif-body:    "EB Garamond", "Iowan Old Style", "Garamond", "Apple Garamond", "Times New Roman", serif;
  --sans:          -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }

/* ───────── Access gate (friendly popup) ───────── */

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: access-in 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.access-gate.is-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.access-veil {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 14, 0.45);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.access-card {
  position: relative;
  max-width: 420px;
  width: 100%;
  background: var(--bg-paper);
  padding: 36px 32px 28px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: access-card-in 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.access-title {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 400;
  font-size: 32px;
  margin: 0 0 14px 0;
  letter-spacing: 0.01em;
}
.access-body {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 22px 0;
}
.access-input {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: var(--bg-soft);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  outline: 0;
  margin-bottom: 16px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.access-input:focus {
  background: var(--bg-card);
  box-shadow: 0 0 0 2px var(--ink) inset;
}
.access-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.access-back, .access-submit {
  padding: 10px 20px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 0;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.access-back {
  background: transparent;
  color: var(--ink-soft);
}
.access-back:hover {
  color: var(--ink);
  background: rgba(0,0,0,0.05);
}
.access-submit {
  background: var(--ink);
  color: #fff;
}
.access-submit:hover { background: #2d2d30; }
.access-error {
  margin: 12px 0 0 0;
  font-size: 13px;
  color: #c1373b;
  font-family: var(--sans);
}
body.is-locked { overflow: hidden; }
body.is-locked main#app,
body.is-locked .bar,
body.is-locked .local-banner { visibility: hidden; }
@keyframes access-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes access-card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 520px) {
  .access-card { padding: 28px 24px 22px; }
  .access-title { font-size: 26px; }
  .access-body { font-size: 14px; }
  .access-actions { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  .access-back, .access-submit { padding: 12px 18px; text-align: center; min-height: 44px; display: flex; align-items: center; justify-content: center; }
}

/* ───────── Login ───────── */

body.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.4), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(0,0,0,0.04), transparent 65%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  padding: 48px 40px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow:
    0 40px 80px -40px rgba(0,0,0,0.35),
    0 12px 28px -16px rgba(0,0,0,0.18);
}

.login-mark {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: 42px;
  letter-spacing: -0.1em;
  margin: 0;
  line-height: 1;
}

.login-sub {
  font-family: var(--serif-body);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 16px;
  margin: 0 0 20px 0;
}

.login-card input[type="password"] {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 4px;
  background: transparent;
  font-family: var(--serif-body);
  font-size: 18px;
  color: var(--ink);
  outline: 0;
  transition: border-color 0.2s ease;
}
.login-card input[type="password"]:focus { border-bottom-color: var(--ink); }

.login-card button {
  width: 100%;
  margin-top: 14px;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--bg-paper);
  border: 0;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease;
}
.login-card button:hover { background: #000; }

.login-error {
  margin: 8px 0 0 0;
  font-size: 13px;
  font-style: italic;
  color: #9a3a3a;
}

/* ───────── Dashboard ───────── */

body.dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 32px;
  background: rgba(243, 241, 236, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.bar-mark {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.1em;
  text-decoration: none;
  color: var(--ink);
  justify-self: start;
  line-height: 1;
  transition: opacity 0.2s ease;
}
.bar-mark:hover { opacity: 0.7; }
.bar-title {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  justify-self: center;
}
.bar-out {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink-soft);
  justify-self: end;
  transition: color 0.2s ease;
}
.bar-out:hover { color: var(--ink); }
.bar-out a {
  color: inherit;
  text-decoration: none;
}

main#app {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 0;
  gap: 0;
}
.editor > * {
  box-shadow: var(--shadow-sm);
}
.editor > .editor-head { box-shadow: none; }
.editor > .format-toolbar { box-shadow: none; }
.editor > .editor-foot { box-shadow: none; }
.editor {
  /* Wrap all editor surfaces in a single card-shadow */
  position: relative;
}
.editor::before {
  content: "";
  position: absolute;
  inset: 16px 16px 16px 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  pointer-events: none;
  z-index: 0;
}
.editor > * { position: relative; z-index: 1; }

.local-banner {
  padding: 10px 28px;
  background: rgba(182, 122, 58, 0.12);
  border-bottom: 1px solid rgba(182, 122, 58, 0.2);
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 14px;
  color: #6b4a1f;
  text-align: center;
}
main#app[data-loading="true"] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.boot {
  font-family: var(--serif-body);
  font-style: italic;
  color: var(--ink-soft);
}

/* ───────── Sidebar ───────── */

.sidebar {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-head {
  padding: 24px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.new-btn:hover { background: #2d2d30; }
.new-btn:active { transform: scale(0.98); }
.new-btn .plus { font-size: 16px; line-height: 1; font-weight: 300; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-pill {
  background: var(--bg-soft);
  border: 0;
  padding: 6px 12px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.18s ease;
}
.filter-pill:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.06);
}
.filter-pill[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

.entry-list {
  list-style: none;
  margin: 0;
  padding: 4px 12px 24px;
  overflow-y: auto;
  flex: 1;
  /* Scrollbar verbergen */
  scrollbar-width: none;
}
.entry-list::-webkit-scrollbar { display: none; }

.entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.18s ease;
}
.entry-row:hover { background: rgba(0,0,0,0.04); }
.entry-row.is-active {
  background: rgba(0,0,0,0.06);
}
.entry-row .entry-title {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.entry-row.untitled .entry-title { font-weight: 400; color: var(--ink-soft); }

.empty-state {
  padding: 48px 24px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}

/* ───────── Status pills ───────── */

.status-pill {
  flex: 0 0 auto;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-pill.concept    { background: var(--status-concept-bg);  color: var(--status-concept); }
.status-pill.working_on { background: var(--status-working-bg);  color: var(--status-working); }
.status-pill.finished   { background: var(--status-finished-bg); color: var(--status-finished); }

/* ───────── Editor ───────── */

.editor {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
  padding: 16px 16px 16px 0;
}

.editor-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-soft);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.editor-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  padding: 22px 28px 18px;
  background: var(--bg-card);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.title-input {
  flex: 1 1 280px;
  border: 0;
  background: transparent;
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.015em;
  color: var(--ink);
  outline: 0;
  padding: 4px 0;
  min-width: 0;
}
.title-input::placeholder { color: var(--ink-faint); font-weight: 400; }

.head-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.status-select,
.edition-input {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  background: var(--bg-soft);
  border: 0;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  outline: 0;
  transition: background 0.18s ease;
}
.status-select:hover,
.edition-input:hover { background: rgba(0, 0, 0, 0.07); }
.status-select:focus-visible,
.edition-input:focus-visible {
  background: var(--bg-card);
  box-shadow: 0 0 0 2px var(--ink) inset;
}

.edition-input {
  width: 96px;
  cursor: text;
  text-align: center;
  font-family: var(--serif-display);
  font-weight: 700;
  letter-spacing: 0;
  font-size: 14px;
}
.edition-input::placeholder {
  color: var(--ink-faint);
  font-weight: 400;
}

/* ───────── Format toolbar ───────── */

.format-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 28px;
  background: var(--bg-card);
  flex-wrap: wrap;
}
.fmt-btn {
  background: transparent;
  border: 0;
  padding: 7px 11px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 8px;
  min-width: 32px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
  outline: 0;
}
.fmt-btn:hover { background: rgba(0,0,0,0.06); color: var(--ink); }
.fmt-btn:focus-visible { outline: 1px solid var(--ink); outline-offset: 1px; }
.fmt-btn.is-active {
  background: var(--ink);
  color: #fff;
}
.fmt-btn.is-active svg { stroke: #fff; }
.fmt-btn.fmt-icon { padding: 6px 8px; }
.fmt-btn.fmt-icon svg { display: block; }
.fmt-hint {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Sound-toggle: toon ic-sound-on standaard, ic-sound-off als gemute */
#soundToggle .ic-sound-off { display: none; }
#soundToggle.is-muted .ic-sound-on  { display: none; }
#soundToggle.is-muted .ic-sound-off { display: block; }
#soundToggle.is-muted { color: var(--ink-faint); }

/* Volume-slider naast sound-toggle */
.sound-volume {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 22px;
  background: transparent;
  cursor: pointer;
  margin-left: 4px;
  outline: 0;
}
.sound-volume::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--line);
  border-radius: 1px;
}
.sound-volume::-moz-range-track {
  height: 1px;
  background: var(--line);
  border-radius: 1px;
}
.sound-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  background: var(--ink);
  border-radius: 999px;
  margin-top: -4.5px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.sound-volume::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.sound-volume:hover::-webkit-slider-thumb { transform: scale(1.2); }
.sound-volume:hover::-moz-range-thumb     { transform: scale(1.2); }
#soundToggle.is-muted + .sound-volume { opacity: 0.3; pointer-events: none; }

.body-input {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 200px;
  border: 0;
  outline: 0;
  background: var(--bg-paper);
  padding: 40px 56px 80px;
  font-family: var(--serif-body);
  font-size: 19px;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  overflow-y: auto;
  cursor: text;

  /* ── Smooth typing ── */
  caret-color: var(--ink);
  letter-spacing: 0.005em;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "onum" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  word-spacing: 0.01em;

  /* Subtiele papier-textuur */
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.3'/></svg>");
  background-blend-mode: multiply;
}
.body-input.is-empty::before {
  content: attr(data-placeholder);
  position: absolute;
  top: 40px;
  left: 64px;
  color: var(--ink-faint);
  font-style: italic;
  pointer-events: none;
}
.body-input ::selection,
.body-input::selection {
  background: rgba(47, 74, 61, 0.18);
}

/* Word-container voorkomt dat de browser woorden mid-letter splitst.
   Browsers breken tussen .word elementen (text-node-spaties), niet binnen. */
.body-input .word {
  display: inline-block;
  white-space: nowrap;
  vertical-align: baseline;
}

/* Per-letter typewriter-reveal binnen een word */
.body-input .ch {
  display: inline-block;
  vertical-align: baseline;
  animation: ch-type 130ms cubic-bezier(0.33, 0, 0.2, 1) both;
}
@keyframes ch-type {
  0%   { clip-path: inset(0 100% 0 0); opacity: 0; }
  100% { clip-path: inset(0 0 0 0);    opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .body-input .ch { animation: none; }
}

/* ───── In-body opmaak (echte visuele styling, geen markdown-tekens) ───── */
.body-input strong, .body-input b {
  font-weight: 700;
}
.body-input em, .body-input i {
  font-style: italic;
}
.body-input s, .body-input del {
  text-decoration: line-through;
  color: var(--ink-soft);
}
.body-input code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 6px;
  border-radius: 3px;
}
.body-input h1, .body-input h2, .body-input h3 {
  font-family: var(--serif-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0.6em 0 0.3em;
}
.body-input h1 { font-size: 1.7em; }
.body-input h2 { font-size: 1.4em; }
.body-input h3 { font-size: 1.18em; }
.body-input blockquote {
  margin: 0.4em 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--line-strong, var(--ink-soft));
  color: var(--ink-soft);
  font-style: italic;
}
.body-input ul, .body-input ol {
  margin: 0.4em 0;
  padding-left: 1.6em;
}
.body-input li { margin: 0.15em 0; }
.body-input hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 1.4em 0;
}
.body-input a {
  color: var(--accent, var(--ink));
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* ───── Pin-icoon op entry-rij ───── */
.entry-row {
  position: relative;
}
.entry-row .pin-btn {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  padding: 4px 6px;
  margin-right: -4px;
  cursor: pointer;
  color: var(--ink-faint);
  opacity: 0;
  transition: opacity 0.18s ease, color 0.18s ease;
  font-size: 14px;
  line-height: 1;
}
.entry-row:hover .pin-btn { opacity: 1; }
.entry-row .pin-btn:hover { color: var(--ink); }
.entry-row.is-pinned .pin-btn {
  opacity: 1;
  color: #9b6a30;
}
.entry-row.is-pinned {
  background: rgba(155, 106, 48, 0.05);
}

/* ───── Export-knop in editor footer ───── */
.export-btn {
  background: transparent;
  border: 0;
  padding: 8px 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.18s ease;
}
.export-btn:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
}
.foot-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background: var(--bg-card);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
}

.save-status { font-style: normal; }
.save-status[data-state="saving"] { color: var(--ink-faint); }
.save-status[data-state="saved"]  { color: var(--status-finished); }
.save-status[data-state="error"]  { color: #c1373b; }

.del-btn {
  background: transparent;
  border: 0;
  padding: 8px 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.18s ease;
}
.del-btn:hover {
  color: #c1373b;
  background: rgba(193, 55, 59, 0.08);
}

/* ───────── Errors ───────── */

.api-error {
  margin: 24px 36px;
  padding: 14px 18px;
  background: rgba(154, 58, 58, 0.08);
  border-left: 3px solid #9a3a3a;
  color: #6b2828;
  font-family: var(--serif-body);
  font-size: 15px;
}

/* ───────── Mobile ───────── */

@media (max-width: 760px) {
  body.dashboard { display: flex; flex-direction: column; min-height: 100vh; }
  .bar { padding: 12px 16px; }
  .bar-mark { font-size: 18px; }
  .bar-title { font-size: 12px; }
  .bar-out { font-size: 12px; }

  main#app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow: visible;
  }
  .sidebar {
    max-height: 38vh;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .sidebar-head {
    padding: 14px 16px 12px;
    gap: 12px;
  }
  .entry-list { padding: 4px 8px 14px; }
  .entry-row { padding: 11px 12px; min-height: 44px; }

  .editor {
    padding: 12px;
    min-height: 60vh;
  }
  .editor::before { inset: 12px; }
  .editor-head {
    padding: 16px 16px 12px;
    gap: 10px;
  }
  .title-input { font-size: 22px; flex-basis: 100%; }
  .head-meta { flex-wrap: wrap; width: 100%; }
  .edition-input, .status-select { font-size: 14px; padding: 9px 14px; min-height: 36px; }
  .edition-input { width: auto; flex: 1; min-width: 80px; }

  .format-toolbar {
    padding: 8px 12px;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .format-toolbar::-webkit-scrollbar { display: none; }
  .fmt-btn { padding: 9px 12px; min-width: 38px; flex-shrink: 0; }

  .body-input {
    padding: 24px 20px 60px;
    font-size: 18px;
    min-height: 50vh;
  }
  .body-input.is-empty::before { top: 24px; left: 20px; }

  .editor-foot { padding: 10px 14px; font-size: 11px; flex-wrap: wrap; gap: 6px; }
  .foot-actions .export-btn,
  .foot-actions .del-btn { padding: 9px 12px; font-size: 12px; min-height: 36px; }

  .sound-volume { width: 60px; }
  .local-banner { padding: 8px 16px; font-size: 12px; }
}
