:root {
  color-scheme: light;
  --paper: #f7f7f7;
  --paper-strong: #ffffff;
  --ink: #333333;
  --muted: #666666;
  --pine: #221715;
  --pine-soft: #715450;
  --acid: #fcc800;
  --line: rgba(34, 23, 21, 0.14);
  --shadow: 0 18px 60px rgba(34, 23, 21, 0.13);
  --n: #f2685c;
  --m: #fcc800;
  --b: #337ab7;
  --c: #715450;
  --z: #6d4c9d;
  --radius: 26px;
  font-family: "Hiragino Sans GB", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -4%, rgba(252, 200, 0, 0.2), transparent 29rem),
    radial-gradient(circle at 110% 26%, rgba(51, 122, 183, 0.09), transparent 22rem),
    var(--paper);
}

/* 备注输入唤起手机键盘时，禁止 Safari 推动底层页面。 */
body.note-input-page-locked { position: fixed; width: 100%; overflow: hidden; }

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(51, 122, 183, 0.34); outline-offset: 3px; }
[hidden] { display: none !important; }

.paper-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.38;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(34, 23, 21, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 23, 21, 0.025) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, black, transparent 84%);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--pine-soft);
  font-family: "DIN Alternate", "Avenir Next Condensed", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow.light { color: rgba(255, 255, 255, 0.64); }

h1, h2, p { margin-top: 0; }
h1, h2 { font-family: "Songti SC", "STSong", serif; }
h2 { margin-bottom: 0; font-size: 22px; line-height: 1.2; letter-spacing: -0.04em; }

.login-view {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
}

.login-card {
  position: relative;
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 32px 24px 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  animation: cardIn 0.7s cubic-bezier(.2,.8,.2,1) both;
}

.login-card::before {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  right: -104px;
  top: -108px;
  border-radius: 50%;
  background: var(--acid);
  opacity: 0.82;
}

.login-mark {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 76px;
  height: 76px;
  margin-bottom: 28px;
  overflow: hidden;
  border: 5px solid var(--pine);
  border-radius: 21px;
  color: white;
  background: var(--pine);
  font-family: "DIN Alternate", sans-serif;
  font-size: 14px;
  font-weight: 900;
}

.login-mark span { display: grid; place-items: center; }
.login-mark span:nth-child(1) { background: var(--n); color: var(--ink); }
.login-mark span:nth-child(2) { background: var(--m); color: var(--ink); }
.login-mark span:nth-child(3) { background: var(--b); }
.login-mark span:nth-child(4) { background: var(--c); }

.login-card h1 { position: relative; margin-bottom: 10px; font-size: clamp(36px, 10vw, 48px); line-height: 1; letter-spacing: -0.08em; }
.login-copy { color: var(--muted); font-size: 15px; }
.login-form { margin-top: 32px; }
.login-form > label { display: block; margin: 0 0 9px 4px; font-size: 13px; font-weight: 700; }
.password-field { position: relative; }
.password-field input {
  width: 100%;
  height: 58px;
  padding: 0 68px 0 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--ink);
  background: white;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.password-field input::placeholder { color: #949494; }
.text-button {
  position: absolute;
  right: 7px;
  top: 7px;
  height: 44px;
  padding: 0 12px;
  border: 0;
  color: var(--pine);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.primary-button, .secondary-button, .ghost-button, .danger-button {
  min-height: 50px;
  border-radius: 16px;
  border: 0;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.primary-button:active, .secondary-button:active, .ghost-button:active, .danger-button:active { transform: scale(.97); }
.primary-button { color: var(--acid); background: var(--pine); box-shadow: 0 12px 25px rgba(34, 23, 21, .2); }
.secondary-button { color: var(--pine); background: var(--acid); }
.ghost-button { color: var(--ink); background: #eeeeee; }
.danger-button { color: #a63f36; background: #fde9e7; }
.login-form > .primary-button { width: 100%; margin-top: 12px; }
.primary-button[disabled] { opacity: .58; cursor: wait; }
.login-form > .remember-device { display: flex; align-items: center; gap: 9px; margin: 14px 2px 0; color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.remember-device input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--pine); cursor: pointer; }
.remember-device span { display: grid; gap: 1px; }
.remember-device small { color: var(--muted); font-size: 10px; font-weight: 600; }

.form-message { min-height: 20px; margin: 11px 2px 0; color: #b54b42; font-size: 13px; line-height: 1.5; }
.setup-hint { margin: 12px 0 0; padding: 12px; border-radius: 12px; color: #5b4610; background: #fff4c2; font-size: 12px; line-height: 1.6; }
.setup-hint code { word-break: break-all; }
.login-footer { display: flex; gap: 7px; align-items: center; margin-top: 32px; color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 5px rgba(252,200,0,.16); }

.app-shell { min-height: 100vh; padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(72px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 18px 0;
  background: rgba(247, 247, 247, .86);
  backdrop-filter: blur(22px) saturate(1.2);
  border-bottom: 1px solid rgba(34,23,21,.07);
}

.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; color: var(--acid); background: var(--pine); font-family: "DIN Alternate", sans-serif; font-size: 22px; font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: "Songti SC", serif; font-size: 17px; letter-spacing: -.04em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.admin-link { display: none; min-height: 38px; align-items: center; padding: 0 14px; border-radius: 12px; color: var(--pine); background: rgba(255,255,255,.72); font-size: 12px; font-weight: 800; text-decoration: none; }
.network-status { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px; border-radius: 999px; color: var(--pine); background: rgba(255,255,255,.65); font-size: 11px; font-weight: 700; }
.network-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--acid); }
.network-status.offline { color: #973b2f; }
.network-status.offline i { background: var(--n); }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 12px; color: var(--ink); background: rgba(255,255,255,.65); cursor: pointer; }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.content { width: min(100% - 28px, 1080px); margin: 0 auto; padding: 14px 0 38px; }
.summary-hero {
  position: relative;
  min-height: 188px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 20px;
  padding: 25px 22px;
  overflow: hidden;
  border-radius: 30px;
  color: #ffffff;
  background:
    linear-gradient(125deg, rgba(255,255,255,.07), transparent 46%),
    var(--pine);
  box-shadow: 0 24px 55px rgba(34, 23, 21, .23);
}
.summary-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--n) 0 20%, var(--b) 20% 40%, var(--m) 40% 60%, var(--c) 60% 80%, var(--z) 80%); }
.summary-copy { position: relative; z-index: 2; }
.summary-copy h1 { margin-bottom: 7px; font-size: clamp(27px, 7vw, 42px); line-height: 1; letter-spacing: -.07em; }
.summary-date { margin: 0; color: rgba(255,255,255,.68); font-size: 13px; }
.total-lockup { position: relative; z-index: 2; text-align: right; }
.total-lockup strong { display: block; color: var(--acid); font-family: "DIN Alternate", "Avenir Next Condensed", sans-serif; font-size: clamp(66px, 21vw, 104px); font-weight: 900; line-height: .72; letter-spacing: -.08em; font-variant-numeric: tabular-nums; }
.total-lockup span { display: block; margin-top: 17px; color: rgba(255,255,255,.72); font-size: 12px; }
.summary-orbit { position: absolute; width: 190px; height: 190px; right: -73px; top: -88px; border: 24px solid rgba(252,200,0,.13); border-radius: 50%; }

.ticket-section { padding: 29px 0 2px; }
.section-heading, .panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.pending-badge { flex: none; padding: 7px 10px; border-radius: 999px; color: #59450d; background: #fff0ae; font-size: 11px; font-weight: 800; }
.business-type-grid { display: grid; gap: 12px; }
.business-type-button { position: relative; display: grid; min-height: 126px; padding: 20px 58px 20px 21px; overflow: hidden; border: 0; border-radius: 25px; color: white; text-align: left; cursor: pointer; box-shadow: 0 12px 28px rgba(34,23,21,.12), inset 0 1px 0 rgba(255,255,255,.24); transition: transform .17s cubic-bezier(.2,.8,.2,1), box-shadow .17s ease; }
.business-type-button::before { content: ""; position: absolute; width: 150px; height: 150px; right: -62px; top: -79px; border: 18px solid rgba(255,255,255,.13); border-radius: 50%; }
.business-type-button:active { transform: scale(.97); box-shadow: 0 6px 14px rgba(34,23,21,.15); }
.business-type-button.personal { color: var(--ink); background: linear-gradient(130deg, #f9b0a8, var(--n)); }
.business-type-button.enterprise { background: linear-gradient(130deg, #4b3834, var(--c)); }
.business-type-kicker, .business-type-button strong, .business-type-button small, .business-type-button i { position: relative; z-index: 1; }
.business-type-kicker { font-family: "DIN Alternate", "Avenir Next Condensed", sans-serif; font-size: 10px; font-weight: 900; letter-spacing: .16em; opacity: .68; }
.business-type-button strong { margin-top: 7px; font-family: "Songti SC", "STSong", serif; font-size: 28px; letter-spacing: -.05em; }
.business-type-button small { margin-top: 6px; font-family: "DIN Alternate", sans-serif; font-size: 12px; font-weight: 900; letter-spacing: .12em; opacity: .78; }
.business-type-button i { position: absolute; right: 22px; top: calc(50% - 18px); font-family: "DIN Alternate", sans-serif; font-size: 34px; font-style: normal; }
.customer-type-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.customer-type-heading button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 11px; color: var(--pine); background: rgba(255,255,255,.78); font-size: 12px; font-weight: 800; cursor: pointer; }
.customer-type-heading p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 800; }
.customer-type-picker .ticket-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ticket-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.ticket-button {
  position: relative;
  min-height: 154px;
  overflow: hidden;
  padding: 17px;
  border: 0;
  border-radius: 25px;
  color: white;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(34,23,21,.12), inset 0 1px 0 rgba(255,255,255,.24);
  transition: transform .17s cubic-bezier(.2,.8,.2,1), box-shadow .17s ease, filter .17s ease;
}
.ticket-button::after { content: "+"; position: absolute; right: 12px; bottom: -20px; color: rgba(255,255,255,.16); font-family: "DIN Alternate", sans-serif; font-size: 106px; font-weight: 900; line-height: 1; }
.ticket-button:active { transform: scale(.955); filter: saturate(1.12); box-shadow: 0 6px 14px rgba(34,23,21,.15); }
.ticket-button.pulse { animation: ticketPulse .42s cubic-bezier(.2,.8,.2,1); }
.ticket-letter { position: relative; z-index: 1; display: block; font-family: "DIN Alternate", "Avenir Next Condensed", sans-serif; font-size: 46px; font-weight: 900; line-height: .9; }
.ticket-description { position: relative; z-index: 1; display: block; max-width: calc(100% - 26px); min-height: 32px; margin-top: 9px; font-size: 11px; font-weight: 800; line-height: 1.45; }
.ticket-action { position: relative; z-index: 1; display: block; margin-top: 4px; font-size: 10px; font-weight: 700; opacity: .7; }
.ticket-button strong { position: absolute; z-index: 1; right: 15px; top: 14px; min-width: 32px; padding: 5px 8px; border-radius: 999px; background: rgba(0,0,0,.18); text-align: center; font-family: "DIN Alternate", sans-serif; font-size: 15px; }
.category-n { color: var(--ink); background: var(--n); }
.category-m { color: var(--ink); background: var(--m); }
.category-n::after, .category-m::after { color: rgba(34,23,21,.10); }
.category-n strong, .category-m strong { background: rgba(255,255,255,.28); }
.category-b { background: var(--b); }
.category-c { background: var(--c); }
.category-z { background: var(--z); }

.history-toolbar { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 25px 0 0; }
.date-button { min-width: 0; display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 19px; color: var(--ink); background: rgba(255,255,255,.64); text-align: left; cursor: pointer; }
.date-button small, .date-button strong { display: block; }
.date-button small { margin-bottom: 3px; color: var(--muted); font-size: 10px; }
.date-button strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: "Songti SC", serif; font-size: 16px; }
.date-button svg { flex: none; width: 22px; margin-left: 8px; fill: none; stroke: var(--pine); stroke-width: 1.8; stroke-linecap: round; }
.history-toolbar .secondary-button { min-height: 64px; }

.insight-grid { display: grid; gap: 13px; margin-top: 27px; }
.panel { min-width: 0; padding: 20px; border: 1px solid rgba(255,255,255,.86); border-radius: var(--radius); background: rgba(255,255,255,.82); box-shadow: 0 11px 32px rgba(34,23,21,.075); backdrop-filter: blur(18px); }
.panel-number { flex: none; color: var(--pine); font-family: "DIN Alternate", sans-serif; font-size: 18px; font-weight: 900; }
.panel-note { flex: none; color: var(--muted); font-size: 11px; }
.distribution-layout { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 15px; min-height: 132px; }
.donut-chart { position: relative; display: grid; place-items: center; width: 112px; height: 112px; border-radius: 50%; background: #e6e4e3; transition: background .35s ease; }
.donut-chart::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: var(--paper-strong); box-shadow: 0 0 0 1px rgba(34,23,21,.06); }
.donut-chart span { position: relative; z-index: 1; color: var(--muted); text-align: center; font-size: 10px; }
.donut-chart strong { display: block; color: var(--ink); font-family: "DIN Alternate", sans-serif; font-size: 29px; line-height: 1.1; }
.distribution-legend { display: grid; gap: 8px; }
.legend-row { display: grid; grid-template-columns: 11px 22px minmax(0, 1fr) auto; align-items: center; gap: 7px; min-height: 34px; font-size: 12px; }
.legend-row i { width: 9px; height: 9px; border-radius: 3px; }
.legend-row strong { font-family: "DIN Alternate", sans-serif; font-size: 15px; }
.legend-row > span { min-width: 0; display: grid; gap: 2px; }
.legend-row > span b { color: var(--ink); font-size: 10px; font-weight: 700; line-height: 1.3; }
.legend-row > span small { color: var(--muted); font-size: 9px; }
.legend-row em { color: var(--muted); font-style: normal; font-variant-numeric: tabular-nums; }

.hourly-chart { display: grid; grid-template-columns: repeat(24, minmax(12px, 1fr)); align-items: end; gap: 3px; height: 166px; padding-top: 12px; overflow: hidden; }
.hour-column { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.hour-column i { width: min(100%, 10px); min-height: 3px; border-radius: 5px 5px 2px 2px; background: var(--pine); opacity: .9; transform-origin: bottom; animation: barGrow .55s cubic-bezier(.2,.8,.2,1) both; }
.hour-column.peak i { background: var(--n); box-shadow: 0 0 0 4px rgba(242,104,92,.11); }
.hour-column span { height: 17px; margin-top: 7px; color: var(--muted); font-family: "DIN Alternate", sans-serif; font-size: 8px; }
.hour-column b { position: absolute; top: -3px; color: var(--pine); font-family: "DIN Alternate", sans-serif; font-size: 9px; }

.trend-panel, .records-panel { margin-top: 13px; }
.trend-chart { display: grid; gap: 11px; }
.trend-row { display: grid; grid-template-columns: 48px 1fr 28px; align-items: center; gap: 9px; min-height: 25px; }
.trend-row time { color: var(--muted); font-family: "DIN Alternate", sans-serif; font-size: 11px; }
.trend-track { display: flex; height: 13px; overflow: hidden; border-radius: 999px; background: #e6e4e3; }
.trend-track i { height: 100%; min-width: 0; }
.trend-track .n { background: var(--n); }.trend-track .m { background: var(--m); }.trend-track .b { background: var(--b); }.trend-track .c { background: var(--c); }
.trend-row strong { text-align: right; font-family: "DIN Alternate", sans-serif; font-size: 13px; }

.record-heading-actions { display: flex; align-items: center; gap: 7px; }
.record-heading-actions button { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--pine); background: #fff7d3; font-size: 10px; font-weight: 900; cursor: pointer; }
.record-list { display: grid; gap: 8px; }
.record-item { display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 9px 11px; border: 1px solid transparent; border-radius: 17px; color: var(--ink); background: rgba(243,243,243,.82); transition: border-color .18s ease, background .18s ease; }
.record-item:hover { border-color: var(--line); background: white; }
.record-item.waiting { border-color: rgba(252,200,0,.45); background: linear-gradient(100deg, rgba(252,200,0,.13), rgba(243,243,243,.9) 62%); }
.record-open { flex: 1; min-width: 0; display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 12px; padding: 0; border: 0; color: inherit; background: none; text-align: left; cursor: pointer; transition: transform .18s ease; }
.record-open:active { transform: scale(.985); }
.record-actions { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.record-start, .record-complete { min-height: 30px; padding: 0 10px; border: 0; border-radius: 11px; font-size: 11px; font-weight: 900; cursor: pointer; white-space: nowrap; }
.record-start { color: var(--pine); background: var(--acid); }
.record-complete { color: white; background: var(--b); }
.record-start:active, .record-complete:active { transform: scale(.95); }
.record-state { padding: 3px 8px; border-radius: 999px; color: var(--muted); background: #e9e9e9; font-size: 10px; font-weight: 800; white-space: nowrap; }
.record-category { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: white; font-family: "DIN Alternate", sans-serif; font-size: 23px; font-weight: 900; }
.record-category.N, .record-category.M { color: var(--ink); }
.record-category.N { background: var(--n); }.record-category.M { background: var(--m); }.record-category.B { background: var(--b); }.record-category.C { background: var(--c); }.record-category.Z { background: var(--z); }
.record-main { min-width: 0; }
.record-main strong, .record-main span { display: block; }
.record-main strong { margin-bottom: 3px; font-size: 13px; line-height: 1.35; }
.record-main span { color: var(--muted); font-size: 11px; }
.record-main .record-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; }
.record-meta b { padding: 3px 6px; border-radius: 999px; color: var(--pine); background: var(--acid); font-family: "DIN Alternate", sans-serif; font-size: 9px; font-weight: 900; white-space: nowrap; }
.record-meta time { color: var(--muted); font-family: "DIN Alternate", sans-serif; font-size: 10px; font-variant-numeric: tabular-nums; }
.record-wait { padding: 2px 7px; border-radius: 999px; color: var(--pine); background: rgba(34,23,21,.06); font-family: "DIN Alternate", sans-serif; font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.record-wait.live { color: #7a5c00; background: rgba(252,200,0,.28); }
.record-service { padding: 2px 7px; border-radius: 999px; color: #1f5e91; background: rgba(51,122,183,.12); font-family: "DIN Alternate", sans-serif; font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.record-service.live { color: #0f4b7a; background: rgba(51,122,183,.22); }
.record-main .record-note { margin-top: 4px; color: #4a4342; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.record-main .record-note.empty { color: var(--muted); }
.record-edit { padding: 0; border: 0; color: var(--muted); background: none; font-size: 12px; cursor: pointer; }
.empty-state { padding: 38px 12px 30px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); font-family: "Songti SC", serif; font-size: 18px; }
.empty-state span { font-size: 12px; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: min(calc(100% - 28px), 390px);
  min-height: 67px;
  padding: 6px;
  transform: translateX(-50%);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 23px;
  background: rgba(34,23,21,.95);
  box-shadow: 0 18px 44px rgba(34,23,21,.32);
  backdrop-filter: blur(20px);
}
.nav-button { display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 18px; color: rgba(255,255,255,.62); background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.nav-button.active { color: var(--pine); background: var(--acid); }
.nav-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.bottom-sheet { width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; }
.bottom-sheet::backdrop { background: rgba(34,23,21,.5); backdrop-filter: blur(4px); }
.bottom-sheet[open] { display: grid; align-items: end; }
.sheet-card { width: 100%; max-height: min(88vh, 700px); max-height: min(88dvh, 700px); overflow-y: auto; overscroll-behavior: contain; padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); border-radius: 30px 30px 0 0; background: var(--paper-strong); box-shadow: 0 -20px 70px rgba(34,23,21,.24); animation: sheetUp .32s cubic-bezier(.2,.8,.2,1) both; }
.bottom-sheet.centered-dialog[open] { align-items: center; padding: 24px 16px; }
.centered-dialog .sheet-card { width: min(100%, 430px); max-height: calc(100dvh - 48px); margin: 0 auto; padding: 24px 20px; border-radius: 30px; box-shadow: 0 20px 70px rgba(34,23,21,.24); animation: dialogEnter .32s cubic-bezier(.2,.8,.2,1) both; }
.centered-dialog .sheet-handle { display: none; }
@keyframes dialogEnter { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.sheet-handle { width: 38px; height: 5px; margin: 0 auto 18px; border-radius: 999px; background: #c8c5c3; }
.sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 23px; }
.sheet-heading h2 { font-size: 25px; }
.sheet-close { width: 43px; height: 43px; border: 0; border-radius: 50%; color: var(--muted); background: #eeeeee; font-size: 27px; line-height: 1; cursor: pointer; }
.date-input-card { display: grid; gap: 8px; margin: 0 0 13px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.date-input-card span, .category-picker legend, .waiting-picker legend, .note-input-card span { color: var(--muted); font-size: 11px; font-weight: 700; }
.note-input-card { display: grid; gap: 8px; margin: 0 0 13px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.note-input-card textarea { width: 100%; padding: 0; border: 0; color: var(--ink); background: transparent; font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.5; resize: none; touch-action: manipulation; }
.note-input-card textarea:focus { outline: none; }
.waiting-picker { margin: 0 0 13px; padding: 0; border: 0; }
.waiting-picker legend { margin-bottom: 9px; }
.waiting-picker > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.waiting-picker button { min-height: 46px; border: 2px solid transparent; border-radius: 15px; color: var(--ink); background: #eeeeee; font-size: 13px; font-weight: 800; cursor: pointer; }
.waiting-picker button.selected { border-color: var(--pine); color: var(--acid); background: var(--pine); }
.record-wait-summary { min-height: 18px; margin: -4px 2px 13px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.note-prompt-badge { display: flex; align-items: center; gap: 13px; margin: 0 0 14px; padding: 13px 15px; border-radius: 18px; background: linear-gradient(120deg, rgba(252,200,0,.18), rgba(243,243,243,.9)); }
.note-prompt-letter { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 15px; color: white; background: var(--pine); font-family: "DIN Alternate", sans-serif; font-size: 24px; font-weight: 900; }
.note-prompt-letter.N { background: var(--n); color: var(--ink); }
.note-prompt-letter.M { background: var(--m); color: var(--ink); }
.note-prompt-letter.B { background: var(--b); }
.note-prompt-letter.C { background: var(--c); }
.note-prompt-letter.Z { background: var(--z); }
.note-prompt-copy { min-width: 0; }
.note-prompt-copy strong, .note-prompt-copy small { display: block; }
.note-prompt-copy strong { color: var(--ink); font-size: 14px; line-height: 1.4; }
.note-prompt-copy small { margin-top: 3px; color: var(--muted); font-family: "DIN Alternate", sans-serif; font-size: 11px; font-variant-numeric: tabular-nums; }
.date-input-card input { width: 100%; min-height: 35px; padding: 0; border: 0; color: var(--ink); background: transparent; font-family: "DIN Alternate", "Hiragino Sans GB", sans-serif; font-size: 17px; font-weight: 800; }
.date-input-card input:focus { outline: none; }
.date-shortcuts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 28px; }
.date-shortcuts button { min-height: 44px; border: 1px solid var(--line); border-radius: 14px; color: var(--pine); background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.sheet-actions { display: grid; grid-template-columns: .8fr 1.2fr; gap: 9px; }
.category-picker { margin: 0 0 14px; padding: 0; border: 0; }
.category-picker legend { margin-bottom: 9px; }
.category-picker > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.category-picker button { min-height: 54px; border: 2px solid transparent; border-radius: 16px; color: var(--ink); background: #eeeeee; font-family: "DIN Alternate", sans-serif; font-size: 21px; font-weight: 900; cursor: pointer; }
.category-picker button.selected { border-color: var(--pine); color: var(--acid); background: var(--pine); }
.record-sheet-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 25px; }
.record-sheet-actions > div { display: flex; gap: 8px; margin-left: auto; }
.delete-confirm-panel { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; margin-top: 7px; padding: 16px; border: 1px solid rgba(166,63,54,.18); border-radius: 20px; background: linear-gradient(145deg, #fff7f5, #fde9e7); box-shadow: 0 13px 30px rgba(166,63,54,.1); animation: confirmIn .22s cubic-bezier(.2,.8,.2,1) both; }
.delete-confirm-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: white; background: #a63f36; font-family: "DIN Alternate", sans-serif; font-size: 24px; font-weight: 900; }
.delete-confirm-copy { min-width: 0; }
.delete-confirm-copy h3 { margin: 1px 0 5px; color: #7f3029; font-family: "Songti SC", "STSong", serif; font-size: 19px; }
.delete-confirm-copy p { margin-bottom: 4px; color: var(--ink); font-size: 12px; font-weight: 800; line-height: 1.45; }
.delete-confirm-copy small { display: block; color: var(--muted); font-size: 10px; line-height: 1.45; }
.delete-confirm-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 3px; }
.delete-confirm-actions button { width: 100%; }
.danger-button.solid { color: white; background: #a63f36; box-shadow: 0 10px 22px rgba(166,63,54,.2); }

.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 18px; width: min(calc(100% - 32px), 430px); min-height: 56px; padding: 12px 14px 12px 18px; transform: translateX(-50%); border-radius: 18px; color: white; background: rgba(34,23,21,.97); box-shadow: 0 17px 40px rgba(34,23,21,.3); font-size: 13px; font-weight: 700; animation: toastIn .26s cubic-bezier(.2,.8,.2,1) both; }
.toast button { flex: none; min-height: 36px; padding: 0 11px; border: 0; border-radius: 11px; color: var(--pine); background: var(--acid); font-size: 12px; font-weight: 900; cursor: pointer; }

.reveal { animation: contentIn .5s cubic-bezier(.2,.8,.2,1) both; }
.delay-1 { animation-delay: .06s; }.delay-2 { animation-delay: .12s; }.delay-3 { animation-delay: .18s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes contentIn { from { opacity: 0; transform: translateY(13px); } }
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px) scale(.97); } }
@keyframes confirmIn { from { opacity: 0; transform: translateY(7px) scale(.985); } }
@keyframes barGrow { from { transform: scaleY(.05); } }
@keyframes ticketPulse { 50% { transform: scale(.94); filter: brightness(1.08); } }

@media (min-width: 760px) {
  .admin-link { display: flex; }
  .content { padding-top: 22px; }
  .summary-hero { min-height: 238px; padding: 35px 38px; }
  .ticket-grid { grid-template-columns: repeat(4, 1fr); }
  .business-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-type-picker .ticket-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ticket-button { min-height: 178px; }
  .insight-grid { grid-template-columns: .86fr 1.14fr; }
  .panel { padding: 24px; }
  .distribution-layout { grid-template-columns: 128px minmax(0, 1fr); gap: 19px; min-height: 146px; }
  .donut-chart { width: 128px; height: 128px; }
  .trend-panel, .records-panel { margin-top: 16px; }
  .record-list { grid-template-columns: repeat(2, 1fr); }
  .sheet-card { width: min(100%, 560px); margin: 0 auto; border-radius: 30px 30px 0 0; }
}

@media (min-width: 1120px) {
  .bottom-nav { left: max(28px, calc((100vw - 1080px) / 2)); bottom: 25px; width: 190px; transform: none; }
  .app-shell { padding-bottom: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
