/* yamin-app · slice 1. Brand: YAMIN wordmark #BC8F7C (warm wood).
   Text-on-accent uses the darker --accent-ink so contrast passes WCAG AA. */
:root {
  --bg: #F7F2EE; --surface: #FFFFFF; --surface-2: #F1E9E3; --line: #E2D6CD;
  --ink: #2B211C; --ink-2: #6B5B52; --accent: #BC8F7C; --accent-ink: #7A4E3B;
  --on-accent: #FFFFFF; --red: #B3261E; --red-bg: #FCE8E6; --amber: #8A5A00;
  --amber-bg: #FFF1D6; --green: #1E6B3A; --green-bg: #E3F4E8; --focus: #1A5FB4;
  --radius: 14px; --shadow: 0 1px 2px rgba(43,33,28,.08), 0 4px 14px rgba(43,33,28,.06);
  --font: "Assistant", "Heebo", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16110E; --surface: #221A16; --surface-2: #2C221D; --line: #3D3029;
    --ink: #F2EAE4; --ink-2: #C2B2A8; --accent: #D2A893; --accent-ink: #E5C2B1;
    --on-accent: #1E1612; --red: #FF8A80; --red-bg: #3A1D1A; --amber: #F2C46D;
    --amber-bg: #33280F; --green: #8FD9A8; --green-bg: #15301F; --focus: #8AB4F8;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
a { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
h1 { font-size: 1.4rem; margin: .4rem 0 1rem; line-height: 1.3; text-wrap: balance; }
h2 { font-size: 1.1rem; margin: 1.2rem 0 .5rem; text-wrap: balance; }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 8px; top: 8px; z-index: 50; background: var(--surface); padding: 8px; }

/* logo */
.logo { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.logo img { height: 31px; width: auto; }
.logo .tagline { font-size: .8rem; color: var(--ink-2); letter-spacing: .02em; }
.logo.small img { height: 20px; }
.logo.small .tagline { display: none; }

/* buttons + inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #1E1612; } }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: currentColor; background: transparent; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.linkish { background: none; border: 0; padding: 10px 0; font: inherit; color: var(--accent-ink);
  cursor: pointer; text-align: start; min-height: 44px; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input, textarea, select { width: 100%; min-height: 48px; padding: 10px 12px; font: inherit;
  font-size: 17px; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; }
textarea { min-height: 96px; resize: vertical; }
input[dir="ltr"] { text-align: right; }
input:focus, textarea:focus { border-color: var(--accent-ink); }
.pw { position: relative; }
.pw input { padding-inline-end: 52px; }
.pw .eye { position: absolute; inset-inline-end: 4px; top: 4px; width: 44px; height: 40px;
  border: 0; background: none; font-size: 18px; cursor: pointer; border-radius: 8px; }
.pw .eye[aria-pressed="true"] { background: var(--surface-2); }
.msg { padding: 10px 12px; border-radius: 10px; margin: 8px 0; }
.msg.err { background: var(--red-bg); color: var(--red); }
.msg.ok { background: var(--green-bg); color: var(--green); }
.msg.warn { background: var(--amber-bg); color: var(--amber); }

/* auth pages */
body.auth { min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 20px;
  padding: 28px 22px; box-shadow: var(--shadow); text-align: start; }
.auth-card > .logo { display: flex; margin: 0 auto 8px; }
.auth-card h1 { text-align: center; }
.auth-card form .btn { margin-top: 20px; }
.forgot { margin-top: 16px; color: var(--ink-2); }
.forgot summary { cursor: pointer; color: var(--accent-ink); min-height: 44px; display: flex; align-items: center; }
.install { margin-top: 12px; }
.ios-hint { font-size: .9rem; color: var(--ink-2); }
footer.ripa { text-align: center; font-size: .85rem; color: var(--ink-2); padding: 18px 16px 90px; }
body.auth footer.ripa { padding-bottom: 0; }

/* app frame */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--line); }
.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a { padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2);
  font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.top nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid;
  place-items: center; font-size: 20px; border-radius: 10px; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; inset-inline-end: 0; top: 48px; min-width: 220px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 8px 16px; box-shadow: var(--shadow); }
.menu-body a, .menu-body .linkish { display: flex; align-items: center; min-height: 44px; width: 100%; }
.menu-body .who { color: var(--ink-2); font-size: .9rem; margin: 6px 0; }
main#view { padding: 12px 16px 150px; max-width: 1280px; margin: 0 auto; outline: none; }
.state { text-align: center; color: var(--ink-2); padding: 40px 12px; }
.state .btn { margin-top: 12px; }

/* filters + tabs */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.warn[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
@media (prefers-color-scheme: dark) { .chip.warn[aria-pressed="true"] { color: #1E1612; } }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--surface-2);
  padding: 4px; border-radius: 12px; margin-bottom: 12px; }
.tabs button { min-height: 52px; border: 0; border-radius: 9px; background: none; font: inherit;
  font-size: .82rem; font-weight: 600; color: var(--ink-2); cursor: pointer; line-height: 1.2; padding: 4px 2px; }
.tabs button b { display: block; font-size: 1.05rem; color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.cols { display: block; }
.col h2 { display: none; }
.col:not(.on) { display: none; }
@media (min-width: 900px) {
  .tabs { display: none; }
  .cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .col, .col:not(.on) { display: block; background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 200px; }
  .col h2 { display: flex; justify-content: space-between; margin: 4px 4px 10px; font-size: 1rem; }
}

/* cards */
.card { display: block; width: 100%; text-align: start; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow); font: inherit; cursor: pointer; }
.card.red { border-inline-start: 5px solid var(--red); background: linear-gradient(0deg, var(--red-bg), var(--red-bg)) padding-box; }
.card .row1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card .name { font-weight: 700; font-size: 1.05rem; }
.card .meta { color: var(--ink-2); font-size: .9rem; }
.card .next { margin-top: 6px; font-size: .95rem; }
.card.red .next { color: var(--red); font-weight: 700; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  background: var(--amber-bg); color: var(--amber); margin-inline-start: 4px; white-space: nowrap; }
.tag.new { background: var(--green-bg); color: var(--green); }
.tag.red { background: var(--red); color: #fff; }
@media (prefers-color-scheme: dark) { .tag.red { color: #1E1612; } }
.empty { text-align: center; color: var(--ink-2); padding: 24px 8px; }

/* fab + feedback */
.fab { position: fixed; inset-inline-start: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20; min-height: 56px; padding: 0 22px; border-radius: 999px; border: 0;
  background: var(--accent-ink); color: var(--on-accent); font: inherit; font-size: 1.1rem; font-weight: 700;
  box-shadow: 0 6px 18px rgba(0,0,0,.25); cursor: pointer; }
@media (prefers-color-scheme: dark) { .fab { color: #1E1612; } }
.fb-btn { position: fixed; inset-inline-end: 16px; bottom: max(24px, calc(env(safe-area-inset-bottom) + 8px));
  z-index: 19; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font: inherit; font-size: .85rem; cursor: pointer; }
@media (max-width: 360px) { .fb-btn { font-size: .78rem; padding: 0 8px; } }

/* toast */
.toast { position: fixed; inset-inline: 16px; bottom: 88px; z-index: 30; margin: 0 auto; max-width: 420px;
  background: var(--ink); color: var(--bg); border-radius: 12px; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: var(--shadow); }
.toast button { background: none; border: 1px solid currentColor; color: inherit; border-radius: 8px;
  min-height: 40px; padding: 0 12px; font: inherit; font-weight: 700; cursor: pointer; }

/* sheet (dialog) */
dialog#sheet { width: 100%; max-width: 560px; max-height: 92dvh; border: 0; padding: 0;
  border-radius: 20px 20px 0 0; margin: auto auto 0; background: var(--surface); color: var(--ink); }
@media (min-width: 700px) { dialog#sheet { border-radius: 20px; margin: auto; } }
dialog#sheet::backdrop { background: rgba(0,0,0,.45); }
.sheet-in { padding: 18px 16px 24px; overflow: auto; max-height: 92dvh; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sheet-head h2 { margin: 0; font-size: 1.2rem; }
.x { width: 44px; height: 44px; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--ink-2); border-radius: 10px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.opt[aria-pressed="true"] { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); font-weight: 700; }
@media (prefers-color-scheme: dark) { .opt[aria-pressed="true"] { color: #1E1612; } }
fieldset { border: 0; padding: 0; margin: 14px 0 0; }
legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 6px; }
.more summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--accent-ink); font-weight: 600; }
.actions { display: flex; gap: 10px; margin-top: 18px; }
.actions .btn { flex: 1; }
.dup { margin-top: 8px; }
.dup .btn { margin-top: 6px; min-height: 40px; }
.paste-row { display: flex; justify-content: flex-start; margin-top: 4px; }
.mic { min-width: 44px; }

/* lead page */
.lead-top { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.lead-top h1 { margin: 0 0 4px; }
.lead-top .meta { color: var(--ink-2); }
.contact { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 14px; margin-top: 12px; box-shadow: var(--shadow); }
.panel h2 { margin-top: 0; }
.panel.red { outline: 2px solid var(--red); }
.said { list-style: none; padding: 0; margin: 10px 0 0; }
.said li { border-top: 1px solid var(--line); padding: 10px 0; }
.said .when { color: var(--ink-2); font-size: .85rem; }
.stage-move { display: flex; flex-wrap: wrap; gap: 8px; }
.back { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; }
dl.kv dt { color: var(--ink-2); }
dl.kv dd { margin: 0; }

/* morning */
.band { background: var(--surface); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.band h2 { margin-top: 0; display: flex; justify-content: space-between; }
.band.stuck { border-inline-start: 5px solid var(--red); }
.band ul { list-style: none; margin: 0; padding: 0; }
.band li a { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; min-height: 44px;
  border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.band li:first-child a { border-top: 0; }
.band .sub { color: var(--ink-2); font-size: .9rem; }
.nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.num { font-size: .9rem; }
.num { background: var(--surface-2); border-radius: 12px; padding: 10px; }
.num b { display: block; font-size: 1.6rem; }
@media (min-width: 900px) { .morning { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; align-items: start; } .morning .band.month { grid-column: 1 / -1; } }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: start; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
/* no transition on .opt/.chip: a choice must look chosen at once (Maya 1916 §1) */
.card { cursor: default; }
.card-link { display: block; color: inherit; text-decoration: none; min-height: 44px; }
.card-foot { display: flex; justify-content: flex-end; margin-top: 2px; }
.card-foot .linkish { padding: 6px 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sub { color: var(--ink-2); font-size: .9rem; }
details.panel > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; color: var(--ink); }

.tag.days { background: var(--surface-2); color: var(--ink-2); }
.tag.days.warn { background: var(--amber-bg); color: var(--amber); }
.tag.days.red { background: var(--red); color: #fff; }
@media (prefers-color-scheme: dark) { .tag.days.red { color: #1E1612; } }

.band li a > span:last-child { white-space: nowrap; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-top: 16px; }
label.check input { width: 24px; min-height: 24px; height: 24px; margin-top: 2px; flex: none; }
.auth-card form + form .btn { margin-top: 8px; }
.linkbox { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.linkbox input { flex: 1 1 100%; font-size: 14px; }
.req { border-top: 1px solid var(--line); padding: 12px 0; }
.req:first-of-type { border-top: 0; }
table.list td[dir="ltr"] { white-space: nowrap; }
