.journal-page,
.journal-page * { box-sizing: border-box; }

.journal-page {
  --jp-ink: #232427;
  --jp-muted: #55545c;
  --jp-hint: #8b8a92;
  --jp-placeholder: #a3a2a9;
  --jp-sheet: #fbfbf9;
  --jp-divider: #ecebe6;
  --jp-day: #cfcdc6;
  --jp-note: #eef0f7;
  --jp-note-ink: #3f4a6b;
  width: 100%;
  min-width: 0;
  padding: 20px 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, #eeeff6 0%, #f3f2ee 55%, #f4efe4 100%);
  box-shadow: 0 30px 60px -30px rgba(20, 20, 30, .35), inset 0 0 0 1px rgba(255, 255, 255, .8);
  color: var(--jp-ink);
  font-family: 'Figtree', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.journal-page button,
.journal-page textarea { font: inherit; color: inherit; }
.journal-page button { cursor: pointer; }
.journal-page-mono,
.journal-page-number,
.journal-page-day span,
.journal-page-speak { font-family: 'JetBrains Mono', ui-monospace, monospace; text-transform: uppercase; }
.journal-page-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--jp-muted); }
.journal-page-mono { font-size: 11px; letter-spacing: .14em; }
.journal-page-nav { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.journal-page-nav button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--jp-muted); }
.journal-page-nav button:hover:not(:disabled) { background: rgba(255, 255, 255, .7); color: var(--jp-ink); }
.journal-page-nav button:disabled { opacity: .3; cursor: default; }
.journal-page-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin: 12px 0 14px; }
.journal-page-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; height: 46px; padding: 2px 0; border: 0; border-radius: 10px; background: transparent; font-size: 16px; font-weight: 600; }
.journal-page-day:hover:not(:disabled):not(.selected) { background: rgba(255, 255, 255, .6); }
.journal-page-day span { color: #6e6d76; font-size: 10px; font-weight: 400; letter-spacing: .12em; }
.journal-page-day strong { font-weight: 600; line-height: 1; }
.journal-page-day i { width: 5px; height: 5px; border-radius: 50%; background: var(--jp-day); }
.journal-page-day i.filled { background: var(--jp-ink); }
.journal-page-day.selected { background: var(--jp-ink); color: #fff; }
.journal-page-day.selected span { color: #c8c7ce; }
.journal-page-day.selected i { background: #fff; }
.journal-page-day:disabled { opacity: .35; cursor: default; }
.journal-page-sheet { padding: 2px 18px; border-radius: 14px; background: var(--jp-sheet); box-shadow: 0 1px 0 rgba(0, 0, 0, .03); }
.journal-page-section { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 10px; padding: 12px 0; }
.journal-page-section + .journal-page-section { border-top: 1px solid var(--jp-divider); }
.journal-page-number { grid-column: 1; grid-row: 1; padding-top: 3px; color: var(--jp-hint); font-size: 10px; letter-spacing: .14em; }
.journal-page-section h3 { grid-column: 2; grid-row: 1; margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: 0; }
.journal-page-hint { grid-column: 2; grid-row: 2; margin: 1px 0 6px; color: var(--jp-hint); font-size: 12px; line-height: 1.35; }
.journal-page-section textarea { display: block; grid-column: 2; width: 100%; min-height: 22px; height: auto; padding: 0; resize: none; overflow: hidden; border: 0; outline: 0; background: transparent; font-size: 14px; font-weight: 400; line-height: 1.45; letter-spacing: 0; }
.journal-page-today textarea { min-height: 52px; }
.journal-page-section textarea::placeholder { color: var(--jp-placeholder); opacity: 1; }
.journal-page-voice-note { display: inline-flex; grid-column: 2; justify-self: start; align-items: center; gap: 8px; max-width: 100%; margin-top: 8px; padding: 8px 10px; border: 0; border-radius: 9px; background: var(--jp-note); color: var(--jp-note-ink) !important; font-size: 12px !important; text-align: left; white-space: nowrap; }
.journal-page-voice-note:hover { background: #e4e8f4; }
.journal-page-voice-note svg { flex: none; }
.journal-page-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
.journal-page-speak { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--jp-ink); color: #fff !important; font-size: 11px !important; font-weight: 500 !important; letter-spacing: .14em; }
.journal-page-speak.recording { background: #8a2e1c; }
.journal-page-speak.recording svg { animation: journal-page-pulse 1s ease-in-out infinite; }
.journal-page-error { margin-top: 12px; color: #8a2e1c; font-size: 13px; }
.journal-page :is(button, textarea):focus-visible { outline: 2px solid #4e5f8f; outline-offset: 3px; }

html[data-palette="dark"] .journal-page {
  --jp-ink: #f2ebdc;
  --jp-muted: #b5a892;
  --jp-hint: #a99e8c;
  --jp-placeholder: #877c6d;
  --jp-sheet: #241f1a;
  --jp-divider: #3a3127;
  --jp-day: #5a5045;
  --jp-note: #343849;
  --jp-note-ink: #dce2f7;
  background: linear-gradient(180deg, #292b36 0%, #2c2926 55%, #30291f 100%);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .08);
}
html[data-palette="dark"] .journal-page-day.selected { color: #232427; }
html[data-palette="dark"] .journal-page-day.selected span { color: #57525a; }
html[data-palette="dark"] .journal-page-day.selected i { background: #232427; }
html[data-palette="dark"] .journal-page-speak { color: #232427 !important; }
html[data-palette="dark"] .journal-page-speak.recording { color: #fff !important; }
html[data-palette="dark"] .journal-page-voice-note:hover { background: #40465c; }

@keyframes journal-page-pulse { 50% { opacity: .35; } }

@media (max-width: 520px) {
  .journal-page { padding: 18px 16px; margin-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); border-radius: 20px; }
  .journal-page-sheet { padding: 2px 14px; }
  .journal-page-section { grid-template-columns: 20px minmax(0, 1fr); column-gap: 8px; }
  .journal-page-week { gap: 4px; }
  .journal-page-voice-note { white-space: normal; }
  .journal-page-nav button { width: 44px; height: 44px; }
}
