/* 夕凪マート — the clerk's tablet (src/tablet.js). Held in both hands in first person, slides up
   over the dimmed scene. The screen has its own light "device" look so it reads as a separate
   object from the game HUD; the wallpaper, call screen and match-3 board borrow the dusk colours. */

#tablet, .tb-ring {
  --tb-paper: #f7f2e9;
  --tb-card: #fffdf8;
  --tb-ink: #2a2433;
  --tb-mute: #6e6678;
  --tb-line: rgba(42, 36, 51, 0.12);
  --tb-teal: #23877f;
  --tb-teal-soft: #dcefeb;
  --tb-green: #2f9a5d;
  --tb-red: #d0473a;
  --tb-night: #221e36;
  --hw: clamp(112px, 14vw, 196px);        /* hand width */
}
.tb [hidden], .tb-ring[hidden] { display: none !important; }

/* ------------------------------------------------------------------ stage */
.tb { position: fixed; inset: 0; z-index: 7; overflow: hidden; pointer-events: none; font-family: var(--font-ui); color: var(--tb-ink); -webkit-tap-highlight-color: transparent; }
.tb-dim { position: absolute; inset: 0; opacity: 0; transition: opacity 0.3s ease; background: radial-gradient(120% 90% at 50% 100%, rgba(14, 11, 34, 0.32), rgba(14, 11, 34, 0.62)); }
.tb.up .tb-dim { opacity: 1; pointer-events: auto; }
.tb.up.cam .tb-dim { opacity: 0; pointer-events: none; }

.tb-rig { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: max(20px, 3.2vh); transform: translateY(106%); transition: transform 0.42s cubic-bezier(0.2, 0.85, 0.25, 1.04); }
.tb.up .tb-rig { transform: none; }
.tb.up.cam .tb-rig { transform: translateY(115%); transition-duration: 0.34s; }
.tb-hold { position: relative; width: min(940px, 86vw); height: min(640px, calc(100vh - 110px)); height: min(640px, calc(100dvh - 110px)); transform: perspective(1800px) rotateX(3deg); transform-origin: 50% 100%; }

/* the uniform under the device: a strip of the teal apron with its stitched hem */
.tb-apron { position: absolute; left: 50%; bottom: -40px; width: min(1180px, 112vw); height: 22vh; transform: translateX(-50%); border-radius: 50% 50% 0 0 / 70px 70px 0 0; background: linear-gradient(180deg, #2f8f86, #1f6a63); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.14); }
.tb-apron::before { content: ""; position: absolute; left: 7%; right: 7%; top: 14px; height: 40px; border-top: 2px dashed rgba(255, 255, 255, 0.28); border-radius: 50% 50% 0 0 / 40px 40px 0 0; }

/* ------------------------------------------------------------------ device */
.tb-device { position: absolute; inset: 0; pointer-events: auto; border-radius: 38px; padding: 20px 26px; background: linear-gradient(160deg, #3b3746 0%, #211e29 55%, #17151d 100%); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.09), inset 0 2px 0 rgba(255, 255, 255, 0.12), 0 30px 60px rgba(6, 4, 20, 0.55), 0 8px 18px rgba(6, 4, 20, 0.4); }
.tb:not(.up) .tb-device, .tb.cam .tb-device { pointer-events: none; }
.tb-device:focus { outline: none; }
.tb-device::before, .tb-device::after { content: ""; position: absolute; top: -4px; height: 5px; border-radius: 3px 3px 0 0; background: #2d2935; }
.tb-device::before { right: 18%; width: 54px; }
.tb-device::after { left: 16%; width: 30px; }
.tb-lens { position: absolute; top: 7px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #5b6b8c, #0d0c12 70%); }
.tb-screen { position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: var(--tb-paper); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); font-size: 14px; isolation: isolate; }
.tb-screen::after { content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none; background: linear-gradient(115deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 30%); }

.tb-status { flex: none; display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 16px; background: var(--tb-night); color: #fdf1df; font-size: 13px; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-time { font-size: 14px; }
.tb-day { opacity: 0.68; }
.tb-flex { flex: 1; }
.tb-money { font-weight: 700; color: #ffd8a8; }
.tb-lv { display: inline-flex; align-items: center; gap: 6px; }
.tb-lv b { padding: 3px 7px; border-radius: 999px; background: #ffb86b; color: #2a1c2f; font-size: 11.5px; }
.tb-lv i { width: 46px; height: 5px; overflow: hidden; border-radius: 3px; background: rgba(255, 255, 255, 0.18); }
.tb-lv s { display: block; height: 100%; border-radius: inherit; background: #7fd6c8; text-decoration: none; transition: width 0.4s; }
.tb-bat { position: relative; width: 22px; height: 11px; padding: 1px; border: 1.5px solid rgba(253, 241, 223, 0.7); border-radius: 3px; }
.tb-bat::after { content: ""; position: absolute; right: -4px; top: 2.5px; width: 2px; height: 4px; border-radius: 0 1px 1px 0; background: rgba(253, 241, 223, 0.7); }
.tb-bat i { display: block; width: 72%; height: 100%; border-radius: 1px; background: #7fd6c8; }
.tb-warn { padding: 4px 9px; border-radius: 999px; background: #f39ab4; color: #2a1c2f; font-size: 12px; font-weight: 700; animation: tb-blink 1.2s ease-in-out infinite; }

.tb-banner { flex: none; position: relative; z-index: 3; display: flex; align-items: center; gap: 10px; margin: 8px 10px 0; padding: 7px 8px 7px 14px; border-radius: 14px; background: #1d3836; color: #fdf1df; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); animation: tb-drop 0.3s ease-out; }
.tb-banner svg { flex: none; width: 22px; height: 22px; fill: #7fd6c8; animation: tb-shake 0.9s ease-in-out infinite; }
.tb-banner span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-banner .tb-btn { min-height: 36px; padding: 4px 14px; background: transparent; border-color: rgba(255, 255, 255, 0.3); color: #fdf1df; }
.tb-banner .tb-btn.tb-lamp { background: #3fae6a; border-color: #3fae6a; color: #fff; }

.tb-view { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 0 18px 34px; scrollbar-width: thin; scrollbar-color: rgba(42, 36, 51, 0.25) transparent; }
.tb-nav { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: grid; place-items: center; height: 26px; pointer-events: none; }
.tb-homebtn { width: 150px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; pointer-events: auto; }
.tb-homebtn i { width: 120px; height: 5px; border-radius: 3px; background: rgba(42, 36, 51, 0.42); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35); transition: background 0.15s; }
.tb-homebtn:hover i { background: rgba(42, 36, 51, 0.7); }

/* ------------------------------------------------------------------ hands */
.tb-hand { position: absolute; bottom: calc(var(--hw) * -0.32); width: var(--hw); aspect-ratio: 2 / 3; pointer-events: none; filter: drop-shadow(0 6px 10px rgba(10, 6, 24, 0.35)); }
.tb-hand svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tb-hand-l { left: calc(var(--hw) * -0.6); }
.tb-hand-r { right: calc(var(--hw) * -0.6); transform: scaleX(-1); }
.h-skin { fill: #f3cba8; }
.h-back { fill: #ebb791; }
.h-shade { fill: rgba(168, 96, 66, 0.2); }
.h-nail { fill: #fbe0cf; stroke: rgba(190, 120, 90, 0.35); stroke-width: 1.2; }
.h-line { fill: none; stroke: rgba(170, 100, 70, 0.45); stroke-width: 2; stroke-linecap: round; }
.h-sleeve { fill: #f7f5f0; }
.h-fold { fill: none; stroke: rgba(120, 118, 140, 0.25); stroke-width: 2.4; stroke-linecap: round; }
.h-cuff { fill: #e4e1d9; }

/* ------------------------------------------------------------------ shared pieces */
.tb-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; margin: 0 -18px 12px; padding: 9px 18px; background: rgba(247, 242, 233, 0.95); border-bottom: 1px solid var(--tb-line); }
.tb-bar h2 { flex: 1; min-width: 0; margin: 0; overflow: hidden; font-size: 18px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.tb-bar-x { flex: none; display: flex; align-items: center; gap: 8px; }
.tb-back { display: inline-flex; align-items: center; gap: 2px; min-height: 40px; padding: 0 12px 0 6px; border: 0; border-radius: 12px; background: transparent; color: var(--tb-teal); font: 700 15px/1 var(--font-ui); cursor: pointer; }
.tb-back svg, .tb-mini { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tb-mini { width: 18px; height: 18px; stroke-width: 1.8; }
.tb-back:hover { background: var(--tb-teal-soft); }
.tb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px 14px; border: 1px solid var(--tb-line); border-radius: 12px; background: var(--tb-card); color: var(--tb-ink); font: 700 14px/1.2 var(--font-ui); white-space: nowrap; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s; }
.tb-btn:hover:not(:disabled) { border-color: var(--tb-teal); color: var(--tb-teal); }
.tb-btn:active:not(:disabled), .tb-step:active { transform: scale(0.95); }
.tb-btn:disabled { opacity: 0.42; cursor: not-allowed; }
.tb-btn small { font-size: 11.5px; font-weight: 500; color: var(--tb-mute); }
.tb-lamp { background: #ffb86b; border-color: #f0a04f; color: #2a1c2f; }
.tb-lamp:hover:not(:disabled) { background: #ffc583; border-color: #e08a35; color: #2a1c2f; }
.tb-wide { width: 100%; min-height: 48px; margin-top: 12px; font-size: 15px; }
.tb-btn:focus-visible, .tb-step:focus-visible, .tb-back:focus-visible, .tb-homebtn:focus-visible, .tp-cell:focus-visible { outline: 2px solid var(--tb-teal); outline-offset: 2px; }
.tb-chip { padding: 5px 10px; border-radius: 999px; background: var(--tb-teal-soft); color: var(--tb-teal); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.tb-tag { display: inline-block; padding: 3px 8px; border-radius: 999px; background: rgba(42, 36, 51, 0.07); color: var(--tb-mute); font-size: 12px; font-weight: 700; white-space: nowrap; }
.tb-tag.ok { background: #dff3e6; color: #22784a; }
.tb-tag.lock { background: #efeaf6; color: #63548c; }
.tb-tag.warn { background: #fdebd8; color: #a8571a; }
.tb-note { margin: 0 0 12px; color: var(--tb-mute); font-size: 13px; line-height: 1.6; }
.tb-note.tb-rule { padding: 10px 14px; border-radius: 14px; background: var(--tb-teal-soft); color: var(--tb-ink); }
.tb-note.tb-rule b { color: var(--tb-teal); }
.rg-new { padding: 2px 9px; border-radius: 999px; background: #fde4ea; color: #d23d63; font-size: 11.5px; font-weight: 800; font-style: normal; }
.tb-empty { margin: 32px 12px; color: var(--tb-mute); font-size: 14px; line-height: 1.7; text-align: center; }
.tb-h3 { margin: 18px 0 8px; color: var(--tb-mute); font-size: 13.5px; font-weight: 800; letter-spacing: 0.04em; }
.tb-meter { display: block; height: 8px; overflow: hidden; border-radius: 4px; background: rgba(42, 36, 51, 0.1); }
.tb-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2a9d94, #7fd6c8); }
.tb-pair { display: inline-flex; gap: 8px; }
.tb .up { color: var(--tb-green); }
.tb .down { color: var(--tb-red); }

/* ------------------------------------------------------------------ home */
.tb-home { display: flex; flex-direction: column; gap: 18px; min-height: calc(100% + 34px); margin: 0 -18px -34px; padding: 16px 18px 40px; color: #fff; background: radial-gradient(90% 60% at 80% 0%, rgba(255, 210, 150, 0.35), transparent 60%), linear-gradient(180deg, #3a3368 0%, #74598f 40%, #df8d7c 74%, #f4c38c 100%); }
.tb-widget { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px; border-radius: 18px; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.24); }
.tb-widget > div { min-width: 0; text-align: center; }
.tb-wk { margin: 0; font-size: 11.5px; opacity: 0.82; }
.tb-wv { margin: 3px 0; overflow: hidden; font-size: 20px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tb-wsm { font-size: 15px; line-height: 24px; }
.tb-stars { color: #ffd27a; font-size: 16px; letter-spacing: 1px; line-height: 24px; }
.tb-stars span { color: rgba(255, 255, 255, 0.3); }
.tb-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 10px; }
.tb-app { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 6px 2px; border: 0; border-radius: 16px; background: none; color: #fff; font: inherit; cursor: pointer; }
.tb-ico { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 62%), var(--c); box-shadow: 0 6px 14px rgba(20, 12, 40, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35); transition: transform 0.15s; }
.tb-ico svg { width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tb-an { font-size: 13.5px; font-weight: 700; text-shadow: 0 1px 3px rgba(20, 12, 40, 0.6); }
.tb-app:hover .tb-ico { transform: translateY(-2px) scale(1.04); }
.tb-app:active .tb-ico { transform: scale(0.94); }
.tb-app:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tb-badge { position: absolute; top: 0; left: calc(50% + 22px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #e5484d; color: #fff; font-size: 12px; line-height: 20px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9); }
.tb-app kbd { position: absolute; top: 2px; left: calc(50% - 40px); padding: 2px 4px; border-radius: 4px; background: rgba(0, 0, 0, 0.28); color: rgba(255, 255, 255, 0.85); font: 700 10px/1 var(--font-ui); }
.tb-notes { display: grid; gap: 6px; padding: 10px; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 18px; background: rgba(20, 16, 40, 0.26); }
.tb-notes-h { margin: 2px 6px 2px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; opacity: 0.8; }
.tb-notice { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.12); color: #fff; font: 600 14px/1.4 var(--font-ui); text-align: left; cursor: pointer; transition: background 0.15s; }
.tb-notice:hover { background: rgba(255, 255, 255, 0.22); }
.tb-notice:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.tb-notice svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tb-notice span { flex: 1; min-width: 0; }
.tb-notice.warn svg:first-child { color: #ffd27a; }
.tb-notice .tb-chev { opacity: 0.6; }
.tb-tip { margin: auto 0 0; font-size: 12px; text-align: center; opacity: 0.78; }
.tb-tip kbd { padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.22); font: 700 11px/1.4 var(--font-ui); }

/* ------------------------------------------------------------------ 订货 */
.to-zone { margin-bottom: 14px; }
.to-zone h3 { margin: 6px 0 8px; color: var(--tb-mute); font-size: 13px; font-weight: 800; letter-spacing: 0.05em; }
.to-row { display: grid; grid-template-columns: minmax(90px, 1.1fr) minmax(140px, 1.5fr) auto auto; align-items: center; gap: 8px 14px; margin-bottom: 6px; padding: 10px 12px; border: 1px solid var(--tb-line); border-radius: 14px; background: var(--tb-card); }
.to-row.is-locked { grid-template-columns: 1fr; border-style: dashed; background: transparent; opacity: 0.68; }
.to-name { min-width: 0; font-size: 15px; font-weight: 800; }
.to-name small { display: block; margin-top: 2px; color: var(--tb-mute); font-size: 11.5px; font-weight: 500; }
.to-stock { display: grid; gap: 5px; min-width: 0; color: var(--tb-mute); font-size: 12px; font-variant-numeric: tabular-nums; }
.to-stock b { color: var(--tb-ink); }
.to-meter { display: block; height: 7px; overflow: hidden; border-radius: 4px; background: rgba(42, 36, 51, 0.1); }
.to-meter i { display: block; height: 100%; border-radius: inherit; background: #3fae6a; }
.to-meter.warn i { background: #f0a04f; }
.to-meter.bad i { background: #e5484d; }
.to-price { display: flex; align-items: center; gap: 4px; }
.to-price b { min-width: 66px; font-size: 15px; line-height: 1.1; text-align: center; font-variant-numeric: tabular-nums; }
.to-price b small { display: block; color: var(--tb-mute); font-size: 10.5px; font-weight: 500; }
.to-price b.hi { color: var(--tb-red); }
.to-price b.lo { color: var(--tb-green); }
.tb-step { width: 34px; height: 34px; border: 1px solid var(--tb-line); border-radius: 10px; background: var(--tb-paper); color: var(--tb-ink); font: 800 18px/1 var(--font-ui); cursor: pointer; }
.tb-step:hover { border-color: var(--tb-teal); color: var(--tb-teal); }
.to-buy { display: flex; gap: 6px; }
.to-buy .tb-btn { flex-direction: column; gap: 1px; min-width: 72px; padding: 4px 10px; }

/* ------------------------------------------------------------------ 升级 / 员工 */
.tb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tb-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--tb-line); border-radius: 16px; background: var(--tb-card); box-shadow: 0 2px 6px rgba(42, 36, 51, 0.05); }
.tb-card header, .tb-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tb-card h3 { margin: 0; font-size: 16px; }
.tb-card p { flex: 1; margin: 0; color: var(--tb-mute); font-size: 13px; line-height: 1.6; }
.tb-card footer b { font-size: 17px; font-variant-numeric: tabular-nums; }
.tb-card footer small { color: var(--tb-mute); font-size: 12px; font-weight: 500; }
.tb-cards + .tb-note { margin-top: 12px; }
.tb-card.is-owned { border-color: #bfe3cd; background: #f1faf5; }
.tb-card.is-locked { background: #f6f3f9; }
.tb-card.is-locked h3, .tb-card.is-locked footer b { color: var(--tb-mute); }
.tb-people { display: flex; gap: 6px; }
.tb-people i { width: 26px; height: 26px; border: 2px dashed rgba(42, 36, 51, 0.2); border-radius: 50%; }
.tb-people i.on { border: 0; background: radial-gradient(circle at 50% 34%, #f3cba8 0 28%, transparent 29%), radial-gradient(ellipse at 50% 115%, #2a9d94 0 55%, transparent 56%), #dcefeb; }

/* ------------------------------------------------------------------ 报表 */
.tb-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.tb-kpis > div { min-width: 0; padding: 10px 12px; border: 1px solid var(--tb-line); border-radius: 14px; background: var(--tb-card); }
.tb-kpis p { margin: 0 0 4px; color: var(--tb-mute); font-size: 12px; }
.tb-kpis b { font-size: 18px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tb-kpis small { font-size: 12px; }
.tb-chart { margin: 0 0 12px; padding: 12px; border: 1px solid var(--tb-line); border-radius: 14px; background: var(--tb-card); }
.tb-chart svg { display: block; width: 100%; height: auto; max-height: 210px; }
.tb-chart text { fill: var(--tb-mute); font-size: 9px; }
.b-sales { fill: #cbc3d8; background: #cbc3d8; }
.b-pos { fill: #2a9d94; background: #2a9d94; }
.b-neg { fill: #e5484d; background: #e5484d; }
.tb-chart figcaption { display: flex; justify-content: center; gap: 14px; margin-top: 6px; color: var(--tb-mute); font-size: 12px; }
.tb-chart figcaption i { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 3px; vertical-align: -1px; }
.tb-table { width: 100%; overflow: hidden; border-collapse: collapse; table-layout: fixed; border-radius: 14px; background: var(--tb-card); font-size: 13px; font-variant-numeric: tabular-nums; }
.tb-table th, .tb-table td { padding: 8px 6px; overflow: hidden; border-bottom: 1px solid var(--tb-line); text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.tb-table th:first-child, .tb-table td:first-child { width: 3em; text-align: center; }
.tb-table th { color: var(--tb-mute); font-size: 12px; font-weight: 700; }

/* ------------------------------------------------------------------ 成长 */
.tg-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, #23877f, #3fae6a); color: #fff; }
.tg-lv { flex: none; display: grid; place-content: center; width: 84px; height: 84px; border: 2px solid rgba(255, 255, 255, 0.5); border-radius: 50%; background: rgba(255, 255, 255, 0.16); text-align: center; }
.tg-lv small { font-size: 11px; opacity: 0.85; }
.tg-lv b { font-size: 34px; line-height: 1; }
.tg-exp { flex: 1; min-width: 0; }
.tg-exp p { margin: 0 0 8px; font-weight: 700; }
.tg-exp .tb-meter { height: 10px; background: rgba(255, 255, 255, 0.25); }
.tg-exp .tb-meter i { background: #ffd27a; }
.tg-exp .tb-note { margin: 8px 0 0; color: rgba(255, 255, 255, 0.88); font-weight: 500; }
.tg-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tg-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--tb-line); border-radius: 14px; background: var(--tb-card); }
.tg-list li.is-ok { border-color: #bfe3cd; }
.tg-list b { font-size: 15px; }
.tg-list p { margin: 3px 0 0; color: var(--tb-mute); font-size: 12.5px; line-height: 1.5; }
.tg-next { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: #fff3e2; color: #87460f; font-size: 13.5px; }

/* ------------------------------------------------------------------ 相册 / 夕凪SNS */
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tp-cell { position: relative; aspect-ratio: 4 / 3; overflow: hidden; padding: 0; border: 0; border-radius: 12px; background: #ddd5c8; cursor: pointer; }
.tp-cell img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s; }
.tp-cell:hover img { transform: scale(1.04); }
.tp-like { position: absolute; left: 6px; bottom: 6px; padding: 3px 7px; border-radius: 999px; background: rgba(20, 16, 40, 0.7); color: #ffd1dc; font-size: 11.5px; }
.tp-big { margin: 0; overflow: hidden; border-radius: 14px; background: #1c1a24; }
.tp-big img { display: block; width: 100%; max-height: 50vh; object-fit: contain; }
.tp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0; color: var(--tb-mute); font-size: 13px; }
.ts-post { max-width: 520px; margin: 0 auto; overflow: hidden; border: 1px solid var(--tb-line); border-radius: 18px; background: var(--tb-card); }
.ts-post header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.ts-av { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #ffb86b, #f39ab4); }
.ts-av svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.ts-post header b { display: block; font-size: 15px; }
.ts-post header small { color: var(--tb-mute); font-size: 12px; }
.ts-post > img { display: block; width: 100%; max-height: 40vh; object-fit: cover; }
.ts-cap { margin: 10px 14px 4px; font-family: var(--font-jp); font-size: 14px; }
.ts-likes { margin: 0 14px 8px; color: #e5486d; font-size: 15px; }
.ts-likes b { font-size: 20px; font-variant-numeric: tabular-nums; }
.ts-comments { display: grid; gap: 6px; margin: 0; padding: 0 14px 14px; list-style: none; }
.ts-comments li { font-family: var(--font-jp); font-size: 13.5px; opacity: 0; transform: translateY(6px); animation: tb-in 0.4s ease-out var(--d, 0s) forwards; }
.ts-comments b { margin-right: 8px; color: var(--tb-teal); font-family: var(--font-ui); font-size: 12.5px; }

/* ------------------------------------------------------------------ 町友圈 */
.sn-me { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; padding: 12px 14px; border: 1px solid var(--tb-line); border-radius: 16px; background: linear-gradient(120deg, #fff6ec, #fdeff3); }
.sn-me > div { flex: 1; min-width: 0; }
.sn-me b { display: block; font-size: 15px; }
.sn-me small { color: var(--tb-mute); font-size: 12px; }
.sn-me p { margin: 0; text-align: center; }
.sn-me p b { font-size: 18px; font-variant-numeric: tabular-nums; color: #d9536f; }
.sn-av { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--c, #7a6ad0); color: #fff; font-weight: 900; font-size: 16px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12); }
.sn-tabs { display: flex; gap: 6px; margin: 0 0 10px; }
.sn-tabs button { flex: 1; padding: 8px; border: 1px solid var(--tb-line); border-radius: 12px; background: var(--tb-card); color: var(--tb-mute); font: 700 13.5px/1 var(--font-ui); cursor: pointer; }
.sn-tabs button.on { border-color: transparent; background: #ff7a59; color: #fff; }
.sn-feed { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sn-post { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--tb-line); border-radius: 16px; background: var(--tb-card); }
.sn-post.mine { background: #f2fbf8; }
.sn-body { flex: 1; min-width: 0; }
.sn-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0; }
.sn-head b { font-size: 14px; }
.sn-head small { color: var(--tb-mute); font-size: 11.5px; }
.sn-text { margin: 4px 0 0; font-size: 14px; line-height: 1.6; word-break: break-word; }
.sn-hash { color: #2f7fd8; font-size: 13px; }
.sn-img { display: block; width: 100%; max-width: 420px; margin: 8px 0 0; border-radius: 12px; aspect-ratio: 16 / 10; object-fit: cover; background: #ddd5c8; }
.sn-meta { display: flex; align-items: center; gap: 12px; margin: 8px 0 0; color: var(--tb-mute); font-size: 12.5px; }
.sn-like { padding: 4px 10px; border: 1px solid var(--tb-line); border-radius: 999px; background: none; color: var(--tb-mute); font: 700 12.5px/1 var(--font-ui); cursor: pointer; font-variant-numeric: tabular-nums; }
.sn-like.on { border-color: #f6c2cf; background: #fff0f4; color: #e5486d; }
.sn-like:disabled { cursor: default; }
.sn-gain { color: #2f9a5d; font-weight: 700; }
.sn-cmts { display: grid; gap: 4px; margin: 8px 0 0; padding: 8px 10px; border-radius: 12px; background: rgba(42, 36, 51, 0.04); list-style: none; font-size: 13px; line-height: 1.5; }
.sn-cmts b { margin-right: 6px; color: var(--tb-teal); font-size: 12px; }
.sn-cmts .more { color: var(--tb-mute); font-size: 12px; }
.sn-sub { margin: 12px 0 6px; color: var(--tb-mute); font-size: 12.5px; font-weight: 800; letter-spacing: 0.04em; }
.sn-pick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.sn-pick button { flex: none; width: 92px; height: 66px; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 10px; background: #ddd5c8; cursor: pointer; }
.sn-pick button.on { border-color: #ff7a59; }
.sn-pick img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sn-pick .sn-none { background: var(--tb-card); border-color: var(--tb-line); color: var(--tb-mute); font: 700 12.5px var(--font-ui); }
.sn-pick .sn-none.on { border-color: #ff7a59; color: #d9536f; }
.sn-caught { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 8px 0 0; color: var(--tb-mute); font-size: 12.5px; }
.sn-input { display: block; box-sizing: border-box; width: 100%; margin: 10px 0 0; padding: 10px 12px; border: 1px solid var(--tb-line); border-radius: 12px; background: #fff; color: var(--tb-ink); font: 14px/1.6 var(--font-ui); resize: vertical; }
.sn-input:focus { outline: 2px solid #ffb39f; border-color: transparent; }
.sn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sn-chips button { padding: 6px 10px; border: 1px solid var(--tb-line); border-radius: 999px; background: var(--tb-card); color: var(--tb-ink); font: 13px/1.3 var(--font-ui); text-align: left; cursor: pointer; }
.sn-chips button:hover { border-color: #ffb39f; }
.sn-chips button.on { border-color: transparent; background: #2f7fd8; color: #fff; }

/* ------------------------------------------------------------------ 熟客 */
.rg-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rg { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--tb-line); border-radius: 16px; background: var(--tb-card); }
.rg > div { flex: 1; min-width: 0; }
.rg.unknown { background: rgba(42, 36, 51, 0.04); }
.rg-av { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--c, #b8b0c4); color: #fff; font-weight: 900; font-size: 18px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12); }
.rg.unknown .rg-av { background: #cfc8d8; }
.rg-n { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0; }
.rg-n b { font-size: 15px; }
.rg-n small { color: var(--tb-mute); font-size: 12px; }
.rg-h { display: flex; align-items: center; gap: 10px; margin: 4px 0 0; }
.rg-h span { color: #e5486d; font-size: 16px; letter-spacing: 1px; }
.rg-h i { color: #e9c6cf; font-style: normal; }
.rg-h small { color: var(--tb-mute); font-size: 12px; }
.rg-l { margin: 4px 0 0; color: var(--tb-mute); font-size: 12.5px; line-height: 1.55; }
.rg-story { display: grid; gap: 3px; margin: 8px 0 0; padding: 8px 10px 8px 24px; border-radius: 12px; background: #fff6ec; color: #7a4a1e; font-size: 12.5px; line-height: 1.55; }

/* ------------------------------------------------------------------ 日历 */
.cl-today { padding: 14px 16px; border-radius: 18px; background: linear-gradient(135deg, #2b2a5a, #7a5a9a 60%, #f29a8a); color: #fff; }
.cl-date { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 8px; }
.cl-date b { font-size: 26px; font-weight: 900; }
.cl-date span { font-size: 15px; opacity: 0.85; }
.cl-date em { margin-left: auto; font-style: normal; font-size: 13.5px; opacity: 0.9; }
.cl-ev { margin: 6px 0 0; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.14); font-size: 13px; line-height: 1.6; }
.cl-ev b { margin-right: 8px; font-size: 14px; }
.cl-ev em, .cl-up em { display: block; margin-top: 2px; font-style: normal; color: #ffe2b0; font-size: 12.5px; }
.cl-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cl-month em { padding: 2px 0; color: var(--tb-mute); font-size: 12px; font-style: normal; font-weight: 800; text-align: center; }
.cl-month span { display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 42px; padding: 4px 2px; border-radius: 10px; background: var(--tb-card); border: 1px solid var(--tb-line); overflow: hidden; }
.cl-month span b { font-size: 13px; font-variant-numeric: tabular-nums; }
.cl-month span small { max-width: 100%; overflow: hidden; color: #fff; font-size: 9.5px; line-height: 1.5; padding: 0 3px; border-radius: 4px; background: #3a8fb7; white-space: nowrap; }
.cl-month span.off b { color: #d0473a; }
.cl-month span.past, .cl-month span.before { opacity: 0.45; }
.cl-month span.today { border-color: #ff7a59; box-shadow: 0 0 0 2px #ffcdb9; }
.cl-month span.k-festival small { background: #d0473a; }
.cl-month span.k-holiday small { background: #2f9a5d; }
.cl-month span.k-sky small { background: #5a4ab0; }
.cl-month span.k-town small, .cl-month span.k-season small { background: #b07a2a; }
.cl-up { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cl-up li { padding: 10px 12px; border: 1px solid var(--tb-line); border-left: 4px solid #3a8fb7; border-radius: 12px; background: var(--tb-card); }
.cl-up li.k-festival { border-left-color: #d0473a; }
.cl-up li.k-holiday { border-left-color: #2f9a5d; }
.cl-up li.k-sky { border-left-color: #5a4ab0; }
.cl-up p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--tb-mute); }
.cl-up p:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: var(--tb-ink); }
.cl-up p:first-child small { color: var(--tb-mute); font-size: 12px; }
.cl-up em { color: #b06a1a; }
.cl-week { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.cl-week span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border: 1px solid var(--tb-line); border-radius: 12px; background: var(--tb-card); }
.cl-week b { font-size: 13px; }
.cl-week small { color: var(--tb-mute); font-size: 11px; }

/* ------------------------------------------------------------------ 电话 */
.tf-contacts, .tf-log { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tf-contacts li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--tb-line); border-radius: 14px; background: var(--tb-card); }
.tf-contacts li > div { flex: 1; min-width: 0; }
.tf-contacts b { display: block; font-size: 15px; }
.tf-contacts small { color: var(--tb-mute); font-size: 12.5px; }
.tf-av { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--c); color: #fff; font: 800 18px/1 var(--font-jp); }
.tb-call { width: 44px; height: 44px; padding: 0; border-color: #2f9a5d; border-radius: 50%; background: #2f9a5d; color: #fff; }
.tb-call:hover:not(:disabled) { background: #36ad69; color: #fff; }
.tb-call svg, .tb-ring svg { width: 20px; height: 20px; fill: currentColor; }
.tf-log li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(42, 36, 51, 0.04); font-size: 13px; }
.tf-log span { color: var(--tb-mute); }
.tf-log li.missed b, .tf-log li.missed span { color: var(--tb-red); }
.tf-call { box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 12px; height: calc(100% + 34px); min-height: 320px; margin: 0 -18px -34px; padding: 18px 18px 40px; background: linear-gradient(180deg, #24304b, #1a2033); color: #fdf1df; }
.tf-who { display: grid; justify-items: center; gap: 6px; text-align: center; }
.tf-big { width: 76px; height: 76px; font-size: 30px; box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.08); }
.tf-who b { font-size: 18px; }
.tf-who small { color: rgba(253, 241, 223, 0.65); font-size: 12.5px; }
.tf-lines { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 560px; min-height: 48px; margin: 0; padding: 4px 2px; overflow-y: auto; list-style: none; }
.tf-lines li { align-self: flex-start; max-width: 85%; padding: 9px 13px; border-radius: 16px 16px 16px 4px; background: rgba(255, 255, 255, 0.1); font-family: var(--font-jp); font-size: 14.5px; line-height: 1.55; }
.tf-lines li.me { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: #ffb86b; color: #2a1c2f; font-family: var(--font-ui); }
.tf-lines li:last-child { animation: tb-in 0.3s ease-out; }
.tf-choices { flex: 0 1 auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; max-width: 560px; max-height: 38%; overflow-y: auto; }
.tf-choices:empty { display: none; }
.tf-choices .tb-btn { border-color: rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.12); color: #fdf1df; }
.tf-choices .tb-btn:hover:not(:disabled) { border-color: rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.2); color: #fff; }
.tf-choices .tb-lamp { border-color: #ffb86b; background: #ffb86b; color: #2a1c2f; }
.tf-choices .tb-lamp:hover:not(:disabled) { background: #ffc583; color: #2a1c2f; }
.tf-hang { flex: none; display: grid; place-items: center; width: 60px; height: 60px; border: 0; border-radius: 50%; background: #e5484d; color: #fff; cursor: pointer; box-shadow: 0 8px 18px rgba(229, 72, 77, 0.4); }
.tf-hang svg { width: 30px; height: 30px; fill: currentColor; }

/* ------------------------------------------------------------------ 消消乐 */
.tm-hud { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 10px; color: var(--tb-mute); font-size: 14px; }
.tm-hud b { margin-left: 4px; color: var(--tb-ink); font-size: 22px; font-variant-numeric: tabular-nums; }
.tm-combo { min-width: 76px; color: #e08a35; font-weight: 800; }
.tm-wrap { position: relative; display: grid; place-items: center; margin-bottom: 10px; }
.tm-canvas { display: block; border-radius: 18px; background: radial-gradient(circle at 50% 18%, #3d3569, #221e36 75%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 24px rgba(34, 30, 54, 0.25); touch-action: none; cursor: pointer; }
.tm-over { position: absolute; inset: 0; display: grid; place-items: center; }
.tm-over > div { padding: 22px 26px; border-radius: 20px; background: rgba(255, 253, 248, 0.96); text-align: center; box-shadow: 0 12px 30px rgba(20, 16, 40, 0.35); animation: tb-pop 0.35s ease-out; }
.tm-over p { margin: 0 0 4px; }
.tm-ttl { color: var(--tb-mute); font-weight: 800; }
.tm-score { color: #e08a35; font-size: 44px; font-weight: 900; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tm-reward { color: var(--tb-green); font-weight: 800; }
.tm-over .tb-pair { margin-top: 12px; }

/* ------------------------------------------------------------------ camera viewfinder */
.tb-finder { position: absolute; inset: 0; pointer-events: none; animation: tb-fade 0.3s ease-out; }
.tb-thirds { position: absolute; inset: 0; opacity: 0.5;
  background:
    linear-gradient(90deg, transparent calc(33.33% - 1px), rgba(255, 255, 255, 0.4) calc(33.33% - 1px) 33.33%, transparent 33.33% calc(66.66% - 1px), rgba(255, 255, 255, 0.4) calc(66.66% - 1px) 66.66%, transparent 66.66%),
    linear-gradient(180deg, transparent calc(33.33% - 1px), rgba(255, 255, 255, 0.4) calc(33.33% - 1px) 33.33%, transparent 33.33% calc(66.66% - 1px), rgba(255, 255, 255, 0.4) calc(66.66% - 1px) 66.66%, transparent 66.66%); }
.tb-fc { position: absolute; width: 44px; height: 44px; border: 3px solid rgba(255, 255, 255, 0.92); filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.45)); }
.tb-fc.tl { top: 12vh; left: 8vw; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.tb-fc.tr { top: 12vh; right: 8vw; border-left: 0; border-bottom: 0; border-top-right-radius: 10px; }
.tb-fc.bl { bottom: 22vh; left: 8vw; border-right: 0; border-top: 0; border-bottom-left-radius: 10px; }
.tb-fc.br { bottom: 22vh; right: 8vw; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }
.tb-fhint { position: absolute; top: calc(var(--pad-t, 14px) + 56px); left: 50%; width: max-content; max-width: calc(100vw - 32px); margin: 0; padding: 7px 14px; transform: translateX(-50%); border-radius: 999px; background: rgba(20, 16, 40, 0.58); color: #fdf1df; font-size: 13px; text-align: center; }
.tb-ftags { position: absolute; left: 50%; bottom: calc(var(--pad-b, 14px) + 168px); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: max-content; max-width: calc(100vw - 32px); padding: 5px; transform: translateX(-50%); border-radius: 999px; background: rgba(20, 16, 40, 0.5); }
.tb-ftags:empty { display: none; }
.tb-ftags span { padding: 5px 4px 5px 8px; color: #fdf1df; font-size: 13px; }
.tb-ftags b { padding: 5px 11px; border-radius: 999px; background: #ffb86b; color: #2a1c2f; font-size: 13px; animation: tb-pop 0.35s ease-out; }
.tb-shutter, .tb-fclose, .tb-flast { position: absolute; pointer-events: auto; cursor: pointer; }
.tb-shutter { left: 50%; bottom: calc(var(--pad-b, 14px) + 76px); width: 76px; height: 76px; margin-left: -38px; padding: 5px; border: 4px solid #fff; border-radius: 50%; background: rgba(255, 255, 255, 0.15); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); }
.tb-shutter i { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform 0.1s; }
.tb-shutter:active i { transform: scale(0.84); }
.tb-fclose, .tb-flast { bottom: calc(var(--pad-b, 14px) + 86px); width: 56px; height: 56px; padding: 0; overflow: hidden; border: 2px solid rgba(255, 255, 255, 0.8); background: rgba(20, 16, 40, 0.6); color: #fff; }
.tb-fclose { left: calc(50% - 38px - 26px - 56px); display: grid; place-items: center; border-radius: 50%; }
.tb-fclose svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.tb-flast { left: calc(50% + 38px + 26px); border-radius: 14px; }
.tb-flast img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tb-shutter:focus-visible, .tb-fclose:focus-visible, .tb-flast:focus-visible, .tb-ring:focus-visible { outline: 2px solid #ffb86b; outline-offset: 3px; }
.tb-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.tb-flash.on { animation: tb-flash 0.45s ease-out; }

/* ------------------------------------------------------------------ incoming call while the tablet is down */
.tb-ring { position: fixed; z-index: 7; right: var(--gutter-r, 16px); bottom: calc(var(--pad-b, 14px) + 64px); display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: calc(100vw - 32px); padding: 0 16px 0 12px; border: 1px solid rgba(127, 214, 200, 0.7); border-radius: 999px; background: rgba(18, 40, 38, 0.9); color: #fdf1df; font: 700 14px/1 var(--font-ui); cursor: pointer; animation: tb-pulse 1.3s ease-out infinite; }
.tb-ring svg { flex: none; color: #7fd6c8; animation: tb-shake 0.9s ease-in-out infinite; }
.tb-ring span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@keyframes tb-blink { 50% { opacity: 0.55; } }
@keyframes tb-drop { from { opacity: 0; transform: translateY(-12px); } }
@keyframes tb-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes tb-pop { from { opacity: 0; transform: scale(0.85); } }
@keyframes tb-fade { from { opacity: 0; } }
@keyframes tb-flash { from { opacity: 0.92; } to { opacity: 0; } }
@keyframes tb-pulse { from { box-shadow: 0 0 0 0 rgba(127, 214, 200, 0.55); } to { box-shadow: 0 0 0 16px rgba(127, 214, 200, 0); } }
@keyframes tb-shake { 0%, 50%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-14deg); } 20%, 40% { transform: rotate(14deg); } }

/* ------------------------------------------------------------------ smaller screens */
@media (max-width: 900px) {
  .to-row { grid-template-columns: minmax(0, 1fr) auto; }
  .to-name { grid-column: 1; grid-row: 1; }
  .to-price { grid-column: 2; grid-row: 1; }
  .to-stock { grid-column: 1 / -1; grid-row: 2; }
  .to-buy { grid-column: 1 / -1; grid-row: 3; }
  .to-buy .tb-btn { flex: 1; flex-direction: row; gap: 8px; }
  .tb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  #tablet, .tb-ring { --hw: 100px; }
  .tb-rig { padding-bottom: 10px; }
  .tb-hold { width: calc(100vw - 14px); height: calc(100vh - 62px); height: calc(100dvh - 62px); transform: none; }
  .tb-device { padding: 15px 9px 12px; border-radius: 28px; }
  .tb-lens { top: 5px; }
  .tb-screen { border-radius: 18px; }
  .tb-status { gap: 6px; padding: 6px 10px; font-size: 12px; }
  .tb-day, .tb-bat { display: none; }
  .tb-lv i { width: 28px; }
  .tb-view { padding: 0 12px 34px; }
  .tb-bar { margin: 0 -12px 10px; padding: 6px 12px; }
  .tb-back { min-height: 44px; }
  .tb-home, .tf-call { margin: 0 -12px -34px; padding-left: 12px; padding-right: 12px; }
  .tb-widget { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .tb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 4px; }
  .tb-ico { width: 58px; height: 58px; border-radius: 16px; }
  .tb-ico svg { width: 30px; height: 30px; }
  .tb-app kbd, .tb-tip { display: none; }
  .tb-btn { min-height: 44px; }
  .tb-step { width: 44px; height: 44px; }
  .tb-homebtn { height: 30px; }
  .tb-cards { grid-template-columns: 1fr; }
  .tg-head { gap: 12px; padding: 12px; }
  .tg-lv { width: 68px; height: 68px; }
  .tg-lv b { font-size: 28px; }
  .tg-list li { flex-direction: column; align-items: flex-start; gap: 8px; }
  .tp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-hud { gap: 12px; }
  .tb-fc.tl, .tb-fc.bl { left: 5vw; }
  .tb-fc.tr, .tb-fc.br { right: 5vw; }
  .tb-fc.tl, .tb-fc.tr { top: 20vh; }
  .tb-fc.bl, .tb-fc.br { bottom: 27vh; }
}
@media (max-height: 500px) and (min-width: 641px) {
  #tablet { --hw: 92px; }
  .tb-rig { padding-bottom: 6px; }
  .tb-hold { height: calc(100vh - 24px); height: calc(100dvh - 24px); transform: none; }
  .tb-device { padding: 10px 18px; }
}
@media (pointer: coarse) {
  .tb-btn { min-height: 44px; }
  .tb-step { width: 44px; height: 44px; }
  .tb-app kbd, .tb-tip kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tb-rig { transform: none !important; opacity: 0; transition: opacity 0.2s ease; }
  .tb.up .tb-rig { opacity: 1; }
  .tb.up.cam .tb-rig { opacity: 0; }
  .tb-hold { transform: none; }
  .tb-warn, .tb-banner, .tb-banner svg, .tb-ring, .tb-ring svg, .tb-finder, .tb-ftags b, .tm-over > div, .tf-lines li:last-child { animation: none; }
  .ts-comments li { opacity: 1; transform: none; animation: none; }
  .tb-flash.on { animation-duration: 0.2s; }
  .tb-ico, .tp-cell img { transition: none; }
}
