:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --ink: #2b2a27;
  --muted: #6f6a60;
  --line: #e5dfd2;
  --accent: #3f6b5a;
  --accent-soft: #e3ece6;
  --danger: #9a4a3c;
  --radius: 14px;
  --serif: ui-serif, "New York", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
}
a { color: var(--accent); }

.main {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
}
.page > * + * { margin-top: 16px; }

h2 { font: 600 13px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
h3.group { font: 600 15px/1.3 var(--serif); margin: 20px 4px 8px; color: var(--muted); }

.central {
  font: italic 19px/1.45 var(--serif);
  margin: 8px 4px 4px;
  color: var(--ink);
}
.prompt { font: italic 16px/1.5 var(--serif); color: var(--muted); margin: 24px 8px; text-align: center; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.empty { color: var(--muted); font-size: 14px; margin: 8px 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card > * + * { margin-top: 12px; }

/* Fields */
.field { display: block; }
.field-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field-hint { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=date], input:not([type]), textarea, select {
  width: 100%;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
}
textarea { resize: none; overflow: hidden; line-height: 1.45; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input.big { font: 600 18px/1.3 var(--serif); }
::placeholder { color: #a8a294; }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; min-height: 44px; }
.check input, .ms input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 > .field { margin: 0; }
@media (max-width: 380px) { .grid2 { grid-template-columns: 1fr; } }

/* Buttons */
button { font: inherit; cursor: pointer; }
.btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 999px;
  padding: 10px 20px; min-height: 44px; font-weight: 600;
}
.btn.danger { background: var(--danger); }
.btn-quiet {
  background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--accent);
  padding: 8px 16px; min-height: 40px;
}
.btn-quiet.danger { color: var(--danger); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 999px; border: 0; background: none;
  font-size: 26px; color: var(--accent); text-decoration: none; flex: none;
}
.icon-btn.ghost { visibility: hidden; }
.actions { display: flex; justify-content: center; gap: 12px; margin: 24px 0; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 14px; min-height: 40px; color: var(--ink); font-size: 15px;
}
.seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg-scroll { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: none; }
.seg-scroll::-webkit-scrollbar { display: none; }
.seg-scroll button { flex: none; }

/* Today */
.daynav { display: flex; align-items: center; justify-content: space-between; text-align: center; margin: -6px -6px 0; }
.daynav-title { font: 600 20px/1.2 var(--serif); }
.daynav-sub { font-size: 13px; color: var(--muted); }
.focus-row { display: flex; align-items: center; gap: 10px; }
.focus-n { font: 600 15px var(--serif); color: var(--muted); width: 14px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li + li { margin-top: 12px; }
.list a { font-weight: 600; text-decoration: none; }
.anchor a::before { content: "★ "; color: var(--accent); }

/* Plan */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.subtabs a {
  padding: 10px 12px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subtabs a.on { color: var(--ink); border-color: var(--accent); }
.items > * + * { margin-top: 10px; }
.item {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
}
.item > * + * { margin-top: 4px; }
.item.dim { opacity: .65; }
.item-title { font: 600 17px/1.35 var(--serif); }
.tag {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font: 600 12px/1.6 var(--sans); vertical-align: 2px;
}
.star { color: var(--accent); }
details.rest { margin-top: 20px; }
details.rest summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 8px 4px; min-height: 44px; }
.detail > .back { display: inline-block; text-decoration: none; padding: 8px 0; font-weight: 600; }
.ms { display: grid; grid-template-columns: 28px 1fr 150px 44px; gap: 8px; align-items: center; }
.ms + .ms { margin-top: 8px; }
.ms { align-items: start; }
.ms textarea { min-height: 44px; }
.ms.done textarea { text-decoration: line-through; color: var(--muted); }
@media (max-width: 480px) {
  .ms { grid-template-columns: 28px 1fr 44px; }
  .ms input[type=date] { grid-column: 2; grid-row: 2; }
  .ms .icon-btn { grid-column: 3; grid-row: 1; }
}
.note { border-left: 3px solid var(--accent-soft); padding-left: 10px; }
.note + .note { margin-top: 10px; }

/* Chrome */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center; gap: 8px;
  background: rgba(246, 243, 236, .94); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
}
.tabbar a {
  flex: 1; max-width: 200px; text-align: center; padding: 10px; min-height: 44px;
  text-decoration: none; color: var(--muted); font-weight: 600; border-radius: 999px;
}
.tabbar a.on { color: var(--accent); background: var(--accent-soft); }
.saved {
  position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 13px; padding: 6px 14px; border-radius: 999px;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.saved.show { opacity: .9; }
.ms input[type=checkbox] { margin-top: 11px; }
