/* Katy Care — hand-written stylesheet, no build step.
   Tablet-first: big tap targets, high contrast, minimal chrome. */

:root {
    --bg: #f7f4ee;
    --surface: #ffffff;
    --ink: #1f2933;
    --muted: #6b7280;
    --line: #e5e1d8;
    --primary: #2f6fed;
    --primary-ink: #ffffff;
    --danger: #c0392b;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 17px/1.45 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h2 { font-size: 1.1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: 0; }

/* Top bar */
.topbar {
    display: flex; align-items: center; gap: 1rem;
    padding: .6rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.topnav { display: flex; gap: .25rem; flex: 1; }
.topnav a { padding: .45rem .8rem; border-radius: 999px; color: var(--ink); }
.topnav a.active { background: var(--bg); font-weight: 600; }
.logout { display: flex; align-items: center; gap: .6rem; margin: 0; }
.who { color: var(--muted); font-size: .9rem; }
button.link { background: none; border: 0; color: var(--primary); font: inherit; cursor: pointer; padding: .4rem; }

/* Page */
.page { max-width: 960px; margin: 0 auto; padding: 1rem; }
.page-title { font-size: 1.5rem; }
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.1rem;
    margin: 1rem 0;
}
.flash { background: #e8f5e9; color: #1b5e20; padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.error { color: var(--danger); font-size: .95rem; }
.pill { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; background: #e8f0fe; color: var(--primary); margin-left: .4rem; vertical-align: middle; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: .9rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field span { font-size: .9rem; color: var(--muted); }
.field input {
    font: inherit; padding: .75rem .9rem;
    border: 1px solid var(--line); border-radius: 10px;
    background: #fff; color: var(--ink);
    min-height: 48px;
}
.field input:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
.check { display: flex; align-items: center; gap: .6rem; font-size: .95rem; }
.check input { width: 22px; height: 22px; }

.btn {
    font: inherit; font-weight: 600;
    padding: .8rem 1.2rem; min-height: 50px;
    border-radius: 12px; border: 1px solid transparent;
    cursor: pointer; touch-action: manipulation;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-block { width: 100%; }

/* Login */
.login-page .page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
    width: 100%; max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.6rem;
}
.login-title { text-align: center; font-size: 1.7rem; }
.login-sub { text-align: center; color: var(--muted); margin: 0 0 1.2rem; }

/* Quick-log tap buttons */
.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .75rem;
}
.tap {
    --tap: #6b7280;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
    min-height: 92px; padding: .6rem;
    border-radius: 16px; border: 2px solid var(--tap);
    background: color-mix(in srgb, var(--tap) 12%, white);
    color: var(--ink);
    font: inherit; cursor: pointer; touch-action: manipulation;
    transition: transform .06s ease, background .15s ease;
}
.tap:active { transform: scale(.97); }
.tap[disabled] { opacity: .55; cursor: default; }
.tap-name { font-weight: 700; font-size: 1.05rem; }
.tap-sub { font-size: .85rem; color: var(--muted); }

/* ---- Quick log home screen ---- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cal-tile {
    display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1;
    padding: .4rem .9rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
}
.cal-num { font-size: 1.6rem; font-weight: 700; }
.cal-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.tap { position: relative; }
.tap.is-used { background: var(--tap); color: #fff; }
.tap.is-used .tap-sub { color: rgba(255,255,255,.85); }
.tap.is-pending { outline: 3px solid var(--tap); outline-offset: 2px; }
.tap-count {
    position: absolute; top: .45rem; right: .55rem;
    min-width: 1.6rem; height: 1.6rem; padding: 0 .4rem;
    border-radius: 999px; background: #fff; color: var(--tap);
    font-weight: 700; font-size: .9rem; line-height: 1.6rem; text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
}

.picker {
    margin-top: 1rem; padding: .9rem 1rem;
    border: 2px solid var(--tap); border-radius: 14px;
    background: color-mix(in srgb, var(--tap) 8%, white);
}
.picker-title { font-weight: 700; margin-bottom: .6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.chip {
    font: inherit; font-weight: 600; min-height: 48px; padding: .5rem 1rem;
    border-radius: 999px; border: 2px solid var(--tap); background: #fff; color: var(--ink);
    cursor: pointer; touch-action: manipulation;
}
.chip:active { background: var(--tap); color: #fff; }
.picker-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.qty { font: inherit; font-size: 1.2rem; width: 6rem; min-height: 48px; padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 10px; text-align: right; }
.unit { color: var(--muted); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }

table.summary { width: 100%; border-collapse: collapse; font-size: 1rem; }
.summary th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: .3rem .4rem; border-bottom: 1px solid var(--line); }
.summary td { padding: .55rem .4rem; border-bottom: 1px solid var(--line); }
.summary tr:last-child td { border-bottom: 0; }
.summary .num { text-align: right; white-space: nowrap; }
.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--tap); margin-right: .5rem; vertical-align: middle; }

.entries li { display: flex; align-items: center; gap: .8rem; }
.e-time { color: var(--muted); min-width: 5.2rem; font-variant-numeric: tabular-nums; }
.e-what { flex: 1; }
button.link.small { font-size: .9rem; }

/* ---- Weight + People ---- */
.people-chips { margin-bottom: 1rem; }
.chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-link { border-style: dashed; color: var(--primary); display: inline-flex; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; text-align: center; }
.stat { display: flex; flex-direction: column; line-height: 1.1; }
.stat-num { font-size: 1.7rem; font-weight: 700; }
.stat-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: .2rem; }
.up { color: #b45309; }
.down { color: #047857; }
.weigh-form { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; align-items: end; }
.weigh-form .field:nth-child(3) { grid-column: 1 / -1; }
.weigh-form .btn { grid-column: 1 / -1; justify-self: start; min-width: 10rem; }
.weigh-form input.big { font-size: 1.5rem; font-weight: 700; }
@media (max-width: 600px) { .weigh-form { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr; text-align: left; } }
.people-table tr.is-off td { color: var(--muted); }
.toggle {
    width: 52px; height: 30px; border-radius: 999px; border: 0; cursor: pointer;
    background: #cfcbc2; position: relative; transition: background .15s;
}
.toggle::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s;
}
.toggle.on { background: var(--primary); }
.toggle.on::after { left: 25px; }
.toggle[disabled] { opacity: .5; cursor: default; }

/* ---- Admin: users, passwords, sign-in links ---- */
.card.narrow { max-width: 420px; }
.users-table td.actions { white-space: nowrap; }
.users-table td.actions .link { padding: .3rem .4rem; }
.pw-row td { background: color-mix(in srgb, var(--primary) 6%, white); }
.qty.pw { width: 16rem; text-align: left; font-size: 1rem; font-weight: 400; }
.linkbox { display: flex; flex-direction: column; gap: .6rem; }
.linkfield { width: 100%; max-width: 560px; text-align: left; font-size: .95rem; font-weight: 400; }
.topnav a.admin { margin-left: auto; }
.menu { display: flex; align-items: center; gap: .6rem; }

/* ---- Admin: foods ---- */
.swatch { display: inline-block; width: 1.1rem; height: 1.1rem; border-radius: 6px; background: var(--tap); vertical-align: middle; }
.swatch.big { width: 2.2rem; height: 2.2rem; border-radius: 8px; border: 1px solid var(--line); }
.foods-table tr.is-editing td { background: color-mix(in srgb, var(--primary) 6%, white); }
.food-form select { font: inherit; min-height: 48px; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.color-row { display: flex; align-items: center; gap: .6rem; }
.color-row input[type=color] { width: 56px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.color-hex { width: 7rem; font-family: ui-monospace, Menlo, Consolas, monospace; }
.field.checks { grid-column: 1 / -1; gap: .6rem; }
.form-actions { grid-column: 1 / -1; display: flex; gap: .6rem; }

/* ---- Voice tokens ---- */
.tokens-table td.actions { white-space: nowrap; }
code.tok { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--bg); padding: .1rem .35rem; border-radius: 6px; }
.steps { padding-left: 1.2rem; }
.steps li { margin: .35rem 0; }

/* ---- Kitchen board (Echo Show / tablet display) ---- */
.board-page .topbar { display: none; }
.board-page .page { max-width: none; padding: 1.2rem 2rem; }
.board { display: grid; gap: 1.2rem; }
.board-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.board-title { font-size: 2.4rem; font-weight: 800; }
.board-clock { font-size: 1.6rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.board-tile {
    border-radius: 20px; padding: 1.2rem 1.4rem; color: #fff; background: var(--tap);
    display: flex; flex-direction: column; gap: .2rem; min-height: 150px; box-shadow: var(--shadow);
}
.board-tile.empty { background: #fff; color: var(--muted); border: 2px dashed var(--line); box-shadow: none; }
.board-tile .bt-name { font-size: 1.3rem; font-weight: 700; opacity: .95; }
.board-tile .bt-num { font-size: 3.2rem; font-weight: 800; line-height: 1; margin-top: .3rem; }
.board-tile .bt-sub { font-size: 1.1rem; opacity: .9; margin-top: auto; }
.board-cal { display: flex; align-items: baseline; gap: .6rem; font-size: 1.5rem; color: var(--muted); }
.board-cal strong { font-size: 2.6rem; color: var(--ink); }
.board-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 1rem; }
.board-foot a { color: var(--muted); text-decoration: underline; }
