/* ============================================================
   Back Home Bakery — Amanda's console
   Big tap targets and plain words: this gets used on a phone
   with flour on your hands.
   ============================================================ */

body.owner { background: var(--shiplap); }
.console { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

/* ---------- Sidebar (chalkboard) ---------- */
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 1.25rem;
  padding: 1.25rem 0.9rem;
  background: var(--chalk-board); color: var(--chalk);
  box-shadow: inset -6px 0 0 #6E5238;
}
.side-brand { display: flex; align-items: center; gap: 0.7rem; padding: 0.25rem 0.4rem 1rem; border-bottom: 1px dashed rgba(245, 240, 230, 0.25); }
.side-brand img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.side-brand .script { display: block; color: var(--butter); font-size: 1.35rem; line-height: 1.05; }
.side-brand small { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7; }
.side-nav { display: grid; gap: 0.2rem; }
.side-nav a {
  display: flex; align-items: center; gap: 0.75rem;
  min-height: 44px; padding: 0.55rem 0.8rem; border-radius: var(--radius);
  color: rgba(245, 240, 230, 0.86); text-decoration: none; font-weight: 700; font-size: 0.95rem;
}
.side-nav a svg { width: 20px; height: 20px; flex: none; opacity: 0.85; }
.side-nav a:hover { background: rgba(245, 240, 230, 0.08); color: #fff; }
.side-nav a[aria-current="page"] { background: var(--chalk); color: var(--chalk-board); }
.side-nav a[aria-current="page"] svg { opacity: 1; }
.side-nav .badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  display: grid; place-items: center; font-size: 0.75rem;
  background: var(--terracotta); color: #fff;
}
.side-nav .short { display: none; }
.side-foot { margin-top: auto; }
.side-link { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.8rem; border-radius: var(--radius); color: var(--butter); text-decoration: none; font-weight: 700; font-size: 0.9rem; }
.side-link svg { width: 18px; height: 18px; }
.side-link:hover { background: rgba(245, 240, 230, 0.08); }

/* ---------- Top bar ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(16px, 3vw, 2rem);
  background: rgba(245, 241, 233, 0.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; color: var(--wood); }
.topbar p { color: var(--muted); font-size: 0.9rem; }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.taking { padding: 0.35rem 0.8rem 0.35rem 0.4rem; border-radius: 10px; background: var(--white); border: 1px solid var(--line); font-weight: 700; font-size: 0.88rem; color: var(--st-ready); }
.taking.off { color: var(--st-baking); background: var(--butter-wash); }
.view { padding: clamp(16px, 3vw, 2rem); display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-content: start; outline: none; max-width: 1280px; width: 100%; }
.view > * { min-width: 0; }

/* ---------- Generic blocks ---------- */
.block { padding: 1.25rem 1.35rem; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.block-head h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--wood); }
.block-head p { color: var(--muted); font-size: 0.88rem; }
.block-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.empty { padding: 1.5rem 1rem; text-align: center; color: var(--muted); font-size: 0.93rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.alert {
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  padding: 0.9rem 1.1rem; border-radius: var(--radius);
  background: var(--butter-wash); border: 1px solid rgba(138, 90, 18, 0.25); color: #6A4510;
}
.alert svg { width: 22px; height: 22px; flex: none; }
.alert > div { flex: 1; min-width: 200px; }
.tag { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tag.custom { color: var(--chalk-frame); }
.tag.msg { color: var(--terracotta-dark); }
.flag { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 700; color: #8A5A12; }
.flag svg { width: 14px; height: 14px; }

/* ---------- Today ---------- */
.greet h2 { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 600; color: var(--wood); }
.greet h2 .script { font-size: 1.1em; }
.greet p { color: var(--muted); font-size: 1.02rem; margin-top: 0.2rem; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.tile { padding: 1.1rem 1.2rem; display: grid; gap: 0.2rem; text-decoration: none; color: inherit; transition: transform 0.15s ease, box-shadow 0.15s ease; }
a.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile .label { font-size: 0.85rem; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 0.45rem; }
.tile .label svg { width: 17px; height: 17px; color: var(--sage-dark); }
.tile .value { font-family: var(--font-body); font-size: 2.1rem; font-weight: 700; color: var(--charcoal); line-height: 1.15; }
.tile .sub { font-size: 0.84rem; color: var(--muted); }
.tile.hot { border-color: rgba(196, 92, 62, 0.35); background: linear-gradient(0deg, var(--terracotta-wash), var(--terracotta-wash)), var(--white); }
.tile.hot .label svg { color: var(--terracotta-dark); }
.today-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1.25rem; align-items: start; }
.today-grid > div { display: grid; gap: 1.25rem; min-width: 0; }

.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.row-item {
  display: grid; grid-template-columns: 1fr auto; gap: 0.6rem 1rem; align-items: center;
  padding: 0.8rem 0.95rem; border-radius: var(--radius); background: var(--cream); border: 1px solid var(--line);
}
.row-item .who { font-weight: 700; color: var(--wood); }
.row-item .what { font-size: 0.88rem; color: var(--muted); }
.row-item .meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.15rem; font-size: 0.8rem; color: var(--faint); }
.row-item .acts { display: flex; gap: 0.4rem; }
.row-item.clickable { cursor: pointer; }
.row-item.clickable:hover { border-color: var(--sage); background: #fff; }

.bake-list { list-style: none; margin: 0; padding: 0; }
.bake-list li { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 0.75rem; align-items: baseline; padding: 0.65rem 0; border-bottom: 1px dashed var(--line-strong); }
.bake-list li:last-child { border-bottom: 0; }
.bake-list .q { font-weight: 700; color: var(--terracotta-dark); font-variant-numeric: tabular-nums; }
.bake-list .n { font-weight: 700; color: var(--charcoal); }
.bake-list .w { font-size: 0.82rem; color: var(--muted); text-align: right; }

.pickup-day + .pickup-day { margin-top: 1rem; }
.pickup-day h3 { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sage-dark); margin-bottom: 0.5rem; display: flex; gap: 0.5rem; align-items: center; }
.pickup-day h3 .count { color: var(--faint); font-weight: 700; letter-spacing: 0; text-transform: none; }

/* ---------- Chart ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid line { stroke: rgba(92, 70, 54, 0.12); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.chart .cap { fill: var(--charcoal); font-size: 12px; font-weight: 700; font-family: var(--font-body); }
.chart .band { fill: transparent; cursor: default; outline: none; }
.chart .band-g:focus-visible .band, .chart .band-g:hover .band { fill: rgba(92, 70, 54, 0.05); }
.chart .bar-past { fill: var(--sage); }
.chart .bar-now { fill: var(--terracotta); }
.chart-tip {
  position: fixed; z-index: 400; pointer-events: none;
  padding: 0.5rem 0.7rem; border-radius: 8px;
  background: var(--charcoal); color: #fff; font-size: 0.82rem; box-shadow: var(--shadow);
  transform: translate(-50%, calc(-100% - 10px));
}
.chart-tip b { display: block; font-size: 0.95rem; }
.chart-key { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); margin-top: 0.5rem; }
.chart-key span { display: inline-flex; align-items: center; gap: 0.4rem; }
.chart-key i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
details.table-view { margin-top: 0.75rem; font-size: 0.85rem; }
details.table-view summary { cursor: pointer; color: var(--terracotta-dark); font-weight: 700; }
details.table-view table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; font-variant-numeric: tabular-nums; }
details.table-view td, details.table-view th { padding: 0.35rem 0.25rem; border-bottom: 1px solid var(--line); text-align: left; }
details.table-view td:last-child, details.table-view th:last-child { text-align: right; }

/* ---------- Orders board ---------- */
.toolbar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter {
  min-height: 38px; padding: 0.4rem 0.85rem; border-radius: 8px; cursor: pointer;
  border: 1.5px solid var(--line-strong); background: var(--white); font-weight: 700; font-size: 0.85rem; color: var(--wood);
}
.filter[aria-pressed="true"] { border-color: var(--wood); box-shadow: inset 0 0 0 1px var(--wood); background: var(--cream); }
.filter .n { opacity: 0.7; margin-left: 0.25rem; }
.search { position: relative; margin-left: auto; min-width: 220px; }
.search svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.search .input { padding-left: 2.3rem; min-height: 40px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 1rem; align-items: start; overflow-x: auto; padding-bottom: 0.25rem; }
.lane { background: rgba(255, 253, 248, 0.55); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0.75rem; display: grid; gap: 0.6rem; min-height: 140px; }
.lane-head { display: flex; align-items: center; justify-content: space-between; padding: 0.15rem 0.25rem 0.35rem; }
.lane-head .n { font-weight: 700; color: var(--muted); font-size: 0.85rem; }
.ocard { padding: 0.85rem 0.95rem; display: grid; gap: 0.45rem; cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.ocard:hover { border-color: var(--sage); transform: translateY(-1px); }
.ocard .top { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--faint); font-weight: 700; }
.ocard .who { font-weight: 700; color: var(--wood); font-size: 1rem; }
.ocard .items { font-size: 0.85rem; color: var(--muted); line-height: 1.45; }
.ocard .foot { display: flex; justify-content: space-between; align-items: center; font-size: 0.84rem; }
.ocard .foot span { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--wood); font-weight: 700; }
.ocard .foot svg { width: 15px; height: 15px; color: var(--sage-dark); }
.ocard .note-dot { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; color: var(--terracotta-dark); font-weight: 700; }
.ocard .note-dot svg { width: 14px; height: 14px; }
.ocard .btn { width: 100%; }
.lane-empty { font-size: 0.85rem; color: var(--faint); text-align: center; padding: 1.25rem 0.5rem; }

/* ---------- Editor rows (this week + menu) ---------- */
.week-head { display: grid; grid-template-columns: auto auto 1fr; gap: 1rem 1.5rem; align-items: end; }
.days { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.day {
  min-width: 52px; min-height: 40px; padding: 0.4rem 0.7rem; border-radius: 8px; cursor: pointer;
  border: 1.5px solid var(--line-strong); background: #fff; font-weight: 700; font-size: 0.85rem; color: var(--wood);
}
.day[aria-pressed="true"] { background: var(--sage-dark); border-color: var(--sage-dark); color: #fff; }
.items-editor { display: grid; gap: 0.75rem; }
.item-row {
  display: grid; grid-template-columns: auto minmax(180px, 1.4fr) 96px 104px 132px auto; gap: 0.75rem; align-items: center;
  padding: 0.9rem 1rem; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line);
}
.item-row.hidden-item { opacity: 0.6; background: var(--cream); }
.item-row .namebox { display: grid; gap: 0.35rem; }
.item-row .namebox .input { min-height: 38px; }
.item-row .namebox .input.desc { font-size: 0.88rem; color: var(--muted); }
.money { position: relative; display: block; }
.money::before { content: '$'; position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.money .input { padding-left: 1.5rem; }
.item-row .mini { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 0.2rem; }
.stock-box { display: grid; gap: 0.3rem; }
.stock-box .left { font-size: 0.82rem; color: var(--muted); }
.row-acts { display: flex; gap: 0.35rem; }
.icon-btn.on { background: var(--sage-wash); color: var(--sage-dark); border-color: var(--sage); }
.icon-btn.danger:hover { background: var(--terracotta-wash); color: var(--terracotta-dark); border-color: var(--terracotta); }
.add-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.add-row .select { max-width: 320px; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 1.25rem; align-items: start; }
.cat-card { padding: 1.1rem 1.2rem; display: grid; gap: 0.9rem; }
.cat-card.off { opacity: 0.65; }
.cat-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.cat-head h3 { font-family: var(--font-display); font-size: 1.45rem; color: var(--wood); }
.cat-price { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; color: var(--muted); }
.cat-price .money { width: 96px; }
.flav-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.4rem; }
.flav-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.35rem; align-items: center; min-height: 46px; padding: 0.3rem 0.35rem 0.3rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.flav-name { font-weight: 700; font-size: 0.9rem; color: var(--charcoal); line-height: 1.25; overflow-wrap: anywhere; }
.flav-name small { display: block; font-size: 0.72rem; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.flav-row.off { background: var(--cream); border-style: dashed; }
.flav-row.off .flav-name { color: var(--faint); }
.flav-row .icon-btn { width: 34px; height: 34px; }
.flav-add { display: flex; gap: 0.4rem; }
.flav-add .input { min-height: 38px; }
.price-rows { display: grid; gap: 0.4rem; }
.price-row { display: grid; grid-template-columns: 1fr 92px auto; gap: 0.5rem; align-items: center; }
.price-row.off .input:first-child { text-decoration: line-through; color: var(--faint); }
.price-row .input { min-height: 38px; }

/* ---------- Requests ---------- */
.req-groups { display: grid; gap: 1.5rem; }
.req-group h2 { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sage-dark); margin-bottom: 0.6rem; display: flex; gap: 0.5rem; }
.req-group h2 .n { color: var(--faint); }
.req-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.9rem; }
.rcard { padding: 1rem 1.1rem; display: grid; gap: 0.5rem; cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.rcard:hover { border-color: var(--sage); transform: translateY(-1px); }
.rcard .top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.rcard .who { font-weight: 700; color: var(--wood); font-size: 1.02rem; }
.rcard .kind { font-size: 0.88rem; color: var(--muted); }
.rcard .desc { font-size: 0.88rem; color: var(--charcoal); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard .foot { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; font-size: 0.84rem; color: var(--wood); font-weight: 700; flex-wrap: wrap; }
.rcard .foot span { display: inline-flex; align-items: center; gap: 0.35rem; }
.rcard .foot svg { width: 15px; height: 15px; color: var(--sage-dark); }

/* ---------- Website settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.settings-grid .wide { grid-column: 1 / -1; }
.stack { display: grid; gap: 0.9rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; align-items: start; }
.preview { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.preview .announce-prev { background: var(--sage-dark); color: #fff; text-align: center; font-weight: 700; font-size: 0.88rem; padding: 0.5rem 1rem; }
.preview .announce-prev .script { color: var(--butter); font-size: 1.1rem; margin-right: 0.3rem; }
.preview .hero-prev { padding: 1rem 1.1rem; background: var(--shiplap); font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--wood); line-height: 1.2; }
.preview .hero-prev .script { font-size: 1.1em; }
.saved { display: none; align-items: center; gap: 0.35rem; font-size: 0.82rem; font-weight: 700; color: var(--st-ready); }
.saved.show { display: inline-flex; }
.saved svg { width: 15px; height: 15px; }

/* ---------- Slide-over panel ---------- */
.scrim { position: fixed; inset: 0; background: rgba(47, 42, 38, 0.38); z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.scrim.open { opacity: 1; pointer-events: auto; }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 210; width: min(520px, 100%);
  background: var(--shiplap); box-shadow: var(--shadow-lift);
  transform: translateX(100%); transition: transform 0.3s ease; visibility: hidden;
  display: flex; flex-direction: column;
}
.panel.open { transform: none; visibility: visible; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.25rem; background: var(--white); border-bottom: 1px solid var(--line); }
.panel-head h2 { font-family: var(--font-display); font-size: 1.7rem; color: var(--wood); }
.panel-head p { color: var(--muted); font-size: 0.88rem; }
.panel-body { flex: 1; overflow-y: auto; padding: 1.25rem; display: grid; gap: 1.1rem; align-content: start; }
.panel-foot { padding: 1rem 1.25rem; background: var(--white); border-top: 1px solid var(--line); display: flex; gap: 0.6rem; flex-wrap: wrap; }
.panel-foot .btn-primary, .panel-foot .btn-sage { flex: 1; }
.sec h3 { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sage-dark); margin-bottom: 0.5rem; }
.contact-acts { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.lines { list-style: none; margin: 0; padding: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.lines li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--line); font-size: 0.93rem; }
.lines li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines li.total { font-weight: 700; color: var(--wood); border-bottom: 0; }
.quote-in { padding: 0.85rem 1rem; border-left: 3px solid var(--terracotta); background: var(--white); border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.93rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1.25rem; font-size: 0.93rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.history li { display: flex; gap: 0.5rem; align-items: center; }
.history li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--sage); flex: none; }
.btn-danger-ghost { background: transparent; color: var(--terracotta-dark); border-color: rgba(163, 72, 47, 0.35); }
.btn-danger-ghost:hover { background: var(--terracotta-wash); }

/* ---------- Print the bake list ---------- */
@media print {
  body.print-bake .console > :not(.main), body.print-bake .topbar, body.print-bake .view > *:not(.today-grid) { display: none !important; }
  body.print-bake .today-grid > div > *:not(#bakeBlock), body.print-bake .today-grid > div:empty { display: none !important; }
  body.print-bake #bakeBlock .btn { display: none; }
  body.print-bake .console { display: block; }
  body.print-bake .today-grid { display: block; }
  body.print-bake .card { box-shadow: none; border: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .item-row { grid-template-columns: auto 1fr 96px 104px; }
  .item-row .stock-box, .item-row .row-acts { grid-column: auto; }
}
@media (max-width: 980px) {
  .today-grid, .settings-grid { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(4, minmax(240px, 1fr)); }
}
@media (max-width: 860px) {
  .console { grid-template-columns: 1fr; padding-bottom: 72px; }
  .side {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 120;
    flex-direction: row; padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom));
    box-shadow: inset 0 4px 0 #6E5238, 0 -8px 24px rgba(0, 0, 0, 0.15);
  }
  .side-brand, .side-foot { display: none; }
  .side-nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; gap: 0.15rem; }
  .side-nav a { flex-direction: column; gap: 0.15rem; padding: 0.4rem 0.2rem; font-size: 0.68rem; position: relative; min-height: 54px; justify-content: center; }
  .side-nav .long { display: none; }
  .side-nav .short { display: inline; }
  .side-nav .badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 18px; height: 18px; font-size: 0.65rem; padding: 0 5px; }
  .topbar h1 { font-size: 1.5rem; }
  .hide-sm { display: none; }
  .taking-label { font-size: 0.8rem; }
  .week-head { grid-template-columns: 1fr; }
  .search { margin-left: 0; width: 100%; }
  .filters { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .filter { flex: none; }
}
@media (max-width: 640px) {
  .tiles { gap: 0.6rem; }
  .tile { padding: 0.85rem; }
  .tile .value { font-size: 1.6rem; }
  .two { grid-template-columns: 1fr; }
  .item-row { grid-template-columns: auto 1fr; }
  .item-row > :nth-child(n+3) { grid-column: 2; }
  .cat-grid, .req-cards { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; }
  .lane { scroll-snap-align: start; }
  .topbar p { display: none; }
}

/* ---------- Product pages ---------- */
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.pg-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 0.9rem; padding: 0.9rem; cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.pg-card:hover { border-color: var(--sage); transform: translateY(-1px); }
.pg-img, .mini-thumb, .big-thumb { display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: var(--cream-dark); color: var(--faint); flex: none; }
.pg-img { width: 96px; height: 96px; }
.pg-img img, .mini-thumb img, .big-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pg-img.cut, .mini-thumb.cut, .big-thumb.cut { background: radial-gradient(ellipse at 50% 60%, #fff, var(--cream) 75%); }
.pg-img.cut img, .mini-thumb.cut img, .big-thumb.cut img { object-fit: contain; padding: 6px; }
.pg-img svg, .big-thumb svg { width: 28px; height: 28px; }
.pg-body { display: grid; gap: 0.2rem; align-content: start; min-width: 0; }
.pg-body .top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.2rem; }
.pg-body b { color: var(--wood); font-size: 1.02rem; line-height: 1.25; }
.pg-body .muted { font-size: 0.86rem; }
.pg-meta { font-size: 0.78rem; color: var(--faint); font-weight: 700; margin-top: 0.15rem; }
.page-line { display: flex; align-items: center; gap: 0.5rem; }
.page-line .select { min-height: 36px; padding: 0.3rem 0.6rem; font-size: 0.85rem; flex: 1; min-width: 0; }
.mini-thumb { width: 36px; height: 36px; border-radius: 8px; }
.mini-thumb svg { width: 16px; height: 16px; }
.main-pic { display: flex; gap: 0.9rem; align-items: flex-start; }
.big-thumb { width: 96px; height: 96px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 0.6rem; }
.photo-tile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--cream-dark); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-acts { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.photo-acts .icon-btn { width: 30px; height: 30px; }
.photo-acts .tag { background: rgba(255, 253, 248, 0.92); }
.panel .alert { font-size: 0.9rem; }
.panel-foot .saved { align-self: center; }

/* ---------- Messages & customers ---------- */
.who-line { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.6rem; display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.who-line svg { width: 14px; height: 14px; color: var(--st-ready); }
.thread { display: grid; gap: 0.5rem; margin-bottom: 0.75rem; }
.bubble { max-width: 85%; padding: 0.6rem 0.85rem; border-radius: 14px; font-size: 0.92rem; }
.bubble span { display: block; font-size: 0.72rem; margin-top: 0.2rem; opacity: 0.8; }
.bubble.theirs { background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; justify-self: start; }
.bubble.mine { background: var(--sage-dark); color: #fff; border-bottom-right-radius: 4px; justify-self: end; }
.send-row { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; margin-top: 0.5rem; }
.send-row .btn { margin-left: auto; }
.check { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.86rem; color: var(--wood); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--sage-dark); }
.check.is-off { color: var(--faint); cursor: not-allowed; }
details.mail { background: var(--white); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 0.4rem; }
details.mail summary { cursor: pointer; padding: 0.55rem 0.8rem; display: grid; gap: 0.05rem; font-size: 0.86rem; list-style: none; }
details.mail summary::-webkit-details-marker { display: none; }
details.mail summary span { color: var(--muted); font-size: 0.78rem; }
details.mail pre { margin: 0; padding: 0.6rem 0.8rem 0.8rem; white-space: pre-wrap; font-family: var(--font-body); font-size: 0.86rem; color: var(--charcoal); border-top: 1px dashed var(--line); }
.note-dot.msg { color: var(--terracotta-dark); }
.note-dot.acct { color: var(--sage-dark); }
.cust-card { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 0.9rem; align-items: center; padding: 0.9rem 1rem; cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.cust-card:hover { border-color: var(--sage); transform: translateY(-1px); }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--sage-dark); color: #fff; font-weight: 700; }
.panel .row-item .what { font-size: 0.86rem; }
@media (max-width: 860px) {
  .side-nav { grid-auto-columns: minmax(0, 1fr); }
  .side-nav a { font-size: 0.62rem; padding: 0.4rem 0; }
  .side-nav a svg { width: 19px; height: 19px; }
}

.week-step { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px; padding: 0.25rem 0.4rem; border: 1.5px solid var(--line-strong); border-radius: 10px; background: #fff; }
.week-step b { min-width: 9.5rem; text-align: center; color: var(--wood); }

/* Small inline notes ("Has a note", "1 new message") anywhere in the console */
.note-dot { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 700; vertical-align: middle; }
.note-dot svg { width: 14px; height: 14px; flex: none; }

/* ---------- sign-in screen (shown until Amanda signs in) ---------- */
.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--shiplap);
}
.gate-card {
  width: 100%;
  max-width: 420px;
  display: grid;
  gap: 0.9rem;
  padding: 2rem 1.6rem;
  text-align: center;
}
.gate-logo { width: 72px; height: 72px; object-fit: contain; justify-self: center; }
.gate-card h1 { margin: 0; font-size: 1.9rem; color: var(--terracotta); line-height: 1.1; }
.gate-sub { margin: -0.5rem 0 0.4rem; color: var(--muted); font-size: 0.9rem; letter-spacing: 0.04em; text-transform: uppercase; }
.gate-lead { margin: 0 0 0.3rem; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.gate-card .field { text-align: left; }
.gate-code { font-size: 1.5rem; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.gate-error {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0; padding: 0.7rem 0.9rem;
  background: var(--st-new-bg); color: var(--st-new);
  border-radius: var(--radius-sm); font-size: 0.9rem; text-align: left;
}
.gate-error svg { width: 18px; height: 18px; flex: none; }

/* Hidden means gone — these two set their own display, which would otherwise win. */
.gate[hidden], .console[hidden] { display: none !important; }

/* ---------- Who Can Sign In ---------- */
.pad { padding: 1.25rem; margin-bottom: 1rem; }
.card-title { margin: 0 0 0.35rem; font-size: 1.15rem; color: var(--wood); }
.pad > .muted { margin: 0 0 0.9rem; font-size: 0.9rem; }
.warn-card { background: var(--st-new-bg); color: var(--st-new); }

.team-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.team-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.team-row.busy { opacity: 0.5; }
.team-tick { display: flex; align-items: center; gap: 0.75rem; flex: 1 1 14rem; cursor: pointer; min-height: 44px; }
.team-tick input { width: 22px; height: 22px; flex: none; accent-color: var(--sage-dark); cursor: pointer; }
.team-who { display: grid; line-height: 1.3; }
.team-who small { color: var(--muted); font-size: 0.82rem; word-break: break-all; }

.gate-or { margin: 0.4rem 0 -0.3rem; color: var(--muted); font-size: 0.85rem; }
.gate-note {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0; padding: 0.7rem 0.9rem;
  background: var(--st-ready-bg); color: var(--st-ready);
  border-radius: var(--radius-sm); font-size: 0.9rem; text-align: left;
}
.gate-note svg { width: 18px; height: 18px; flex: none; }

@media (max-width: 480px) {
  .team-row .btn { width: 100%; }
}

/* ---------- Add someone ---------- */
.invite-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.invite-grid + .field, .card .field + .field { margin-top: 0.75rem; }
.invite-roles { display: grid; gap: 0.6rem; margin: 0.4rem 0 1rem; }
.invite-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.invite-actions .btn { flex: 1 1 10rem; }
@media (max-width: 480px) { .invite-grid { grid-template-columns: 1fr; } }

/* The same choice tile the customer site uses, for the console's own choices. */
.opt {
  position: relative; display: flex; align-items: center; gap: 0.75rem; width: 100%; min-height: 56px;
  padding: 0.7rem 0.9rem; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--white);
  cursor: pointer; text-align: left; color: var(--charcoal);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.opt:hover { border-color: var(--wood-light); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt > span { display: grid; gap: 0.1rem; }
.opt small { color: var(--muted); font-size: 0.85rem; line-height: 1.35; }
.opt.on { border-color: var(--wood); box-shadow: inset 0 0 0 1px var(--wood); background: var(--cream); }
.opt.on::after {
  content: ''; position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--wood) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17l9-10'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* A person's row, and the editor that opens in its place. */
.team-row.open { display: block; padding: 1rem; }
.team-who-btn { flex: 1 1 14rem; display: flex; text-align: left; background: none; border: 0; padding: 0.3rem 0; min-height: 44px; cursor: pointer; font: inherit; color: inherit; }
.team-row.needs-name .team-who strong { color: var(--muted); font-style: italic; }
.team-tag { font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.tag-owner { background: var(--sage-wash); color: var(--sage-dark); }
.tag-cust { background: var(--cream-dark); color: var(--muted); }
.person-form { display: grid; gap: 0.75rem; }
.person-form .field-label { margin: 0.3rem 0 0; }
.person-extra { display: flex; gap: 0.6rem; flex-wrap: wrap; padding-top: 0.85rem; border-top: 1px solid var(--line); }
.small { font-size: 0.85rem; }

/* Who is on the site right now. */
.dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 0.5rem; vertical-align: 0.05em; flex: none;
}
.dot-on { background: var(--st-ready); box-shadow: 0 0 0 3px rgba(63, 125, 78, 0.18); }
.dot-off { background: var(--line-strong); }

.temp-pw { display: flex; gap: 0.5rem; align-items: stretch; }
.temp-pw .input { flex: 1; }
.temp-pw .btn { white-space: nowrap; }
