/* ==========================================================================================
   Restyle (loaded after style.css, goes with nav.js): bolder tokens, floating tab bar, header
   with page title + back, More page as a tool launcher, overflow fixes.
   Remove the <link> to this file in index.html to go back to the old look.
   ========================================================================================== */
:root {
  --bg: #eef1f4; --card: #ffffff; --raised: #f7f8fa; --text: #10141a; --muted: #667080; --line: #e1e5ea;
  --accent: #178a52; --accent-2: #20b26b; --accent-text: #fff;
  --shadow: 0 1px 2px rgb(16 24 40 / .06), 0 4px 14px rgb(16 24 40 / .06);
  --r: 18px; --r-sm: 12px; --tab-h: 64px;
  --g-mod: #e5484d; --g-srv: #3e7bfa; --g-eco: #e39b16; --g-com: #8e4ec6; --g-dat: #12a594;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e12; --card: #151a21; --raised: #1b2129; --text: #eceff3; --muted: #8d97a5; --line: #232a34;
    --accent: #34c77b; --accent-2: #5de0a0; --accent-text: #06120b;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 6px 20px rgb(0 0 0 / .25);
    --g-mod: #ff6b70; --g-srv: #6d9dff; --g-eco: #f5b843; --g-com: #b583ec; --g-dat: #3fd0bd;
  }
}
body {
  font-size: 15.5px; letter-spacing: -.005em;
  background: radial-gradient(circle at top, rgba(52, 199, 123, 0.08), transparent 20%), var(--bg);
}
h1 { font-weight: 750; letter-spacing: -.02em; }
h2 { font-size: 13.5px; font-weight: 700; letter-spacing: .07em; margin: 24px 4px 10px; }

/* surfaces */
.card, .list { border-radius: var(--r); box-shadow: var(--shadow); }
.list > * { padding: 13px 16px; }
.stat b { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.btn { border-radius: var(--r-sm); min-height: 44px; transition: transform .08s; }
.btn.slim { min-height: 0; }
.btn:active, .tile:active, .sc:active, .acctbtn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: transparent;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent); }
input, select, textarea { border-radius: var(--r-sm); background: var(--raised); }
input[type="checkbox"], input[type="radio"] { min-height: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
.chip { border-radius: 999px; padding: 7px 14px; }
.tag { border-radius: 999px; padding: 2px 9px; font-weight: 600; }

/* header: translucent, page title with server + status underneath */
.top {
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 92%, transparent), color-mix(in srgb, var(--bg) 80%, transparent));
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); padding-top: calc(env(safe-area-inset-top) + 8px); padding-bottom: 8px; gap: 4px;
  box-shadow: 0 10px 24px rgb(16 24 40 / .04);
}
.top-title { gap: 0; }
.tstack { display: grid; min-width: 0; }
.top-title strong { font-size: 20px; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; }
.tsub { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--muted); }
.tsub #srvLabel:empty { display: none; }
.tsub .pill { font-size: 11px; padding: 1px 8px; font-weight: 600; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; flex: none; }
.icon-btn:active { background: var(--line); }
.hback { margin-left: -10px; color: var(--text); }
#view .back { display: none; }   /* the header arrow does this now */

/* floating bottom tab bar (phones) */
.tabs {
  position: fixed; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(560px, calc(100% - 18px)); z-index: 20; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px; padding: 6px 8px 8px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  background: rgba(15, 18, 22, 0.82); box-shadow: 0 12px 26px rgb(0 0 0 / .24);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.tabs button {
  position: relative; height: 56px; border: 0; background: transparent; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 4px 2px 5px; font-size: 10.5px; line-height: 1.1; font-weight: 700; letter-spacing: .01em;
  color: var(--muted); transition: background .15s ease, color .15s ease, transform .12s ease;
}
.tabs button:active { transform: scale(.98); }
.tabs svg {
  width: 20px; height: 20px; display: block; flex: none; transition: transform .15s ease;
}
.tabs button.on {
  background: rgba(52, 199, 123, 0.12); color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(52, 199, 123, 0.18);
}
.tabs button.on svg { transform: scale(1.04); }
.tabs .badge { position: absolute; top: 6px; right: calc(50% - 16px); left: auto; }
main {
  padding: 12px 18px calc(var(--tab-h, 64px) + 22px);
  max-width: 1120px;
  margin: 0 auto;
  scrollbar-gutter: stable;
}
.toast { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 18px); border-radius: 14px; }

/* overflow fixes */
.seg { grid-auto-columns: minmax(max-content, 1fr); overflow-x: auto; scrollbar-width: none; border-radius: var(--r-sm); }
.seg button { padding: 8px 12px; }
.seg::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.chips { scrollbar-width: none; }
.tbl { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
.progress { top: var(--top-h, 56px); }
.tip { max-width: 70vw; white-space: normal; }

/* More page: tool launcher */
.msearch { position: relative; margin: 8px 0 4px; }
.msearch svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.msearch input { padding-left: 44px; min-height: 48px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.ghead { display: flex; align-items: baseline; justify-content: space-between; }
.ghead .link { text-decoration: none; font-weight: 600; margin-right: 4px; }
.hint { margin: 0 4px; }
.home-dashboard, .dash-panel, .player-workspace, .player-detail, .player-roster-tools { display: contents; }
.player-roster, .dash-toolbar, .dash-editor, .dash-panel-head { display: none; }
.shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sc { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; border: 0; border-radius: var(--r); text-align: left;
  font-weight: 650; font-size: 14px; color: var(--text); background: color-mix(in srgb, var(--gc) 13%, var(--card)); box-shadow: var(--shadow); }
.sc > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.tile { position: relative; display: grid; justify-items: center; align-content: start; gap: 7px; padding: 12px 4px 10px; min-height: 92px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); color: var(--text); transition: transform .08s; }
.ti { flex: none; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--gc) 78%, #fff), var(--gc)); box-shadow: 0 3px 10px color-mix(in srgb, var(--gc) 35%, transparent); }
.sc .ti { width: 38px; height: 38px; border-radius: 12px; }
.ti svg { width: 23px; height: 23px; }
.tt { font-size: 12px; font-weight: 600; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.tile .badge { position: absolute; top: 8px; right: 8px; }
.tile .pinmark { position: absolute; top: 6px; right: 9px; font-size: 16px; color: var(--muted); }
.tile.pinned { border-color: var(--gc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gc) 40%, transparent); }
.tile.pinned .pinmark { color: var(--g-eco); }
.g-mod { --gc: var(--g-mod); } .g-srv { --gc: var(--g-srv); } .g-eco { --gc: var(--g-eco); } .g-com { --gc: var(--g-com); } .g-dat { --gc: var(--g-dat); }
.acct { display: grid; gap: 10px; margin-top: 26px; }
.acctbtn { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
  box-shadow: var(--shadow); text-align: left; color: var(--text); --gc: #6b7685; }
.acctbtn > span:last-child { display: grid; min-width: 0; }
@media (min-width: 560px) { .shortcuts { grid-template-columns: repeat(4, minmax(0, 1fr)); } .acct { grid-template-columns: 1fr 1fr; } }

/* Wide screens use a persistent, labeled navigation rail. */
@media (min-width: 900px) {
  :root { --rail: 216px; }
  body { padding-left: var(--rail); }
  #app { height: 100dvh; display: flex; flex-direction: column; }
  .top, #offline { flex: none; }
  .tabs {
    position: fixed; inset: 0 auto 0 0; transform: none; width: var(--rail); height: 100dvh;
    display: flex; flex-direction: column; align-items: stretch; gap: 6px;
    margin: 0; padding: 24px 14px; border: 0; border-right: 1px solid var(--line); border-radius: 0;
    background: var(--card); box-shadow: 6px 0 24px rgb(15 23 42 / .05);
  }
  .tabs button {
    flex: none; width: 100%; height: 48px; display: flex; flex-direction: row; align-items: center;
    justify-content: flex-start; gap: 13px;
    padding: 0 14px; border-radius: 12px; font-size: 14px; font-weight: 650;
  }
  .tabs svg { width: 20px; height: 20px; }
  .tabs button.on {
    background: color-mix(in srgb, var(--accent) 12%, var(--card));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
  }
  .tabs .badge { position: static; margin-left: auto; }
  main { flex: 1 1 auto; min-height: 0; height: auto; width: 100%; max-width: 1440px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
  .tile { min-height: 108px; padding: 14px 8px 12px; }
  .tile .ti { width: 46px; height: 46px; }
  .tile .tt { font-size: 13px; }
  .dash-toolbar { display: flex; justify-content: flex-end; margin: 4px 0 8px; }
  .dash-editor { display: grid; gap: 12px; margin-bottom: 14px; }
  .dash-pref-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; }
  .dash-pref-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 5px 0; }
  .dash-pref-row label { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); }
  .dash-pref-row input { flex: none; }
  .dash-pref-row .btns { flex: none; }
  .dash-pref-actions { justify-content: flex-end; }
  .dash-pref-actions .btn { flex: none; }
  .dash-panel { display: block; min-width: 0; }
  .dash-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 4px 6px; color: var(--muted); font-size: 12px; }
  .dash-drag { border: 1px solid var(--line); border-radius: 8px; padding: 3px 9px; color: var(--muted); background: var(--card); cursor: grab; }
  .dash-drag:active { cursor: grabbing; }
  .dash-panel.is-hidden > :not(.dash-panel-head) { opacity: .4; }
  .dash-panel.dragging { opacity: .45; }
  .dash-sync-error { margin-bottom: 10px; }
  body.chat-page main#view {
    display: flex; flex-direction: column; min-height: 0;
    height: calc(100dvh - var(--top-h, 56px)); overflow: hidden; padding: 0 28px 18px;
  }
  body.chat-page #view > .seg { flex: none; margin: 0 0 12px; }
  body.chat-page .chat-shell {
    flex: 1 1 auto; min-height: 0; height: auto; max-height: none; padding-bottom: 12px;
  }
  body.chat-page .thread.chat { min-height: 0; }
  body.chat-page .chatbar { margin: 0; }
  body.chat-locked main#view {
    height: calc(100dvh - var(--top-h, 56px));
    min-height: 0; overflow: hidden; padding: 0 28px 18px;
  }
  body.chat-locked #view {
    display: flex; flex-direction: column; min-height: 0;
  }
  body.chat-locked #view > .seg { flex: none; margin: 0 0 12px; }
  body.chat-locked .chat-panel {
    flex: 1 1 auto; min-height: 0; height: auto; max-height: none;
    gap: 10px; padding: 0 0 12px;
  }
  body.chat-locked #view .chat-panel { padding-bottom: 12px; }
  body.chat-locked .chat-panel > .chips { margin: 0; }
  body.chat-locked #gcq { margin: 0; max-width: none; }
  body.chat-locked .gwrap {
    min-height: 0; border: 1px solid var(--line); border-radius: var(--r);
    background: var(--card); box-shadow: var(--shadow);
  }
  body.chat-locked .gthread { padding: 12px; margin: 0; }
  body.chat-locked .gmsg { padding: 10px 12px; border-radius: var(--r-sm); }
  body.chat-locked .chatbar {
    margin: 0; padding: 12px; border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--card) 96%, transparent);
  }
  body.chat-locked .chatbar textarea { min-height: 52px; max-height: 20vh; }
  body.chat-locked .chatbar .btn { min-width: 76px; }
  main { padding: 12px 24px 24px; }
  .toast { bottom: 18px; }
  .siteframe { height: calc(100dvh - var(--top-h, 56px) - 70px); }
}
@media (min-width: 1100px) {
  .home-dashboard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; align-items: start; }
  .dash-panel[data-dash-panel="attention"],
  .dash-panel[data-dash-panel="stats"],
  .dash-panel[data-dash-panel="quick"],
  .dash-panel[data-dash-panel="activity"],
  .dash-panel[data-dash-panel="clock"] { grid-column: 1 / -1; }
}
@media (min-width: 1200px) {
  .player-workspace { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(0, 1.7fr); gap: 24px; align-items: start; }
  .player-roster { display: block; position: sticky; top: 12px; align-self: start; max-height: calc(100dvh - var(--top-h, 56px) - 36px); overflow-y: auto; }
  .player-roster-tools { display: grid; position: sticky; top: 0; z-index: 2; gap: 6px; padding-bottom: 8px; background: var(--bg); }
  .player-roster-tools .seg { margin: 0; }
  .player-detail { display: block; min-width: 0; }
  .player-detail > .back { display: none; }
  .player-roster .item.selected { background: color-mix(in srgb, var(--accent) 12%, var(--card)); box-shadow: inset 3px 0 var(--accent); }
}
@media (max-width: 899px) {
  :root { --tab-h: max(64px, calc(2.75rem + 10px)); }
  body { font-size: max(15.5px, 1rem); }
  h1 { font-size: max(22px, 1.375rem); }
  h2 { font-size: max(13.5px, .875rem); }
  .small { font-size: max(13px, .875rem); }
  label, .sfield > span { font-size: max(13px, .875rem); }
  .top-title strong { font-size: max(20px, 1.25rem); }
  .tag, .badge, .pill, .tsub .pill { font-size: max(11px, .75rem); line-height: 1.25; }
  .badge { height: auto; min-height: 20px; }
  .stat span { font-size: max(13px, .8125rem); }
  .tabs button { height: auto; min-height: 56px; font-size: max(10.5px, .75rem); }
  .tt, .tbl { font-size: max(13px, .8125rem); }
  .tbl.cards td:first-child { font-size: max(14px, .875rem); font-weight: 700; }
  .tbl.cards td::before { font-size: max(12px, .75rem); }
  .logline, .tip, .gmeta, .msg .meta { font-size: max(12px, .75rem); }
  .ptabs button { font-size: max(14px, .875rem); }
  .ticket-preview { font-size: max(13px, .8125rem); }
  .cnt { font-size: max(11px, .75rem); }
  .qbtn { font-size: max(12px, .8125rem); }
  input, select, textarea { font-size: max(16px, 1rem); line-height: 1.3; }
  .player-detail-sections { display: block; min-width: 0; }
  .player-section-tabs { position: sticky; top: 0; z-index: 4; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 12px; }
  .player-section-tabs button { min-width: 0; min-height: 44px; white-space: normal; overflow-wrap: anywhere; font-size: max(13px, .875rem); }
  .player-section { display: none; }
  .player-section.on { display: block; }
  .player-section > h2 { display: none; }
}
@media (min-width: 900px) {
  .player-detail-sections, .player-section { display: contents; }
  .player-section-tabs { display: none; }
}
@media (min-width: 1200px) {
  .player-detail-sections { display: grid; gap: 14px; }
  .player-detail-sections > .player-section { display: grid; gap: 8px; min-width: 0; }
  .player-detail-sections > .player-section[aria-label="Overview"] { grid-row: 1; }
  .player-detail-sections > .player-section[aria-label="Actions"] { grid-row: 2; }
  .player-detail-sections > .player-section[aria-label="History"] { grid-row: 3; }
}
@media (pointer: coarse) {
  .btn, .btn.slim, .chip, .seg button, .ptabs button, .list button.item { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  input[type="checkbox"], input[type="radio"] { width: 24px; height: 24px; min-height: 24px; }
  .list button.item { min-height: 48px; }
  .banner .link { min-height: 44px; padding: 6px 8px; }
  .btn:active, .tabs button:active, .icon-btn:active, .list button.item:active,
  .qbtn:active, .chip:active, .mbtn:active, .tile:active, .sc:active, .acctbtn:active {
    filter: brightness(.92);
  }
}
:where(button, a[href], input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 85%, transparent);
  outline-offset: 2px;
}
button:not(:disabled) { cursor: pointer; }
button:disabled { cursor: not-allowed; }
@media (hover: hover) {
  .list button.item:hover, .card.activity:hover, .item-card:hover {
    background: color-mix(in srgb, var(--text) 5%, var(--card));
  }
  .btn:not(:disabled):hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .seg button:not(.on):hover, .ptabs button:not(.on):hover { color: var(--text); }
}
.ticket-tools { display: grid; grid-template-columns: minmax(0, .9fr) minmax(260px, 1.1fr); gap: 10px; align-items: center; margin-bottom: 10px; }
.ticket-tools .seg { margin: 0; }
.list button.item.ticket-item { display: grid; gap: 4px; }
.ticket-subject { display: -webkit-box; min-width: 0; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.3; }
.ticket-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.ticket-meta > :last-child { flex: none; white-space: nowrap; }
.ticket-preview { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  color: var(--muted); font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.banner-message { flex: 1 1 100%; }
.banner-queue { font-weight: 600; }
.banner .link { min-height: 36px; padding: 6px 8px; }
@media (max-width: 600px) { .ticket-tools { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .btn, .tile, .tabs svg { transition: none; } }

/* Bottom sheets (sheet.js) */
.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / .45); opacity: 0; transition: opacity .2s; }
.sheet-bg.in { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto; max-height: 88dvh; overflow-y: auto;
  display: grid; gap: 12px; padding: 8px 18px calc(env(safe-area-inset-bottom) + 18px);
  background: var(--card); border-radius: 26px 26px 0 0; box-shadow: 0 -10px 40px rgb(0 0 0 / .3);
  transform: translateY(100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.sheet.in { transform: translateY(0); }
.sgrab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 2px auto 4px; }
.sheet h3 { margin: 0; font-size: 19px; font-weight: 750; letter-spacing: -.01em; }
.stext { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.sfield { gap: 8px; }
.sfield > span { font-size: 13px; color: var(--muted); }
.sfchips { flex-wrap: wrap; overflow: visible; }
.sbtns { display: grid; gap: 8px; margin-top: 4px; }
.sbtns .btn { min-height: 50px; font-size: 16px; }
.btn.dangerfill { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghostbtn { background: none; border-color: transparent; color: var(--muted); }
.btn:disabled { opacity: .62; box-shadow: none; cursor: not-allowed; }
body.sheet-open { overflow: hidden; }
@media (min-width: 900px) { .sheet { bottom: 50% !important; transform: translateY(60%); border-radius: 22px; opacity: 0; transition: transform .2s, opacity .2s; }
  .sheet.in { transform: translateY(50%); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-bg { transition: none; } }

/* Restart planner, logs and console controls */
.log-tools { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 8px; margin: 10px 0 6px; }
.log-time-note { margin: 0 4px 4px; }
.log-info { margin: 0 4px 8px; }
.log-results > .ev { grid-template-columns: 10px minmax(0, 1fr); align-items: start; }
.log-results .dot { margin-top: 6px; }
.event-content { min-width: 0; }
.event-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 3px; }
.event-time { display: grid; justify-items: end; gap: 1px; min-width: 0; text-align: right; }
.event-time time { color: var(--text); font-size: 13px; font-weight: 600; }
.event-message, .audit-action { overflow-wrap: anywhere; }
.audit-entry { display: grid; gap: 5px; }
.audit-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.audit-heading b { min-width: 0; overflow-wrap: anywhere; }
.dot.chatflag { background: var(--warn); }
.dot.watch, .dot.joins, .dot.link, .dot.mentor { background: var(--accent); }
.dot.story, .dot.lottery, .dot.pshop, .dot.entry { background: var(--g-com); }
.dot.deaths, .dot.staff, .dot.chat, .dot.apply { background: var(--muted); }
.planner-time { margin: 8px 4px 12px; }
.planner-booking > b { display: block; overflow-wrap: anywhere; }
.scheduled-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; margin: 10px 4px; }
.scheduled-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.scheduled-list { display: grid; gap: 10px; margin-top: 12px; }
.scheduled-item { min-width: 0; }
.scheduled-heading { align-items: flex-start; }
.scheduled-title { min-width: 0; overflow-wrap: anywhere; }
.scheduled-summary { overflow-wrap: anywhere; }
.scheduled-times { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px 14px; }
.scheduled-times > div { display: grid; gap: 2px; min-width: 0; }
.scheduled-times b { font-weight: 600; overflow-wrap: anywhere; }
.scheduled-run { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px 10px; }
.scheduled-run > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.scheduled-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.scheduled-actions .chip { width: 100%; max-width: none; min-width: 0; min-height: 44px; white-space: normal; line-height: 1.2; overflow-wrap: anywhere; }
.scheduled-toolbar-actions > button { min-height: 44px; }
.scheduled-item details summary { display: flex; align-items: center; min-height: 44px; padding: 6px 2px; cursor: pointer; }
.scheduled-weekdays { flex-wrap: wrap; overflow: visible; }
.scheduled-error { margin: 10px 0; }
.scheduled-zone { margin-top: 4px; }
.log-controls, .con-controls {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: center;
  margin: 10px 0;
}
.log-info, .con-info { align-items: flex-start; gap: 8px; margin: 0 4px 8px; }
.log-info > span, .con-info > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.log-info > button, .con-info > button { flex: none; }
.con details summary { display: flex; align-items: center; min-height: 44px; padding: 6px 4px; cursor: pointer; }
.con details[open] summary { margin-bottom: 4px; border-bottom: 1px solid var(--line); }
@media (max-width: 600px) {
  .log-controls, .con-controls { grid-template-columns: minmax(0, 1fr); }
  .log-tools { grid-template-columns: minmax(0, 1fr); }
  .watch-tools { grid-template-columns: minmax(0, 1fr); }
  .event-time { justify-items: start; text-align: left; }
  .site-status { flex-wrap: wrap; }
  .site-status-actions { width: 100%; }
  .site-status-actions .btn { flex: 1; }
  .site-link { align-items: flex-start; }
  .site-link .btns { width: 100%; }
  .site-link .btns .btn { flex: 1; }
  .health-toolbar { grid-template-columns: minmax(0, 1fr); }
  .health-toolbar .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .health-toolbar .seg button { min-width: 0; padding-inline: 6px; white-space: normal; }
  .health-refresh { justify-content: space-between; }
  .health-refresh .btn { flex: none; }
  .health-refresh > span { text-align: left; }
  .perf-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .perf-actions .chip { width: 100%; min-width: 0; max-width: none; overflow-wrap: anywhere; }
  .scheduled-toolbar { grid-template-columns: minmax(0, 1fr); }
  .scheduled-toolbar-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .scheduled-toolbar-actions > .tag { grid-column: 1 / -1; justify-self: start; }
  .scheduled-times, .scheduled-form-grid { grid-template-columns: minmax(0, 1fr); }
  .scheduled-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  pre.evidence { font-size: max(12px, .75rem); }
}
@media (max-width: 600px) {
  .health-toolbar { grid-template-columns: minmax(0, 1fr); }
  .health-toolbar .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .health-toolbar .seg button { min-width: 0; padding-inline: 6px; white-space: normal; }
  .health-refresh { justify-content: space-between; }
  .health-refresh > span { text-align: left; }
  .perf-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Home v2 */
.need { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; text-align: left; color: var(--text);
  border-left: 4px solid var(--gc); }
.need .mt { display: grid; gap: 1px; }
.allgood { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 14px 16px; border-radius: var(--r);
  background: color-mix(in srgb, var(--good) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--good) 25%, var(--line)); }
.allgood > span:last-child { display: grid; }
.stats .stat { color: var(--text); }
.stat.hot b { color: var(--bad); }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0 12px; }
.qbtn { display: grid; justify-items: center; gap: 6px; padding: 6px 2px; border: 0; background: none; color: var(--text); font-size: 12px; font-weight: 600; }
.qbtn .ti { width: 48px; height: 48px; border-radius: 16px; transition: transform .08s; }
.qbtn:active .ti { transform: scale(.94); }

/* Help text behind the (i) button */
body:not(.help-on) #view .help { display: none; }
#view .help { padding: 10px 12px 10px 36px; border-radius: var(--r-sm); position: relative; color: var(--text);
  background: color-mix(in srgb, var(--g-srv) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--g-srv) 22%, var(--line)); }
#view .help::before { content: "i"; position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  font: 700 11px/1 Georgia, serif; color: #fff; background: var(--g-srv); }
#helpBtn.on { color: var(--g-srv); background: color-mix(in srgb, var(--g-srv) 14%, transparent); }

/* Tables as cards on phones (nav.js labels each cell with its column) */
@media (max-width: 600px) {
  .tbl.cards { display: block; white-space: normal; overflow: visible; }
  .tbl.cards tbody { display: grid; gap: 8px; }
  .tbl.cards tr:first-child { display: none; }
  .tbl.cards tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 14px; padding: 10px 12px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); }
  .tbl.cards td { border: 0; padding: 0; display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
  .tbl.cards td::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
  .tbl.cards td:first-child { grid-column: 1 / -1; font-weight: 700; font-size: 14px; padding-bottom: 2px; }
  .tbl.cards td:first-child::before { content: none; }
}

/* Action bar that stays above the tab bar while you scroll (Map chunks) */
.actbar { position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 18px); z-index: 3; margin-top: 10px;
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border-radius: var(--r); border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 24px rgb(0 0 0 / .18); }
.actbar .btn { flex: 1 1 auto; min-height: 42px; padding: 8px 12px; }
@media (min-width: 900px) { .actbar { bottom: 16px; } }

/* Loading placeholders */
.empty.skel { display: grid; gap: 10px; padding: 16px; }
.empty.skel i { display: block; height: 14px; border-radius: 7px; background: var(--line); animation: skel 1.2s ease-in-out infinite; }
.empty.skel i:nth-of-type(2) { width: 80%; animation-delay: .15s; }
.empty.skel i:nth-of-type(3) { width: 55%; animation-delay: .3s; }
@keyframes skel { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .empty.skel i { animation: none; } }

/* Theme picked in Settings (beats the phone's setting) */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f4; --card: #ffffff; --raised: #f7f8fa; --text: #10141a; --muted: #667080; --line: #e1e5ea;
  --accent: #178a52; --accent-2: #20b26b; --accent-text: #fff; --good: #2f7d4f; --warn: #b7791f; --bad: #c0392b;
  --staff-bubble: #e4f1e9; --player-bubble: #eef0f3; --chart: #2f7d4f;
  --shadow: 0 1px 2px rgb(16 24 40 / .06), 0 4px 14px rgb(16 24 40 / .06);
  --g-mod: #e5484d; --g-srv: #3e7bfa; --g-eco: #e39b16; --g-com: #8e4ec6; --g-dat: #12a594;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0e12; --card: #151a21; --raised: #1b2129; --text: #eceff3; --muted: #8d97a5; --line: #232a34;
  --accent: #34c77b; --accent-2: #5de0a0; --accent-text: #06120b; --good: #5cc28a; --warn: #e0a84a; --bad: #ef6b5d;
  --staff-bubble: #1f3a2b; --player-bubble: #242a33; --chart: #3f9a66;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 6px 20px rgb(0 0 0 / .25);
  --g-mod: #ff6b70; --g-srv: #6d9dff; --g-eco: #f5b843; --g-com: #b583ec; --g-dat: #3fd0bd;
}

/* Game chat (gamechat.js): name colours get their lightness from --gc-l */
:root { --gc-l: 38%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --gc-l: 68%; } }
:root[data-theme="light"] { --gc-l: 38%; }
:root[data-theme="dark"] { --gc-l: 68%; }
.chat-panel { display: flex; flex-direction: column; height: calc(100dvh - var(--top-h, 56px) - var(--tab-h, 64px) - 18px); max-height: calc(100dvh - var(--top-h, 56px) - var(--tab-h, 64px) - 18px); overflow: hidden; padding-bottom: 8px; }
.chat-panel > .chips, .chat-panel > #gcq { flex-shrink: 0; }
.gwrap { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; padding-bottom: 0; }
body.chat-locked .chat-panel, body.chat-locked .chat-shell { padding-bottom: calc(var(--tab-h, 62px) + 14px); }
.gthread { flex: 1 1 auto; gap: 2px; margin-top: 8px; min-height: 120px; height: 0; max-height: 100%; overflow-y: auto; }
.gwrap .chatbar { margin-top: auto; }
.gmsg { padding: 6px 10px; border-radius: var(--r-sm); }
.gmsg.flagged { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.gmeta { display: flex; align-items: baseline; gap: 2px; flex-wrap: wrap; font-size: 12px; }
.gname { font-weight: 700; padding: 0; }
.gline { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 1px 0; color: var(--text); font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; }
.gacts { margin: 4px 0 2px; }
.gcnew { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); box-shadow: var(--shadow); }
#gcq { width: 100%; margin-top: 8px; }

/* Anti-cheat evidence panel (anticheat.js) */
.acev { margin-top: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--raised); gap: 6px; overflow-wrap: anywhere; }
.acev .tag { font-size: 11px; }
.cf-refresh, .ac-refresh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; }
.cf-sync, .ac-sync { min-width: 0; overflow-wrap: anywhere; }
.cf-sync.error, .ac-sync.error { color: var(--bad); }
.cf-sync.busy, .ac-sync.busy { color: var(--warn); }
.cf-grid { display: grid; gap: 12px; }
.cf-grid > section, .cf-flagged { min-width: 0; }
.cf-mute { margin: 0; align-content: start; }
.cf-muted .row { align-items: flex-start; }
.cf-muted .btn { flex: none; min-height: 44px; }
.cf-flag { min-width: 0; }
.cf-flag .row { align-items: flex-start; gap: 8px; }
.cf-flag time { flex: none; }
.cf-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.cf-search, .ac-search { margin-top: 5px; min-height: 44px; }
.cf-count, .ac-count { min-height: 20px; margin: 5px 2px; }
.cf-flagged { margin-top: 16px; }
.ac-heading { align-items: center; flex-wrap: wrap; margin-top: 18px; }
.ac-heading h2 { margin: 0; }
.ac-management { flex: none; }
.acselbar { display: grid; gap: 8px; margin: 8px 0; }
.ac-selection-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.ac-selection-actions .btn, .ac-actions .btn { min-width: 0; min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
.ac-filters { margin: 8px 0; }
.ac-flag.dismissed { opacity: .65; }
.ac-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); margin-top: 6px; }
.ac-pick { display: grid; place-items: center; min-width: 44px; max-width: none; min-height: 44px; padding: 4px; }
@media (min-width: 900px) {
  .cf-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr); align-items: start; }
}
@media (max-width: 600px) {
  .cf-refresh, .ac-refresh { align-items: flex-start; }
  .cf-refresh .btn, .ac-refresh .btn { flex: none; }
  .ac-heading { align-items: flex-start; }
}

/* Public site inside the app (web.js viewSite) */
.sitebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.sitebar .ellipsis { min-width: 0; }
.siteframe { display: block; width: 100%; height: calc(100dvh - var(--top-h, 56px) - var(--tab-h, 64px) - 70px); min-height: 360px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.watch-tools { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; margin: 12px 0 6px; }
.watch-info { margin: 4px 4px 8px; }
.watch-grid { display: grid; gap: 8px; }
.watch-person { display: grid; gap: 7px; width: 100%; min-width: 0; text-align: left; color: var(--text); cursor: pointer; transition: background .12s, border-color .12s; }
.watch-person:active { background: color-mix(in srgb, var(--text) 6%, var(--card)); }
.watch-person-head { min-height: 30px; }
.watch-name, .watch-reason { min-width: 0; overflow-wrap: anywhere; }
.watch-meta { overflow-wrap: anywhere; }
.watch-exact { white-space: normal; }
.site-status { align-items: flex-start; }
.site-status-copy { flex: 1; align-items: flex-start; gap: 12px; }
.site-status-copy > div { min-width: 0; }
.site-status-actions .btn { min-height: 44px; }
.site-link { flex-wrap: wrap; }
.site-link-copy { flex: 1 1 220px; min-width: 0; }
.site-url { overflow-wrap: anywhere; }
.site-links .btns .btn { min-height: 44px; }
.site-links .list > * { min-width: 0; }
.adm-toolbar, .st-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 8px 0; }
.adm-toolbar h2 { margin: 14px 4px 4px; }
.adm-toolbar > .btn, .st-toolbar > .btn { min-height: 44px; white-space: normal; }
.adm-toolbar [role="status"], .st-toolbar [role="status"] { min-width: 0; overflow-wrap: anywhere; }
.adm-account { min-width: 0; }
.adm-summary { align-items: flex-start; gap: 8px; }
.adm-summary > span:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.adm-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.adm-actions .btn { min-width: 0; min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
.st-people td { overflow-wrap: anywhere; }
.push-kinds > .switch { min-height: 48px; }
.push-status:empty { display: none; }
.push-note { margin: 10px 4px; }
@media (max-width: 600px) {
  .adm-toolbar, .st-toolbar { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .adm-toolbar > .btn, .st-toolbar > .btn { max-width: 124px; }
}
.health-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 10px 0; }
.health-toolbar .seg { margin: 0; }
.health-toolbar .seg button { min-height: 44px; }
.health-refresh { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.health-refresh > span { min-width: 0; overflow-wrap: anywhere; text-align: right; }
.health-refresh .btn { min-height: 44px; }
.health-error { overflow-wrap: anywhere; }
.chartcard summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; }
.perf-summary { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.perf-summary > .stat { min-width: 0; padding-inline: 4px; }
.perf-actions { flex-wrap: wrap; overflow: visible; }
.perf-actions .chip { min-height: 44px; white-space: normal; line-height: 1.2; text-align: center; }
.ptabs button { min-height: 44px; }
.eco-week { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 0 2px; }
.eco-week > div { display: grid; align-content: center; gap: 2px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); }
.eco-week b { font-size: 18px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.eco-time-note { margin: 4px; }
.eco-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.eco-chart-card { min-width: 0; }
.eco-chart-card .chart { min-width: 0; }
.eco-circulation { grid-column: 1 / -1; }
.eco-table-wrap { max-width: 100%; }
.eco-table-wrap .tbl { margin-top: 0; }
.eco-leaders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.eco-leaders > section { min-width: 0; }
.eco-leaders h2 { margin-top: 16px; }
.eco-grant-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.eco-grant-head > b { min-width: 0; overflow-wrap: anywhere; }
.eco-grant-head time { flex: none; }
.bk-refresh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; }
.bk-status { min-width: 0; overflow-wrap: anywhere; }
.bk-status.error { color: var(--bad); }
.bk-status.busy { color: var(--warn); }
.bk-policy { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.bk-policy > div { display: grid; align-content: start; gap: 4px; min-width: 0; }
.bk-policy span { overflow-wrap: anywhere; }
.bk-selection { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 0; font-size: 13px; }
.bk-selection .btn { flex: none; min-height: 44px; }
.bk-file { min-height: 48px; }
.bk-file > span { overflow-wrap: anywhere; }
.hs-entry-count { min-height: 20px; margin: 5px 2px 0; }
.hs-limit { padding: 10px 14px; }
.ch-refresh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; }
.ch-sync { min-width: 0; overflow-wrap: anywhere; }
.ch-sync.error, .ch-map-status .bad { color: var(--bad); }
.ch-sync.busy { color: var(--warn); }
.ch-status { line-height: 1.5; }
.ch-map-status { min-height: 40px; }
.ch-selection { display: grid; gap: 4px; margin-top: 8px; }
.ch-selection > * { overflow-wrap: anywhere; }
.ch-houses { min-height: 48px; margin: 8px 0; }
.actbar .btn { min-height: 44px; }
.ch-map-pane, .ch-side { min-width: 0; }
.ch-detail-summary { display: grid; gap: 5px; overflow-wrap: anywhere; }
.ch-detail-chunk > div { overflow-wrap: anywhere; }
.ch-detail-pages { margin-top: 8px; gap: 6px; }
.ch-snaps > .row { flex-wrap: wrap; gap: 6px; }
@media (min-width: 900px) {
  main#view.chunks-page { display: flex; flex-direction: column; overflow: hidden; max-width: none; scrollbar-gutter: auto; }
  .chunks-page > h2 { flex: none; margin: 0 0 10px; }
  .ch-workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 36%); gap: 20px; }
  .ch-map-pane { display: flex; flex-direction: column; min-height: 0; }
  .ch-map-pane .mapwrap { flex: 1; min-height: 0; }
  .ch-map-pane .map { height: 100%; aspect-ratio: auto; cursor: grab; }
  .ch-map-pane .map:active { cursor: grabbing; }
  .ch-map-pane .map.picking { cursor: crosshair; }
  .ch-map-pane .legend, .ch-map-status { flex: none; }
  .ch-map-status { margin: 4px 4px 0; }
  .ch-side { display: flex; flex-direction: column; min-height: 0; gap: 12px; }
  .ch-controls { flex: none; max-height: 55%; overflow-y: auto; scrollbar-width: thin; padding-right: 4px; }
  .ch-controls .ch-refresh { margin-top: 0; }
  .ch-controls .actbar { position: static; box-shadow: none; }
  .ch-controls .btns, .ch-controls .actbar { gap: 6px; }
  .ch-controls .btn { white-space: normal; }
  .ch-history { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .ch-history section { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
  .ch-history h2 { margin: 0 4px 6px; }
  .ch-history .row, .ch-history .btns { flex: none; }
  .ch-history .list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain; }
  .ch-history .list > * { overflow-wrap: anywhere; }
  .ch-history .item { white-space: normal; }
}
.shops-title { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; }
.shops-title h2 { margin-bottom: 8px; }
.shops-grid { display: grid; gap: 8px; }
.shop-card { min-width: 0; padding: 12px 14px; }
.shop-card summary { min-height: 44px; cursor: pointer; list-style: none; }
.shop-card summary::-webkit-details-marker { display: none; }
.shop-card summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.shop-card[open] summary::after { transform: rotate(225deg); }
.shop-summary { align-items: flex-start; }
.shop-summary-copy { display: grid; gap: 3px; min-width: 0; }
.shop-summary-copy > * { overflow-wrap: anywhere; }
.shop-line { gap: 10px; }
.shop-line > span { min-width: 0; overflow-wrap: anywhere; }
.shop-line > b { flex: none; }
.shop-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.shop-actions .btn { min-width: 0; min-height: 44px; overflow-wrap: anywhere; }
.lottery-actions .btn { min-height: 44px; }
.shop-add { display: grid; gap: 8px; }
.shop-add label { color: var(--text); font-size: inherit; }
.shop-add label input { margin-top: 5px; }
.shop-tabs { flex-wrap: wrap; overflow: visible; }
.shop-tabs .chip { min-height: 44px; }
.shitem-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shitem-fields label { min-width: 0; }
.shitem-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shitem-actions .btn { min-width: 0; min-height: 44px; overflow-wrap: anywhere; }
.shbar { align-items: center; }
.shbar .btns { display: flex; flex: none; }
@media (min-width: 900px) {
  .watch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shops-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 600px) {
  .watch-tools { grid-template-columns: minmax(0, 1fr); }
  .ch-refresh { align-items: flex-start; }
  .ch-refresh .btn { flex: none; }
  .bk-policy { grid-template-columns: minmax(0, 1fr); }
  .eco-week { grid-template-columns: minmax(0, 1fr); }
  .eco-week > div { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
  .eco-week b { text-align: right; }
  .eco-charts, .eco-leaders { grid-template-columns: minmax(0, 1fr); }
  .eco-circulation { grid-column: auto; }
  .shop-summary { flex-wrap: wrap; }
  .shop-summary > .tag { flex: none; }
  .shitem-fields { grid-template-columns: minmax(0, 1fr); }
  .shitem-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shbar .btns { width: 100%; }
  .shbar .btns .btn { flex: 1; }
}
