/* Stella's Desk – "Cozy shop" tokens from design/DESIGN-HANDOFF.md */
:root {
  --bg: #FBF5EC;
  --surface: #FFFDF8;
  --line: #EFE4D8;
  --line-btn: #E6D9CC;
  --line-strong: #DCCFC2;
  --ink: #3A2E28;
  --muted: #7B6B60;
  --accent: #7A5A8C;
  --accent-ink: #6A4A7C;
  --accent-soft: #E9DDF0;
  --lilac-panel: #F3ECF6;
  --seg: #F3EADF;
  --awning-lilac: #E4D6EC;
  --awning-cream: #F7EEE2;
  --awning-cap: #E2C4B4;
  --peach: #F8E1D6; --peach-ink: #9A4F36;
  --sky: #E0E8F4; --sky-ink: #3F5F8C;
  --butter: #F5E9C8; --butter-ink: #7A5C0E;
  --mint: #DDEDE3; --mint-ink: #2F6B4E;
  --rose: #F6E3E6; --rose-ink: #8A3D50;
  --gray: #EFE7DE; --gray-ink: #5A4C43;
  --serif: Fraunces, Georgia, serif;
  --sans: Nunito, "Noto Sans Myanmar", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.35;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--accent); }
button { font: inherit; cursor: pointer; color: inherit; }
img { display: block; }
h1, h2, p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* awning */
.awning { display: flex; flex-direction: column; }
.awning i { display: block; }
.awning .cap { height: 4px; background: var(--awning-cap); }
.awning .stripes { height: 16px; background: repeating-linear-gradient(90deg, var(--awning-lilac) 0 26px, var(--awning-cream) 26px 52px); }
.awning .scallop { height: 13px; background-image: radial-gradient(circle at 13px 0, var(--awning-lilac) 12.5px, transparent 13px), radial-gradient(circle at 39px 0, var(--awning-cream) 12.5px, transparent 13px); background-size: 52px 13px; background-repeat: repeat-x; }

.shell { max-width: 480px; margin: 0 auto; }
body.has-tabs .shell { padding-bottom: 96px; }
body.has-foot .shell { padding-bottom: 100px; }

/* header */
.hdr { display: flex; align-items: center; gap: 12px; padding: 4px 18px 8px; }
.hdr .tt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hdr h1 { font-family: var(--serif); font-weight: 600; font-size: 27px; line-height: 1.1; }
.hdr .sub { font-size: 12px; color: var(--muted); }
.hdr.home { justify-content: space-between; padding: 2px 22px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 20px; color: var(--accent); }
.rbtn { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-btn); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; padding: 0; }

main.page { padding: 6px 18px 20px; display: flex; flex-direction: column; gap: 14px; }

/* type */
.h2 { font-family: var(--serif); font-style: italic; font-size: 19px; font-weight: 500; }
.rowhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rowhead a { font-size: 14px; font-weight: 700; text-decoration: none; }
.small { font-size: 12px; color: var(--muted); }
.b { font-weight: 700; }
.unknown { color: var(--butter-ink); font-weight: 700; }
.num { font-family: var(--serif); font-weight: 600; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); }
.card.row { flex-direction: row; align-items: center; gap: 12px; }
.card .grow, .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
a.card:active { background: #FBF7F0; }
.divider { height: 1px; background: var(--line); }
.list { display: flex; flex-direction: column; gap: 12px; }

/* tiles, avatars, chips */
.tile { border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; padding: 5px; }
.tile img { width: 100%; height: 100%; object-fit: contain; }
.av { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 600; flex: 0 0 auto; }
.chip { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; align-self: flex-start; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.c-peach { background: var(--peach); color: var(--peach-ink); }
.c-sky { background: var(--sky); color: var(--sky-ink); }
.c-butter { background: var(--butter); color: var(--butter-ink); }
.c-mint { background: var(--mint); color: var(--mint-ink); }
.c-rose { background: var(--rose); color: var(--rose-ink); }
.c-gray { background: var(--gray); color: var(--gray-ink); }
.c-lilac { background: var(--accent-soft); color: var(--accent-ink); }

/* buttons */
.btn { min-height: 50px; padding: 0 20px; border-radius: 999px; background: var(--accent); color: #fff; border: none; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.wide { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn.small { min-height: 44px; font-size: 14px; padding: 0 16px; }
.mini { min-height: 34px; min-width: 44px; padding: 0 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line-strong); font-size: 12px; font-weight: 600; }

/* segmented control + filter chips */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--seg); }
.seg button { flex: 1; min-height: 38px; border: none; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; font-weight: 700; }
.fchips { display: flex; gap: 8px; flex-wrap: wrap; }
.fchips button { min-height: 36px; padding: 0 12px; border-radius: 999px; border: none; background: var(--gray); color: var(--gray-ink); font-weight: 700; font-size: 13px; }
.fchips button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); }

/* search */
.search { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-btn); color: var(--muted); }
.search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font: inherit; color: var(--ink); min-height: 44px; }

/* banners */
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 22px; }
.banner img { width: 96px; height: 96px; object-fit: contain; flex: 0 0 auto; }
.banner .ttl { font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.15; }
.banner .txt { font-size: 13px; line-height: 1.4; }

/* home */
.greet { display: flex; gap: 16px; align-items: stretch; }
.greet > img { width: 128px; height: 156px; object-fit: contain; flex: 0 0 auto; }
.greet .g { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.greet h1 { font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.1; }
.greet .lead { font-size: 14px; color: var(--muted); line-height: 1.4; }
.shelves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shelf { gap: 4px; }
.shelf .top { display: flex; justify-content: space-between; align-items: center; }
.shelf .n { font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.2; }
.shelf img { width: 40px; height: 40px; object-fit: contain; }
.note { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; }
.warnline { font-size: 12px; color: var(--butter-ink); display: flex; gap: 6px; align-items: center; }

/* more */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mtile { gap: 6px; padding: 14px 14px 16px; }
.mtile .top { display: flex; justify-content: space-between; align-items: flex-start; }
.mtile .ic { width: 44px; height: 44px; border-radius: 12px; padding: 4px; }
.mtile .ic img { width: 100%; height: 100%; object-fit: contain; }
.mtile .n { font-family: var(--serif); font-weight: 600; font-size: 22px; }
.mtile .t { font-weight: 700; font-size: 16px; margin-top: 4px; }
.account { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 22px; background: var(--accent-soft); }
.account img { width: 44px; height: 56px; object-fit: contain; }

/* progress ring + bar */
.ring { position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring span { position: relative; font-size: 11px; font-weight: 800; }
.bar { height: 8px; border-radius: 999px; background: var(--sky); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--sky-ink); }

/* stage tracker */
.hero { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 24px; background: var(--rose); }
.hero .ttl { font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.15; }
.steps { list-style: none; margin: 0; padding: 12px 8px; border-radius: 16px; background: #fff; display: flex; gap: 2px; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; font-size: 10px; font-weight: 600; text-align: center; }
.steps .st { width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; }
.st.done { background: var(--mint); color: var(--mint-ink); }
.st.todo { background: #fff; color: var(--muted); border: 1.5px solid var(--line-strong); }
.st.none { background: #fff; color: var(--muted); border: 1.5px dashed var(--muted); }
.steps li.off { color: var(--muted); }

/* key/value rows */
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv > :first-child { color: var(--muted); }
.kv > :last-child { text-align: right; font-weight: 600; }
.diff { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 13px; }
.diff .k { flex: 1; color: var(--muted); }
.diff .old { color: var(--muted); text-decoration: line-through; }
.diff .new { font-weight: 700; color: var(--accent); }
.bubble { align-self: flex-start; padding: 8px 12px; border-radius: 4px 14px 14px 14px; background: var(--lilac-panel); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.nosave { aspect-ratio: 1; border-radius: 14px; border: 1.5px dashed #C9B9AA; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; }

/* shop group head */
.ghead { display: flex; align-items: center; gap: 10px; padding: 4px 2px 0; }
.ghead img { width: 30px; height: 30px; object-fit: contain; }
.ghead .h2 { flex: 1; font-size: 17px; }
.qty { font-family: var(--serif); font-weight: 600; font-size: 18px; }
.cust { font-size: 13px; color: var(--accent); font-weight: 700; }
.numbox { width: 26px; height: 26px; border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.line-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }

/* history timeline */
.tl { display: flex; flex-direction: column; }
.tl .ev { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; position: relative; }
.tl .ev:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 40px; bottom: -6px; width: 2px; background: var(--line); }
.tl .ic { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }

/* sticky footer bar (detail screens) */
.foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; }
.foot > div { max-width: 480px; margin: 0 auto; display: flex; gap: 10px; align-items: center; padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); border-radius: 24px 24px 0 0; }

/* bottom tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--line); }
.tabbar .in { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 8px calc(10px + env(safe-area-inset-bottom)); }
.tabbar a { position: relative; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tabbar .ico { height: 30px; display: inline-flex; align-items: flex-end; justify-content: center; }
.tabbar img { width: 24px; height: 24px; object-fit: contain; opacity: .5; }
.tabbar .u { width: 18px; height: 3px; border-radius: 2px; background: transparent; }
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.tabbar a[aria-current="page"] img { width: 30px; height: 30px; opacity: 1; }
.tabbar a[aria-current="page"] .u { background: var(--accent); }
.tabbar .dot { position: absolute; top: 4px; left: 50%; margin-left: 10px; width: 9px; height: 9px; border-radius: 50%; background: #B5654A; border: 2px solid var(--surface); }

/* states */
.sk { background: #F1E8DD; border-radius: 18px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 12px; text-align: center; color: var(--muted); }
.empty img { width: 150px; height: 150px; object-fit: contain; }
.err { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 12px; text-align: center; }
.err .small { overflow-wrap: anywhere; }

/* sign in */
.signin { min-height: calc(100vh - 33px); display: flex; flex-direction: column; padding: 16px 18px 24px; gap: 14px; }
.signin .hero2 { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.signin .hero2 img { width: min(280px, 70vw); height: auto; aspect-ratio: 1; object-fit: contain; }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.signin h1 { font-family: var(--serif); font-size: 36px; font-weight: 600; line-height: 1.05; }
.signin p { color: var(--muted); line-height: 1.5; max-width: 280px; margin: 0 auto; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.field input { min-height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; font-weight: 400; color: var(--ink); }
.msg { padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; }
