:root {
  color: #1d1d1f;
  background: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --soft: #8f8f96;
  --line: #e7e7eb;
  --surface: rgba(255, 255, 255, 0.9);
  --glass: rgba(255, 255, 255, 0.72);
  --black: #111111;
  --accent: #d65738;
  --accent-dark: #873421;
  --accent-soft: #fdeee8;
  --warm: #fbfaf8;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.085);
  --soft-shadow: 0 8px 22px rgba(0, 0, 0, 0.055);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100%;
  min-height: 100%;
  background: #ffffff;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

button:active {
  transform: scale(0.985);
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(22px + env(safe-area-inset-top)) 20px calc(112px + env(safe-area-inset-bottom));
  position: relative;
}

@supports (min-height: 100dvh) {
  body,
  .app-shell {
    min-height: 100dvh;
  }
}

.topbar {
  min-height: 76px;
  margin-bottom: 12px;
  position: relative;
}

.topbar.with-back {
  padding-left: 46px;
}

.back-btn {
  position: absolute;
  left: 0;
  top: 8px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
}

.date-hero {
  min-height: 76px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.date-hero h1 {
  max-width: none;
  font-size: 26px;
  line-height: 1.14;
  word-break: keep-all;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--soft);
  font-size: 12px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 280px;
  font-size: 28px;
  font-weight: 520;
  line-height: 1.13;
}

h2 {
  font-size: 19px;
  font-weight: 520;
  line-height: 1.25;
}

h3 {
  font-size: 16px;
  font-weight: 520;
  line-height: 1.25;
}

.pill {
  position: absolute;
  right: 0;
  top: 12px;
  min-height: 31px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
}

.date-hero .pill {
  position: static;
  margin-top: 6px;
  white-space: nowrap;
}

.settings-dot {
  width: 38px;
  height: 38px;
  align-self: start;
  margin-top: 4px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(231, 231, 235, 0.92);
  background: rgba(255, 255, 255, 0.82);
  color: var(--soft);
  box-shadow: var(--soft-shadow);
}

.settings-dot .nav-icon {
  width: 18px;
  height: 18px;
}

.settings-dot span {
  position: absolute;
  right: -3px;
  top: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 600;
  border: 1px solid rgba(214, 87, 56, 0.14);
}

.panel {
  border: 1px solid rgba(231, 231, 235, 0.92);
  background: #ffffff;
  border-radius: 28px;
  box-shadow: var(--soft-shadow);
  padding: 20px;
  margin: 16px 0;
  overflow: hidden;
}

.panel.slim {
  padding: 18px 20px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
  line-height: 1.45;
}

.body {
  font-size: 15px;
  line-height: 1.45;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}

.segmented button {
  min-height: 30px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.segmented button.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: none;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  min-height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.reminder-list {
  margin-top: 18px;
}

.list-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.list-row:last-child {
  border-bottom: 0;
}

.list-cover {
  width: 42px;
  height: 52px;
  border-radius: 10px;
  display: block;
  overflow: hidden;
  background: var(--warm);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.list-cover img,
.list-cover .cover-placeholder {
  width: 100%;
  height: 100%;
}

.list-cover .cover-placeholder {
  border-radius: 10px;
  font-size: 8px;
}

.list-cover .cover-placeholder strong {
  max-width: 34px;
}

.icon-mark {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--warm);
  color: var(--ink);
  flex: 0 0 auto;
}

.icon-mark.dark {
  background: var(--black);
  color: #fff;
}

.icon-mark.subscription-icon {
  background: var(--warm);
  color: var(--ink);
}

.icon-mark.date-icon {
  background: var(--accent-soft);
  color: var(--ink);
}

.icon-mark.reading-icon {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.icon-mark.ai-icon {
  background: #111;
  color: #fff;
}

.icon-mark.accent {
  background:
    radial-gradient(circle at 48% 38%, rgba(255, 255, 255, 1) 0%, rgba(255, 250, 248, 0.96) 34%, rgba(253, 238, 232, 0.9) 68%, rgba(245, 202, 190, 0.78) 100%);
  color: var(--accent-dark);
  border: 1px solid rgba(214, 87, 56, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -8px 18px rgba(214, 87, 56, 0.08),
    0 8px 18px rgba(214, 87, 56, 0.12);
}

.row-title {
  display: block;
  font-size: 16px;
  font-weight: 520;
  line-height: 1.2;
}

.row-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.row-right {
  text-align: right;
  font-size: 13px;
  color: var(--ink);
}

.row-status {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.quick-section {
  min-height: 246px;
  margin-top: 34px;
  display: grid;
  align-content: end;
  justify-items: center;
  padding-bottom: 18px;
}

.inline-expand {
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.inline-expand.compact {
  width: auto;
  min-height: 28px;
  margin: 4px 0 0 auto;
  padding: 0 8px;
  display: block;
}

.sticky-note-zone {
  position: relative;
  margin-top: 16px;
  padding: 0 5px 8px;
}

.sticky-note-stack {
  position: relative;
  min-height: 126px;
  transition: min-height .22s ease;
}

.sticky-note-stack.open { min-height: 206px; }
.sticky-note-stack.actions-open { min-height: 168px; }

.sticky-note-layer {
  position: absolute;
  display: block;
  border-radius: 22px;
  pointer-events: none;
}

.sticky-note-layer.layer-one {
  inset: 9px 8px -3px 10px;
  background: #f5d7ce;
  transform: rotate(-1.6deg);
  box-shadow: 0 12px 24px rgba(125, 59, 39, .07);
}

.sticky-note-layer.layer-two {
  inset: 5px 5px 1px 8px;
  background: #f9e4dd;
  transform: rotate(1.2deg);
}

.sticky-note {
  position: absolute;
  inset: 0 0 5px;
  width: 100%;
  min-height: 121px;
  display: block;
  overflow: hidden;
  padding: 45px 38px 20px 22px;
  border: 1px solid rgba(219, 152, 130, .32);
  border-radius: 22px;
  background: #fbe5de;
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .74), 0 13px 26px rgba(154, 72, 47, .11);
  cursor: pointer;
  transition: height .22s ease;
}

.sticky-note.open { height: 200px; }

.sticky-note::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 17px;
  pointer-events: none;
}

.sticky-note-label {
  position: absolute;
  left: 22px;
  top: 21px;
  color: #9b5b47;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
}

.sticky-note-content {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 16px;
  font-weight: 570;
  line-height: 1.5;
}

.sticky-note.open .sticky-note-content {
  display: block;
  overflow: visible;
}

.sticky-note-count {
  position: absolute;
  right: 17px;
  bottom: 13px;
  color: #9a624f;
  font-size: 10px;
  font-weight: 700;
}

.sticky-note-edge {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 43px;
  height: 121px;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(170, 96, 71, .045));
  color: rgba(146, 80, 59, .52);
  font-size: 22px;
}

.sticky-note-actions {
  position: absolute;
  top: 127px;
  right: 8px;
  display: none;
  gap: 8px;
}

.sticky-note-stack.actions-open .sticky-note-actions { display: flex; }

.sticky-note-actions button {
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(225, 223, 221, .92);
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  color: var(--muted);
  font-size: 11px;
}

.sticky-note-actions button.delete { color: #9a5241; }

.sticky-note-hint {
  margin: 2px 7px 0;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.manual-reminder-row {
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--line);
}

.manual-reminder-main {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
}

.manual-reminder-main b { display: block; font-size: 15px; font-weight: 560; }
.manual-reminder-main small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.manual-reminder-actions {
  display: flex;
  gap: 8px;
  margin: 9px 0 0 54px;
}

.manual-reminder-actions button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(225, 223, 221, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 10px;
}

.manual-reminder-edit-actions {
  display: none;
  gap: 8px;
  margin: 8px 0 0 54px;
}

.manual-reminder-row.actions-open .manual-reminder-edit-actions { display: flex; }

.manual-reminder-edit-actions button {
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(225, 223, 221, .92);
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  color: var(--muted);
  font-size: 11px;
}

.manual-reminder-edit-actions button.delete { color: #9a5241; }

.new-record-btn {
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  gap: 0;
  padding: 0;
  position: relative;
  border-radius: 50%;
  background:
    radial-gradient(circle at 48% 38%, rgba(255, 255, 255, 1) 0%, rgba(255, 250, 248, 0.96) 34%, rgba(253, 238, 232, 0.9) 68%, rgba(245, 202, 190, 0.78) 100%);
  color: var(--accent-dark);
  border: 1px solid rgba(214, 87, 56, 0.16);
  text-align: center;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.94),
    inset 0 -10px 22px rgba(214, 87, 56, 0.08),
    0 20px 42px rgba(214, 87, 56, 0.13);
}

.new-record-btn .icon-mark {
  position: absolute;
  left: 50%;
  top: 30px;
  transform: translateX(-50%);
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.new-record-btn .nav-icon {
  width: 31px;
  height: 31px;
}

.new-record-btn > span:last-child {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  display: block;
  width: 100%;
  margin-top: 0;
  font-size: 12px;
  font-weight: 520;
}

.quick-panel {
  margin-top: 14px;
  padding: 18px;
  border-radius: 34px;
  border: 1px solid rgba(240, 238, 236, 0.96);
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.quick-panel.compact {
  padding: 10px 18px;
  border-radius: 28px;
}

.choice-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  min-height: 70px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.choice-row:last-child {
  border-bottom: 0;
}

.circle-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 40;
}

.circle-menu {
  position: fixed;
  left: var(--origin-x, 50vw);
  top: var(--origin-y, 62vh);
  width: 326px;
  height: 326px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.entry-circle,
.main-circle {
  position: absolute;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
  font-size: 12px;
  line-height: 1;
}

.entry-circle .icon-mark,
.main-circle .icon-mark,
.entry-glyph {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  display: grid;
  place-items: center;
}

.entry-circle .nav-icon,
.entry-glyph .nav-icon {
  width: 24px;
  height: 24px;
}

.entry-circle.ai {
  top: 17px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  border-color: rgba(0, 0, 0, 0.18);
}

.entry-circle.sub {
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
}

.entry-circle.date {
  bottom: 17px;
  left: 50%;
  transform: translateX(-50%);
}

.entry-circle.reading {
  right: 17px;
  top: 50%;
  transform: translateY(-50%);
}

.main-circle {
  left: 50%;
  top: 50%;
  width: 118px;
  height: 118px;
  transform: translate(-50%, -50%);
  position: absolute;
  background:
    radial-gradient(circle at 48% 38%, rgba(255, 255, 255, 1) 0%, rgba(255, 250, 248, 0.96) 34%, rgba(253, 238, 232, 0.9) 68%, rgba(245, 202, 190, 0.78) 100%);
  border: 1px solid rgba(214, 87, 56, 0.16);
  color: var(--accent-dark);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.94),
    inset 0 -10px 22px rgba(214, 87, 56, 0.08),
    0 20px 42px rgba(214, 87, 56, 0.13);
}

.main-circle .nav-icon {
  width: 31px;
  height: 31px;
}

.main-circle .entry-glyph {
  position: absolute;
  left: 50%;
  top: 30px;
  transform: translateX(-50%);
}

.main-circle span:last-child {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  width: 100%;
  margin-top: 0;
  font-size: 12px;
  font-weight: 520;
}

.quick-tile {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 86px;
  padding: 16px 18px;
  border-radius: 28px;
  background: #fff;
  border: 1px solid #ece8e2;
  text-align: left;
}

.quick-tile .row-title {
  font-size: 20px;
  line-height: 1.18;
}

.quick-tile .row-meta {
  margin-top: 8px;
  max-width: 190px;
  line-height: 1.45;
}

.quick-tile + .quick-tile {
  margin-top: 18px;
}

.quick-tile.accent {
  background: var(--accent-soft);
  border-color: #f7dfd5;
}

.quick-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 24px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 11px;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 8px 0 22px;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  margin-top: 6px;
  font-size: 32px;
  line-height: 1;
  font-weight: 430;
}

.divider {
  height: 1px;
  margin: 22px 0;
  background: var(--line);
}

.bars {
  display: grid;
  gap: 15px;
}

.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 54px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e5e5e9;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: #66666b;
  animation: grow 700ms ease both;
}

.bar-fill.accent {
  background: var(--accent);
}

@keyframes grow {
  from {
    width: 0;
  }
}

.form-panel {
  padding: 22px 20px;
}

.field {
  min-height: 58px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}

.field + .field {
  padding-top: 11px;
}

.field label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
}

.field-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
}

.field-value {
  min-width: 0;
  font-size: 17px;
  line-height: 1.25;
  word-break: break-word;
}

.field-right {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.select-field {
  width: 100%;
  min-height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.25;
  appearance: auto;
}

.edit-field {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.edit-field span,
.range-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.edit-field input,
.edit-field textarea,
.range-grid input {
  width: 100%;
  min-height: 38px;
  border: 0;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
}

.edit-field textarea {
  min-height: 132px;
  padding: 12px 0;
  line-height: 1.45;
  resize: vertical;
  font-family: inherit;
}

.ai-notice {
  border-color: rgba(214, 87, 56, 0.18);
  background:
    radial-gradient(circle at 10% 0%, rgba(253, 238, 232, 0.72), transparent 42%),
    rgba(255, 255, 255, 0.92);
}

.api-panel summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

.api-panel[open] summary {
  margin-bottom: 10px;
  color: var(--ink);
}

.voice-panel {
  min-height: 540px;
  display: grid;
  gap: 16px;
  justify-items: center;
  align-content: stretch;
  text-align: center;
}

.voice-orb {
  width: 104px;
  height: 104px;
  margin: 2px 0 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 43% 32%, rgba(79, 79, 82, 0.9), rgba(17, 17, 17, 0.98) 72%),
    #111;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 18px 38px rgba(0, 0, 0, 0.18);
  transform: translateZ(0);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.voice-orb.listening {
  color: var(--accent-dark);
  background:
    radial-gradient(circle at 48% 35%, #ffffff 0%, rgba(255, 250, 248, 0.98) 32%, rgba(253, 238, 232, 0.94) 72%, rgba(245, 202, 190, 0.82) 100%);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.96),
    0 18px 42px rgba(214, 87, 56, 0.18);
  animation: voicePulse 1.35s ease-in-out infinite;
}

.voice-icon {
  width: 38px;
  height: 38px;
}

.voice-hint {
  max-width: 286px;
  margin-top: 12px;
}

.voice-status {
  margin-top: 14px;
}

.voice-error {
  margin-top: 10px;
  color: var(--accent-dark);
}

.future-reminder-panel {
  margin-top: 4px;
}

.reminder-details-panel details {
  width: 100%;
}

.reminder-details-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  cursor: pointer;
  list-style: none;
}

.reminder-details-panel summary::-webkit-details-marker {
  display: none;
}

.reminder-details-panel summary > span:first-child {
  display: grid;
  gap: 4px;
}

.reminder-details-panel summary b {
  font-size: 17px;
}

.reminder-details-panel summary small {
  color: var(--muted);
  font-size: 12px;
}

.reminder-summary-meta {
  color: var(--accent-dark);
  font-size: 12px;
}

.reminder-details-content {
  margin-top: 13px;
  border-top: 1px solid rgba(226, 226, 229, 0.76);
}

.chat-thread {
  width: 100%;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  align-items: stretch;
  padding: 4px 0 2px;
}

.voice-dock {
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 10px;
  min-height: 150px;
  margin-top: auto;
  padding: 14px 0 2px;
  border-radius: 28px;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.9), rgba(255,255,255,.25) 50%, transparent 74%);
}

.voice-dock h2 { margin: 0; font-size: 16px; }

.chat-bubble {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 19px;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  word-break: break-word;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.055);
  animation: chatIn 0.22s ease both;
}

.chat-bubble.assistant {
  align-self: flex-start;
  border-bottom-left-radius: 7px;
  border: 1px solid rgba(226, 226, 229, 0.86);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
}

.chat-bubble.user {
  align-self: flex-end;
  border-bottom-right-radius: 7px;
  background: linear-gradient(135deg, #1d1d1f, #3a393c);
  color: #fff;
}

.chat-bubble.typing {
  width: 62px;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

.chat-bubble.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a8a8ad;
  animation: typingDot 1s ease-in-out infinite;
}

.chat-bubble.typing span:nth-child(2) {
  animation-delay: 0.14s;
}

.chat-bubble.typing span:nth-child(3) {
  animation-delay: 0.28s;
}

.ai-choice-panel {
  width: 100%;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(226, 226, 229, 0.86);
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
  animation: chatIn 0.22s ease both;
}

.transcript-box {
  width: 100%;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(214, 87, 56, 0.14);
  background: rgba(253, 238, 232, 0.36);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  word-break: break-word;
}

@keyframes voicePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.035);
  }
}

@keyframes chatIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes typingDot {
  0%, 70%, 100% {
    transform: translateY(0);
    opacity: 0.38;
  }
  35% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.computed-field p {
  margin: 0;
  min-height: 38px;
  display: flex;
  align-items: center;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.35;
  word-break: break-word;
}

.range-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.date-control,
.rating-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.date-control button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--warm);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.rule-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px auto;
  gap: 10px;
  align-items: center;
}

.rule-grid input {
  width: 100%;
  min-height: 38px;
  border: 0;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
}

.rule-grid .btn {
  min-width: 64px;
  padding: 0 14px;
}

.rule-chips {
  margin-top: 12px;
}

.rule-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rule-chip span {
  margin: 0;
  color: inherit;
  font-size: 13px;
}

.category-field {
  min-height: auto;
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 2px;
}

.category-chip {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.category-chip.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.category-chip.custom {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: rgba(214, 87, 56, 0.16);
}

.cost-block {
  padding-top: 22px;
}

.big-number {
  margin-top: 8px;
  font-size: 42px;
  line-height: 1;
  font-weight: 420;
}

.button-row {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.btn {
  min-height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.035);
}

.btn.primary {
  min-width: 104px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.accent {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.btn.danger {
  color: #9a2f1b;
  border-color: rgba(154, 47, 27, 0.2);
  background: #fff8f5;
}

.selectable-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.selectable-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.selectable-content {
  min-width: 0;
}

.hero-card {
  position: relative;
  min-height: 156px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 13px;
}

.cover-editor {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 16px;
}

.book-cover {
  width: 116px;
  aspect-ratio: 0.72;
  border-radius: 18px;
  overflow: hidden;
  background: #f4f4f5;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.14);
}

.book-cover.small-cover {
  width: 104px;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  align-content: space-between;
  padding: 16px 13px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 42%),
    linear-gradient(160deg, #171717 0%, #4a4a4d 52%, #d65738 53%, #fdeee8 73%, #f8f7f4 100%);
}

.cover-placeholder strong {
  font-size: 17px;
  line-height: 1.15;
  font-weight: 560;
  word-break: break-word;
}

.cover-placeholder span {
  width: 42px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.cover-actions {
  display: grid;
  gap: 10px;
}

.cover-upload,
.restore-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.cover-upload input,
.restore-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.reading-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: end;
}

.star-rating {
  display: flex;
  align-items: center;
  gap: 1px;
}

.star-rating button {
  width: 29px;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b8b8be;
  font-size: 27px;
  line-height: 1;
}

.star-rating button.active,
.star-text {
  color: var(--accent);
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.score-card {
  min-height: 70px;
  padding: 10px 6px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: center;
}

.score-card strong {
  display: block;
  margin-top: 6px;
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 520;
}

.chart {
  height: 160px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  align-items: end;
  padding-top: 18px;
}

.chart-col {
  display: grid;
  justify-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.chart-bar {
  width: 24px;
  height: var(--h);
  min-height: 28px;
  border-radius: 999px;
  background: #b8b8be;
  animation: rise 550ms ease both;
  animation-delay: var(--delay);
}

.chart-bar.active {
  background: var(--accent);
}

@keyframes rise {
  from {
    height: 0;
    opacity: 0.3;
  }
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 28px), 402px);
  height: 74px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 7px 8px;
  border-radius: 28px;
  border: 1px solid rgba(231, 231, 235, 0.92);
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 1),
    0 18px 46px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(30px) saturate(190%) contrast(112%) brightness(108%);
  -webkit-backdrop-filter: blur(30px) saturate(190%) contrast(112%) brightness(108%);
  z-index: 20;
}

.nav-btn {
  border-radius: 22px;
  background: transparent;
  color: var(--muted);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  font-size: 10px;
}

.nav-btn.active {
  background: rgba(253, 238, 232, 0.92);
  color: var(--accent);
  border: 1px solid rgba(214, 87, 56, 0.16);
}

.nav-icon {
  width: 20px;
  height: 20px;
}

/* Shared warm glass treatment for the record flow and core app surfaces. */
body {
  background:
    radial-gradient(circle at 50% -12%, rgba(255, 255, 255, 0.98) 0, rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, #fbfbfc 0%, #f5f4f3 54%, #efeeed 100%);
}

.panel {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1.2px 0 rgba(255, 255, 255, 0.96), 0 10px 26px rgba(0, 0, 0, 0.045);
}

.btn.primary {
  background: #1d1d1f;
  border-color: #1d1d1f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 18px rgba(0, 0, 0, 0.12);
}

.chip.active,
.nav-btn.active {
  background: rgba(253, 232, 224, 0.9);
  color: var(--accent-dark);
  border-color: rgba(214, 87, 56, 0.15);
}

.bottom-nav {
  border-color: rgba(255, 255, 255, 0.82);
  background:
    radial-gradient(ellipse at 50% -18%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.28) 45%, transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(242, 242, 244, 0.2) 44%, rgba(210, 210, 216, 0.3));
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 1), inset 0 -1.5px 0 rgba(0, 0, 0, 0.1), 0 18px 46px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(255, 255, 255, 0.54);
}

.new-record-btn {
  background: radial-gradient(circle at 43% 27%, #fff 0%, #fff7f4 30%, #f8ddd4 64%, #e89b82 100%);
  border-color: rgba(218, 121, 94, 0.2);
  color: #7f3323;
  box-shadow: inset 0 1.7px 0 rgba(255, 255, 255, 0.98), inset 0 -12px 23px rgba(178, 73, 41, 0.12), 0 19px 40px rgba(194, 87, 57, 0.16);
}

.new-record-btn::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.58);
  pointer-events: none;
}

.new-record-btn .nav-icon {
  width: 33px;
  height: 33px;
  transform: translateY(-8px);
}

.record-girl-sticker {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 54px;
  height: 54px;
  object-fit: contain;
  transform: translateX(-50%);
  mix-blend-mode: multiply;
}

/* Family edition visual baseline — matched to the confirmed warm-pink preview. */
:root {
  background: #ebe5e4;
  --ink: #2d292a;
  --muted: #7d7071;
  --soft: #8c7e80;
  --line: rgba(255, 255, 255, 0.84);
  --surface: rgba(255, 255, 255, 0.56);
  --glass: rgba(255, 255, 255, 0.56);
  --black: #2e2a2b;
  --accent: #2e2a2b;
  --accent-dark: #463839;
  --accent-soft: #f0deda;
  --warm: #f7efef;
  --shadow: 0 18px 48px rgba(69, 49, 52, 0.12);
  --soft-shadow: 0 10px 26px rgba(87, 67, 68, 0.06);
}

html { background: #ebe5e4; }

body {
  background: #ebe5e4;
}

.app-shell {
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 5%, rgba(255,255,255,.94), transparent 25%),
    linear-gradient(160deg, #fffdfb, #f7efef 56%, #ece2e3);
}

.app-shell::before,
.app-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  opacity: .65;
  pointer-events: none;
}

.app-shell::before { width: 110px; height: 110px; right: -48px; top: 195px; background: #ecd0ce; }
.app-shell::after { width: 77px; height: 77px; left: -32px; bottom: 145px; background: #ddd1c3; }

.panel,
.topbar .pill,
.settings-dot,
.list-row,
.manual-reminder-row,
.sticky-note,
.record-entry-sheet {
  border-color: rgba(255,255,255,.84);
  background: rgba(255,255,255,.56);
  box-shadow: inset 0 1px rgba(255,255,255,.96), 0 12px 26px rgba(87,67,68,.06);
}

.sticky-note { background: #f5dfc2; }

.chip.active,
.nav-btn.active,
.segmented button.active {
  background: rgba(255,255,255,.82);
  color: #2b2728;
  border-color: transparent;
  box-shadow: inset 0 1px #fff;
}

.btn.primary,
.segmented button.active,
.filter.active {
  background: #2e2a2b;
  border-color: #2e2a2b;
  color: #fff;
}

.new-record-btn {
  width: 112px;
  height: 112px;
  background: radial-gradient(circle at 36% 25%, rgba(255,255,255,.98), rgba(255,255,255,.58) 26%, rgba(202,193,193,.38) 56%, rgba(76,63,65,.92) 100%);
  border-color: rgba(255,255,255,.95);
  color: #5e5153;
  box-shadow: inset 0 2px 1px rgba(255,255,255,1), inset 0 -4px 10px rgba(0,0,0,.18), 0 15px 29px rgba(73,52,55,.24);
}

.new-record-btn::after { inset: 9px; border-color: rgba(255,255,255,.58); }
.record-girl-sticker { top: 15px; width: 70px; height: 70px; filter: drop-shadow(0 2px 1px rgba(255,255,255,.42)); }
.new-record-btn > span:last-child { top: 83%; color: #f7eeee; font-size: 12px; font-weight: 700; }

.bottom-nav {
  border-color: rgba(255,255,255,.9);
  background: rgba(235,231,231,.70);
  box-shadow: inset 0 1px #fff, 0 15px 38px rgba(48,39,40,.20);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.nav-btn { color: #817577; }
.nav-btn.active { background: rgba(255,255,255,.64); color: #282425; }

.new-record-btn > span:last-child {
  z-index: 1;
  top: 56%;
  font-weight: 650;
}

.record-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  padding: 20px 20px calc(92px + env(safe-area-inset-bottom));
  background: rgba(20, 20, 22, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.record-entry-sheet {
  position: relative;
  width: min(100%, 390px);
  margin: 0 auto;
  padding: 24px 18px 17px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.98);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(249, 247, 247, 0.88));
  box-shadow: 0 22px 55px rgba(22, 22, 24, 0.17), inset 0 1px 0 #fff;
  text-align: center;
}

.record-sheet-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.record-entry-sheet h2 {
  margin: 6px 0 17px;
  font-size: 20px;
  letter-spacing: 0;
}

.ai-record-choice {
  width: 100%;
  min-height: 95px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 17px;
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  border-radius: 24px;
  background: linear-gradient(135deg, #1d1d1f, #3a393c);
  color: #fff;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 22px rgba(0, 0, 0, 0.15);
}

.ai-record-mic {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 28%, #fff 0%, #f8d9ce 35%, #e9977b 100%);
  color: #772d20;
}

.ai-record-mic .nav-icon {
  width: 25px;
  height: 25px;
}

.ai-record-choice strong {
  font-size: 16px;
}

.ai-record-choice small {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.record-chevron {
  color: rgba(255, 255, 255, 0.65);
  font-size: 22px;
  font-weight: 300;
}

.manual-record-link {
  margin-top: 16px;
  padding: 9px;
  color: #68686d;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.manual-record-options {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-top: 13px;
}

.manual-record-options.open {
  display: grid;
}

.manual-record-options > button {
  min-height: 79px;
  padding: 10px 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(247, 245, 244, 0.95);
  color: #36363a;
}

.manual-record-options .entry-glyph,
.manual-record-options .icon-mark {
  display: grid;
  width: 22px;
  height: 22px;
  margin: 0 auto 7px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.manual-record-options .nav-icon {
  width: 21px;
  height: 21px;
}

.manual-record-options span:last-child {
  font-size: 12px;
}

.swipe-record {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.swipe-record .list-row {
  border-bottom: 0;
}

.swipe-record-actions {
  position: absolute;
  inset: 0 0 0 auto;
  width: 136px;
  display: grid;
  grid-template-columns: 68px 68px;
}

.swipe-record-actions button {
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}

.swipe-edit {
  background: #303033;
}

.swipe-delete {
  background: #d67a60;
}

.swipe-record-content {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.9);
  transition: transform 220ms ease;
}

.swipe-record.open .swipe-record-content {
  transform: translateX(-136px);
}

.empty {
  padding: 28px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.expense-stat-layout {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 22px;
}

.family-module-hero { position: relative; overflow: hidden; min-height: 106px; }
.family-module-hero .metric-grid { padding-right: 96px; }
.family-bear { position: absolute; width: 102px; height: 82px; object-fit: contain; right: -2px; top: 0; transform: rotate(-4deg); pointer-events: none; }
.moment-hero { min-height: 108px; padding-right: 92px; }
.moment-hero .family-bear { top: -9px; right: -7px; width: 112px; height: 96px; }

.expense-pie {
  width: 132px;
  height: 132px;
  flex: 0 0 132px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 18px rgba(255,255,255,.92), 0 10px 24px rgba(89,67,72,.10);
}

.expense-pie span {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.96);
  color: var(--ink);
  font-weight: 760;
  font-size: 13px;
}

.expense-legend { min-width: 0; flex: 1; }
.expense-legend p { margin: 7px 0; display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.expense-legend i { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.expense-legend strong { margin-left: auto; color: var(--ink); font-size: 12px; }

.moment-photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.moment-photo { aspect-ratio: 1; position: relative; overflow: hidden; border-radius: 14px; background: #f1e7e1; }
.moment-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.moment-photo button { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border-radius: 50%; background: rgba(30,27,28,.58); color: white; font-size: 19px; line-height: 20px; }

@media (max-width: 360px) {
  .app-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .metric-value {
    font-size: 28px;
  }

  .quick-tile {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (min-width: 390px) and (max-width: 430px) {
  .app-shell {
    padding-left: 22px;
    padding-right: 22px;
  }

  .list-row {
    min-height: 68px;
  }

  .bottom-nav {
    width: min(calc(100% - 32px), 410px);
  }
}

@media (display-mode: standalone) {
  .app-shell {
    padding-top: calc(18px + env(safe-area-inset-top));
  }

  .bottom-nav {
    bottom: calc(8px + env(safe-area-inset-bottom));
  }
}
