:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  color: #182128;
  background: #eef1f3;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #182128;
  --muted: #74818a;
  --line: #e6eaec;
  --green: #146c58;
  --green-dark: #0e5a49;
  --coral: #dc654f;
  --mint: #e8f3ee;
  --frame: #fff;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100dvh; background: #eef1f3; }
.stage { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.mobile-shell {
  height: calc(100dvh - 40px);
  width: min(100%, 430px);
  background: var(--frame);
  border: 1px solid #e8ecee;
  border-radius: 9px;
  overflow: hidden;
  overscroll-behavior: contain;
  padding: 0 22px;
  display: flex;
  flex-direction: column;
}
.topbar { height: 64px; flex: 0 0 64px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; background: #e4f0eb; color: var(--green); border-radius: 14px; font-weight: 700; font-size: 23px; }
.brand-mark.small { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; }
.topbar-title { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.topbar-title strong { font-size: 14px; }
.current-avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; object-fit: cover; background: #e4f0eb; }
.avatar-fallback { display: grid; place-items: center; color: var(--green); font-size: 14px; font-weight: 700; }
.database-badge { color: #77868b; font-size: 9px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.eyebrow { font-size: 9px; letter-spacing: 0; color: #85928f; margin: 0 0 4px; font-weight: 600; }
.icon-button { border: 0; background: transparent; width: 38px; height: 38px; display: grid; place-items: center; color: #728088; border-radius: 8px; cursor: pointer; }
.icon-button:hover { background: #f0f3f3; color: var(--ink); }
.icon-button svg, .adjust-button svg, .search svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.overview { flex: 0 0 auto; display: flex; align-items: end; justify-content: space-between; padding: 19px 0 13px; }
.overview h1 { font-size: 24px; line-height: 1.15; margin: 0; font-weight: 700; }
.user-count { display: flex; align-items: baseline; gap: 5px; color: var(--muted); font-size: 11px; }
.user-count strong { font-size: 19px; color: var(--ink); font-variant-numeric: tabular-nums; }
.search { height: 39px; min-width: 0; border: 1px solid #dfe5e6; background: #f8f9f9; border-radius: 7px; display: flex; align-items: center; padding: 0 10px; gap: 8px; color: #829097; }
.search svg { width: 17px; height: 17px; }
.search input { border: 0; outline: 0; background: transparent; min-width: 0; flex: 1; font: inherit; font-size: 12px; color: var(--ink); }
.search input::placeholder { color: #9aa4a9; }
.clear-search { border: 0; background: none; color: #8c999f; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 1px; }
.clear-search[hidden] { display: none; }
.search-controls { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; }
.search-controls .search { flex: 1; }
.sort-control { height: 39px; display: flex; align-items: center; gap: 4px; border: 1px solid #dfe5e6; border-radius: 7px; padding: 0 7px; color: #879397; font-size: 9px; }
.sort-menu-wrap { position: relative; }
.sort-trigger { min-width: 64px; height: 31px; display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 0 4px; border: 0; border-radius: 5px; background: transparent; color: #35434a; font: inherit; font-size: 10px; cursor: pointer; }
.sort-trigger:hover, .sort-trigger[aria-expanded="true"] { background: #edf3f0; }
.sort-trigger svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 140ms ease; }
.sort-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.sort-options { position: absolute; z-index: 5; top: calc(100% + 7px); right: -7px; min-width: 116px; padding: 4px; border: 1px solid #e1e8e4; border-radius: 7px; background: #fff; box-shadow: 0 10px 24px #263b351c; }
.sort-options[hidden] { display: none; }
.sort-options button { width: 100%; height: 34px; display: flex; align-items: center; padding: 0 9px; border: 0; border-radius: 4px; background: transparent; color: #536168; text-align: left; font: inherit; font-size: 10px; cursor: pointer; }
.sort-options button:hover, .sort-options button[aria-selected="true"] { background: #eef5f1; color: var(--green); }
.sort-direction { flex: 0 0 36px; width: 36px; height: 39px; border: 1px solid #dfe5e6; background: #fff; border-radius: 7px; color: #45545a; cursor: pointer; font-size: 19px; }
.section-label { flex: 0 0 auto; display: flex; justify-content: space-between; color: #96a1a4; font-size: 10px; padding: 14px 1px 7px; }
.usage-summary { font-variant-numeric: tabular-nums; white-space: pre-wrap; text-align: right; }
.user-list, .log-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #ccd3d5 transparent; border-top: 1px solid var(--line); }
.user-row { min-height: 69px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 10px; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 13px 10px; cursor: pointer; transition: background-color 130ms ease; }
.user-row:hover, .user-row:focus-visible { background: #f7faf8; outline: none; }
.avatar { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #eff2ee; color: #557063; font-size: 13px; font-weight: 700; text-transform: uppercase; }
.user-row:nth-child(3n + 2) .avatar { background: #f8eee8; color: #9c634c; }
.user-row:nth-child(3n) .avatar { background: #eaf0f5; color: #59758a; }
.user-main { min-width: 0; flex: 1; }
.user-name-line { display: flex; align-items: center; gap: 6px; }
.user-name-line strong { max-width: 190px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; font-size: 12px; font-weight: 600; }
.user-sub { display: flex; gap: 8px; color: #9aa4a8; font-size: 9px; margin-top: 2px; }
.quota-line { display: flex; gap: 12px; color: #7e8a8d; font-size: 9px; margin-top: 5px; font-variant-numeric: tabular-nums; }
.quota-line b { font-weight: 600; color: #26352f; }
.user-activity { grid-column: 1 / -1; min-width: 0; }
.usage-totals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; color: #86958d; font-size: 9px; font-variant-numeric: tabular-nums; }
.usage-totals span { display: flex; flex-direction: column; gap: 3px; }
.usage-totals span:not(:first-child) { align-items: flex-end; text-align: right; }
.usage-totals b { color: #3b6351; font-weight: 600; overflow-wrap: anywhere; }
.usage-heatmap { display: grid; grid-template-columns: repeat(28, minmax(0, 1fr)); gap: 3px; margin-top: 7px; }
.heat-tile { min-width: 0; aspect-ratio: 1; border-radius: 2px; background: #eef6ef; border: 1px solid #d5e5d7; }
.heat-1 { background: #c3e8b7; border-color: #a9d69b; }
.heat-2 { background: #83c975; border-color: #69b55b; }
.heat-3 { background: #419c54; border-color: #328442; }
.heat-tooltip { position: fixed; z-index: 50; padding: 6px 9px; border-radius: 5px; background: #243b2e; color: #fff; box-shadow: 0 3px 12px #14291e25; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
.heat-tooltip[hidden] { display: none; }
.heat-4 { background: #19613d; border-color: #104b2d; }
.adjust-button { width: 32px; height: 32px; flex: 0 0 32px; border: 1px solid #e0e8e4; background: #f5faf7; border-radius: 7px; color: var(--green); display: grid; place-items: center; cursor: pointer; }
.adjust-button:hover { background: var(--mint); border-color: #c7dfd3; }
.adjust-button svg { width: 17px; height: 17px; }
.row-chevron { color: #a1aeae; font-size: 22px; line-height: 1; padding: 0 2px; }
.bottom-nav { flex: 0 0 56px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); background: #fff; padding-bottom: env(safe-area-inset-bottom); }
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #899596; text-decoration: none; font-size: 9px; }
.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active { color: var(--green); font-weight: 600; }
.alert { border-radius: 6px; padding: 9px 11px; margin: 0 0 12px; font-size: 11px; line-height: 1.45; }
.alert.success { background: #edf7f1; color: #256e52; border: 1px solid #d8ebdf; }
.alert.error { background: #fff1ed; color: #a64f3c; border: 1px solid #f5d8d0; }
.empty-state { min-height: 200px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; color: #8a9699; font-size: 11px; }
.empty-state strong { color: #526067; font-size: 13px; }
.empty-icon { font-size: 28px; color: #aab4b6; }
.log-row { display: flex; gap: 10px; align-items: flex-start; padding: 13px 8px; border-bottom: 1px solid var(--line); }
.log-loader { display: flex; justify-content: center; align-items: center; min-height: 58px; padding: 10px 0 16px; }
.load-more-button { min-width: 112px; height: 32px; border: 1px solid #dfe8e2; border-radius: 16px; background: #f7faf8; color: #537267; font: inherit; font-size: 10px; cursor: pointer; transition: background 140ms ease, border-color 140ms ease, color 140ms ease; }
.load-more-button:hover { background: #edf5f0; border-color: #c8ddd0; color: var(--green); }
.load-more-button:disabled { cursor: wait; opacity: .7; }
.load-complete { display: inline-flex; align-items: center; gap: 9px; color: #a0aaa6; font-size: 9px; letter-spacing: .02em; }
.load-complete::before, .load-complete::after { content: ''; width: 34px; height: 1px; background: #e5ebe7; }
.log-loader.is-complete { min-height: 48px; padding-top: 8px; }
.log-mark { flex: 0 0 27px; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: #e8f3ee; color: #318568; font-weight: 600; }
.log-mark.user\.quota_subtract { background: #fbefeb; color: var(--coral); }
.log-mark.user\.quota_override { background: #edf1f3; color: #687983; }
.log-columns { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; }
.log-target, .log-actor { min-width: 0; }
.log-target > strong { display: block; overflow: hidden; color: #34434a; font-size: 10px; font-weight: 600; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.log-target > strong span { color: #929e9f; font-size: 9px; font-weight: 400; }
.log-change { margin-top: 5px; color: #718078; font-size: 9px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.log-actor { max-width: 145px; text-align: right; }
.log-actor strong { display: block; overflow: hidden; color: #718078; font-size: 9px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.log-actor time { display: block; margin-top: 5px; color: #8d999d; font-size: 9px; white-space: nowrap; }
.adjust-dialog { padding: 0; border: 0; border-radius: 12px; width: min(410px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow-y: auto; box-shadow: 0 24px 90px #102b3540; color: var(--ink); }
.adjust-dialog::backdrop { background: #19282f70; backdrop-filter: blur(2px); }
.adjust-dialog[open] { animation: dialog-in 307ms cubic-bezier(.2, .75, .25, 1) 50ms both; }
.adjust-dialog[open]::backdrop { animation: backdrop-in 173ms ease-out 50ms both; }
.adjust-dialog.closing { animation: dialog-out 147ms ease-in both; }
.adjust-dialog.closing::backdrop { animation: backdrop-out 107ms ease-in both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(100dvh); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(100dvh); } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdrop-out { from { opacity: 1; } to { opacity: 0; } }
.adjust-dialog form { padding: 10px 22px 22px; }
.dialog-grabber { display: none; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.dialog-heading h2 { font-size: 19px; margin: 0; }
.target-user { display: flex; align-items: center; gap: 10px; padding: 11px; background: #f6f8f7; border: 1px solid #e9eeeb; border-radius: 7px; }
.dialog-avatar { background: #e4f0eb; }
.target-user > div:last-child { display: flex; flex-direction: column; gap: 3px; }
.target-user strong { font-size: 12px; }
.target-user span { font-size: 10px; color: #83908e; }
.quota-history { margin-top: 13px; border-top: 1px solid var(--line); padding-top: 10px; }
.history-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.history-heading strong { color: #526168; font-size: 10px; }
.history-heading span { color: #96a1a4; font-size: 9px; }
.quota-history-list { max-height: 128px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #ccd3d5 transparent; }
.history-row { min-height: 27px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid #eef1ef; color: #66746e; font-size: 9px; font-variant-numeric: tabular-nums; }
.history-symbol { width: 15px; flex: 0 0 15px; color: #318568; font-size: 12px; font-weight: 700; text-align: center; }
.history-symbol.subtract { color: var(--coral); }
.history-symbol.override { color: #778894; }
.history-amount { color: #35443d; font-weight: 600; }
.history-result { color: #85918c; }
.history-row time { flex: 1; color: #9aa4a6; text-align: right; white-space: nowrap; }
.receipt-link { cursor: pointer; }
.receipt-link:hover, .receipt-link:focus-visible { background: #f6faf7; outline: none; }
.receipt-screen { min-height: 100dvh; width: 100%; display: grid; place-items: center; padding: 32px 16px; background: #eaedf0; cursor: pointer; }
.receipt-container { width: min(100%, 420px); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.receipt-paper { position: relative; width: 100%; padding: 24px 26px 22px; border: 1px solid #dfe5e2; border-radius: 14px; background: #fff; box-shadow: 0 16px 48px -12px rgba(24, 45, 38, 0.12), 0 3px 12px rgba(0, 0, 0, 0.03); color: var(--ink); cursor: default; }

.receipt-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid #f0f3f2; margin-bottom: 20px; }
.receipt-brand { display: flex; align-items: center; gap: 10px; }
.receipt-brand-badge { width: 34px; height: 34px; border-radius: 9px; background: #eaf5ee; color: var(--green); display: grid; place-items: center; }
.receipt-brand-text { display: flex; flex-direction: column; }
.receipt-brand-title { font-size: 13px; font-weight: 700; color: #203129; line-height: 1.25; }
.receipt-brand-subtitle { font-size: 10px; color: #85958f; }


.receipt-change { text-align: center; padding: 4px 0 20px; }
.receipt-status-wrap { display: flex; justify-content: center; margin-bottom: 12px; }
.receipt-type { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px; background: #edf7f1; color: #186b47; font-size: 13px; font-weight: 600; line-height: 1.2; }
.receipt-type-icon { width: 15px; height: 15px; flex-shrink: 0; }
.receipt-label { margin: 0 0 6px; color: #8a9692; font-size: 11px; font-weight: 500; }
.receipt-amount { display: inline-flex; align-items: baseline; justify-content: center; gap: 2px; color: #16603d; font-size: clamp(34px, 9.5vw, 44px); letter-spacing: -1.2px; font-variant-numeric: tabular-nums; line-height: 1.15; font-weight: 700; }
.receipt-sign { font-size: 0.85em; font-weight: 600; margin-right: 1px; }
.receipt-value { min-width: 0; }

.receipt-change.user\.quota_subtract .receipt-type { background: #fdf1ed; color: #b05035; }
.receipt-change.user\.quota_subtract .receipt-amount { color: #b05035; }
.receipt-change.user\.quota_override .receipt-type { background: #eef3f8; color: #4b6685; }
.receipt-change.user\.quota_override .receipt-amount { color: #3d5875; }

.receipt-override { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 6px; background: #f3f6f9; color: #586979; font-size: 11px; }
.receipt-override strong { color: #283a4c; font-variant-numeric: tabular-nums; }

.receipt-summary { margin-top: 4px; display: flex; flex-direction: column; gap: 10px; }
.receipt-user-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #f9fbf9; border: 1px solid #ecf1ee; border-radius: 9px; }
.receipt-user-avatar { width: 32px; height: 32px; border-radius: 8px; background: #e6ede8; color: #3a5446; font-size: 13px; font-weight: 700; display: grid; place-items: center; text-transform: uppercase; flex-shrink: 0; }
.receipt-user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.receipt-user-caption { font-size: 9px; color: #8d9b95; line-height: 1.2; text-transform: uppercase; letter-spacing: 0.3px; }
.receipt-user-title { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.receipt-user-name { font-size: 13px; font-weight: 600; color: #283730; overflow-wrap: anywhere; }
.receipt-user-id { font-size: 11px; color: #879590; font-variant-numeric: tabular-nums; }

.receipt-balance-card { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 10px; background: linear-gradient(180deg, #f5f9f6 0%, #f1f6f3 100%); border: 1px solid #e1ebe4; }
.receipt-balance-col { display: flex; flex-direction: column; gap: 3px; }
.receipt-balance-col.receipt-balance-target { text-align: right; }
.receipt-balance-label { font-size: 10px; color: #788a81; }
.receipt-balance-val { font-size: 14px; font-weight: 600; color: #52635a; font-variant-numeric: tabular-nums; }
.receipt-balance-val.receipt-val-to { font-size: 16px; font-weight: 700; color: #185237; }
.receipt-balance-arrow { color: #8aa195; display: flex; align-items: center; justify-content: center; }

.receipt-divider { height: 1px; margin: 18px 0 10px; background: repeating-linear-gradient(90deg, #e1e7e4, #e1e7e4 4px, transparent 4px, transparent 8px); }

.receipt-details { margin: 0; }
.receipt-details > div { min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11px; padding: 4px 0; }
.receipt-details dt { flex: 0 0 auto; color: #85938e; }
.receipt-details dd { margin: 0; color: #2e3e36; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; font-weight: 500; }
.receipt-meta-id { color: #869690; font-size: 10px; }
.receipt-row-event { align-items: baseline !important; }
.receipt-id { font-size: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; letter-spacing: -0.2px; color: #586962; word-break: break-all; }

.receipt-footer { margin-top: 18px; padding-top: 14px; border-top: 1px solid #f1f4f2; text-align: center; }
.receipt-footer-text { margin: 0; color: #9aa7a2; font-size: 10px; }

.receipt-actions { width: 100%; display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.receipt-action-btn { height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 9px; border: 1px solid #d5dfdb; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 140ms ease; }
.receipt-btn-back { background: #fff; color: #495a52; }
.receipt-btn-back:hover { background: #f4f7f5; color: #22342c; border-color: #c1cfc9; }
.receipt-btn-copy { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 2px 6px rgba(20, 108, 88, 0.2); }
.receipt-btn-copy:hover { background: var(--green-dark); border-color: var(--green-dark); }
.receipt-download-icon { display: none; }
.receipt-btn-copy[data-device-action="download"] .receipt-copy-icon { display: none; }
.receipt-btn-copy[data-device-action="download"] .receipt-download-icon { display: block; }
.receipt-hint { font-size: 11px; color: #84938d; text-align: center; }

.receipt-copy-status { position: fixed; z-index: 100; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); border-radius: 9px; padding: 11px 18px; background: #1e3328; color: #fff; font-size: 12px; font-weight: 500; box-shadow: 0 10px 24px rgba(0,0,0,0.22); pointer-events: none; }
.receipt-copy-status[hidden] { display: none; }

.history-state { padding: 12px 0; color: #9aa4a6; font-size: 9px; text-align: center; }
.history-state { padding: 12px 0; color: #9aa4a6; font-size: 9px; text-align: center; }
.mode-picker { border: 0; padding: 0; margin: 18px 0 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.mode-picker legend, .amount-label { font-size: 11px; font-weight: 600; margin-bottom: 8px; }
.mode-picker legend { grid-column: 1 / -1; }
.mode-picker label { height: 43px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #e2e8e5; border-radius: 6px; font-size: 10px; color: #697773; cursor: pointer; }
.mode-picker input { position: absolute; opacity: 0; }
.mode-picker label:has(input:checked) { border-color: #87b7a4; background: #eff7f2; color: var(--green); font-weight: 600; }
.mode-symbol { font-size: 15px; font-weight: 600; }
.mode-symbol.plus { color: #318568; }
.mode-symbol.minus { color: var(--coral); }
.mode-symbol.replace { color: #778894; }
.amount-label { display: flex; justify-content: space-between; }
.amount-label span { color: #95a09f; font-size: 9px; font-weight: 400; }
.amount-input { height: 53px; display: flex; align-items: center; gap: 8px; border: 1px solid #dce4e0; border-radius: 7px; padding: 0 12px; }
.amount-input:focus-within { border-color: #68a58b; box-shadow: 0 0 0 3px #e9f4ee; }
.amount-input > span { color: #66746e; font-size: 18px; }
.amount-input input { width: 100%; height: 100%; border: 0; outline: none; font: 500 22px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); background: transparent; }
.amount-input input::placeholder { color: #c3ccca; }
.preview { margin: 10px 0 16px; min-height: 33px; color: #7e8b88; font-size: 10px; line-height: 1.5; }
.button { height: 44px; border: 0; border-radius: 7px; padding: 0 15px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.button.primary { background: var(--green); color: white; }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { border: 1px solid #dfe5e6; background: #fff; color: #526168; }
.button.secondary:hover { background: #f5f7f7; }
.button.danger { background: #bd5142; color: #fff; }
.button.danger:hover { background: #a84437; }
.button.full { width: 100%; display: flex; justify-content: center; align-items: center; gap: 9px; }
.button span { font-size: 17px; font-weight: 400; }
.confirm-dialog { width: min(390px, calc(100vw - 32px)); padding: 0; border: 1px solid #e3e9e6; border-radius: 10px; color: var(--ink); box-shadow: 0 22px 70px #102b3538; }
.confirm-dialog::backdrop { background: #19282f70; backdrop-filter: blur(2px); }
.confirm-dialog[open] { animation: dialog-in 170ms ease-out both; }
.confirm-content { padding: 22px; }
.confirm-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #edf4f0; color: var(--green); font-size: 18px; font-weight: 700; }
.confirm-dialog:has(.danger) .confirm-icon { background: #fbefeb; color: var(--coral); }
.confirm-content h2 { margin: 15px 0 7px; font-size: 17px; }
.confirm-content p { margin: 0; color: #66757a; font-size: 11px; line-height: 1.65; }
.confirm-summary { margin-top: 15px; padding: 11px 12px; display: flex; justify-content: space-between; align-items: center; border-radius: 7px; background: #f5f7f6; color: #77858a; font-size: 10px; }
.confirm-summary strong { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.confirm-actions .button { height: 38px; padding: 0 12px; font-size: 10px; }
.login-shell { display: flex; flex-direction: column; justify-content: center; padding: 25px 35px; }
.login-shell h1 { margin: 0; font-size: 26px; }
.login-shell > .muted { color: var(--muted); font-size: 12px; margin: 6px 0 24px; }
.login-form { display: grid; gap: 9px; }
.login-form label { font-size: 11px; font-weight: 600; }
.login-form input { height: 44px; border: 1px solid #dfe5e2; border-radius: 6px; padding: 0 11px; font: inherit; outline: none; }
.login-form input:focus { border-color: #68a58b; box-shadow: 0 0 0 3px #e9f4ee; }
.login-form .button { margin-top: 5px; }
.login-foot { margin-top: 20px; text-align: center; color: #99a3a3; font-size: 9px; }

@media (max-aspect-ratio: 1/1) {
  body { background: #fff; }
  .stage { min-height: 100dvh; padding: 0; display: block; }
  .mobile-shell { width: 100%; height: 100dvh; max-width: none; border: 0; border-radius: 0; padding: 0 18px; }
  .topbar { height: 60px; flex-basis: 60px; }
  .overview { padding-top: 17px; }
  .login-shell { padding-left: 30px; padding-right: 30px; }
  .adjust-dialog { position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: none; border-radius: 14px 14px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .adjust-dialog { max-height: calc(100dvh - 12px); }
  .adjust-dialog form { padding: 8px 20px 20px; }
  .confirm-dialog { position: fixed; inset: 50% auto auto 50%; transform: translate(-50%, -50%); margin: 0; }
  .confirm-dialog[open] { animation: confirm-in 170ms ease-out both; }
  @keyframes confirm-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
  .dialog-grabber { display: block; width: 36px; height: 4px; background: #d9dfdd; border-radius: 4px; margin: 0 auto 16px; }
  .dialog-heading { margin-bottom: 12px; }
  .receipt-screen { padding: 20px 14px 28px; }
  .receipt-paper { padding: 20px 18px 18px; box-shadow: 0 8px 24px rgba(24, 45, 38, 0.08); }
}

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