:root {
  color-scheme: light;
  --bg: #efe3cc;
  --surface: #161511;
  --surface-strong: #222019;
  --ink: #2b2419;
  --ink-on-dark: #f7ead1;
  --muted: #8b7a61;
  --muted-on-dark: #b6a98e;
  --line: rgba(91, 78, 54, 0.24);
  --line-dark: rgba(247, 234, 209, 0.12);
  --accent: #d9bd82;
  --accent-dark: #a98142;
  --rose: #bb6b5a;
  --gold: #e5c990;
  --blue: #bfa671;
  --peach: #d9bd82;
  --mint: #312d21;
  --lilac: #3a3325;
  --shadow: 0 30px 70px rgba(31, 27, 20, 0.28);
  --round-sm: 14px;
  --round-md: 20px;
  --round-lg: 30px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 247, 229, 0.82), transparent 20%),
    radial-gradient(circle at 18% 14%, rgba(246, 224, 184, 0.78), transparent 30%),
    radial-gradient(circle at 84% 82%, rgba(210, 179, 126, 0.5), transparent 34%),
    linear-gradient(160deg, #f5ead7 0%, #ead9bb 48%, #d7bd8d 100%);
  color: var(--ink);
  font-family: "手札体-简", "ShouZhaTi-Jian", "Hannotate SC", "Kaiti SC", "STKaiti", ui-serif, serif;
  letter-spacing: 0;
}

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

input,
select,
textarea {
  font-family: "手札体-简", "ShouZhaTi-Jian", "Hannotate SC", "Kaiti SC", "STKaiti", ui-serif, serif;
}

button {
  cursor: pointer;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.auth-card {
  display: grid;
  gap: 14px;
  width: min(430px, 100%);
  border: 1px solid var(--line-dark);
  border-radius: var(--round-lg);
  padding: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 32%),
    linear-gradient(160deg, #222018 0%, #12110e 78%);
  box-shadow: 0 28px 70px rgba(30, 26, 20, 0.36), 0 18px 34px rgba(157, 121, 65, 0.22);
  color: var(--ink-on-dark);
}

.auth-card h2,
.auth-card p {
  margin: 0;
}

.auth-card h2 {
  font-size: 28px;
}

.auth-card p {
  color: var(--muted-on-dark);
  line-height: 1.55;
}

.auth-message {
  min-height: 22px;
  font-size: 13px;
  font-weight: 700;
}

.auth-message.error {
  color: var(--rose);
}

.auth-message.ok {
  color: var(--gold);
}

.sync-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  max-width: 220px;
  border: 1px solid rgba(229, 201, 144, 0.28);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted-on-dark);
  background: rgba(22, 21, 17, 0.72);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  border-right: 1px solid rgba(91, 78, 54, 0.28);
  background: rgba(238, 221, 190, 0.64);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, #1c1a15, #3b3324);
  color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 28px rgba(45, 35, 18, 0.2);
  font-weight: 800;
}

.brand h1,
.topbar h2,
.composer h2 {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  font-weight: 800;
}

.brand p,
.eyebrow {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.nav-list,
.sidebar-actions {
  display: grid;
  gap: 8px;
}

.nav-button,
.ghost-button,
.primary-button,
.danger-button,
.text-button,
.icon-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
}

.nav-button {
  text-align: left;
}

.nav-button:hover,
.nav-button.active,
.ghost-button:hover,
.text-button:hover {
  border-color: var(--line);
  background: rgba(255, 247, 230, 0.72);
}

.primary-button {
  background: linear-gradient(135deg, #ecd7a5, #b98c4f);
  color: #211b12;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(87, 60, 24, 0.26);
}

.primary-button:hover {
  background: linear-gradient(135deg, #f4dfae, #a97a3b);
}

.ghost-button {
  border-color: var(--line);
  background: rgba(255, 247, 230, 0.58);
}

.danger-button {
  color: white;
  background: var(--rose);
}

.text-button {
  color: #6f512a;
  font-weight: 700;
}

.icon-button {
  width: 40px;
  padding: 0;
  border-color: var(--line);
  border-radius: 16px;
  background: #f8ecd4;
  font-size: 24px;
}

.file-button {
  display: grid;
  place-items: center;
}

.file-button input {
  display: none;
}

.image-field {
  display: grid;
  gap: 12px;
}

.image-picker {
  display: grid;
  min-height: 46px;
  place-items: center;
  border: 1px dashed rgba(229, 201, 144, 0.34);
  border-radius: 18px;
  color: var(--gold) !important;
  background: rgba(255, 243, 218, 0.07);
  cursor: pointer;
}

.image-picker input {
  display: none;
}

.image-preview {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.image-preview img,
.entry-image,
.viewer-image-button img {
  width: 100%;
  border: 1px solid rgba(229, 201, 144, 0.2);
  border-radius: 18px;
  object-fit: cover;
  background: rgba(255, 243, 218, 0.08);
}

.image-preview img {
  aspect-ratio: 1;
}

.entry-image {
  max-height: 260px;
  margin-top: 10px;
}

.entry-card {
  cursor: pointer;
}

.main {
  min-width: 0;
  padding: 28px clamp(18px, 4vw, 42px) 118px;
}

.bottom-guide {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr 92px 1fr 1fr;
  align-items: center;
  gap: 8px;
  width: min(720px, calc(100vw - 22px));
  min-height: 72px;
  padding: 10px;
  border: 1px solid rgba(247, 234, 209, 0.14);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), transparent 34%),
    linear-gradient(160deg, rgba(33, 31, 24, 0.96), rgba(14, 13, 11, 0.96));
  box-shadow: 0 24px 58px rgba(31, 27, 20, 0.34), 0 12px 26px rgba(169, 122, 59, 0.18);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.bottom-nav-button,
.bottom-compose-button {
  min-width: 0;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted-on-dark);
  background: transparent;
  font-weight: 800;
}

.bottom-nav-button.active,
.bottom-nav-button:hover {
  border-color: rgba(229, 201, 144, 0.22);
  color: var(--gold);
  background: rgba(229, 201, 144, 0.1);
}

.bottom-compose-button {
  min-height: 54px;
  color: #211b12;
  background: linear-gradient(135deg, #f1daa4, #b88949);
  box-shadow: 0 14px 28px rgba(185, 140, 79, 0.3);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.topbar h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(110, 91, 57, 0.26);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255, 248, 233, 0.92);
  color: var(--ink);
}

textarea {
  resize: vertical;
}

a {
  color: #e5c990;
}

.auth-card input,
.composer input,
.composer select,
.composer textarea {
  border-color: rgba(229, 201, 144, 0.2);
  background: rgba(255, 243, 218, 0.08);
  color: var(--ink-on-dark);
}

.auth-card input::placeholder,
.composer input::placeholder,
.composer textarea::placeholder {
  color: rgba(247, 234, 209, 0.45);
}

#searchInput {
  width: min(340px, 38vw);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.panel {
  border: 1px solid var(--line-dark);
  border-radius: var(--round-md);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 34%),
    linear-gradient(160deg, #222019 0%, #13120f 80%);
  box-shadow: 0 18px 48px rgba(35, 29, 19, 0.24), 0 12px 28px rgba(174, 132, 70, 0.13);
  color: var(--ink-on-dark);
}

.panel {
  min-height: 280px;
  padding: 18px;
}

.panel.wide {
  grid-column: span 3;
}

.panel-header,
.filter-row,
.composer-header,
.viewer-header,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header {
  margin-bottom: 12px;
}

.panel h3 {
  margin: 0;
  font-size: 18px;
}

.calendar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.mini-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekday {
  color: var(--muted-on-dark);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.calendar-cell {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 92px;
  border: 1px solid rgba(229, 201, 144, 0.14);
  border-radius: 14px;
  padding: 8px;
  color: var(--ink-on-dark);
  background: rgba(255, 243, 218, 0.045);
  text-align: left;
}

.calendar-cell:hover {
  border-color: rgba(229, 201, 144, 0.42);
  background: rgba(229, 201, 144, 0.09);
}

.calendar-cell.muted {
  opacity: 0.42;
}

.calendar-cell.today {
  border-color: rgba(229, 201, 144, 0.7);
  box-shadow: inset 0 0 0 1px rgba(229, 201, 144, 0.28);
}

.calendar-date {
  color: var(--gold);
  font-size: 15px;
  font-weight: 900;
}

.calendar-items {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.calendar-items b {
  overflow: hidden;
  border-radius: 8px;
  padding: 3px 5px;
  color: #211b12;
  background: linear-gradient(135deg, #f1daa4, #c39a5e);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-view {
  display: grid;
  gap: 16px;
}

.filter-row {
  justify-content: flex-start;
}

.filter-row select {
  max-width: 190px;
}

.item-list,
.compare-list {
  display: grid;
  gap: 10px;
}

.entry-card,
.compare-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-dark);
  border-radius: var(--round-md);
  padding: 15px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 30%),
    linear-gradient(160deg, #211f18 0%, #12110e 85%);
  box-shadow: 0 14px 34px rgba(35, 29, 19, 0.2);
  color: var(--ink-on-dark);
}

.entry-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.entry-card:hover {
  border-color: rgba(229, 201, 144, 0.42);
  transform: translateY(-1px);
}

.entry-main {
  min-width: 0;
}

.entry-title-row,
.entry-meta,
.tag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.entry-title-row h3 {
  margin: 0;
  font-size: 17px;
}

.entry-body {
  margin: 8px 0 0;
  color: var(--muted-on-dark);
  line-height: 1.5;
  white-space: pre-wrap;
}

.entry-meta,
.tag-row {
  color: var(--muted-on-dark);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(229, 201, 144, 0.16);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}

.pill.compare {
  background: rgba(229, 201, 144, 0.2);
  color: #f3dcaa;
}

.pill.calendar {
  background: rgba(241, 218, 164, 0.22);
  color: #f6ddb0;
}

.pill.idea {
  background: rgba(217, 189, 130, 0.18);
  color: #f0d69a;
}

.pill.material {
  background: rgba(185, 140, 79, 0.2);
  color: #e8c98b;
}

.pill.reading {
  background: rgba(255, 240, 206, 0.13);
  color: #ead4a1;
}

.entry-side {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 8px;
  min-width: 96px;
}

.amount {
  font-size: 20px;
  font-weight: 800;
}

.progress-track {
  width: 118px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(247, 234, 209, 0.13);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9d7942, #e8cf9a);
}

.compare-card strong {
  font-size: 16px;
}

.compare-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted-on-dark);
  font-size: 13px;
}

.compare-stats span {
  display: grid;
  gap: 2px;
}

.compare-stats b {
  color: var(--ink-on-dark);
  font-size: 16px;
}

dialog {
  width: min(720px, calc(100vw - 28px));
  border: 0;
  border-radius: var(--round-lg);
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(36, 33, 29, 0.42);
}

.composer,
.viewer {
  display: grid;
  gap: 14px;
  max-height: min(86vh, 880px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line-dark);
  border-radius: var(--round-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 32%),
    linear-gradient(160deg, #242119 0%, #12110e 80%);
  color: var(--ink-on-dark);
  box-shadow: var(--shadow);
}

.composer label {
  display: grid;
  gap: 7px;
  color: var(--muted-on-dark);
  font-size: 13px;
  font-weight: 700;
}

.viewer {
  gap: 16px;
}

.viewer-header h2,
.viewer-header p {
  margin: 0;
}

.viewer-meta,
.viewer-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted-on-dark);
  font-size: 14px;
}

.viewer-body {
  margin: 0;
  color: var(--ink-on-dark);
  line-height: 1.7;
  white-space: pre-wrap;
}

.viewer-detail {
  border: 1px solid rgba(229, 201, 144, 0.16);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 243, 218, 0.06);
}

.viewer-image-button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 22px;
  padding: 0;
  background: transparent;
}

.viewer-image-button img {
  display: block;
  max-height: min(54vh, 520px);
}

#imageDialog {
  width: min(1120px, calc(100vw - 18px));
}

#imageDialog::backdrop {
  background: rgba(10, 9, 7, 0.78);
}

.image-viewer {
  position: relative;
  display: block;
  max-height: 90vh;
  min-height: min(86vh, 900px);
  overflow: auto;
  padding: 72px 18px 18px;
}

.image-viewer img {
  display: block;
  width: 100%;
  min-width: min(100%, 980px);
  max-width: none;
  max-height: none;
  margin: 0 auto;
  border: 1px solid rgba(229, 201, 144, 0.2);
  border-radius: 22px;
  object-fit: contain;
  box-shadow: var(--shadow);
}

.image-tools {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: -54px 0 14px;
  padding: 8px;
  border: 1px solid rgba(229, 201, 144, 0.18);
  border-radius: 999px;
  background: rgba(18, 17, 14, 0.86);
  backdrop-filter: blur(12px);
}

.image-tools .ghost-button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--ink-on-dark);
}

.image-tools .icon-button {
  width: 36px;
  height: 36px;
  background: rgba(255, 243, 218, 0.08);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.type-fields {
  display: none;
  gap: 12px;
}

.type-fields.visible {
  display: grid;
}

.form-actions {
  justify-content: flex-end;
  padding-top: 6px;
}

#deleteEntry {
  margin-right: auto;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed rgba(229, 201, 144, 0.28);
  border-radius: var(--round-md);
  color: var(--muted-on-dark);
  text-align: center;
}

.empty-state strong {
  color: var(--ink-on-dark);
}

.hidden {
  display: none !important;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 4;
    gap: 14px;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-button {
    flex: 0 0 auto;
  }

  .sidebar-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .topbar,
  .topbar-tools {
    align-items: stretch;
    flex-direction: column;
  }

  #searchInput {
    width: 100%;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel.wide {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 18px 12px 116px;
  }

  .brand p,
  .sidebar-actions .file-button,
  .sidebar-actions #exportCsv {
    display: none;
  }

  .sidebar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .form-grid,
  .compare-stats {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    gap: 4px;
  }

  .calendar-cell {
    min-height: 72px;
    border-radius: 12px;
    padding: 6px;
  }

  .calendar-items b {
    padding: 2px 4px;
    font-size: 11px;
  }

  .panel.wide {
    grid-column: span 1;
  }

  .entry-card {
    grid-template-columns: 1fr;
  }

  .entry-side {
    justify-items: start;
  }

  .progress-track {
    width: 100%;
  }

  .image-preview {
    grid-template-columns: 1fr;
  }

  .bottom-guide {
    grid-template-columns: 1fr 1fr 78px 1fr 1fr;
    gap: 5px;
    width: calc(100vw - 14px);
    min-height: 66px;
    padding: 8px;
    border-radius: 24px;
  }

  .bottom-nav-button,
  .bottom-compose-button {
    min-height: 44px;
    padding: 0 6px;
    font-size: 13px;
  }
}

/* v18 softer cream palette and clearer dashboard layout */
:root {
  --bg: #f6efe6;
  --surface: #fffaf3;
  --surface-strong: #f0e7f1;
  --ink: #342f3a;
  --ink-on-dark: #342f3a;
  --muted: #8b8191;
  --muted-on-dark: #8b8191;
  --line: rgba(99, 88, 111, 0.16);
  --line-dark: rgba(99, 88, 111, 0.14);
  --accent: #b9aacd;
  --accent-dark: #8f7caf;
  --rose: #c97d7d;
  --gold: #8f7caf;
  --blue: #a5bdc9;
  --peach: #e7cfc1;
  --mint: #b9c9b4;
  --lilac: #d8cde2;
  --shadow: 0 24px 58px rgba(88, 76, 96, 0.16);
}

body {
  background:
    radial-gradient(circle at 14% 10%, rgba(216, 205, 226, 0.62), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(185, 201, 180, 0.48), transparent 30%),
    radial-gradient(circle at 70% 86%, rgba(165, 189, 201, 0.42), transparent 34%),
    linear-gradient(150deg, #fbf4eb 0%, #f6efe6 52%, #ece2ee 100%);
}

.auth-card,
.panel,
.entry-card,
.compare-card,
.composer,
.viewer {
  border-color: var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.26)),
    linear-gradient(160deg, #fffaf3 0%, #f3ecf4 100%);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.sidebar,
.bottom-guide {
  border-color: var(--line);
  background: rgba(255, 250, 243, 0.72);
  box-shadow: 0 18px 44px rgba(88, 76, 96, 0.14);
}

.brand-mark {
  background: linear-gradient(145deg, #d8cde2, #a5bdc9);
  color: #fffaf3;
}

.sync-status,
.nav-button:hover,
.nav-button.active,
.ghost-button,
.ghost-button:hover,
.text-button:hover,
.icon-button,
.bottom-nav-button.active,
.bottom-nav-button:hover {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
}

.primary-button,
.bottom-compose-button {
  color: #fffaf3;
  background: linear-gradient(135deg, #b9aacd, #8f7caf);
  box-shadow: 0 14px 28px rgba(143, 124, 175, 0.24);
}

.primary-button:hover {
  background: linear-gradient(135deg, #c7bad8, #8f7caf);
}

.dashboard-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.panel.full {
  grid-column: 1 / -1;
}

.panel.wide {
  grid-column: span 4;
}

.calendar-grid {
  gap: 8px;
}

.calendar-cell {
  min-height: 112px;
  border-color: rgba(143, 124, 175, 0.16);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
}

.calendar-cell:hover,
.calendar-cell.today {
  border-color: rgba(143, 124, 175, 0.42);
  background: rgba(240, 231, 241, 0.76);
}

.calendar-date,
.pill,
.amount,
.compare-stats b,
.empty-state strong {
  color: var(--accent-dark);
}

.calendar-items b {
  color: #4a4055;
  background: linear-gradient(135deg, #e8dcec, #d4e1df);
}

.entry-body,
.entry-meta,
.tag-row,
.viewer-meta,
.viewer-detail,
.brand p,
.eyebrow,
.calendar-weekday {
  color: var(--muted);
}

.pin-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  color: #fffaf3;
  background: #8f7caf;
  font-size: 12px;
  font-weight: 800;
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.compact-list .entry-card,
.entry-card.compact {
  grid-template-columns: 1fr;
  padding: 12px;
}

.install-steps {
  display: grid;
  gap: 12px;
}

.install-steps section {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.52);
}

.install-steps h3,
.install-steps p {
  margin: 0;
}

.install-steps p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 920px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel.full,
  .panel.wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .calendar-cell {
    min-height: 88px;
  }
}

/* v19 minimal white interface and readable scrolling calendar */
:root {
  --bg: #101723;
  --surface: #ffffff;
  --surface-strong: #f7f7f5;
  --ink: #171717;
  --ink-on-dark: #171717;
  --muted: #7d7d7a;
  --muted-on-dark: #7d7d7a;
  --line: rgba(20, 20, 20, 0.1);
  --line-dark: rgba(20, 20, 20, 0.1);
  --accent: #c9a76a;
  --accent-dark: #a7803d;
  --rose: #ce7d73;
  --gold: #a7803d;
  --blue: #d8e8f6;
  --peach: #fae0c8;
  --mint: #dcefd2;
  --lilac: #e7ddf5;
  --shadow: 0 20px 50px rgba(15, 23, 35, 0.14);
}

body {
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.08), transparent 24%),
    linear-gradient(155deg, #101723 0%, #18202d 100%);
}

.app-shell {
  gap: 18px;
  padding: 18px;
}

.sidebar,
.bottom-guide,
.auth-card,
.panel,
.entry-card,
.compare-card,
.composer,
.viewer {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.sidebar {
  border-radius: 28px;
}

.main {
  padding: 8px 8px 116px;
}

.brand-mark {
  background: #171717;
  color: #ffffff;
  box-shadow: none;
}

.sync-status,
.ghost-button,
.icon-button,
.nav-button:hover,
.nav-button.active,
.bottom-nav-button.active,
.bottom-nav-button:hover {
  border-color: var(--line);
  background: #f7f7f5;
  color: var(--ink);
}

.primary-button,
.bottom-compose-button {
  background: #c9a76a;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(201, 167, 106, 0.24);
}

.text-button,
.calendar-date,
.amount,
.pill {
  color: var(--accent-dark);
}

.dashboard-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.panel.full {
  grid-column: 1 / -1;
}

.panel.wide {
  grid-column: span 8;
}

.panel.full:has(.calendar-grid) {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.calendar-grid {
  grid-template-columns: repeat(7, minmax(96px, 1fr));
  min-width: 760px;
  gap: 8px;
  padding-bottom: 4px;
}

.calendar-weekday {
  color: #969693;
}

.calendar-cell {
  min-height: 112px;
  border: 1px solid #eeeeea;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 35, 0.04);
}

.calendar-cell:hover {
  border-color: #d9c193;
  background: #fffdf8;
}

.calendar-cell.today {
  border-color: #c9a76a;
  background: #fff8eb;
}

.calendar-cell.muted {
  opacity: 0.34;
}

.calendar-items {
  gap: 3px;
}

.calendar-items b {
  display: block;
  overflow: hidden;
  min-height: 18px;
  border-radius: 3px;
  padding: 2px 4px;
  color: #435044;
  background: #dcefd2;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-note.color-0 {
  background: #dcefd2;
  color: #4a6d46;
}

.calendar-note.color-1 {
  background: #d8e8f6;
  color: #41657f;
}

.calendar-note.color-2 {
  background: #fae0c8;
  color: #98633b;
}

.calendar-note.color-3 {
  background: #e7ddf5;
  color: #695289;
}

.entry-body,
.entry-meta,
.viewer-meta,
.viewer-detail,
.brand p,
.eyebrow {
  color: var(--muted);
}

.pill,
.pin-pill {
  background: #f3eadb;
  color: #8d6930;
}

.install-steps section,
.viewer-detail {
  background: #f7f7f5;
}

@media (max-width: 920px) {
  .app-shell {
    display: block;
    padding: 0;
  }

  .sidebar {
    border-radius: 0 0 24px 24px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel.full,
  .panel.wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .calendar-grid {
    grid-template-columns: repeat(7, 94px);
    min-width: 690px;
  }

  .calendar-cell {
    min-height: 116px;
  }
}

/* v21 Apple Notes inspired mobile-first minimal theme */
:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-strong: #f9f9fb;
  --ink: #1c1c1e;
  --ink-on-dark: #1c1c1e;
  --muted: #8e8e93;
  --muted-on-dark: #8e8e93;
  --line: rgba(60, 60, 67, 0.12);
  --line-dark: rgba(60, 60, 67, 0.12);
  --accent: #ffcc00;
  --accent-dark: #b98500;
  --rose: #ff3b30;
  --gold: #b98500;
  --blue: #e8f2ff;
  --peach: #fff0d8;
  --mint: #ecf8ea;
  --lilac: #f0ebff;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  --round-sm: 12px;
  --round-md: 16px;
  --round-lg: 22px;
}

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.app-shell {
  gap: 0;
  padding: 0;
}

.sidebar {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #f2f2f7;
  box-shadow: none;
}

.main {
  padding: 16px 16px 112px;
}

.brand-mark {
  border-radius: 12px;
  background: #ffcc00;
  color: #1c1c1e;
  box-shadow: none;
}

.brand h1,
.topbar h2,
.composer h2,
.viewer h2 {
  font-weight: 800;
  letter-spacing: 0;
}

.brand p,
.eyebrow,
.entry-meta,
.entry-body,
.viewer-meta,
.viewer-detail,
.calendar-weekday {
  color: var(--muted);
}

.topbar {
  margin-bottom: 14px;
}

.topbar-tools {
  gap: 8px;
}

.auth-card,
.panel,
.entry-card,
.compare-card,
.composer,
.viewer,
.bottom-guide {
  border: 0;
  background: #ffffff;
  color: var(--ink);
  box-shadow: none;
}

.panel,
.entry-card,
.compare-card {
  border: 1px solid var(--line);
}

.panel {
  min-height: 0;
  padding: 16px;
}

.panel-header {
  margin-bottom: 10px;
}

.panel h3 {
  font-size: 18px;
  font-weight: 800;
}

.dashboard-grid {
  gap: 12px;
}

.sync-status,
.ghost-button,
.icon-button,
.nav-button,
.bottom-nav-button {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
}

.sync-status,
.ghost-button,
.icon-button,
.nav-button:hover,
.nav-button.active,
.bottom-nav-button.active,
.bottom-nav-button:hover {
  background: #ffffff;
  border-color: var(--line);
}

.primary-button,
.bottom-compose-button {
  background: #ffcc00;
  color: #1c1c1e;
  box-shadow: none;
}

.primary-button:hover {
  background: #f5c400;
}

.text-button,
.calendar-date,
.amount {
  color: #b98500;
}

#searchInput,
.auth-card input,
.composer input,
.composer select,
.composer textarea {
  border-color: transparent;
  background: #f2f2f7;
  color: var(--ink);
}

.calendar-actions {
  gap: 6px;
}

.calendar-actions .mini-button {
  background: #f2f2f7;
}

.panel.full:has(.calendar-grid) {
  overflow-x: auto;
  scrollbar-width: none;
}

.panel.full:has(.calendar-grid)::-webkit-scrollbar {
  display: none;
}

.calendar-grid {
  grid-template-columns: repeat(7, minmax(108px, 1fr));
  min-width: 812px;
  gap: 8px;
}

.calendar-weekday {
  font-size: 12px;
}

.calendar-cell {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  background: #ffffff;
  box-shadow: none;
}

.calendar-cell.today {
  border-color: #ffcc00;
  background: #fff9dd;
}

.calendar-cell:hover {
  border-color: #ffcc00;
  background: #fffdf4;
}

.calendar-date {
  font-size: 15px;
  font-weight: 800;
}

.calendar-items {
  gap: 4px;
}

.calendar-items b {
  min-height: 18px;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 10px;
  line-height: 1.25;
}

.calendar-note.color-0 {
  background: #ecf8ea;
  color: #3f7b46;
}

.calendar-note.color-1 {
  background: #e8f2ff;
  color: #2e6d9f;
}

.calendar-note.color-2 {
  background: #fff0d8;
  color: #9b6422;
}

.calendar-note.color-3 {
  background: #f0ebff;
  color: #6652a3;
}

.pill,
.pin-pill {
  background: #fff4bf;
  color: #8a6a00;
}

.entry-card:hover {
  border-color: rgba(255, 204, 0, 0.72);
  transform: none;
}

.bottom-guide {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.install-steps section,
.viewer-detail {
  background: #f2f2f7;
}

@media (max-width: 920px) {
  .sidebar {
    border-bottom: 1px solid var(--line);
    background: rgba(242, 242, 247, 0.94);
  }

  .main {
    padding: 14px 12px 112px;
  }
}

@media (max-width: 560px) {
  .topbar-tools {
    flex-direction: column;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, 106px);
    min-width: 770px;
  }

  .calendar-cell {
    min-height: 120px;
  }
}
