:root {
  color-scheme: light;
  --bg: #fbf8f0;
  --paper: #fffdfa;
  --ink: #2f352b;
  --muted: #615f52;
  --line: #e8dfd0;
  --brand: #824727;
  --brand-deep: #6e361b;
  --cream: #faeecc;
  --green: #e7eddf;
  --serif: "Songti SC", "Noto Serif CJK SC", STSong, "Baskervville", serif;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "DM Sans", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; color: var(--ink); font-size: 16px; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #9c6134; outline-offset: 3px;
}
p, h1, h2, h3 { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 700; }
h1 { font-size: clamp(2.25rem, 5vw, 3.45rem); letter-spacing: -.045em; line-height: 1.13; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.06rem; }
.topbar { height: 77px; border-bottom: 1px solid var(--line); background: #fffdf8; }
.topbar-inner { max-width: 1180px; margin: auto; height: 100%; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 1.24rem var(--serif); white-space: nowrap; }
.brand img { border-radius: 12px; }
.tabs { display: flex; align-items: center; justify-content: center; gap: 9px; }
.tabs a { padding: 11px 17px; color: var(--muted); border-radius: 30px; font-weight: 650; white-space: nowrap; }
.tabs a[aria-current="page"] { background: #f3e7d5; color: var(--brand-deep); }
.nav-icon { margin-right: 3px; font-size: 1.15em; line-height: 1; }
button.plain, .text-button { border: 0; background: transparent; color: var(--brand-deep); padding: 8px 3px; font-weight: 650; }
.settings { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.settings > span:first-child { font-size: 1.15em; }
.main { max-width: 1180px; margin: 0 auto; padding: 32px 32px 64px; }
.initial, .empty { padding: 25px; color: var(--muted); }
.notice { margin-bottom: 16px; display: flex; justify-content: space-between; gap: 10px; align-items: center; background: #efe8d8; padding: 5px 14px; border-radius: 10px; color: #5f533f; font-size: .91rem; }
.panel { background: var(--paper); border-radius: 22px; border: 1px solid var(--line); overflow: hidden; }
.hero { min-height: 302px; position: relative; isolation: isolate; display: flex; align-items: center; overflow: hidden; border-radius: 26px; border: 1px solid #eddfbd; background: var(--cream); }
.hero-image { position: absolute; right: 0; top: 0; width: 70%; height: 100%; object-fit: cover; object-position: 65% 52%; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg,#faeecc 30%,#faeecc 36%,#faeecc00 66%); }
.hero-copy { padding: 30px 44px; max-width: 66%; }
.hero-copy .date { color: #6b573d; font-size: .94rem; margin-bottom: 13px; font-weight: 650; }
.hero-copy h1 { margin-bottom: 12px; }
.hero-copy p:not(.date) { color: #5d5440; margin-bottom: 20px; max-width: 17em; line-height: 1.65; }
.primary, .secondary, .danger { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 17px; border-radius: 12px; font-weight: 650; border: 1px solid transparent; }
.primary { background: var(--brand); color: #fffaf1; }
.primary:hover { background: var(--brand-deep); }
.secondary { background: #fffaf2; border-color: #ddceb8; color: #65492f; }
.secondary:hover { background: #f6ead9; }
.danger { background: #fbebe5; color: #832f20; border-color: #e6c4b8; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 28px 0 13px; }
.section-heading .text-button { flex-shrink: 0; }
.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { text-align: left; display: flex; gap: 12px; align-items: center; padding: 18px 15px; min-height: 85px; border: 1px solid #0000000a; border-radius: 17px; color: var(--ink); background: var(--tone); }
.tile:hover { border-color: #a3957a; }
.tile strong { display: block; line-height: 1.2; }
.tile small { color: #4f5047; font-size: .84rem; display: block; margin-top: 5px; }
.mood { --tone: #f9ebbf; --glyph: #755310; }
.english { --tone: #e7edde; --glyph: #3f5f39; }
.piano { --tone: #ece5f3; --glyph: #624774; }
.story { --tone: #fae6da; --glyph: #8a452a; }
.glyph { background: #fffcf2c9; min-width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--glyph, var(--brand)); font-size: 24px; line-height: 1; }
.glyph.english { font: 700 19px var(--serif); }
.home-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 24px; align-items: start; }
.garden-preview { background: var(--green); border-color: #d9e2d1; padding: 21px 23px; display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: center; }
.garden-preview p { color: #4c5d42; line-height: 1.5; margin-top: 4px; }
.preview-sprig { color: #57744b; font-size: 2.65rem; }
.entry { padding: 16px 18px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: start; }
.entry + .entry { border-top: 1px solid var(--line); }
.entry h3 { margin: 1px 0 5px; overflow-wrap: anywhere; }
.entry p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.entry .glyph { background: var(--tone); }
.entry-tools { display: flex; gap: 9px; align-items: flex-start; }
.icon-button { border: 0; background: transparent; color: var(--brand); min-width: 35px; min-height: 36px; padding: 5px; border-radius: 9px; font-weight: 650; }
.icon-button:hover { background: #f5ecdf; }
.meta { color: var(--muted); font-size: .85rem; line-height: 1.6; }
.entry img { display: block; object-fit: cover; width: min(100%, 260px); max-height: 200px; margin-top: 8px; border-radius: 10px; }
audio { width: min(100%, 350px); height: 42px; display: block; margin-top: 8px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 14px 0 26px; }
.page-heading p { color: var(--muted); margin-top: 9px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 17px; }
.chip { border: 1px solid #dfd3c0; border-radius: 22px; padding: 8px 14px; font-weight: 650; background: #fffaf1; color: #65543e; }
.chip[aria-pressed="true"] { color: #fffaf2; background: var(--brand); border-color: var(--brand); }
.search-row { display: flex; gap: 12px; align-items: center; }
.search-row label { flex: 1; max-width: 470px; }
.compare { margin-bottom: 17px; padding: 18px; background: #f0edf5; border-color: #e2dbe9; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 12px; }
.garden-layout { display: grid; grid-template-columns: 1.14fr 1fr; gap: 22px; }
.garden-board { background: #f4e8ca; padding-bottom: 22px; text-align: center; }
.garden-board img { width: 100%; max-height: 355px; display: block; object-fit: cover; object-position: 72% 60%; }
.garden-stats { padding: 17px 18px 0; display: grid; gap: 9px; justify-items: center; }
.leaf-track { display: flex; gap: 8px; }
.leaf-track span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 1px dashed #827049; color: #6d613d; }
.leaf-track span.filled { background: #dce5ce; color: #43623a; border: 1px solid #6f865d; }
.garden-stack { display: grid; gap: 15px; align-content: start; }
.box { padding: 20px; }
.box h2 { margin-bottom: 9px; }
.box > .primary, .box > .secondary { margin-top: 13px; }
.box p { line-height: 1.6; }
.line-item { padding: 11px 0; border-bottom: 1px solid var(--line); }
.line-item:last-child { border-bottom: 0; }
label { display: grid; gap: 6px; font-weight: 650; line-height: 1.4; }
input:not([type="checkbox"]), select, textarea { border: 1px solid #d9cbb5; background: #fffdf8; border-radius: 10px; color: var(--ink); padding: 10px 11px; min-width: 0; width: 100%; min-height: 43px; }
textarea { resize: vertical; min-height: 85px; }
::placeholder { color: #746b5e; }
dialog { width: min(610px, calc(100% - 24px)); max-height: min(90dvh, 810px); overflow: auto; padding: 0; color: var(--ink); border: 1px solid var(--line); border-radius: 22px; background: var(--paper); }
dialog::backdrop { background: #31291883; }
.sheet-header { position: sticky; top: 0; background: var(--paper); z-index: 1; padding: 16px 22px; display: flex; justify-content: space-between; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.sheet-header h2 { font-size: 1.5rem; }
.sheet-body { padding: 18px 22px 23px; }
.sheet-body p { margin-bottom: 12px; line-height: 1.58; }
.flow { display: grid; gap: 13px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 7px; font-weight: 650; }
.pick { display: flex; flex-wrap: wrap; gap: 7px; }
.pick .chip { display: flex; gap: 6px; align-items: center; }
.form-buttons { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.form-buttons .primary { margin-left: auto; }
.attachment-block { padding: 12px; background: #f6eee1; border-radius: 13px; }
.attachment-block img { width: min(170px, 100%); display: block; max-height: 140px; object-fit: cover; margin-top: 8px; border-radius: 10px; }
.attachment-block .secondary { font-size: .91rem; min-height: 41px; }
.attachment-block p { margin: 2px 0 8px; }
.error { color: #932e20; font-weight: 650; min-height: 1.2em; margin: 0 !important; }
.setting-group { padding: 13px 0; border-bottom: 1px solid var(--line); }
.setting-group h3 { margin-bottom: 10px; }
.setting-group:last-child { border-bottom: 0; }
.members li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.members { padding: 0; list-style: none; margin: 0; }
.key-field { word-break: break-all; background: #f2ead9; padding: 10px; border-radius: 8px; }
#toast { position: fixed; z-index: 10; background: #363b2e; color: white; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 25px); padding: 12px 17px; border-radius: 12px; }
#toast:empty { display: none; }
@media (max-width: 800px) {
  .topbar-inner { padding-inline: 20px; }
  .main { padding-inline: 20px; }
  .tile { padding: 14px 9px; gap: 8px; }
  .tile small { font-size: .8rem; }
}
@media (max-width: 650px) {
  .topbar { height: 61px; }
  .topbar-inner { padding-inline: 16px; }
  .brand { font-size: 1.17rem; }
  .brand img { width: 34px; height: 34px; }
  .settings-label { font-size: .89rem; }
  .tabs { position: fixed; z-index: 4; bottom: 0; inset-inline: 0; padding: 6px 5px max(6px, env(safe-area-inset-bottom)); background: #fffdf8; border-top: 1px solid var(--line); justify-content: space-around; gap: 0; }
  .tabs a { display: grid; text-align: center; gap: 3px; padding: 6px 12px; width: 31%; border-radius: 10px; font-size: .84rem; }
  .nav-icon { margin: 0; font-size: 1.2rem; }
  .main { padding: 15px 14px calc(86px + env(safe-area-inset-bottom)); }
  .hero { min-height: 220px; border-radius: 20px; }
  .hero-copy { padding: 20px 15px; max-width: 73%; }
  .hero-copy .date { font-size: .78rem; margin-bottom: 8px; }
  .hero-copy h1 { font-size: clamp(1.6rem, 6.7vw, 2.1rem); margin-bottom: 8px; }
  .hero-copy p:not(.date) { font-size: .87rem; max-width: 12em; margin-bottom: 13px; }
  .hero-image { width: 74%; object-position: 78% 50%; }
  .hero::after { background: linear-gradient(90deg,#faeecc 27%,#faeecc 30%,#faeecc00 72%); }
  .primary, .secondary, .danger { padding-inline: 13px; }
  .actions { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .tile { padding: 10px; min-height: 65px; }
  .glyph { min-width: 35px; height: 35px; font-size: 21px; }
  .section-heading { margin-top: 18px; margin-bottom: 9px; }
  h2 { font-size: 1.38rem; }
  .home-grid, .garden-layout { grid-template-columns: 1fr; gap: 0; }
  .garden-layout { gap: 13px; }
  .garden-board img { max-height: 230px; object-position: 65% 60%; }
  .page-heading { margin: 9px 0 17px; }
  .page-heading h1 { font-size: 2.2rem; }
  .page-heading p { font-size: .93rem; }
  .entry { padding: 12px; gap: 8px; }
  .entry-tools { gap: 0; }
  .icon-button { min-width: 30px; }
  #toast { bottom: calc(68px + env(safe-area-inset-bottom)); }
  .sheet-body { padding: 16px; }
  .sheet-header { padding: 13px 16px; }
}
@media (max-width: 360px) {
  .form-row, .compare-grid { grid-template-columns: 1fr; }
  .tile small { display: none; }
}
