/* jeannie.skin — same bones as jeannie.today. Lexend (self-hosted), 15px desktop / 17px phone, dusty rose accent,
   flat matte surfaces on true black, hairlines, no shadows. The product is the hero; controls stay slim and quiet. */
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/assets/fonts/lexend.woff2) format("woff2"); }

:root {
  --bg: #0a0a0a; --card: rgba(255, 255, 255, .035); --card-2: #161616; --line: #232323; --line-2: #2e2e2e;
  --text: #edece8; --muted: #8f8f8a; --accent: #ee779e; --accent-2: #f4a3bf; --accent-ink: #20090f;
  --accent-soft: rgba(238, 119, 158, .14); --tile: #f3ebee;
  --radius: 6px; --sans: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sa-l: env(safe-area-inset-left, 0px); --sa-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; font-size: 15px; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 1rem; line-height: 1.5; text-align: left; overflow-x: hidden; overflow-wrap: anywhere; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a.plain { text-decoration: none; }
p, li, .muted, .calm, .prose { max-width: 70ch; }
h1, h2, h3 { font-weight: 700; font-style: normal; line-height: 1.25; margin: 0 0 .35em; }
h1 { font-size: 1.6rem; letter-spacing: -0.02em; }
h2 { font-size: 1.05rem; }
em, i { font-style: normal; color: var(--accent); font-weight: 700; }
strong, b { font-weight: 700; }
[hidden] { display: none !important; }
img { max-width: 100%; }

/* header / footer */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; max-width: 640px; margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top, 0px)) calc(14px + var(--sa-r)) 4px calc(14px + var(--sa-l)); }
.brand { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 1.15rem; font-weight: 500; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand .accent, .auth h1 .accent { color: var(--accent); font-weight: 600; }
.mark { color: var(--accent); width: 1.2em; height: 1.2em; vertical-align: -0.22em; flex: 0 0 auto; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 8px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.foot { max-width: 640px; margin: 28px auto 0; padding: 8px calc(14px + var(--sa-r)) calc(20px + env(safe-area-inset-bottom, 0px)) calc(14px + var(--sa-l)); display: flex; justify-content: flex-end; }
.foot form { margin: 0; }

/* layout */
.wrap { max-width: 640px; margin: 0 auto; padding: 6px calc(14px + var(--sa-r)) 16px calc(14px + var(--sa-l)); }
.greet { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.025em; margin: 8px 0 14px; line-height: 1.25; }
.greet .date { display: block; margin-top: 3px; font-size: .95rem; line-height: 1.45; color: var(--muted); font-weight: 400; letter-spacing: 0; max-width: 46ch; }
.layer { margin: 0 0 26px; }
.layer h2 { font-size: 1.2rem; font-weight: 500; line-height: 1.3; margin: 0 0 6px; padding: 1px 0 1px 10px; border-left: 3px solid var(--accent); }
.layer h2 .plain { text-decoration: none; }
.calm, .muted { color: var(--muted); }
.calm { margin: 4px 0; }
.small { font-size: .9rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 8px; }
.card.notice p { margin: .4em 0; }
.card > h2 { font-size: .95rem; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.note { color: var(--muted); font-size: .95rem; border-left: 3px solid var(--line-2); padding: 2px 0 2px 10px; margin: 0 0 14px; }
.toast { background: var(--card-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 8px 12px; margin: 0 0 12px; font-weight: 600; }
.soft-error { background: var(--card-2); border-left: 3px solid var(--accent); padding: 8px 10px; border-radius: var(--radius); }

/* buttons: slim and quiet; bold only for real emphasis */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 6px 14px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); font: inherit; font-weight: 500; text-decoration: none; text-align: center; cursor: pointer; line-height: 1.3; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn.ghost:hover, .btn.ghost:focus-visible { color: var(--text); }
.btn.outline { background: transparent; color: var(--text); border-color: var(--accent); }
.btn.small { font-size: .9rem; padding: 4px 10px; }
.btn.wide { width: 100%; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible, .ib:focus-visible, summary:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.row form { margin: 0; }
.add-row { margin: 16px 0 0; justify-content: space-between; }
.add-row form { margin: 0; }
.detail-actions { justify-content: space-between; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.detail-actions .end { display: flex; gap: 4px; }

/* product rows (routines, library, picker): photo + name are the content; everything else is quiet */
.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.step { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: 2px; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step.dragging { opacity: .4; }
.tickform { grid-column: 1; grid-row: 1; margin: 0; min-width: 0; display: flex; }
.tick { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; min-height: 64px; padding: 8px 4px 8px 2px; border: 0; border-radius: var(--radius); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tick .box { flex: 0 0 22px; width: 22px; height: 22px; border: 1.5px solid var(--muted); border-radius: 6px; background: transparent; position: relative; transition: border-color .15s, background-color .15s; }
.tick .box::after { content: ''; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); opacity: 0; transition: opacity .15s; }
.tick[aria-checked="true"] .box { background: var(--accent-soft); border-color: var(--accent); }
.tick[aria-checked="true"] .box::after { opacity: 1; }
.tick:hover .box, .tick:focus-visible .box { border-color: var(--accent); }
.step.done .name { color: var(--muted); font-weight: 500; }
.step.done .thumb { opacity: .55; }
.tk { flex: 0 0 22px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.num { color: var(--muted); font-size: .7rem; line-height: 1; font-variant-numeric: tabular-nums; }
/* Photo tile: a soft rose-white tile; the photo multiplies onto it so mixed white-background bottle shots look uniform. */
.thumb { flex: 0 0 56px; width: 56px; height: 56px; padding: 4px; border-radius: 8px; background: var(--tile); display: block; overflow: hidden; transition: opacity .15s; }
.thumb img, .big img { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.thumb.none { background: var(--card-2); border: 1px solid var(--line); }
.what { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.what .name { font-weight: 700; font-size: 1.05rem; line-height: 1.25; text-decoration: none; }
.what .brand { font-size: .85rem; line-height: 1.3; }
.stepnote { color: var(--accent-2); font-size: .85rem; }
.ctl { grid-column: 1; grid-row: 2; display: flex; gap: 0; align-items: center; padding: 0 0 4px 88px; }
.ctl form { margin: 0; display: flex; }
.ctl:empty { display: none; }
.more { grid-column: 2; grid-row: 1 / 3; align-self: stretch; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0; color: var(--muted); text-decoration: none; font-size: 1.5rem; border-radius: var(--radius); }
.more:hover, .more:focus-visible { color: var(--text); }
.ib { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--muted); font: inherit; font-size: 1rem; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ib:hover, .ib:focus-visible { color: var(--text); }
.ib:disabled { opacity: .25; cursor: default; }
.ib.grip { cursor: grab; touch-action: none; letter-spacing: -0.3em; font-size: .9rem; }
@media (min-width: 560px) {
  .step { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: auto; }
  .ctl { grid-column: 2; grid-row: 1; padding: 0; }
  .more { grid-column: 3; grid-row: 1; }
}

/* product list + picker */
.search { display: flex; gap: 8px; margin: 0 0 12px; }
.search input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); font: inherit; }
.search input::placeholder { color: var(--muted); }
.plist { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 12px; }
.prow { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 8px 2px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; margin: 0; }
.prow:first-child { border-top: 0; }
.prow .btn { flex: 0 0 auto; }
.prow .chev { flex: 0 0 auto; color: var(--muted); font-size: 1.5rem; padding: 0 4px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 14px; }
.list-head .greet { margin: 0; }

/* product detail */
.product .hero { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 6px 0 14px; }
.product .big { width: 168px; height: 168px; padding: 10px; background: var(--tile); border-radius: 14px; margin: 0 0 14px; overflow: hidden; }
.product .hero h1 { margin: 0 0 2px; font-size: 1.45rem; }
.product .hero p { margin: 0; max-width: none; }
.routine-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 6px; }
.routine-bar .tickform { margin: 0; display: flex; }
.tick.box { flex: 1 1 auto; justify-content: center; min-height: 48px; padding: 6px 12px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); font-size: 1rem; gap: 10px; }
.tick.box .box { flex-basis: 20px; width: 20px; height: 20px; }
.tick.box[aria-checked="true"] { border-color: var(--accent); color: var(--accent-2); }
.routine-bar .next { min-height: 48px; }
.routine-bar .next.last { color: var(--muted); border-color: var(--line); background: transparent; cursor: default; }
.routine-bar .next::after { content: '›'; font-size: 1.3rem; line-height: 1; margin-top: -2px; }
.routine-bar .next.last::after { content: none; }
.backlink { display: block; text-align: center; margin: 0 0 16px; }
.backlink a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--muted); text-decoration: none; font-size: .95rem; }
.backlink a:hover, .backlink a:focus-visible { color: var(--text); }
.add-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 14px; }
.add-pair form { margin: 0; display: flex; }
.add-pair .btn { flex: 1 1 auto; }
.prose { white-space: normal; }
.card .prose p { margin: 0; }
.inci { color: var(--text); font-size: .95rem; line-height: 1.65; }
details.card { padding: 0; }
details.card summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 10px 14px; font-size: .95rem; font-weight: 600; color: var(--muted); border-radius: var(--radius); }
details.card summary::-webkit-details-marker { display: none; }
details.card summary .count { font-weight: 400; margin-left: auto; }
details.card summary::after { content: '›'; font-size: 1.3rem; line-height: 1; transform: rotate(90deg); transition: transform .15s; color: var(--muted); }
details.card[open] summary::after { transform: rotate(-90deg); }
details.card .prose { padding: 0 14px 12px; }

/* forms */
.form label { display: block; margin: 0 0 12px; color: var(--muted); font-size: .95rem; }
.form input:not([type="checkbox"]):not([type="file"]), .form textarea { display: block; width: 100%; margin-top: 4px; min-height: 44px; padding: 9px 12px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); font: inherit; line-height: 1.4; }
.form input::placeholder, .form textarea::placeholder { color: #5f5f5b; }
.form textarea { resize: vertical; min-height: 88px; }
.form input[type="file"] { display: block; margin-top: 6px; color: var(--muted); font: inherit; font-size: .9rem; min-height: 44px; padding: 8px 0; }
.form input[type="file"]::file-selector-button { font: inherit; font-size: .9rem; min-height: 36px; padding: 4px 12px; margin-right: 10px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); cursor: pointer; }
.form .check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.form .check input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; }
.form .row { margin-top: 4px; }
.auth { max-width: 420px; margin: 8vh auto 0; }
.auth h1 { font-weight: 500; letter-spacing: 0; text-align: center; }
.install { max-width: 420px; margin: 1rem auto 0; }

/* usage: plain facts, quiet */
.quiet-link { text-align: center; margin: 22px 0 0; }
.quiet-link a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--muted); font-size: .9rem; text-decoration: none; border-bottom: 1px solid transparent; }
.quiet-link a:hover, .quiet-link a:focus-visible { color: var(--text); }
.usage .last { margin: 0 0 8px; }
.usage .stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 0 0 10px; }
.usage .stats div { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; min-width: 0; }
.usage .stats dt { font-size: .8rem; color: var(--muted); line-height: 1.25; }
.usage .stats dd { margin: 2px 0 0; font-size: 1.15rem; font-weight: 600; line-height: 1.2; }
.usage .days { list-style: none; margin: 0; padding: 0; }
.usage .days li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); font-size: .95rem; }
.usage .days li:first-child { border-top: 0; }
.usage .fold { margin-top: 2px; }
.usage .fold summary { list-style: none; cursor: pointer; display: flex; align-items: center; min-height: 44px; font-size: .9rem; color: var(--muted); }
.usage .fold summary::-webkit-details-marker { display: none; }
.usage .fold summary::before { content: '›'; font-size: 1.2rem; line-height: 1; margin-right: 8px; transform: rotate(90deg); transition: transform .15s; }
.usage .fold[open] summary::before { transform: rotate(-90deg); }
.logday h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.logday .when { margin: 8px 0 2px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.entries { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.entries li { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; padding: 4px 2px; border-top: 1px solid var(--line); }
.entries li:first-child { border-top: 0; }
.entries a { text-decoration: none; min-width: 0; }
.entries .time { flex: 0 0 auto; font-size: .9rem; font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  html { font-size: 17px; }
  .greet { font-size: 1.3rem; }
  .thumb { flex-basis: 54px; width: 54px; height: 54px; }
  .ctl { padding-left: 84px; }
}
@media (max-width: 520px) {
  /* Phone: brand on its own line, then three even tabs. Nothing has to squeeze. */
  .nav { flex: 1 0 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: -2px; border-bottom: 1px solid var(--line); }
  .nav a { padding: 6px 4px; min-height: 44px; margin-bottom: -1px; }
  .top { padding-bottom: 0; }
  .wrap { padding-top: 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: fadein .15s ease-out; }
  @keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
