:root {
  color-scheme: light;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  --canvas: #fbfbf8;
  --ink: #2b2536;
  --accent: #593085;
  --muted: #4e465b;
  --line: #e5dfea;
  --control-line: #8b7c9a;
  --highlight-ink: #30251e;
  --edge: #ffffffb8;
  --panel: #fff;
  --small-button: #e8d7f6;
  --button-ink: #49316c;
  --primary-ink: #fff;
  --focus: var(--accent);
  --deck-friends: #afd3eb;
  --deck-friends-icon: #78b2d8;
  --deck-friends-ink: #143954;
  --deck-personal: #f2d39a;
  --deck-personal-icon: #dfa74e;
  --deck-personal-ink: #522c08;
  --deck-relationships: #dfbce8;
  --deck-relationships-icon: #c88fd7;
  --deck-relationships-ink: #4d205c;
  --deck-family: #cee3d3;
  --deck-family-icon: #9ec6ab;
  --deck-family-ink: #214f34;
  --card-faith: #d9c7f1;
  --card-faith-art: #b69bdf;
  --card-saints: #efc1d0;
  --card-saints-art: #d88da8;
  --card-life: #b6ddcf;
  --card-life-art: #7dbdab;
  --deck-layer-1: #d9cbe9;
  --deck-layer-2: #c4addb;
  --shadow-soft: #44275a15;
  --shadow-raised: #3c255a29;
  --shadow-dialog: #27193938;
  --scrim: #2b203650;
  --scrim-soft: #2b203626;
  --danger: #a53a42;
  --danger-fill: #a53a42;
  --danger-ink: #fff;
  --tab-height: 3.45rem;
  --tab-bottom: max(.32rem, env(safe-area-inset-bottom));
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #1c1e20;
  --ink: #f5f0f8;
  --accent: #dbb8ff;
  --muted: #e0d8e5;
  --line: #4c4753;
  --control-line: #82788e;
  --edge: #f0def518;
  --panel: #2e2d34;
  --small-button: #54396c;
  --button-ink: #f0e1fb;
  --primary-ink: #2d1e43;
  --deck-friends: #255671;
  --deck-friends-icon: #337093;
  --deck-friends-ink: #e0f3ff;
  --deck-personal: #65461d;
  --deck-personal-icon: #88612a;
  --deck-personal-ink: #ffe8bc;
  --deck-relationships: #633e70;
  --deck-relationships-icon: #835395;
  --deck-relationships-ink: #f8e4ff;
  --deck-family: #315244;
  --deck-family-icon: #456e5b;
  --deck-family-ink: #d6f2e0;
  --card-faith: #533a73;
  --card-faith-art: #7457a4;
  --card-saints: #663b52;
  --card-saints-art: #8e5273;
  --card-life: #26554b;
  --card-life-art: #3d7565;
  --deck-layer-1: #59456e;
  --deck-layer-2: #463557;
  --shadow-soft: #130f1833;
  --shadow-raised: #140e1c46;
  --shadow-dialog: #140e2070;
  --scrim: #16121b82;
  --scrim-soft: #16121b4d;
  --danger: #f2a4a8;
  --danger-fill: #a53a42;
  --danger-ink: #fff;
}

:root[data-accent="ocean"] {
  --accent: #205a82;
  --small-button: #cce5f6;
  --button-ink: #163f5d;
}

:root[data-accent="amber"] {
  --accent: #dfa944;
  --small-button: #f9e8bd;
  --button-ink: #6a4914;
  --primary-ink: #332308;
  --focus: #87591b;
}

:root[data-accent="teal"] {
  --accent: #195d53;
  --small-button: #bfe3d7;
  --button-ink: #23584f;
}

:root[data-theme="dark"][data-accent="ocean"] {
  --accent: #a0d7fa;
  --small-button: #2a526c;
  --button-ink: #e0f3ff;
  --primary-ink: #162f42;
}

:root[data-theme="dark"][data-accent="amber"] {
  --accent: #ffd487;
  --small-button: #77592c;
  --button-ink: #ffedc4;
  --primary-ink: #332308;
  --focus: var(--accent);
}

:root[data-theme="dark"][data-accent="teal"] {
  --accent: #a0e8d5;
  --small-button: #28564a;
  --button-ink: #d0f3eb;
  --primary-ink: #17352e;
}

html, body, .game, button, input, textarea, [contenteditable="true"] {
  touch-action: pan-x pan-y;
  -webkit-tap-highlight-color: transparent;
}

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

.visually-hidden, .note-status:empty, #diary-backup-status:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

html { scroll-padding-block-end: calc(var(--tab-height) + var(--tab-bottom) + 1rem); }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--canvas);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Keep native text selection for editing and copying personal writing. */
:is(input, textarea, [contenteditable="true"], .entry-reader-body, #share-preview) {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.startup-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  background: var(--canvas);
}

.startup-screen img {
  display: block;
  width: clamp(6rem, 24vw, 9rem);
  height: auto;
}

.startup-screen:not([hidden]) ~ .game { visibility: hidden; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .startup-screen { background: #1c1e20; }
}

.game {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 clamp(1.1rem, 5vw, 3rem) calc(var(--tab-height) + var(--tab-bottom) + 1.5rem);
}

.game.is-playing { padding-bottom: 1.25rem; }
.game.has-field-keyboard { padding-bottom: calc(var(--field-keyboard-inset) + 4rem); }
.has-field-keyboard .tab-bar { visibility: hidden; }
.has-field-keyboard textarea:focus { max-height: max(3.5rem, calc(var(--field-viewport-height) - 4.5rem)); }
.has-field-keyboard .note-dialog[open] {
  position: fixed;
  inset: calc(var(--field-viewport-top) + .75rem) 0 auto;
  margin: 0 auto;
  max-height: max(3.5rem, calc(var(--field-viewport-height) - 4.5rem));
  overflow: auto;
}

.intro {
  text-align: center;
}

h1, h2 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
}

.intro h1, .intro h2 {
  max-width: none;
  font-size: clamp(2.25rem, 7.6vw, 4.1rem);
  line-height: 1.1;
  letter-spacing: -.03em;
}

.intro p {
  max-width: 29ch;
  margin: .75rem auto 0;
  color: var(--muted);
  line-height: 1.5;
}

.screen {
  max-width: 31rem;
  margin: 0 auto;
}

.home {
  padding: clamp(1.35rem, 4vh, 2.5rem) 0 1.25rem;
}

.home-intro {
  margin-bottom: 1.35rem;
}

.home-intro h1 {
  font-size: clamp(2.6rem, 9.8vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.home-intro p {
  margin: .55rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.deck-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: clamp(.6rem, 2.8vw, .9rem);
}

.deck-option, .welcome {
  --deck-paper: var(--deck-friends);
  --deck-icon-paper: var(--deck-friends-icon);
  --deck-ink: var(--deck-friends-ink);
}

[data-deck="personal"] {
  --deck-paper: var(--deck-personal);
  --deck-icon-paper: var(--deck-personal-icon);
  --deck-ink: var(--deck-personal-ink);
}

[data-deck="relationships"] {
  --deck-paper: var(--deck-relationships);
  --deck-icon-paper: var(--deck-relationships-icon);
  --deck-ink: var(--deck-relationships-ink);
}

[data-deck="family"] {
  --deck-paper: var(--deck-family);
  --deck-icon-paper: var(--deck-family-icon);
  --deck-ink: var(--deck-family-ink);
}

.deck-option {
  --tile-fill: #286486;
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: start;
  align-items: start;
  gap: .9rem;
  min-height: 7.8rem;
  padding: clamp(.65rem, 3vw, 1rem);
  border: 1px solid #ffffff36;
  border-radius: 1.2rem;
  background: var(--tile-fill);
  box-shadow: 0 4px 12px var(--shadow-soft);
  color: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.deck-option[data-deck="personal"] {
  --tile-fill: #b16022;
}

.deck-option[data-deck="relationships"] {
  --tile-fill: #7e4b8b;
}

.deck-option[data-deck="family"] {
  --tile-fill: #38684f;
}

.deck-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  aspect-ratio: 1;
  border-radius: 44% 56% 53% 47% / 53% 46% 54% 47%;
  background: #fff3;
  color: inherit;
  font-size: 1.2rem;
}

.deck-copy { display: grid; min-width: 0; gap: .22rem; overflow-wrap: anywhere; }

.deck-copy strong {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.12rem, 4.8vw, 1.65rem);
  line-height: 1.18;
  letter-spacing: -.015em;
  font-weight: 700;
}

.deck-copy span {
  font-size: .9375rem;
  line-height: 1.45;
}

.welcome {
  position: relative;
  display: grid;
  justify-items: center;
  gap: clamp(1.25rem, 4vh, 2.3rem);
  padding: clamp(4rem, 10vh, 5.5rem) 0 1rem;
}

#welcome { padding-block-start: clamp(3.6rem, 8vh, 4.6rem); }

.screen-back {
  position: absolute;
  top: .5rem;
  left: 0;
}

.welcome-art {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  width: clamp(6.5rem, 26vw, 9.2rem);
  aspect-ratio: 4 / 5;
  margin: .75rem 0;
  transform: rotate(-8deg);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--deck-paper);
  box-shadow: inset 0 1px 0 var(--edge), 1rem .55rem 0 var(--deck-layer-1), 1.8rem 1.02rem 0 var(--deck-layer-2);
}

.welcome-art > span {
  display: grid;
  place-items: center;
  width: 3rem;
  aspect-ratio: 1;
  border-radius: 50%;
  color: var(--deck-ink);
  background: var(--deck-icon-paper);
  font-size: 1.5rem;
}

.welcome-actions {
  display: grid;
  width: min(100%, 22rem);
  gap: .6rem;
}

.round-levels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
}

.round-level {
  display: grid;
  align-content: start;
  gap: .3rem;
  padding: .75rem;
  text-align: left;
}

.round-level span { font-size: .875rem; font-weight: 400; line-height: 1.45; }

.personal-replay {
  display: grid;
  gap: .65rem;
  text-align: center;
}

.round-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  padding: .65rem 0 .85rem;
  column-gap: .75rem;
  color: var(--muted);
}

.progress-label {
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}

.bookmark-button {
  display: grid;
  place-items: center;
  width: 2.75rem;
  padding: 0;
}

.bookmark-icon {
  position: relative;
  width: .9rem;
  height: 1.1rem;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 69%, 0 100%);
}

.bookmark-icon::after {
  position: absolute;
  inset: 2px 2px 3px;
  background: var(--small-button);
  clip-path: inherit;
  content: '';
}

.bookmark-button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--primary-ink);
}

.bookmark-button[aria-pressed="true"] .bookmark-icon::after { display: none; }

progress {
  grid-column: 1 / -1;
  width: 100%;
  height: .3rem;
  accent-color: var(--accent);
  border: 0;
  border-radius: 1rem;
  overflow: hidden;
}

progress::-webkit-progress-bar { background: var(--deck-layer-1); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }

.deck {
  --card-radius: 1.5rem;
  position: relative;
  isolation: isolate;
  margin: 0 .38rem 1.65rem;
}

.deck::before, .deck::after {
  position: absolute;
  z-index: -1;
  content: '';
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
}

.deck::before { inset: .5rem .9rem -.7rem; background: var(--deck-layer-2); }
.deck::after { inset: .25rem .44rem -.36rem; background: var(--deck-layer-1); }

.card-stage {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  border-radius: var(--card-radius);
  overflow: hidden;
}

.card {
  --paper: var(--card-faith);
  --card-art-accent: var(--card-faith-art);
  --drag: 0px;
  --tilt: 0deg;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(20.5rem, 45vh, 24.5rem);
  padding: clamp(1.35rem, 5.7vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 1px 0 var(--edge);
  touch-action: pan-y;
  transform: translateX(var(--drag)) rotate(var(--tilt));
  transition: transform 180ms ease, background-color 220ms ease;
}

.card[data-tone="scripture"] { --paper: var(--deck-friends); --card-art-accent: var(--deck-friends-icon); }
.card[data-tone="saints"] { --paper: var(--card-saints); --card-art-accent: var(--card-saints-art); }
.card[data-tone="life"] { --paper: var(--card-life); --card-art-accent: var(--card-life-art); }
.card.is-dragging { transition: none; cursor: grabbing; }
.card-under-swipe { transition: none; }

.card-leaving {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-height: 0;
  pointer-events: none;
  transition: none;
}

.card-swipe-fallback { animation: card-out var(--swipe-duration) ease-out both; }
.card-fade-fallback { animation: card-fade var(--swipe-duration) ease-out both; }

@keyframes card-out {
  from { transform: var(--swipe-start); }
  to { transform: var(--swipe-exit); }
}

@keyframes card-fade {
  from { opacity: 1; }
  to { opacity: 0; }
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  letter-spacing: .07em;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.category {
  padding: .35rem .65rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
}

.card-content {
  display: flex;
  align-items: center;
  min-height: 13.5rem;
  padding: 1.1rem 0;
}

h2 {
  max-width: 13em;
  font-size: clamp(1.95rem, 6.9vw, 3.05rem);
  line-height: 1.15;
  letter-spacing: -.025em;
  text-wrap: pretty;
}

.card-content h2 {
  max-width: 24ch;
  font-size: clamp(1.6rem, 6.4vw, 2.7rem);
  line-height: 1.45;
  letter-spacing: .005em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.card-content h2:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.large-prompt-text .card-content h2 { font-size: clamp(1.95rem, 7.6vw, 3.3rem); }

.card-footer {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 650;
  letter-spacing: .19em;
}

.card-art {
  position: absolute;
  z-index: -1;
  right: -2.15rem;
  bottom: -3.4rem;
  display: grid;
  width: 13rem;
  aspect-ratio: 1;
  place-items: center;
  pointer-events: none;
}

.card-art::before, .card-art::after {
  position: absolute;
  z-index: -1;
  width: 64%;
  height: 35%;
  border-radius: 80% 8% 80% 8%;
  background: var(--card-art-accent);
  opacity: .55;
  content: '';
}

.card-art::before { right: 24%; bottom: 46%; transform: rotate(34deg); }
.card-art::after { right: 10%; bottom: 30%; transform: rotate(-26deg) scale(.88); }

.card-art span {
  display: grid;
  width: 3.15rem;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: var(--card-art-accent);
  color: var(--button-ink);
  font-size: 1.45rem;
}

.controls { display: grid; grid-template-columns: 1fr 1.65fr; gap: .65rem; }
#write-reflection { grid-column: 1 / -1; justify-self: stretch; }
.reflection-status { flex: none; margin: 0; color: var(--muted); font-size: .875rem; text-align: center; }
.reflection-status:not(:empty) { margin-top: .4rem; }

.button {
  min-height: 3.25rem;
  padding: .7rem 1.1rem;
  border: 1px solid transparent;
  border-radius: .8rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button {
  transition: scale 120ms ease-out, transform 140ms ease-out, filter 140ms ease-out;
}

button:enabled:active {
  scale: .975;
  filter: brightness(.94);
  transition-duration: 55ms;
}

.button-back {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: inset 0 1px 0 var(--edge);
}

.button-next {
  background: var(--accent);
  color: var(--primary-ink);
  border-radius: .9rem;
  box-shadow: inset 0 1px 0 var(--edge), 0 3px 8px var(--shadow-raised);
}
.button-small {
  justify-self: start;
  min-height: 2.75rem;
  padding: .35rem .8rem;
  border-color: var(--control-line);
  border-radius: .65rem;
  background: var(--small-button);
  color: var(--button-ink);
  font-size: .875rem;
  box-shadow: inset 0 1px 0 var(--edge), 0 1px 3px var(--shadow-soft);
}
.button:disabled { opacity: .48; cursor: default; }
.button:focus-visible, .deck-option:focus-visible, .tab-button:focus-visible, .settings-row:focus-visible,
input:focus-visible, select:focus-visible, .note-body:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

@media (hover: hover) {
  .deck-option:hover { transform: translateY(-2px); }
  .button-small:hover, .button-back:hover:not(:disabled), .button-next:hover { filter: brightness(.96); }
}

.tab-bar {
  position: fixed;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  padding: .3rem env(safe-area-inset-right) var(--tab-bottom) env(safe-area-inset-left);
  border-top: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 -.35rem 1rem var(--shadow-soft);
}

.tab-row {
  --tab-count: 4;
  --tab-gap: clamp(.45rem, 2.5vw, 1.1rem);
  --tab-inset: .7rem;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--tab-count), minmax(0, 1fr));
  gap: var(--tab-gap);
  width: min(100%, 31rem);
  min-height: var(--tab-height);
  margin: 0 auto;
  padding: 0 var(--tab-inset);
}

.tab-button {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .25rem;
  border: 0;
  border-radius: .85rem;
  background: transparent;
  color: var(--muted);
  font: 650 .8125rem/1.2 'Segoe UI', system-ui, sans-serif;
  cursor: pointer;
}

.tab-button:enabled:active, .preference-control button:enabled:active {
  scale: none;
  filter: none;
}

.tab-button[aria-current="page"] {
  color: var(--ink);
}

.tab-button .tab-icon { width: 1.375rem; height: 1.375rem; transition: color 140ms ease-out; }
.tab-button[aria-current="page"] .tab-icon { color: var(--button-ink); fill: currentColor; }
.tab-button[aria-current="page"] .tab-icon-detail { stroke: var(--panel); }

.tab-button + .tab-button::before {
  position: absolute;
  top: 26%;
  bottom: 26%;
  left: calc(-.5 * var(--tab-gap));
  width: 1px;
  background: var(--line);
  content: '';
}

.tab-icon {
  display: block;
  position: relative;
  width: 1.2rem;
  height: 1.2rem;
}

.home-icon {
  background: currentColor;
  clip-path: polygon(50% 2%, 100% 45%, 88% 45%, 88% 95%, 59% 95%, 59% 65%, 41% 65%, 41% 95%, 12% 95%, 12% 45%, 0 45%);
}

.today-icon {
  flex: none;
  height: 1.05rem;
  margin-top: .15rem;
  border: 1.5px solid currentColor;
  border-radius: .22rem;
}

.today-icon::before {
  position: absolute;
  top: -.23rem;
  left: .22rem;
  width: .11rem;
  height: .3rem;
  border-radius: 1rem;
  background: currentColor;
  box-shadow: .53rem 0 currentColor;
  content: '';
}

.today-icon::after {
  position: absolute;
  top: .25rem;
  right: 0;
  left: 0;
  border-top: 1px solid currentColor;
  content: '';
}

.profile-icon::before, .profile-icon::after {
  position: absolute;
  left: 50%;
  background: currentColor;
  transform: translateX(-50%);
  content: '';
}

.profile-icon::before {
  top: .03rem;
  width: .48rem;
  height: .48rem;
  border-radius: 50%;
}

.profile-icon::after {
  bottom: .05rem;
  width: 1.06rem;
  height: .52rem;
  border-radius: 1rem 1rem .23rem .23rem;
}

.profile-avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary-ink);
  font: 700 .78rem/1 Georgia, serif;
}

.account {
  display: grid;
  justify-items: start;
  gap: 1.2rem;
  width: 100%;
  padding: 1rem 0 2rem;
}

.account-heading h1, .diary h1 {
  margin-top: .35rem;
  font-size: clamp(2.35rem, 9vw, 3.6rem);
  line-height: 1.09;
  letter-spacing: -.025em;
}

.account-heading p {
  margin: .5rem 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.account-panel {
  display: grid;
  width: 100%;
  gap: .7rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
}

.account-panel label { font-weight: 650; }

.profile-identity {
  display: grid;
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
}

.profile-identity .profile-avatar-large { width: 3rem; height: 3rem; font-size: 1.4rem; }
.profile-identity h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.75rem, 7vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -.02em;
}

.profile-name-row { display: flex; align-items: center; gap: .375rem; min-width: 0; }
.profile-name-row h1 { min-width: 0; }

.profile-edit-name {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--button-ink);
}

.profile-edit-name::before {
  grid-area: 1 / 1;
  width: 1.875rem;
  aspect-ratio: 1;
  border: 1px solid var(--control-line);
  border-radius: .5rem;
  background: var(--small-button);
  content: '';
}

.profile-edit-name svg { grid-area: 1 / 1; position: relative; }

.profile-edit-name[aria-expanded="false"] .profile-edit-close,
.profile-edit-name[aria-expanded="true"] .profile-edit-pencil { display: none; }

.profile-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}

.settings-group-title {
  max-width: none;
  font: 700 1.1rem/1.3 'Segoe UI', system-ui, sans-serif;
}

.settings-row {
  display: grid;
  justify-items: start;
  gap: .2rem;
  width: 100%;
  min-height: 2.75rem;
  padding: .7rem 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.settings-row:active { color: var(--button-ink); }
.settings-version { justify-self: center; }

.reflection-privacy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  min-height: 2.75rem;
  cursor: pointer;
}

.reflection-privacy input {
  flex: none;
  inline-size: 1.2rem;
  block-size: 1.2rem;
  margin: 0;
  accent-color: var(--accent);
}

.settings-detail {
  padding-top: .35rem;
  border-top: 1px solid var(--line);
}

.settings-detail > :not(summary) { margin-top: .65rem; }

.account-panel summary {
  min-height: 2.75rem;
  align-content: center;
  font-weight: 650;
  cursor: pointer;
}

.settings-detail textarea {
  display: block;
  width: 100%;
  border: 1px solid var(--control-line);
  border-radius: .65rem;
  padding: .55rem .7rem;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

.saved-prompt-list {
  display: grid;
  gap: .6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.saved-prompt-list li { border-top: 1px solid var(--line); padding-block: .7rem .25rem; }
.saved-prompt-list li p { margin: 0 0 .45rem; line-height: 1.5; overflow-wrap: anywhere; }

.saved-prompt-actions { display: flex; flex-wrap: wrap; gap: .45rem; }

.today-prompt { gap: 1rem; }

.today-prompt h2 {
  max-width: 33ch;
  font-size: clamp(1.25rem, 1.075rem + .85vw, 1.6rem);
  line-height: 1.45;
  letter-spacing: .005em;
  overflow-wrap: anywhere;
}

.large-prompt-text .today-prompt h2 { font-size: clamp(1.5rem, 1.2rem + 1.55vw, 2.15rem); }

.streak-card {
  display: grid;
  width: 100%;
  gap: .85rem;
  padding: clamp(.85rem, 4vw, 1.35rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--small-button);
  background: radial-gradient(ellipse at 94% 0, var(--small-button), color-mix(in srgb, var(--small-button) 48%, var(--panel)) 72%);
  color: var(--button-ink);
}

.streak-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
}

.streak-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 6vw, 1.8rem);
  line-height: 1.18;
  letter-spacing: -.015em;
}

.streak-emblem {
  display: grid;
  flex: none;
  place-items: center;
  width: clamp(2.25rem, 11vw, 3rem);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
}

.streak-emblem svg { width: 59%; }

.streak-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .45rem;
  margin: 0;
}

.streak-metrics > div {
  display: grid;
  align-content: start;
  gap: .28rem;
  min-width: 0;
  padding: .65rem .7rem;
  border-radius: .75rem;
  background: var(--panel);
  overflow-wrap: anywhere;
}

.streak-metrics dt { color: var(--muted); font-size: .8rem; font-weight: 650; }
.streak-metrics dd {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.375rem, 5.6vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -.01em;
}

.streak-status { margin: 0; font-size: .9rem; line-height: 1.5; }
.streak-details { border-top: 1px solid var(--line); padding-top: .55rem; }
.streak-details summary {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 2.75rem;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.streak-details summary::-webkit-details-marker { display: none; }
.streak-details summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: .35rem; }
#streak-milestone-count { margin-inline-start: auto; font-weight: 500; }
.streak-details[open] .settings-chevron { rotate: 90deg; }
#streak-milestone { margin: .2rem 0 .5rem; font-size: .8rem; }

.streak-milestones {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: 0 0 .25rem;
  padding: 0;
  list-style: none;
}

.streak-milestones li {
  padding: .3rem .55rem;
  border-radius: .45rem;
  background: var(--panel);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 650;
}

.streak-milestones li[data-earned="true"] { background: var(--button-ink); color: var(--panel); }

.history-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.history-filters label { display: grid; gap: .3rem; min-width: 0; }
.today-history li { display: flex; align-items: center; gap: .45rem; padding-block: .5rem 0; }
.today-history .reflection-shortcut { flex: 1; min-width: 0; }
.today-history time { margin: 0; }
.today-history .account-note { display: block; margin-top: .2rem; }
.history-delete { flex: none; }

.username-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}

.username-row input, .preference-control select, .preference-control button, .diary-sort select, .diary-search input, .note-form input, .note-form select, .folder-form input {
  min-width: 0;
  min-height: 2.75rem;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
}

.preference-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 56%);
  align-items: center;
  gap: .65rem;
}

.preference-label { font-weight: 650; }

.preference-control { position: relative; }

.preference-control::after {
  position: absolute;
  top: 50%;
  right: .8rem;
  width: .42rem;
  height: .42rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
  content: '';
}

.preference-control select, .preference-control button {
  appearance: none;
  width: 100%;
  height: 2.75rem;
  padding-inline: .65rem 1.55rem;
  font-size: .9375rem;
  cursor: pointer;
}

.preference-control button {
  display: flex;
  align-items: center;
  gap: .45rem;
  text-align: left;
}

#accent-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preference-control :focus-visible, .accent-option:has(:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

.accent-options {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .25rem;
}

.accent-options .accent-option {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: .3rem;
  min-height: 3.2rem;
  padding: .35rem .12rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.accent-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.accent-option:has(:checked) { border-color: var(--focus); background: var(--small-button); color: var(--button-ink); }
.accent-swatch { flex: none; width: 1.2rem; height: 1.2rem; border: 1px solid #16122055; border-radius: 50%; background: var(--swatch); }
.preference-control .accent-swatch { width: .8rem; height: .8rem; }
[data-swatch="violet"] { --swatch: #9064bf; }
[data-swatch="ocean"] { --swatch: #397fae; }
[data-swatch="amber"] { --swatch: #e4ae47; }
[data-swatch="teal"] { --swatch: #338e7d; }

.username-row input { flex: 1; width: 100%; }
.username-row .button { min-height: 2.75rem; }
.username-row input::placeholder { color: var(--muted); }

.account-note {
  margin: 0;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.5;
}

.account-settings {
  display: grid;
  place-items: center;
  align-self: start;
  width: 2.75rem;
  padding-inline: 0;
}

.reflection-shortcut {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  width: 100%;
  text-align: left;
}

.reflection-shortcut strong, .reflection-shortcut time { display: block; }
.reflection-shortcut strong { overflow-wrap: anywhere; }
.reflection-shortcut time { margin-top: .2rem; }

.settings-gear {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
}

.settings-chevron {
  width: .45rem;
  height: .45rem;
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}

.diary {
  display: grid;
  width: 100%;
  gap: .9rem;
  padding: 1.35rem 0 1rem;
}

.diary > .button-small { justify-self: start; }

.diary-heading, .diary-sort, .folder-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
}

.diary-heading .button, .diary-sort select { min-height: 2.75rem; }
.diary-heading h1 { min-width: 0; overflow-wrap: anywhere; }
.diary-heading .button { flex: none; }
.diary-sort { font-size: .875rem; color: var(--muted); }
.diary-empty p { margin: 0; color: var(--muted); }
.diary-search { display: grid; gap: .35rem; }
.diary-search label { font-weight: 650; }
.diary-search input { width: 100%; }
#today-history-search-label, #today-history-search-status { margin-block-end: .75rem; }
.entry-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.entry-actions p { flex-basis: 100%; }
#send-feedback { display: inline-flex; align-items: center; text-decoration: none; }
.entry-reader blockquote {
  margin: 0;
  padding-inline-start: .7rem;
  border-inline-start: 2px solid var(--control-line);
  color: var(--muted);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
  line-height: 1.5;
}
.entry-reader-body, .entry-reader blockquote { overflow-wrap: anywhere; }
.entry-reader-body { white-space: pre-wrap; line-height: 1.55; }
.entry-reader-body:empty { display: none; }
.entry-reader .reflection-draft { width: 100%; }
.draft-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem; }
.draft-row .reflection-draft { width: 100%; }
.reader-search-match { background: var(--small-button); color: var(--button-ink); text-decoration: underline; }

.diary-folders { display: grid; gap: .6rem; }
.folder-heading h2, .unfiled-title { font-size: 1.45rem; letter-spacing: -.015em; }
.folder-form-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.folder-form-actions .button { min-height: 2.75rem; }

.folder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: .25rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--panel);
}

.folder-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  width: 100%;
  border: 0;
  border-radius: .85rem;
  box-shadow: none;
  text-align: left;
  overflow-wrap: anywhere;
}

.folder-icon {
  position: relative;
  width: 1.2rem;
  height: .825rem;
  margin-top: .16rem;
  border: 1.5px solid currentColor;
  border-radius: .13rem;
  color: var(--accent);
}

.folder-icon::before {
  position: absolute;
  bottom: 100%;
  left: -1px;
  width: .52rem;
  height: .25rem;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: .12rem .19rem 0 0;
  content: '';
}

.diary-list {
  display: grid;
  gap: .6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reflection-draft {
  display: grid;
  gap: .2rem;
  width: 100%;
  text-align: start;
  overflow-wrap: anywhere;
}

.note-row {
  --note-action-width: min(52%, 11rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0px;
  min-height: 5.9rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--panel);
  transition: grid-template-columns 210ms cubic-bezier(.22, .7, .25, 1);
}

.note-row.is-open { grid-template-columns: minmax(0, 1fr) var(--note-action-width); }

.note-surface {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: .25rem;
  background: var(--panel);
  touch-action: pan-y;
}

.note-list-item {
  display: grid;
  gap: .25rem;
  width: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
  overflow-wrap: anywhere;
  transition: padding-inline-start 210ms ease-out, filter 140ms ease-out;
}

.note-row.is-open .note-list-item { padding-inline-start: .75rem; padding-inline-end: .5rem; }
.note-row.is-open .note-list-item strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.note-row.is-open .note-menu { display: none; }

.note-menu {
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin-right: .4rem;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
}

.folder-list-item:focus-visible, .note-list-item:focus-visible, .note-menu:focus-visible,
.note-actions .button:focus-visible { outline-offset: -4px; }

.note-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(2.75rem, 1fr));
  gap: .15rem;
  padding: .16rem;
  overflow: hidden;
  visibility: hidden;
  background: var(--canvas);
  transition: visibility 0ms linear 210ms;
}

.note-row.is-open .note-actions { visibility: visible; transition-delay: 0ms; }

.note-actions .button {
  display: grid;
  place-items: center;
  min-height: 2.75rem;
  min-width: 0;
  padding: 0 .1rem;
  border-radius: .45rem;
  font-size: .8125rem;
  white-space: nowrap;
}

.note-delete, .note-dialog-buttons .button-danger { background: var(--danger-fill); color: var(--danger-ink); }
.note-delete:focus-visible { outline-color: var(--danger-ink); }
.note-cancel, .note-rename, .note-move { background: var(--small-button); color: var(--button-ink); }

.note-dialog {
  width: min(26rem, calc(100% - 2rem));
  max-width: none;
  margin: min(14vh, 6rem) auto auto;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 .9rem 2.6rem var(--shadow-dialog);
}

.note-context {
  position: fixed;
  inset: auto;
  top: var(--context-top, 0px);
  left: var(--context-left, 0px);
  width: min(15rem, calc(100vw - 1.5rem));
  max-width: none;
  max-height: var(--context-max-height, calc(100dvh - 1.5rem));
  margin: 0;
  padding: .32rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 .55rem 1.65rem var(--shadow-dialog);
}

.note-context::backdrop { background: var(--scrim-soft); }
.note-context-list { display: grid; }

.note-context-item {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  min-height: 2.75rem;
  padding: .35rem .7rem;
  border: 0;
  border-radius: .62rem;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 600;
}

.note-context-item:focus-visible { outline-offset: -2px; }
.note-context-item .folder-icon { color: currentColor; }
.note-context-delete { color: var(--danger); }
.note-context-cancel { color: var(--muted); border-top: 1px solid var(--line); border-radius: 0 0 .62rem .62rem; }

.context-pencil {
  position: relative;
  width: .45rem;
  height: .93rem;
  margin-left: .36rem;
  border: 1.4px solid currentColor;
  border-radius: .13rem .13rem .24rem .24rem;
  transform: rotate(38deg);
}

.context-close { font-size: 1.2rem; line-height: 1; }

@media (hover: hover) {
  .note-context-item:hover { background: var(--small-button); }
}

.note-dialog::backdrop { background: var(--scrim); }
.note-dialog form, .note-dialog-field { display: grid; gap: .75rem; }
.note-dialog h2 { font-size: 1.8rem; }
.share-dialog[open] { display: grid; gap: .75rem; }
.share-question { display: flex; align-items: center; gap: .5rem; min-height: 2.75rem; }
.share-question input { accent-color: var(--accent); }
.share-dialog pre {
  max-height: 35vh;
  margin: 0;
  padding: .65rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: .55rem;
  color: var(--ink);
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.note-dialog-field input, .note-dialog-field select {
  width: 100%;
  min-height: 2.75rem;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
}
.note-dialog-buttons { display: flex; justify-content: flex-end; gap: .55rem; }
.note-dialog-buttons .button { min-height: 2.75rem; }

.bin-icon {
  position: relative;
  width: .88rem;
  height: .88rem;
  margin-top: .26rem;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 .17rem .17rem;
}

.bin-icon::before, .bin-icon::after {
  position: absolute;
  left: 50%;
  background: currentColor;
  transform: translateX(-50%);
  content: '';
}

.bin-icon::before { top: -.18rem; width: 1.08rem; height: 2px; }
.bin-icon::after { top: -.34rem; width: .4rem; height: 2px; border-radius: 2px 2px 0 0; }

.note-list-item time, .note-form label span {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 400;
}

.note-form input, .note-form select, .folder-form input { display: block; width: 100%; }
.note-form input::placeholder { color: var(--muted); }
.note-details, .editor-heading { display: grid; gap: .65rem; }
.note-workspace { display: contents; }
.note-details { grid-template-columns: minmax(0, 1fr); }

.note-prompt {
  margin: 0;
  padding: .2rem 0 .4rem;
  overflow-wrap: anywhere;
}

.note-prompt figcaption { color: var(--muted); font-size: .8125rem; font-weight: 650; }
.note-prompt blockquote {
  max-width: 37ch;
  margin: .25rem 0 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.2rem;
  line-height: 1.48;
  letter-spacing: .005em;
  text-wrap: pretty;
}

.is-reflection .editor-heading h1 { font-size: 1.95rem; letter-spacing: -.02em; }
.is-reflection .note-form { padding: 0; border: 0; background: transparent; }
.is-reflection .note-body { min-height: clamp(7.5rem, 18vh, 11rem); }
.is-reflection .note-body:focus-visible { caret-color: var(--accent); }

.reflection-details {
  padding-inline: .75rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--panel);
}

.reflection-details summary {
  min-height: 2.75rem;
  align-content: center;
  font-weight: 650;
  cursor: pointer;
}

.reflection-details[open] { padding-bottom: .75rem; }

.note-details input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  max-width: 100%;
}

.note-details input[type="date"]::-webkit-date-and-time-value { min-width: 0; }

.editor-heading > .button { justify-self: start; }
.editor-back { display: inline-flex; align-items: center; gap: .4rem; }
.editor-back-arrow { font-size: 1.15rem; line-height: 1; }
.editor-done { display: none; }
.note-field { border: 1px solid var(--line); border-radius: .75rem; background: var(--canvas); }

.format-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .45rem .55rem;
  border-bottom: 1px solid var(--line);
}

.format-button { width: 2.75rem; padding-inline: 0; }
.format-button[aria-pressed="true"] { background: var(--accent); color: var(--primary-ink); }
.format-button i { font: italic 700 1.13rem/1 Georgia, 'Times New Roman', serif; }

.highlight-toggle {
  display: inline-grid;
  place-items: center;
}

.highlight-toggle[aria-expanded="true"] { border-color: var(--focus); }

.highlight-pen {
  position: relative;
  width: 1.15rem;
  height: 1.15rem;
}

.highlight-pen::before {
  position: absolute;
  top: 0;
  left: .39rem;
  width: .42rem;
  height: .94rem;
  border: 1px solid currentColor;
  border-radius: .1rem .1rem .12rem .12rem;
  background: linear-gradient(transparent 66%, currentColor 66% 78%, transparent 78%);
  transform: rotate(38deg);
  content: '';
}

.highlight-pen::after {
  position: absolute;
  right: 0;
  bottom: -.04rem;
  left: 0;
  height: .1rem;
  border-radius: .1rem;
  background: var(--highlight, currentColor);
  content: '';
}

.highlight-options { display: flex; flex-basis: 100%; gap: .15rem; align-items: center; }

.highlight-button {
  display: grid;
  place-items: center;
  width: 2.75rem;
  padding: .15rem;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.highlight-button[aria-pressed="true"] { border-color: var(--accent); background: var(--panel); }
.highlight-button span {
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid #22332955;
  border-radius: 50%;
  background: var(--highlight);
}

.highlight-button[aria-pressed="true"] span::after {
  width: .55rem;
  height: .3rem;
  border: solid var(--highlight-ink);
  border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg);
  content: '';
}
[data-format="blue"], [data-note-highlight="blue"], [data-active-highlight="blue"] { --highlight: #75a9e0; }
[data-format="green"], [data-note-highlight="green"], [data-active-highlight="green"] { --highlight: #82b86d; }
[data-format="red"], [data-note-highlight="red"], [data-active-highlight="red"] { --highlight: #df8a86; }
[data-format="orange"], [data-note-highlight="orange"], [data-active-highlight="orange"] { --highlight: #efa05b; }

.note-body {
  min-height: 11rem;
  padding: .75rem;
  font-size: 1rem;
  line-height: 1.55;
  white-space: pre-wrap;
  text-align: start;
  overflow-wrap: anywhere;
}

:is(.note-body, .entry-reader-body) [data-note-bold] { font-weight: 700; }
:is(.note-body, .entry-reader-body) [data-note-italic] { font-style: italic; }
:is(.note-body, .entry-reader-body) [data-note-underline] { text-decoration: underline; text-underline-offset: .12em; }
:is(.note-body, .entry-reader-body) [data-note-highlight] { background: var(--highlight); color: var(--highlight-ink); }
.note-body:empty::before { color: var(--muted); content: attr(data-placeholder); pointer-events: none; }
.note-save { width: 100%; }
.note-status { color: var(--danger); }

.note-conflict {
  display: grid;
  gap: .55rem;
  padding: .75rem;
  border: 1px solid var(--control-line);
  border-radius: .65rem;
  overflow-wrap: anywhere;
}

.note-conflict p { margin: 0; }
.note-conflict summary { cursor: pointer; }
#note-conflict-preview { max-height: 8rem; overflow: auto; white-space: pre-wrap; }

@media (max-width: 42rem) {
  .game {
    --page-left: max(1rem, env(safe-area-inset-left));
    --page-right: max(1rem, env(safe-area-inset-right));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    padding: env(safe-area-inset-top) var(--page-right)
      calc(var(--tab-height) + var(--tab-bottom) + 1rem) var(--page-left);
  }

  .game.is-playing {
    height: 100vh;
    height: 100dvh;
    height: min(100dvh, var(--visual-viewport-height, 100dvh));
    min-height: 0;
    padding-bottom: calc(.75rem + env(safe-area-inset-bottom));
  }

  .round-header {
    flex: none;
    padding-block: .45rem .6rem;
    row-gap: .45rem;
  }

  .welcome {
    align-content: center;
    flex: 1;
    width: 100%;
    padding: 3.6rem 0 1.25rem;
  }

  #welcome { padding-block: 3.6rem 2rem; }

  .intro h1, .intro h2 {
    font-size: clamp(1.95rem, 8.8vw, 3.35rem);
  }

  .intro p {
    margin-top: .5rem;
    font-size: .9375rem;
  }

  .play-area {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-self: center;
    width: 100%;
    min-height: 0;
  }

  .deck {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    flex: 1;
    min-height: 0;
    margin-inline: 0;
    margin-bottom: 1.05rem;
  }

  .card {
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: clamp(1rem, 5vw, 1.65rem);
  }

  .card-content {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }

  .card-content h2 {
    margin-block: auto;
  }

  h2 {
    font-size: clamp(1.8rem, 8.5vw, 2.85rem);
    line-height: 1.15;
  }

  .card-art {
    right: -2.1rem;
    bottom: -3.3rem;
    width: 12rem;
  }

  .button {
    min-height: 3.25rem;
  }

  .button-small {
    min-height: 2.75rem;
  }

  .controls { flex: none; }

  .game.is-composing { min-height: var(--composer-document-height, 100svh); }
  .is-composing .tab-bar { visibility: hidden; }

  .is-composing #diary-edit {
    position: absolute;
    z-index: 4;
    top: var(--composer-top, 0px);
    right: 0;
    left: 0;
    height: var(--composer-height, 100dvh);
    container: diary-composer / size;
    grid-template-rows: auto minmax(0, 1fr);
    gap: .65rem;
    padding: max(.6rem, env(safe-area-inset-top)) var(--page-right) .6rem var(--page-left);
    background: var(--canvas);
  }

  .is-composing .editor-heading { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .4rem; }
  .is-composing .editor-heading h1 { margin: 0; font-size: 1.55rem; overflow-wrap: anywhere; }
  .is-composing .editor-back { width: 2.75rem; justify-content: center; padding-inline: 0; }
  .is-composing #diary-back-label, .is-composing .note-details, .is-composing .reflection-details, .is-composing .entry-actions { display: none; }
  .is-composing .editor-done { display: block; }
  .is-composing .note-form { display: flex; flex-direction: column; min-height: 0; padding: .45rem; }
  .is-composing .note-workspace {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: .6rem;
    min-height: 0;
    padding: .2rem;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
  .is-composing .note-workspace > * { flex-shrink: 0; }
  .is-composing .note-prompt { flex: none; padding-block: .15rem; }
  .is-composing .note-prompt blockquote { font-size: 1rem; }
  .is-composing .is-reflection .editor-heading h1 { font-size: 1.55rem; }
  .is-composing .note-field { display: flex; flex: 1 0 auto; flex-direction: column; }
  .is-composing .note-body { flex: 1 0 auto; min-height: 6rem; }
  .is-composing .note-body:focus-visible { outline-offset: -2px; }
  .is-composing .format-bar {
    position: sticky;
    z-index: 1;
    top: 0;
    flex: none;
    border-radius: .75rem .75rem 0 0;
    background: var(--canvas);
  }
  .is-composing .note-save { flex: none; min-height: 2.75rem; }
}

@container diary-composer (max-height: 20rem) {
  .is-composing .format-bar { position: static; }
}

@media (max-width: 42rem) and (min-height: 42rem) {
  #welcome { padding-block-end: clamp(3.5rem, 8vh, 5.5rem); }
  #welcome .welcome-art { width: clamp(6.75rem, 29vw, 9.2rem); }
}

@media (max-width: 42rem) and (max-height: 37.5rem) {
  .card-content { padding-block: .65rem; }
}

@media (max-width: 42rem) and (max-height: 30rem) {
  .game.is-playing { min-height: 100dvh; height: auto; }
  .is-playing .deck { flex: none; }
  .is-playing .card-content { min-height: 8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .card, button, .tab-button .tab-icon, .note-row, .note-actions { transition: none; }
  .deck-option:hover { transform: none; }
  button:enabled:active { scale: none; }

}
