/* My Way — shared page styles (Notion-like). */
:root {
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --wash: #f7f6f3;
  --ink: #37352f;
  --muted: #787774;
  --faint: #a5a29d;
  --line: rgba(55, 53, 47, 0.09);
  --line-strong: rgba(55, 53, 47, 0.16);
  --hover: rgba(55, 53, 47, 0.06);
  --press: rgba(55, 53, 47, 0.1);
  --blue: #2383e2;
  --blue-hover: #0077d4;
  --red: #e03e3e;
  --green: #448361;
  --quest: #c9962e;
  --callout: #f1f1ef;
  --pop-shadow: rgba(15, 15, 15, 0.05) 0 0 0 1px, rgba(15, 15, 15, 0.1) 0 3px 6px, rgba(15, 15, 15, 0.2) 0 9px 24px;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #191919; --bg-elevated: #252525; --wash: #202020; --ink: rgba(255, 255, 255, 0.81);
    --muted: rgba(255, 255, 255, 0.46); --faint: rgba(255, 255, 255, 0.28);
    --line: rgba(255, 255, 255, 0.094); --line-strong: rgba(255, 255, 255, 0.16);
    --hover: rgba(255, 255, 255, 0.055); --press: rgba(255, 255, 255, 0.1);
    --red: #ff7369; --green: #4dab9a; --quest: #e6b55c; --callout: #252525;
    --pop-shadow: rgba(15, 15, 15, 0.1) 0 0 0 1px, rgba(15, 15, 15, 0.2) 0 3px 6px, rgba(15, 15, 15, 0.4) 0 9px 24px;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #191919; --bg-elevated: #252525; --wash: #202020; --ink: rgba(255, 255, 255, 0.81);
  --muted: rgba(255, 255, 255, 0.46); --faint: rgba(255, 255, 255, 0.28);
  --line: rgba(255, 255, 255, 0.094); --line-strong: rgba(255, 255, 255, 0.16);
  --hover: rgba(255, 255, 255, 0.055); --press: rgba(255, 255, 255, 0.1);
  --red: #ff7369; --green: #4dab9a; --quest: #e6b55c; --callout: #252525;
  --pop-shadow: rgba(15, 15, 15, 0.1) 0 0 0 1px, rgba(15, 15, 15, 0.2) 0 3px 6px, rgba(15, 15, 15, 0.4) 0 9px 24px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
[hidden] { display: none !important; }
input[type="checkbox"] { accent-color: var(--blue); width: 16px; height: 16px; }
:focus-visible { outline: 2px solid rgba(35, 131, 226, 0.5); outline-offset: 1px; border-radius: 4px; }

/* top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 45px;
  padding: max(0px, env(safe-area-inset-top)) 12px 0;
  background: var(--bg);
}
.crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumb .sep { color: var(--faint); }
a.crumb:hover { background: var(--hover); }
.icon-btn {
  width: 32px; height: 28px;
  border: 0; border-radius: 4px;
  background: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }

/* page */
.page {
  max-width: 600px;
  margin: 0 auto;
  padding: 28px 16px max(64px, env(safe-area-inset-bottom));
}
.page.wide { max-width: 900px; }
.page-icon { font-size: 64px; line-height: 1.1; margin-bottom: 8px; }
.page-title {
  font-size: 40px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

/* properties */
.props { display: grid; gap: 2px; margin-bottom: 4px; }
.prop {
  display: grid;
  grid-template-columns: 148px 1fr;
  align-items: center;
  min-height: 34px;
  font-size: 14px;
}
.prop-k { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.prop-i { width: 16px; text-align: center; color: var(--faint); font-size: 14px; }
.prop-v { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 6px; border-radius: 4px; }
.prop-v .empty { color: var(--faint); }
.bar { flex: 0 0 96px; height: 4px; border-radius: 2px; background: var(--line-strong); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--green); transition: width 0.4s; }

.divider { border: 0; border-top: 1px solid var(--line); margin: 14px 0 18px; }

/* buttons */
.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  font: 500 14px/1.2 var(--sans);
  padding: 10px 14px;
  min-height: 40px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}
.btn:hover { background: var(--hover); }
.btn:active { background: var(--press); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary {
  background: var(--blue);
  border-color: transparent;
  color: #fff;
  font-size: 15px;
  min-height: 46px;
}
.btn-primary:hover { background: var(--blue-hover); }
.btn-primary:active { background: var(--blue-hover); }
.btn-danger { color: var(--red); }
.btn-sm { min-height: 30px; padding: 5px 10px; font-size: 13px; }
.link-btn {
  border: 0; background: none; padding: 0;
  color: var(--ink);
  font: inherit; font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  cursor: pointer;
}

/* callout */
.callout {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--callout);
  border-radius: 6px;
  padding: 14px 16px 14px 12px;
  margin-top: 18px;
  font-size: 15px;
  line-height: 1.5;
}
.callout-i { font-size: 18px; line-height: 1.35; }

/* toggles */
.toggle { margin-top: 10px; }
.toggle:first-of-type { margin-top: 22px; }
.toggle summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
}
.toggle summary::-webkit-details-marker { display: none; }
.toggle summary::before {
  content: "";
  width: 0; height: 0;
  border-left: 6px solid var(--ink);
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
  margin: 0 8px 0 6px;
  transition: transform 0.15s;
}
.toggle[open] summary::before { transform: rotate(90deg); }
.toggle summary:hover { background: var(--hover); }
.toggle .count { color: var(--faint); font-weight: 400; font-size: 14px; }
.toggle-body { padding: 6px 0 4px 26px; }
.hint-text { color: var(--muted); font-size: 14px; margin: 0 0 8px; }

/* inputs */
.input {
  width: 100%;
  font: 16px var(--sans);
  color: var(--ink);
  background: var(--wash);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px 10px;
  outline: none;
}
.input:focus { border-color: rgba(35, 131, 226, 0.6); box-shadow: 0 0 0 3px rgba(35, 131, 226, 0.15); }
.input::placeholder { color: var(--faint); }

@media (max-width: 420px) {
  .page-title { font-size: 32px; }
  .page-icon { font-size: 52px; }
  .prop { grid-template-columns: 128px 1fr; }
  .bar { flex-basis: 64px; }
}
