/* 2026-11-12 PATROL-004: owner-approved 4/6/10 px account controls; circular status/avatar shapes retained. */
/* 店主手机版 (owner.mjs): a phone page first - the day's total on top, a card per store, quiet grey for what a number is,
   dark for the number, green or red only for more or less than last week. Safe areas of a phone added to its home screen.
   The store app's palette (2026-11-10, the approved samples): warm-white page and cards, warm lines and greys, pure white
   only for what is pressed or typed in (--o-control), the day's total in the dark frame's colour. */
:root {
  --o-canvas: #faf9f6; --o-surface: #faf9f6; --o-control: #fff; --o-frame: #171c27; --o-ink: #121926; --o-ink-2: #344054; --o-muted: #5f5b54; --o-faint: #77736b;
  --o-line: #e4e0d8; --o-primary: #1b52fb; --o-primary-soft: #eef3ff; --o-up: #0f8a4b; --o-up-soft: #e7f6ee; --o-down: #d92d20;
  --o-down-soft: #fdeceb;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--o-canvas); color: var(--o-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14px; line-height: 1.45; font-variant-numeric: tabular-nums;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.environment { padding: calc(6px + env(safe-area-inset-top, 0px)) 16px 6px; background: #fff7e6; color: #8a5a00; font-size: 12px; text-align: center; }
.owner { max-width: 560px; margin: 0 auto; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
.environment + .owner { padding-top: 10px; }
.owner-boot, .owner-failed, .owner-empty { margin: 40vh 0 16px; color: var(--o-muted); text-align: center; }

.owner-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.owner-top h1 { margin: 0; font-size: 28px; font-weight: 750; letter-spacing: -.01em; line-height: 1.15; }
.owner-day { margin: 0 0 2px; color: var(--o-muted); font-size: 14px; font-weight: 600; }
/* Everything pressed on this page is at least 48 px under a finger (REV2-009; the owner's rule for a touch screen): 刷新 and
   ⋯ are 48 px squares 8 px apart, their icons kept at 20 px; the menu's rows, the 通知 buttons and a note's × too. */
.owner-actions { position: relative; display: flex; gap: 8px; }
.owner-icon {
  display: inline-grid; place-items: center; width: 48px; height: 48px; margin: 0; padding: 0; border: 1px solid var(--o-line); border-radius: 0;
  background: var(--o-control); color: var(--o-ink-2); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.owner-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.owner-icon[data-action="menu"] svg { fill: currentColor; stroke: none; }
.owner-icon:disabled svg { animation: owner-spin 900ms linear infinite; }
@keyframes owner-spin { to { transform: rotate(360deg); } }
.owner-menu {
  position: absolute; top: 54px; right: 0; z-index: 5; display: grid; min-width: 140px; padding: 6px; border: 1px solid var(--o-line); border-radius: 0;
  background: var(--o-surface); box-shadow: 0 14px 34px -8px rgba(16, 24, 40, .22);
}
.owner-menu[hidden] { display: none; }
.owner-menu a, .owner-menu button {
  display: flex; align-items: center; min-height: 48px; margin: 0; padding: 0 14px; border: 0; border-radius: 0; background: transparent; color: var(--o-ink);
  font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
/* A press shows on every key of the page, one step deeper, at once (2026-11-26: 刷新, ⋯ and the blue keys showed nothing; the
   menu's rows and the quiet keys #faf9f6 on white, too faint to see). */
.owner-menu a:active, .owner-menu button:active { background: #efece6; }
.owner-icon:active:not(:disabled) { background: #efece6; }

.owner-total { margin: 0 0 12px; padding: 18px 18px 16px; border-radius: 0; background: var(--o-frame); color: #fff; }
.owner-total .owner-label { margin: 0; color: #c3cad6; font-size: 14px; font-weight: 600; }
.owner-total .owner-amount { margin: 2px 0 6px; color: #fff; }
.owner-total-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; color: #c3cad6; font-size: 14px; font-weight: 600; }
.owner-total .owner-trend.is-up { background: rgba(34, 197, 94, .18); color: #86efac; }
.owner-total .owner-trend.is-down { background: rgba(248, 113, 113, .18); color: #fca5a5; }
.owner-total .owner-trend.is-flat { background: rgba(255, 255, 255, .1); color: #c3cad6; }

.owner-amount { margin: 6px 0 10px; color: var(--o-ink); font-size: 20px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.owner-amount.is-big { font-size: 28px; }
.owner-total .owner-amount.is-none { color: var(--o-faint); }   /* no store read (yet): a dash, never a $0 */

.owner-store { margin: 0 0 12px; padding: 16px 16px 12px; border: 1px solid var(--o-line); border-radius: 0; background: var(--o-surface); }
.owner-store h2 { margin: 0; min-width: 0; overflow: hidden; color: var(--o-ink-2); font-size: 16px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.owner-store-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.owner-store.is-loading, .owner-store.is-failed { color: var(--o-muted); }
.owner-store.is-failed .owner-muted { color: var(--o-down); }
.owner-store .owner-retry { margin-top: 10px; }
.owner-trend { flex: none; margin: 0; padding: 3px 9px; border-radius: 0; font-size: 14px; font-weight: 650; white-space: nowrap; }
.owner-trend.is-up { background: var(--o-up-soft); color: var(--o-up); }
.owner-trend.is-down { background: var(--o-down-soft); color: var(--o-down); }
.owner-trend.is-flat { background: var(--o-canvas); color: var(--o-muted); }
.owner-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 6px; }
.owner-facts div { min-width: 64px; }
.owner-facts dt { color: var(--o-muted); font-size: 12px; font-weight: 500; }
.owner-facts dd { margin: 1px 0 0; color: var(--o-ink); font-size: 16px; font-weight: 700; }
.owner-chart { display: block; width: 100%; height: 56px; margin-top: 8px; overflow: visible; }
.owner-chart polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.owner-chart .before { stroke: #d3cec4; stroke-width: 2; stroke-dasharray: 3 4; }
.owner-chart .today { stroke: var(--o-primary); stroke-width: 2.5; }
.owner-chart .dot { fill: var(--o-primary); stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.owner-chart-axis { display: flex; justify-content: space-between; color: var(--o-faint); font-size: 12px; }
.owner-muted { margin: 4px 0 0; color: var(--o-muted); font-size: 14px; }
.owner-updated { margin: 6px 0 0; color: var(--o-faint); font-size: 12px; text-align: center; }

.owner-login { display: grid; justify-items: center; max-width: 380px; margin: 9vh auto 0; text-align: center; }
.owner-mark { width: 56px; height: 56px; margin-bottom: 14px; }
.owner-login h1 { margin: 0; font-size: 20px; font-weight: 750; }
.owner-login form { display: grid; gap: 12px; width: 100%; margin-top: 20px; text-align: left; }
.owner-login label { display: grid; gap: 6px; color: var(--o-ink-2); font-size: 14px; font-weight: 600; }
.owner-login input {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid #d3cec4; border-radius: 0; background: var(--o-control); color: var(--o-ink);
  font: inherit; font-size: 16px; outline: none;
}
.owner-login input:focus { border-color: var(--o-primary); box-shadow: 0 0 0 3px rgba(27, 82, 251, .15); }
.owner-error { margin: 0; color: var(--o-down); font-size: 14px; font-weight: 600; }
.owner-primary {
  width: 100%; height: 48px; margin-top: 4px; border: 0; border-radius: 0; background: var(--o-primary); color: #fff; font: inherit; font-size: 16px;
  font-weight: 700; cursor: pointer;
}
.owner-primary:disabled { opacity: .6; }
.owner-primary:active:not(:disabled) { background: #1038b5; }
.owner-failed + .owner-primary { display: block; max-width: 240px; margin: 0 auto; }

/* 退出 the server has not confirmed (owner.mjs renderSignOut): nothing of the account, what is going on, and 再试一次. */
.owner-signout { display: grid; justify-items: center; gap: 10px; max-width: 380px; margin: 24vh auto 0; text-align: center; }
.owner-signout h1 { margin: 0; font-size: 20px; font-weight: 750; }
.owner-signout .owner-muted { margin: 0; font-size: 14px; }
.owner-signout .owner-primary { margin-top: 12px; }

/* 通知 (owner-push.mjs): a quiet card under the stores - one solid button while off, a small 已开启 and two quiet ones while on. */
.owner-push { margin: 16px 0 0; padding: 14px 16px; border: 1px solid var(--o-line); border-radius: 0; background: var(--o-surface); }
.owner-push-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.owner-push h2 { margin: 0; color: var(--o-ink-2); font-size: 16px; font-weight: 700; }
.owner-push-state { padding: 3px 9px; border-radius: 0; background: var(--o-up-soft); color: var(--o-up); font-size: 14px; font-weight: 650; }
.owner-push-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.owner-push .owner-primary { width: auto; min-width: 140px; height: 48px; margin: 0; padding: 0 20px; font-size: 14px; }
.owner-secondary, .owner-quiet {
  height: 48px; margin: 0; padding: 0 16px; border-radius: 0; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.owner-secondary { border: 1px solid var(--o-line); background: var(--o-control); color: var(--o-ink); }
.owner-quiet { border: 0; background: transparent; color: var(--o-muted); }
.owner-secondary:active:not(:disabled), .owner-quiet:active:not(:disabled) { background: #efece6; }
.owner-secondary:disabled, .owner-quiet:disabled { opacity: .6; cursor: default; }
.owner-push-note {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 0; padding: 8px 6px 8px 12px; border-radius: 0;
  background: var(--o-canvas); color: var(--o-ink-2); font-size: 14px;
}
.owner-push-note.is-error { background: var(--o-down-soft); color: var(--o-down); }
/* The × is a 48 px square reaching the note's edges (the note keeps its height: 8 px of it above and below are the note's). */
.owner-push-close {
  flex: none; width: 48px; height: 48px; margin: -8px -6px -8px 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit;
  font: inherit; font-size: 16px; line-height: 1; cursor: pointer;
}
/* 退回上一版 (owner-release.mjs, 2026-11-22): the platform owner's card, as 通知's; the question opens in it, with the password
   field as the sign-in's, and its one solid button red: it changes every store's release. */
.owner-release-status { margin: 8px 0 0; color: var(--o-ink-2); font-size: 14px; font-weight: 600; }
.owner-release-form { display: grid; gap: 10px; margin-top: 12px; }
.owner-release-ask { margin: 0; color: var(--o-ink); font-size: 16px; font-weight: 700; }
.owner-release-form label { display: grid; gap: 6px; color: var(--o-ink-2); font-size: 14px; font-weight: 600; }
.owner-release-form input {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid #d3cec4; border-radius: 0; background: var(--o-control); color: var(--o-ink);
  font: inherit; font-size: 16px; outline: none;
}
.owner-release-form input:focus { border-color: var(--o-primary); box-shadow: 0 0 0 3px rgba(27, 82, 251, .15); }
.owner-release-form .owner-push-actions { margin-top: 2px; }
.owner-push .owner-primary.is-danger { background: var(--o-down); }
:focus-visible { outline: 2px solid var(--o-primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .owner-icon:disabled svg { animation: none; } }
