/* MyJournal — warm Gold Coast paper */
:root {
  --paper: #FBF6EE;
  --paper-2: #FFFDF8;
  --ink: #1C1917;
  --ink-soft: #4A433C;
  --muted: #7A7268;
  --coral: #E07A5F;
  --coral-soft: #F4C7B8;
  --teal: #2A9D8F;
  --teal-soft: #C9E8E3;
  --gold: #C9A227;
  --gold-line: rgba(201, 162, 39, 0.45);
  --sky: #7EB8D4;
  --navy: #1B365D;
  --danger: #B44A3A;
  --shadow: 0 10px 40px rgba(27, 54, 93, 0.08), 0 1px 0 rgba(201, 162, 39, 0.28);
  --radius: 18px;
  --font-ui: "Nunito", system-ui, sans-serif;
  --font-write: "Fraunces", "Palatino Linotype", serif;
  --top: 72px;
}
[data-theme="night"] {
  --paper: #121821;
  --paper-2: #1A2230;
  --ink: #F4EDE0;
  --ink-soft: #D5CBBA;
  --muted: #9A9084;
  --coral: #E08B74;
  --coral-soft: #4A2E28;
  --teal: #4DB6A8;
  --teal-soft: #1A3A36;
  --gold: #D4B84A;
  --gold-line: rgba(212, 184, 74, 0.35);
  --sky: #8EC4D8;
  --navy: #C9D7EA;
  --danger: #E07A6A;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(212, 184, 74, 0.18);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  min-height: 100dvh;
  line-height: 1.5;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
.grain {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 0;
  opacity: 0.18;
  background-image:
    radial-gradient(rgba(28, 25, 23, 0.07) 0.6px, transparent 0.7px),
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(201,162,39,0.03) 3px, rgba(201,162,39,0.03) 4px);
  background-size: 5px 5px, 100% 4px;
}
[data-theme="night"] .grain { opacity: 0.22; mix-blend-mode: overlay; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.65rem 1.25rem;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gold-line);
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: inherit; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong {
  font-family: var(--font-write);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand-text em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.weather-chip {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--gold-line);
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.weather-chip.unavailable { color: var(--muted); font-weight: 500; }

.clock { display: flex; align-items: center; gap: 0.55rem; margin-left: 0.2rem; }
.analog { flex: none; filter: drop-shadow(0 2px 4px rgba(27,54,93,0.08)); }
.clock-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--navy);
  font-size: 1.05rem;
}
.clock-date { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; }

.search-wrap { margin-left: auto; min-width: 180px; flex: 0 1 240px; }
.search-wrap input {
  width: 100%;
  padding: 0.45rem 0.8rem 0.45rem 2rem;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: var(--paper-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237A7268' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5 14 14'/%3E%3C/svg%3E") 0.7rem center no-repeat;
}
.search-wrap input:focus, .input:focus, .title-input:focus, .body-input:focus, .tags-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 22%, transparent);
}
.top-actions { display: flex; gap: 0.35rem; }
.icon-btn {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
}
.icon-btn:hover, .btn-ghost:hover { background: color-mix(in srgb, var(--gold) 12%, var(--paper-2)); }
.icon-btn.sm { width: 32px; height: 32px; padding: 0; }
#btn-cal-mobile { display: none; }

.banner {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  margin: 0.75rem 1.25rem 0;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--coral) 12%, var(--paper-2));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
}
.banner p { margin: 0; flex: 1; }

.shell {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.25rem;
  padding: 1rem 1.25rem 3rem;
  max-width: 1320px;
  margin: 0 auto;
}
.sidebar { display: flex; flex-direction: column; gap: 0.9rem; }
.panel {
  background: var(--paper-2);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow);
}
.panel-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.prompt {
  margin: 0;
  font-family: var(--font-write);
  font-style: italic;
  color: var(--ink-soft);
}

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.cal-head h2 { margin: 0; font-family: var(--font-write); font-size: 1.05rem; font-weight: 600; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
}
.cal-dow { font-size: 0.65rem; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; padding: 0.25rem 0; }
.cal-day {
  aspect-ratio: 1;
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.cal-day.empty { pointer-events: none; }
.cal-day:hover:not(.empty) { background: color-mix(in srgb, var(--sky) 22%, transparent); }
.cal-day.today { font-weight: 800; color: var(--coral); }
.cal-day.selected { background: var(--navy); color: #fff; }
[data-theme="night"] .cal-day.selected { background: var(--coral); color: #1C1917; }
.cal-day .pip {
  position: absolute; bottom: 3px; width: 5px; height: 5px; border-radius: 50%;
}
.pip.m1 { background: #9A4A3C; }
.pip.m2 { background: #C47A4A; }
.pip.m3 { background: var(--gold); }
.pip.m4 { background: var(--teal); }
.pip.m5 { background: var(--sky); }
.pip.m0 { background: var(--coral); }
.cal-day.selected .pip { background: #fff; }

.streak-panel { text-align: center; }
.streak-num {
  font-family: var(--font-write);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--coral);
  line-height: 1;
}
.streak-label { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); font-size: 0.85rem; }

.forecast { display: flex; flex-direction: column; gap: 0.35rem; }
.forecast-row {
  display: grid; grid-template-columns: 2.4rem 1.4rem 1fr auto;
  gap: 0.4rem; align-items: center;
  font-size: 0.82rem;
}
.forecast-row .hi { font-weight: 700; color: var(--navy); }

.heatmap { display: flex; gap: 2px; overflow-x: auto; padding-bottom: 0.2rem; }
.heat-col { display: flex; flex-direction: column; gap: 2px; }
.heat-cell {
  width: 8px; height: 8px; border-radius: 2px;
  background: color-mix(in srgb, var(--gold) 14%, var(--paper));
}
.heat-cell.c1 { background: color-mix(in srgb, var(--teal) 35%, var(--paper)); }
.heat-cell.c2 { background: color-mix(in srgb, var(--teal) 55%, var(--paper)); }
.heat-cell.c3 { background: var(--teal); }
.heat-cell.c4 { background: var(--coral); }
.heat-cell.today-cell { outline: 1px solid var(--gold); }

.mood-chart svg { width: 100%; height: auto; display: block; }

.main { min-width: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.day-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.day-kicker {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.day-title {
  margin: 0.1rem 0 0;
  font-family: var(--font-write);
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: -0.02em;
}
.day-actions { display: flex; gap: 0.4rem; }

.pages { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.page-tab {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: var(--paper-2);
  font-size: 0.8rem;
}
.page-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
[data-theme="night"] .page-tab.active { background: var(--coral); color: #1C1917; border-color: var(--coral); }

.onthisday {
  font-size: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-left: 2px solid var(--gold);
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  border-radius: 0 12px 12px 0;
}
.onthisday button { color: var(--teal); font-weight: 700; }

.paper, .editor-card {
  background: var(--paper-2);
  border: 1px solid var(--gold-line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  position: relative;
}
.editor-card {
  padding: 1.1rem 1.25rem 1.2rem;
  background-image:
    linear-gradient(180deg, color-mix(in srgb, var(--gold) 10%, transparent), transparent 42px),
    repeating-linear-gradient(
      transparent,
      transparent calc(1.75rem - 1px),
      color-mix(in srgb, var(--sky) 22%, transparent) calc(1.75rem - 1px),
      color-mix(in srgb, var(--sky) 22%, transparent) 1.75rem
    );
  background-position: 0 6.6rem;
}
.editor-card::before {
  content: "";
  position: absolute; left: 2.4rem; top: 0; bottom: 0; width: 1px;
  background: color-mix(in srgb, var(--coral) 35%, transparent);
  pointer-events: none;
}
.editor-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.6rem; margin-bottom: 0.4rem; }
.mood-picker { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.mood-picker button {
  display: flex; flex-direction: column; align-items: center; gap: 0.05rem;
  width: 52px; padding: 0.25rem 0;
  border-radius: 12px;
  opacity: 0.55;
  font-size: 1.15rem;
}
.mood-picker button span { font-size: 0.62rem; color: var(--muted); font-weight: 700; letter-spacing: 0.02em; }
.mood-picker button:hover { opacity: 0.9; }
.mood-picker button.selected {
  opacity: 1;
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.save-pill {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.save-pill.saving { color: var(--gold); }
.save-pill.saved { color: var(--teal); }
.save-pill.err { color: var(--danger); }

.title-input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-write);
  font-size: 1.55rem;
  font-weight: 600;
  padding: 0.2rem 0 0.5rem 1.5rem;
}
.body-input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-write);
  font-size: 1.12rem;
  line-height: 1.75rem;
  padding: 0.15rem 0.4rem 0.8rem 1.5rem;
  resize: vertical;
  min-height: 18rem;
}
.interim {
  margin: 0 0 0.5rem 1.5rem;
  font-family: var(--font-write);
  font-style: italic;
  color: var(--muted);
  min-height: 1.3em;
}

.toolbar {
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
  padding-top: 0.6rem;
  border-top: 1px solid var(--gold-line);
}
.grow { flex: 1; }
.word-count { font-size: 0.78rem; color: var(--muted); }
.tags-input {
  width: min(220px, 40vw);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: var(--paper);
  font-size: 0.82rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid transparent;
}
.btn-block { width: 100%; margin-top: 0.55rem; }
.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:hover { filter: brightness(1.05); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-ghost { border-color: var(--gold-line); background: var(--paper-2); color: var(--ink-soft); }
.btn-danger { color: var(--danger); }
.btn-dictate {
  background: var(--coral);
  color: #fff;
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--coral) 35%, transparent);
}
.btn-dictate .mic {
  width: 10px; height: 14px; border-radius: 6px;
  background: #fff; display: inline-block; position: relative;
}
.btn-dictate .mic::after {
  content: ""; position: absolute; left: -3px; right: -3px; bottom: -4px;
  border: 2px solid #fff; border-top: none; border-radius: 0 0 8px 8px; height: 6px;
}
.btn-dictate.listening { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--coral) 50%, transparent); }
  50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--coral) 0%, transparent); }
}
.dictate-fallback { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--muted); }

.att-strip { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.7rem; }
.att {
  position: relative;
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper);
  max-width: 160px;
}
.att img { display: block; width: 140px; height: 100px; object-fit: cover; cursor: zoom-in; }
.att .doc {
  display: block; padding: 0.55rem 0.7rem; font-size: 0.78rem; color: var(--navy); text-decoration: none;
}
.att .x {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  color: var(--danger); font-size: 0.75rem;
}

.empty-state { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty-mark { font-size: 2.2rem; margin: 0; color: var(--gold); }
.empty-state h2 { font-family: var(--font-write); color: var(--ink); font-weight: 500; }

.lock-screen {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
}
.lock-card { width: min(380px, calc(100% - 2rem)); padding: 2rem 1.5rem; text-align: center; }
.lock-card h1 { font-family: var(--font-write); margin: 0; font-size: 2.2rem; }
.lock-sub { letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-size: 0.75rem; }
.lock-sun { color: var(--coral); font-size: 1.6rem; }
.pin-dots { display: flex; justify-content: center; gap: 0.7rem; margin: 0.8rem 0; }
.pin-dots i {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--coral); display: block;
}
.pin-dots i.on { background: var(--coral); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 0.55rem; justify-content: center; }
.pin-pad button {
  height: 52px; border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--gold-line);
  font-size: 1.2rem; font-weight: 700;
}
.pin-muted { font-size: 0.78rem !important; color: var(--muted); }
.pin-error { color: var(--danger); min-height: 1.2em; font-size: 0.85rem; }

.scrim { position: fixed; inset: 0; background: rgba(27,54,93,0.35); z-index: 50; }
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-card {
  width: min(520px, 100%);
  max-height: 90dvh; overflow: auto;
  padding: 1.35rem 1.4rem;
}
.modal-card.wide { width: min(860px, 100%); }
.modal-card.slim { width: min(380px, 100%); }
.modal-card h2 { font-family: var(--font-write); margin: 0 0 0.3rem; }
.modal-card h3 { margin: 1.1rem 0 0.4rem; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.row { display: flex; gap: 0.45rem; flex-wrap: wrap; align-items: center; }
.input {
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--gold-line);
  background: var(--paper);
  width: 9rem;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 0.4rem; margin-top: 1.1rem; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.7rem;
  margin-top: 0.6rem;
}
.gallery-item {
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper);
  text-align: left;
}
.gallery-item img { width: 100%; height: 110px; object-fit: cover; display: block; }
.gallery-item figcaption, .gallery-item .cap { padding: 0.4rem 0.55rem; font-size: 0.75rem; color: var(--muted); }

.lightbox {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(12, 16, 22, 0.88);
  display: flex; align-items: center; justify-content: center;
}
.lightbox img { max-width: 92vw; max-height: 90dvh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.lightbox-x {
  position: absolute; top: 1rem; right: 1rem;
  color: #fff; font-size: 1.2rem; padding: 0.4rem 0.6rem;
}

.toasts {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 0.4rem;
  width: min(360px, calc(100% - 2rem));
}
.toast {
  background: var(--paper-2);
  border: 1px solid var(--gold-line);
  box-shadow: var(--shadow);
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  font-size: 0.88rem;
}
.toast.err { color: var(--danger); }
.toast.ok { color: var(--teal); }

.search-results {
  display: flex; flex-direction: column; gap: 0.45rem;
}
.search-hit {
  text-align: left; padding: 0.7rem 0.85rem;
  border: 1px solid var(--gold-line); border-radius: 12px; background: var(--paper-2);
}
.search-hit b { font-family: var(--font-write); display: block; }
.search-hit small { color: var(--muted); }


.todo-card {
  padding: 1.05rem 1.2rem 1.15rem;
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--gold) 10%, transparent), transparent 42px);
}
.todo-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.todo-title {
  margin: 0;
  font-family: var(--font-write);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.todo-caption {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  font-family: var(--font-write);
}
.todo-rolled {
  flex: none;
  display: inline-block;
  background: color-mix(in srgb, var(--teal) 16%, var(--paper-2));
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--teal) 28%, transparent);
  white-space: nowrap;
}
.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.45rem 0.1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 22%, transparent);
}
.todo-item:last-child { border-bottom: none; }
.todo-check {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 0.18rem;
  accent-color: var(--teal);
  cursor: pointer;
}
.todo-text {
  flex: 1;
  min-width: 0;
  font-family: var(--font-write);
  font-size: 1.05rem;
  line-height: 1.45;
  word-break: break-word;
  background: transparent;
  border: none;
  padding: 0.1rem 0.15rem;
  border-radius: 6px;
}
.todo-text:focus {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 28%, transparent);
  background: var(--paper);
}
.todo-item.done .todo-text {
  color: var(--muted);
  text-decoration: line-through;
}
.todo-del {
  flex: none;
  color: var(--muted);
  opacity: 0.45;
  padding: 0.15rem 0.4rem;
  font-size: 0.95rem;
  border-radius: 8px;
  line-height: 1;
}
.todo-del:hover { opacity: 1; color: var(--danger); background: color-mix(in srgb, var(--coral) 12%, transparent); }
.todo-empty {
  margin: 0.4rem 0 0.7rem;
  color: var(--muted);
  font-family: var(--font-write);
  font-style: italic;
  text-align: center;
  padding: 0.6rem 0.4rem;
}
.todo-add {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--gold-line);
}
.todo-add input {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: var(--paper);
  font-family: var(--font-write);
  font-size: 1.02rem;
}
.todo-add input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 22%, transparent);
}
.todo-add .btn-dictate {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--coral) 28%, transparent);
}

@media (max-width: 960px) {
  #btn-cal-mobile { display: inline-flex; }
  .shell { grid-template-columns: 1fr; padding: 0.75rem 0.75rem 5rem; }
  .sidebar {
    position: fixed; z-index: 55; top: var(--top); left: 0; bottom: 0;
    width: min(340px, 92vw); overflow: auto;
    padding: 0.75rem;
    background: var(--paper);
    border-right: 1px solid var(--gold-line);
    transform: translateX(-110%);
    transition: transform 0.22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .clock-digital { display: none; }
  .search-wrap { flex: 1; min-width: 0; }
  .day-title { font-size: 1.45rem; }
  .editor-card::before { left: 1.2rem; }
  .title-input, .body-input, .interim { padding-left: 0.9rem; }
  .brand-text em { display: none; }
  .topbar { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .weather-chip span:last-child { max-width: 4.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-actions .icon-btn { padding: 0.35rem 0.5rem; font-size: 0.72rem; }
  .todo-add { flex-wrap: wrap; }
  .todo-add input { flex: 1 1 100%; }
}

[hidden] { display: none !important; }
