/* Dashboards: black marble with gold veins, dark glass panes, bright gold. One dark theme (the brand look), shared by both dashboards and the Activity. */
:root {
  --bg: #080706; --bg-2: #0d0b09;
  --panel: #121009; --panel-2: #1a1711; --panel-3: #221e16;
  --text: #efe6d2; --sub: #b0a58e; --faint: #948a76; --champagne: #e6d3a3;
  --gold: #dcae4a; --gold-2: #f3d27a; --gold-3: #a87b1f; --gold-ink: #160f03;
  --line: rgb(220 174 74 / 24%); --line-strong: rgb(220 174 74 / 50%);
  --accent: var(--gold); --accent-ink: var(--gold-ink);
  --good: #8cc4a2; --bad: #dc7b6e; --warn: #dcb36a;
  --radius: 12px; --radius-sm: 8px;
  /* gold leaf: used for numbers and headings (text) */
  --foil: linear-gradient(135deg, #a87b1f 0%, #f3d27a 26%, #d9a944 46%, #fff0b8 60%, #b8892a 82%, #f0cd72 100%);
  /* the bright gold of a surface: the primary button (the one main action of a screen) and chart bars only.
   "Where you are" (menu, tabs, tab bar) is a gold line and gold text, not a filled band (2026-11-16). */
  --gold-grad: linear-gradient(180deg, #f6dc8c 0%, #f3d27a 30%, #d4a53f 70%, #a87b1f 100%);
  --gold-glow: 0 0 0 1px rgb(243 210 122 / 35%), 0 0 18px -4px rgb(243 210 122 / 55%);
  --hair: rgb(220 174 74 / 13%);
  --glow: 0 0 0 1px rgb(216 176 98 / 6%), 0 18px 40px -18px rgb(0 0 0 / 90%), inset 0 1px 0 rgb(255 228 170 / 7%);
  --glow-hover: 0 0 26px -6px rgb(216 176 98 / 35%), inset 0 1px 0 rgb(255 228 170 / 10%);
  --font: "Inter", "Helvetica Neue", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --serif: "Cinzel", "Cormorant Garamond", "Trajan Pro", "Times New Roman", serif;
  --mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--text); font: 15px/1.55 var(--font); min-height: 100vh;
  background: transparent; /* the marble (body::before) shows; html keeps the dark base colour */
}
/*
 * The page background: one image of black marble whose gold light leaks from the edges and the cracks (the owner's
 * picture, 2026-11-12). The picture is already near black with gold veins, so no colour filter is applied (the old
 * one turned a pale grey marble gold, and would grey out this light); it is only dimmed a little so text on the
 * glass panes stays easy to read. The light (bottom and edges) is the aura layer above it; the middle stays dark.
 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("marble-bg.webp") center / cover no-repeat;
  filter: brightness(.9);
}
/* a fine grain over everything: the surface reads as material, not as flat colour */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 5; opacity: .05; mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
* { scrollbar-width: thin; scrollbar-color: rgb(216 176 98 / 35%) transparent; }
::selection { background: rgb(216 176 98 / 35%); color: #fff; }
/* pages without the app frame (the Activity) */
body:not(:has(.app)) { padding: 0 16px 48px; max-width: 960px; margin: 0 auto; }
body:not(:has(.app)) > header.top { display: flex; align-items: center; gap: 12px; padding: 16px 0; }
body:not(:has(.app)) > header.top h1 { font-size: 18px; margin: 0; flex: 1; }
a { color: var(--gold-2); }
.ic { width: 20px; height: 20px; flex: none; }

/* ---- gold aura (decoration) ----------------------------------------------------------- */
.aura { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
  transform: translate(calc(var(--px, 0) * -14px), calc(var(--py, 0) * -10px)); transition: transform 1.4s cubic-bezier(.2, .7, .2, 1); }
/* gold light leaking in along the bottom and the lower edges, a darker veil at the top (under the title bar) */
.aura::before {
  content: ""; position: absolute; inset: -24px; /* larger than the screen: the aura drifts a few pixels with the pointer */
  background:
    radial-gradient(130% 50% at 50% 116%, rgb(243 196 92 / 20%), rgb(168 123 31 / 7%) 45%, transparent 70%),
    radial-gradient(36% 70% at -6% 100%, rgb(243 196 92 / 13%), transparent 70%),
    radial-gradient(36% 70% at 106% 100%, rgb(243 196 92 / 11%), transparent 70%),
    linear-gradient(180deg, rgb(5 4 3 / 40%), rgb(5 4 3 / 8%) 60%, transparent);
}
.aura .glow { position: absolute; border-radius: 50%; filter: blur(48px); mix-blend-mode: screen; will-change: transform, opacity; }
.aura .g1 { display: none; } /* the old top-right haze: gone (the light comes from below now) */
.aura .g2 { width: 620px; height: 420px; left: -220px; bottom: -300px; background: radial-gradient(closest-side, rgb(243 196 92 / 32%), rgb(168 123 31 / 10%) 55%, transparent); animation: drift-2 32s ease-in-out infinite alternate, breathe 11s ease-in-out infinite alternate -4s; }
.aura .g3 { display: none; } /* no glow in the middle of the screen */
.aura .g4 { width: 420px; height: 260px; right: 14%; bottom: -170px; background: radial-gradient(closest-side, rgb(255 222 140 / 26%), transparent); animation: drift-2 36s ease-in-out infinite alternate-reverse, breathe 8s ease-in-out infinite alternate -2s; }
@keyframes drift-1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(-120px, 80px) scale(1.12); } }
@keyframes drift-2 { from { transform: translate(0, 0) scale(1); } to { transform: translate(140px, -90px) scale(1.08); } }
@keyframes drift-3 { from { transform: translate(-80px, 40px); } to { transform: translate(120px, -60px); } }
@keyframes breathe { from { opacity: .6; } to { opacity: 1; } }
/* the logo carries the same aura */
.brand-logo { animation: logo-aura 6s ease-in-out infinite alternate; }
@keyframes logo-aura { from { filter: drop-shadow(0 0 12px rgb(216 176 98 / 25%)); } to { filter: drop-shadow(0 0 26px rgb(243 216 145 / 55%)); } }
.app { position: relative; z-index: 1; }

/* panes of dark glass: the aura glows through, softened */
.side { overflow: hidden; }
@media (max-width: 900px), (pointer: coarse) {
  .side, .content > header.top, .content > header.top::before, .tile, .section, .panel { -webkit-backdrop-filter: none; backdrop-filter: none; }
  /* no blur on phones (cost): the panes are a little denser instead, the marble still shows faintly */
  .tile, .section, .panel { background: linear-gradient(160deg, rgb(255 222 150 / 5%), transparent 40%), linear-gradient(180deg, rgb(16 14 10 / 84%), rgb(7 6 4 / 90%)); }
  .content > header.top::before { background: linear-gradient(180deg, rgb(8 7 6 / 94%) 60%, rgb(8 7 6 / 0%)); }
  .aura .g3, .aura .g4 { display: none; }
  .aura .glow { filter: blur(36px); }
}
@media (prefers-reduced-motion: reduce) {
  .side, .drawer-backdrop { transition: none !important; }
  .aura, .aura .glow, .brand-logo, .glint, .bar > i, .card:hover::before { animation: none !important; transition: none; }
  .glint { display: none; }
}

/* ---- app frame ------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 26px 14px 18px;
  background: linear-gradient(180deg, rgb(14 12 8 / 62%), rgb(7 6 4 / 76%));
  -webkit-backdrop-filter: blur(16px) saturate(1.15); backdrop-filter: blur(16px) saturate(1.15);
  border-right: 1px solid var(--line); box-shadow: inset -1px 0 0 rgb(255 228 170 / 4%), 20px 0 60px -30px rgb(0 0 0 / 90%);
}
.brand { display: grid; justify-items: center; gap: 6px; text-align: center; padding-bottom: 6px; }
.brand-logo { width: 104px; height: 104px; border-radius: 24px; filter: drop-shadow(0 0 18px rgb(216 176 98 / 35%)); }
.brand-logo.sm { width: 34px; height: 34px; border-radius: 9px; filter: drop-shadow(0 0 8px rgb(216 176 98 / 35%)); }
.brand-name {
  font-family: var(--serif); font-size: 25px; font-weight: 400; letter-spacing: .42em; text-indent: .42em;
  background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 12px rgb(216 176 98 / 30%));
}
.brand::after { content: ""; width: 120px; height: 1px; margin-top: 10px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .6; }
.brand-name.sm { font-size: 17px; letter-spacing: .26em; }
.brand-tag { font-size: 9.5px; letter-spacing: .32em; color: var(--sub); text-transform: uppercase; }
.nav { display: grid; align-content: start; gap: 4px; overflow-y: auto; flex: 1 1 auto; min-height: 0; margin-bottom: 8px; padding-right: 2px;
  mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 13px; width: 100%; padding: 11px 16px; border-radius: 6px; border: 0;
  background: transparent; color: var(--sub); font-size: 14px; letter-spacing: .04em; text-align: left; cursor: pointer; transition: color .2s, background .2s;
}
.nav-item:hover { color: var(--text); background: linear-gradient(90deg, rgb(216 176 98 / 7%), transparent); box-shadow: none; }
.nav-item.active, .nav-item.active:hover { color: var(--gold-2); font-weight: 700; background: linear-gradient(90deg, rgb(243 210 122 / 14%), rgb(243 210 122 / 3%)); box-shadow: inset 3px 0 0 var(--gold-2); }
.nav-item.active .ic { color: var(--gold-2); }
.nav-item .ic { color: var(--gold); }
.nav-item span { line-height: 1.35; word-break: keep-all; overflow-wrap: anywhere; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--hair); display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--faint); padding: 0 6px; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.ok { background: var(--good); box-shadow: 0 0 8px var(--good); }
.dot.bad { background: var(--bad); box-shadow: 0 0 8px var(--bad); }

.content { min-width: 0; display: flex; flex-direction: column; padding: 0 28px 24px; }
.content > header.top {
  display: flex; align-items: center; gap: 16px; padding: 22px 0 18px; position: sticky; top: 0; z-index: 30;
}
/* the frosted, fading backdrop is a layer of its own: a mask on the header itself would also cut off its popups */
.content > header.top::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgb(8 7 6 / 72%) 60%, rgb(8 7 6 / 0%));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  mask-image: linear-gradient(180deg, #000 80%, transparent);
}
.mobile-brand { display: none; align-items: center; gap: 10px; }
.hello { flex: 1; min-width: 0; }
.hello h1 {
  margin: 0; font-family: var(--mincho); font-weight: 600; font-size: 27px; letter-spacing: .14em; line-height: 1.3;
  background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hello .headline { margin: 2px 0 0; color: var(--sub); font-family: var(--mincho); letter-spacing: .12em; font-size: 13.5px; }
.top-right { display: flex; gap: 10px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 8px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); box-shadow: var(--glow);
}
.pill select { border: 0; background: transparent; padding: 2px 4px; font-weight: 600; max-width: 220px; }
.ic.discord { color: var(--champagne); width: 21px; height: 21px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); object-fit: cover; }
.avatar.letter { display: grid; place-items: center; font-family: var(--serif); color: var(--gold-2); background: var(--panel-3); }
.who { display: grid; line-height: 1.2; } .who small { color: var(--sub); font-size: 11.5px; }
main { display: block; }
.foot { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; gap: 14px; flex-wrap: wrap; font-size: 10.5px; letter-spacing: .3em; color: var(--faint); }
[hidden] { display: none !important; }
.foot-brand { font-family: var(--serif); color: var(--sub); }

/* ---- controls ----------------------------------------------------------------- */
select, input, textarea, button { font: inherit; color: inherit; }
select, input[type="text"], input[type="number"], input[type="search"], textarea {
  background: rgb(0 0 0 / 35%); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 11px; min-width: 0; max-width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgb(216 176 98 / 18%); }
option { background: #15120c; }
button {
  cursor: pointer; border: 1px solid var(--line-strong); background: linear-gradient(180deg, var(--panel-3), var(--panel-2));
  border-radius: var(--radius-sm); padding: 8px 16px; color: var(--text); transition: .15s;
}
button:hover { border-color: var(--gold); box-shadow: var(--glow-hover); }
button.primary {
  background: var(--gold-grad); color: var(--gold-ink); border-color: transparent;
  font-weight: 700; letter-spacing: .12em; transition: filter .2s, box-shadow .2s;
  box-shadow: var(--gold-glow), inset 0 1px 0 rgb(255 255 255 / 45%), inset 0 -1px 0 rgb(0 0 0 / 25%);
}
button.primary:hover { filter: brightness(1.08); box-shadow: 0 0 0 1px rgb(243 210 122 / 50%), 0 0 26px -4px rgb(243 210 122 / 70%), inset 0 1px 0 rgb(255 255 255 / 50%); }
/* a small primary (an action inside a list, a small 保存) is a gold outline: the fill is for the screen's one main action */
button.primary.small, button.primary.quiet { background: rgb(243 210 122 / 8%); color: var(--gold-2); border-color: var(--gold-2); box-shadow: none; letter-spacing: .06em; }
button.primary.small:hover, button.primary.quiet:hover { filter: none; background: rgb(243 210 122 / 16%); box-shadow: var(--glow-hover); }
button.danger { color: var(--bad); border-color: rgb(236 106 94 / 45%); }
button.ghost { background: transparent; border-color: transparent; padding: 4px 8px; color: var(--sub); box-shadow: none; }
button.ghost:hover { color: var(--gold-2); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---- tiles (conclusions first) ------------------------------------------------------ */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile, .section, .card {
  position: relative; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--glow);
  background: linear-gradient(160deg, rgb(255 222 150 / 5%), transparent 40%), linear-gradient(180deg, rgb(18 16 12 / 66%), rgb(8 7 5 / 78%));
}
.tile, .section { -webkit-backdrop-filter: blur(12px) saturate(1.1); backdrop-filter: blur(12px) saturate(1.1); }
.card { background: linear-gradient(160deg, rgb(255 222 150 / 4%), transparent 40%), linear-gradient(180deg, rgb(20 18 13 / 70%), rgb(9 8 6 / 80%)); }
/* a second, finer frame inside, with gold corner marks: only on stat tiles and large sections (repeated everywhere they get noisy) */
.tile::after, .section.wide::after {
  content: ""; position: absolute; inset: 5px; border-radius: calc(var(--radius) - 4px); pointer-events: none; border: 1px solid var(--hair);
  --c: rgb(232 205 140 / 70%);
  background:
    linear-gradient(var(--c), var(--c)) left top / 14px 1px, linear-gradient(var(--c), var(--c)) left top / 1px 14px,
    linear-gradient(var(--c), var(--c)) right top / 14px 1px, linear-gradient(var(--c), var(--c)) right top / 1px 14px,
    linear-gradient(var(--c), var(--c)) left bottom / 14px 1px, linear-gradient(var(--c), var(--c)) left bottom / 1px 14px,
    linear-gradient(var(--c), var(--c)) right bottom / 14px 1px, linear-gradient(var(--c), var(--c)) right bottom / 1px 14px;
  background-repeat: no-repeat;
}
.tile::before, .section::before, .card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgb(243 216 145 / 55%), transparent) top / 70% 1px no-repeat;
}
.tile { padding: 14px 14px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; align-items: center; min-height: 104px; }
.tile > :not(.icon-badge) { grid-column: 2; }
.tile .icon-badge { grid-row: span 3; width: 40px; height: 40px; }
.tile .icon-badge .ic { width: 20px; height: 20px; }
.tile .label { color: var(--sub); font-size: 11.5px; line-height: 1.3; letter-spacing: .14em; }
.tile .value {
  white-space: nowrap; font-size: 25px; font-weight: 600; letter-spacing: .03em; font-variant-numeric: tabular-nums; line-height: 1.2;
  background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tile .value.text { font-size: 19px; padding: 3px 0; }
.tile .value small { font-size: 13px; -webkit-text-fill-color: var(--sub); color: var(--sub); font-weight: 400; margin-left: 5px; letter-spacing: .05em; }
.tile .delta, .tile .muted { font-size: 12.5px; }
.tile .spark { height: 34px; margin-top: 2px; }
.icon-badge {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--champagne);
  background: radial-gradient(circle at 50% 30%, rgb(216 176 98 / 18%), rgb(0 0 0 / 35%) 72%); border: 1px solid rgb(216 176 98 / 50%);
  /* an inner ring a few pixels in: the badge reads as a struck medal */
  box-shadow: 0 0 18px -8px rgb(216 176 98 / 60%), inset 0 0 0 3px rgb(10 9 7 / 85%), inset 0 0 0 4px rgb(216 176 98 / 22%);
}
.icon-badge .ic { width: 24px; height: 24px; }
.icon-badge.sm { width: 38px; height: 38px; } .icon-badge.sm .ic { width: 19px; height: 19px; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }

/* ---- sections ---------------------------------------------------------------------- */
.sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.sections > .section { margin: 0; }
.sections > .section.wide, .sections > .section.open.wide { grid-column: 1 / -1; }
.section { margin-bottom: 14px; overflow: hidden; scroll-margin-top: 110px; }
.section > .head { display: flex; align-items: center; gap: 11px; padding: 16px 18px; cursor: pointer; user-select: none; }
.section > .head h2 { font-family: var(--mincho); font-size: 16.5px; margin: 0; flex: 1; font-weight: 600; letter-spacing: .12em; min-width: 0; color: var(--champagne); }
.section.open > .head { position: relative; }
.section.open > .head::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 1px; background: linear-gradient(90deg, rgb(216 176 98 / 45%), rgb(216 176 98 / 8%) 70%, transparent); }
.section.open > .body { padding-top: 14px; }
.section > .head .head-ic { color: var(--gold); }
.section > .head .summary { color: var(--champagne); font-size: 12.5px; letter-spacing: .06em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.section > .head .chev { transition: transform .15s; color: var(--gold); font-size: 18px; line-height: 1; }
.section.open > .head .chev { transform: rotate(90deg); }
.section > .body { padding: 0 16px 16px; display: none; }
.section.open > .body { display: block; }
.section.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 2px var(--gold), 0 0 40px -4px rgb(216 176 98 / 60%); } }
.pin { color: var(--faint); font-size: 13px; filter: grayscale(1); opacity: .55; } .pin.on { filter: none; opacity: 1; }

/* ---- module cards ------------------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card { padding: 14px; display: grid; gap: 10px; transition: .15s; }
.card:hover { border-color: var(--line-strong); box-shadow: var(--glow-hover); }
/* a gold light passes along the top edge of a card under the pointer */
.card:hover::before { background-size: 45% 1px; animation: edge-sheen 1.6s ease-in-out; }
@keyframes edge-sheen { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.card.off { opacity: .62; } .card.off .icon-badge { filter: grayscale(.8); }
.card.expanded { grid-column: 1 / -1; }
.card-head { display: flex; gap: 12px; align-items: center; }
.card-title { flex: 1; min-width: 0; }
.card-title strong { display: block; font-size: 15px; letter-spacing: .06em; font-weight: 600; color: var(--text); }
.card-title span { display: block; color: var(--sub); font-size: 12.5px; line-height: 1.4; }
.card-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--faint); }
.card-foot .grow { flex: 1; }
.card button.ghost { padding: 3px 10px; border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
.card button.ghost .ic { width: 15px; height: 15px; }
.res-card { text-align: left; cursor: pointer; padding: 14px; }
.res-card .count { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.res-card .count small { font-size: 12px; -webkit-text-fill-color: var(--sub); color: var(--sub); font-weight: 400; margin-left: 3px; }

/* ---- module detail pages ------------------------------------------------------------------ */
.nav-group { margin: 14px 10px 4px; font-size: 10.5px; letter-spacing: .24em; color: var(--faint); }
.nav-group:first-child { margin-top: 0; }
.module-bar { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; }
.module-bar-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.switch-row { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--text); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tab {
  position: relative; border: 1px solid var(--hair); border-bottom: 0; border-radius: 6px 6px 0 0; background: rgb(0 0 0 / 30%); padding: 10px 22px; color: var(--sub); white-space: nowrap; letter-spacing: .06em; box-shadow: none;
}
.tab:hover { color: var(--text); border-color: var(--line); box-shadow: none; }
.tab.active { color: var(--gold-2); font-weight: 700; background: rgb(243 210 122 / 8%); border-color: var(--line); box-shadow: inset 0 -2px 0 var(--gold-2); }
.sub-tabs-body { margin-top: 4px; }
/* a menu item that holds several modules (経済・遊び・ランク): one tab per module above that module's own page */
.unit-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.unit-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: rgb(0 0 0 / 35%); color: var(--sub); text-decoration: none; letter-spacing: .06em; font-size: 14px; transition: .15s;
}
.unit-tab .ic { width: 18px; height: 18px; color: var(--gold); }
.unit-tab:hover { color: var(--text); border-color: var(--line-strong); }
.unit-tab.active { color: var(--gold-2); border-color: var(--gold-2); background: rgb(243 210 122 / 8%); font-weight: 600; }
.unit-tab.off:not(.active) { opacity: .6; }
/* the overview: modules and admin data under the menu's units */
.unit-block + .unit-block { margin-top: 18px; }
.unit-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-family: var(--mincho); font-weight: 600; font-size: 14.5px; letter-spacing: .14em; color: var(--champagne); }
.unit-title .ic { width: 18px; height: 18px; color: var(--gold); }
.cols3 { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(0, 1.25fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.col { display: grid; gap: 16px; min-width: 0; }
.side-stack { display: grid; gap: 16px; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.panel {
  position: relative; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--glow);
  background: linear-gradient(160deg, rgb(255 222 150 / 5%), transparent 40%), linear-gradient(180deg, rgb(16 14 10 / 72%), rgb(7 6 4 / 82%));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  min-width: 0;
}
.panel::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(90deg, transparent, rgb(243 216 145 / 55%), transparent) top / 70% 1px no-repeat; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--hair); }
.panel-head h2 { flex: 1; min-width: 0; margin: 0; font-family: var(--mincho); font-size: 16px; font-weight: 600; letter-spacing: .1em; color: var(--champagne); }
.panel-head .head-ic { color: var(--gold); }
.panel-actions { display: flex; gap: 8px; align-items: center; }
.panel-actions .ghost { border: 1px solid var(--line); }
.panel-body { padding: 14px 16px 16px; }
select.small { padding: 4px 8px; font-size: 12.5px; }
.add-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--champagne) !important; border: 1px solid var(--line-strong) !important; }
.item-list { display: grid; gap: 10px; }
.item-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; width: 100%; text-align: left; padding: 12px 14px;
  border-radius: 10px; border: 1px solid var(--line); background: rgb(0 0 0 / 28%); box-shadow: none;
}
.item-card > strong, .item-card > small { grid-column: 1 / 3; }
.item-card small { color: var(--sub); font-size: 12px; }
.item-card.selected { border-color: var(--gold-2); background: linear-gradient(90deg, rgb(243 210 122 / 14%), rgb(0 0 0 / 30%)); box-shadow: var(--gold-glow); }
.plan-card .item-text { display: grid; gap: 2px; min-width: 0; }
.plan-card .item-text strong { font-size: 15px; letter-spacing: .04em; }
.plan-card .facts { display: flex; gap: 12px; flex-wrap: wrap; color: var(--faint); }
.state-dot { font-size: 12px; color: var(--faint); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.state-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.state-dot.on { color: var(--good); } .state-dot.on::before { background: var(--good); box-shadow: 0 0 8px var(--good); }
.desc-list { margin: 0; display: grid; gap: 0; }
.desc-row { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.desc-row:last-child { border-bottom: 0; }
.desc-row dt { display: flex; align-items: center; gap: 8px; color: var(--champagne); font-size: 13px; }
.desc-row dt .ic { color: var(--gold); width: 18px; height: 18px; }
.desc-row dd { margin: 0; color: var(--sub); font-size: 13px; line-height: 1.6; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; font-size: 13px; }
.checklist .mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.checklist .ok .mark { color: #0b1a12; background: var(--good); }
.checklist .ng .mark { color: #1f1405; background: var(--warn); }
.checklist .text small { display: block; color: var(--warn); font-size: 12px; }
.checklist .state { font-size: 11px; color: var(--good); letter-spacing: .06em; }
.checklist .ng .state { color: var(--warn); }
.bar-chart { width: 100%; height: auto; display: block; }
.bar-chart .grid { stroke: var(--hair); }
.bar-chart .axis { fill: var(--faint); font-size: 9px; }
.bar-chart .value { fill: var(--champagne); font-size: 10px; font-weight: 600; }
.bar-chart .bc-bar { opacity: .72; }
.bar-chart .bc-bar.last { opacity: 1; filter: drop-shadow(0 0 6px rgb(243 210 122 / 65%)); }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.mini-stat { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--hair); border-radius: 10px; background: rgb(0 0 0 / 25%); }
.mini-stat .ic { color: var(--gold); }
.mini-stat small { display: block; color: var(--sub); font-size: 11.5px; }
.mini-stat strong { font-size: 18px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
/* dashboard stat-cards pack: a card that leads somewhere is a button with "›" and a press response */
.card-link { cursor: pointer; text-align: left; width: 100%; position: relative; transition: transform .12s ease-out, border-color .15s, background-color .15s, box-shadow .15s; }
.mini-stat.card-link { background: rgb(0 0 0 / 25%); border: 1px solid var(--hair); border-radius: 10px; padding: 10px 12px; box-shadow: none; }
.mini-stat.card-link > div { min-width: 0; }
.tile.card-link { border-radius: var(--radius, 14px); padding: 14px 34px 14px 14px; }
.card-link:hover { border-color: var(--gold); background-color: rgb(216 176 98 / 8%); box-shadow: var(--glow-hover); }
.card-link:active { transform: scale(.97); background-color: rgb(216 176 98 / 14%); }
.card-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.card-go { margin-left: auto; display: grid; place-items: center; color: var(--gold); opacity: .75; transition: transform .15s, opacity .15s; }
.card-go .ic { width: 16px; height: 16px; }
.tile .card-go { position: absolute; right: 10px; top: 50%; translate: 0 -50%; grid-column: auto; }
.card-link:hover .card-go { opacity: 1; transform: translateX(2px); }
.stat-text { margin: 10px 0 0; font-size: 12.5px; }
/* where a card leads: lit up for a moment on arrival */
.flash { animation: flash 1.2s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .card-link, .card-go { transition: none; }
  .card-link:active { transform: none; }
  .card-link:hover .card-go { transform: none; }
}
.preview-frame { display: grid; gap: 8px; }
.preview-note { margin: 0; font-size: 11.5px; color: var(--faint); }
.rank-preview { display: block; width: 100%; height: auto; border-radius: 10px; }
/* a Discord-like voice channel and its control panel (preview only) */
.dc { border-radius: 10px; background: #2b2d31; padding: 10px; display: grid; gap: 10px; font-family: system-ui, "Hiragino Sans", "Noto Sans JP", sans-serif; }
.dc-channel { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; background: #404249; color: #f2f3f5; font-size: 14px; }
.dc-channel .ic { width: 18px; height: 18px; color: #b5bac1; }
.dc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-count { font-size: 11px; color: #b5bac1; background: #1e1f22; border-radius: 8px; padding: 1px 6px; }
.dc-message { display: grid; gap: 8px; padding: 6px 4px; color: #dbdee1; font-size: 13px; }
.dc-row { display: flex; gap: 6px; flex-wrap: wrap; }
.dc-btn { padding: 5px 12px; border-radius: 4px; font-size: 12.5px; color: #fff; background: #4e5058; }
.dc-btn.primary { background: #5865f2; }
.dc-btn.danger { background: #da373c; }
.dc-btn.success { background: #248046; }
.dc-sub { margin-top: 2px; font-size: 11.5px; color: #949ba4; }
/* form rows: label / control / note */
.plan-form { display: grid; gap: 4px; }
.field { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px 16px; align-items: start; padding: 8px 0; }
.field-label { padding-top: 9px; font-size: 13.5px; color: var(--text); letter-spacing: .04em; }
.field-label .req { color: var(--gold); }
.field-control { display: grid; gap: 4px; min-width: 0; }
.field-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; position: relative; }
.field-line > input[type="text"] { flex: 1 1 auto; width: 100%; min-width: 0; }
.field-note { color: var(--faint); font-size: 11.5px; }
.counter { position: absolute; right: 10px; font-size: 11px; color: var(--faint); pointer-events: none; }
.field-line > input[type="text"]:has(+ .counter) { padding-right: 52px; }
.inline { display: inline-flex; gap: 8px; align-items: center; flex-wrap: nowrap; max-width: 100%; }
.inline.wrap { flex-wrap: wrap; }
.inline input[type="number"] { width: 110px; }
.stack { display: grid; gap: 8px; }
.unit { color: var(--sub); font-size: 13px; white-space: nowrap; }
.currency { display: inline-flex; align-items: center; gap: 6px; padding-left: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgb(0 0 0 / 35%); }
.currency select { border: 0; background: transparent; }
.currency .coin-mark { width: 20px; height: 20px; margin: 0; }
.discounts { display: grid; gap: 8px; }
.discounts input[type="number"] { width: 80px; }
.form-sub { margin: 14px 0 4px; font-size: 14px; }
.toggle-list { display: grid; gap: 2px; }
.toggle-row { display: grid; grid-template-columns: 150px auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--hair); font-size: 13px; }
.toggle-row strong { font-weight: 500; }
.toggle-row small { color: var(--faint); font-size: 11.5px; }
.form-actions { justify-content: flex-end; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hair); }
.form-actions button, .panel-actions button { display: inline-flex; align-items: center; gap: 4px; }
.form-actions .ic, .panel-actions .ic { width: 16px; height: 16px; }
a.button { display: inline-flex; align-items: center; text-decoration: none; border-radius: var(--radius-sm); }
a.button.ghost { color: var(--sub); padding: 3px 10px; border: 1px solid var(--line); font-size: 12.5px; }
a.button.ghost:hover { color: var(--gold-2); }
/* top bar: search and notifications */
.top-tools { display: flex; gap: 10px; align-items: center; }
.search { position: relative; display: flex; align-items: center; }
.search .search-ic { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.search-input { width: 240px; padding-left: 34px !important; border-radius: 8px !important; background: rgb(0 0 0 / 40%) !important; }
.icon-btn { position: relative; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border-radius: 8px; }
/* スマホ版だけの部品: wide screens never show them (after .icon-btn, whose display: grid would win otherwise) */
.burger, .drawer-backdrop, .tabbar, .search-toggle, .search-close { display: none; }
.icon-btn .ic { width: 20px; height: 20px; color: var(--champagne); }
.bell-wrap { position: relative; }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; min-width: 300px; max-width: min(380px, 90vw); padding: 6px; border-radius: 12px; border: 1px solid var(--line-strong); background: #141109; box-shadow: 0 18px 50px rgb(0 0 0 / 70%); }
.search-pop { left: 0; right: auto; }
.pop-title { padding: 8px 10px; color: var(--champagne); font-size: 12px; letter-spacing: .14em; border-bottom: 1px solid var(--hair); margin-bottom: 4px; }
.pop-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.pop-item:hover, .pop-item:focus { background: rgb(216 176 98 / 10%); outline: none; }
.pop-item .ic { color: var(--gold); width: 18px; height: 18px; margin-top: 2px; }
.pop-item span { display: grid; gap: 2px; min-width: 0; }
.pop-item small { color: var(--sub); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-empty { padding: 12px 10px; color: var(--sub); font-size: 13px; }
@media (max-width: 1280px) {
  .cols3 { grid-template-columns: minmax(220px, .8fr) minmax(0, 1.4fr); }
  .col-side { grid-column: 1 / -1; }
  .col-side .side-stack { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
}
@media (max-width: 1100px) { .search-input { width: 170px; } }

/* ---- widgets ---------------------------------------------------------------------------- */
.stat { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.coin-mark { width: 1.25em; height: 1.25em; vertical-align: -.28em; margin-right: 12px; filter: drop-shadow(0 2px 6px rgb(0 0 0 / 60%)) drop-shadow(0 0 10px rgb(216 176 98 / 35%)); }
.stat .big { font-size: 30px; font-weight: 600; letter-spacing: .03em; font-variant-numeric: tabular-nums; color: #f6e7c2; }
.stat .big .num { background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spark { width: 100%; height: 48px; display: block; margin-top: 6px; overflow: visible; }
.spark path.line { fill: none; stroke: var(--gold); stroke-width: 2; filter: drop-shadow(0 0 4px rgb(216 176 98 / 60%)); }
.spark path.area { fill: var(--gold); opacity: .14; }
.spark path.glint { fill: none; stroke: #fff3cf; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 30 970; animation: glint 5s linear infinite; filter: drop-shadow(0 0 5px #f3d891); }
.bar { height: 8px; background: rgb(0 0 0 / 45%); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.bar > i { display: block; height: 100%; border-radius: 999px; box-shadow: 0 0 12px rgb(216 176 98 / 60%);
  background: linear-gradient(100deg, transparent 40%, rgb(255 246 214 / 75%) 50%, transparent 60%) 0 0 / 250% 100%, linear-gradient(90deg, var(--gold-3), var(--gold) 60%, var(--gold-2));
  animation: sheen 3.2s ease-in-out infinite; }
@keyframes sheen { from { background-position: 150% 0, 0 0; } to { background-position: -100% 0, 0 0; } }
.muted { color: var(--sub); font-size: 13px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
th { color: var(--champagne); font-weight: 500; font-size: 11.5px; letter-spacing: .14em; white-space: nowrap; border-bottom-color: rgb(216 176 98 / 28%); }
td { border-bottom-color: var(--hair); }
tbody tr:hover td { background: rgb(216 176 98 / 4%); }
.table-wrap {
  display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%;
  /* edge shadows that show only while there is more to scroll (background-attachment trick) */
  background:
    linear-gradient(90deg, var(--panel), transparent) left / 24px 100% no-repeat local,
    linear-gradient(270deg, var(--panel), transparent) right / 24px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgb(0 0 0 / 70%), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgb(0 0 0 / 70%), transparent) right / 12px 100% no-repeat scroll;
}
.section > .body { min-width: 0; }
ul.list { list-style: none; padding: 0; margin: 0; }
ul.list li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px; border-radius: 4px; font-size: 11.5px; letter-spacing: .08em; background: transparent; color: var(--sub); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok, .badge.bad, .badge.warn { border-color: var(--hair); }
.badge.ok { color: var(--good); } .badge.bad { color: var(--bad); } .badge.warn { color: var(--warn); }
.badge.ok::before, .badge.bad::before, .badge.warn::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.badge.gold { color: var(--gold-2); border-color: var(--line-strong); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.switch { position: relative; width: 44px; height: 24px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: rgb(0 0 0 / 50%); border: 1px solid var(--line-strong); border-radius: 999px; transition: .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: linear-gradient(160deg, #e9e2d2, #8f887a); border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgb(0 0 0 / 60%); }
.switch input:checked + span { background: linear-gradient(90deg, var(--gold-3), var(--gold)); border-color: var(--gold); box-shadow: 0 0 14px -2px rgb(216 176 98 / 65%); }
.switch input:checked + span::after { transform: translateX(20px); background: linear-gradient(160deg, #fff6dc, #d6b56c); }
.switch input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.form { display: grid; gap: 12px 16px; margin-top: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); align-items: start; }
.form > :not(label) { grid-column: 1 / -1; }
form.form { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgb(0 0 0 / 28%); }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; margin: 0; background: rgb(216 176 98 / 3%); min-width: 0; }
fieldset fieldset { background: rgb(0 0 0 / 22%); }
legend { color: var(--gold); padding: 0 6px; font-size: 13px; }
.form label { display: grid; gap: 5px; font-size: 13px; color: var(--sub); }
.form h3, .body h3 { font-family: var(--mincho); font-weight: 600; color: var(--champagne); margin: 6px 0 2px; letter-spacing: .14em; }
details > summary { cursor: pointer; padding: 6px 0; color: var(--sub); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 11px 18px; border-radius: 12px; font-size: 14px; z-index: 10; max-width: calc(100% - 32px);
  background: linear-gradient(180deg, var(--panel-3), var(--panel-2)); color: var(--text); border: 1px solid var(--gold); box-shadow: 0 10px 40px rgb(0 0 0 / 70%), 0 0 24px -6px rgb(216 176 98 / 50%);
}
.empty { text-align: center; padding: 56px 0; color: var(--sub); display: grid; gap: 14px; justify-items: center; }
.login { padding: 72px 16px; }
.login .brand-logo { width: 120px; height: 120px; }
.offline { background: var(--warn); color: #000; text-align: center; font-size: 13px; padding: 4px; border-radius: 8px; margin-bottom: 8px; }
pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; background: rgb(0 0 0 / 40%); border: 1px solid var(--line); padding: 8px; border-radius: 8px; max-height: 240px; overflow: auto; }

/* ---- narrow screens --------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .sections { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  /* スマホ版（第1部）: the side bar slides in from the left as a drawer (the same items, groups, order and gold band) */
  .side {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; width: 248px; max-width: 85vw; height: 100vh; height: 100dvh;
    background: linear-gradient(180deg, rgb(14 12 8 / 97%), rgb(7 6 4 / 98%));
    transform: translateX(-100%); transition: transform .24s ease; box-shadow: none;
  }
  body.drawer-open .side { transform: none; box-shadow: 24px 0 60px -20px rgb(0 0 0 / 90%); }
  .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgb(0 0 0 / 55%); opacity: 0; pointer-events: none; transition: opacity .24s ease; }
  body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
  body.drawer-open { overflow: hidden; }
  .burger { display: grid; flex: none; }
  /* スマホ版（第2部）: the bottom tab bar — under the drawer and its backdrop; the same gold band as the side bar */
  .tabbar:not([hidden]) {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgb(14 12 8 / 97%), rgb(7 6 4 / 98%)); border-top: 1px solid var(--line);
  }
  .tabbar-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 50px; padding: 5px 2px;
    border: 0; border-radius: 8px; background: transparent; box-shadow: none; color: var(--sub); font-size: 10.5px; letter-spacing: .02em; transition: color .2s, background .2s;
  }
  .tabbar-item:hover { border: 0; box-shadow: none; color: var(--text); }
  .tabbar-item .ic { width: 20px; height: 20px; color: var(--gold); }
  .tabbar-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar-item.active, .tabbar-item.active:hover { color: var(--gold-2); font-weight: 700; background: rgb(243 210 122 / 8%); box-shadow: inset 0 2px 0 var(--gold-2); }
  .tabbar-item.active .ic { color: var(--gold-2); }
  body.has-tabbar .content { padding-bottom: calc(20px + 62px + env(safe-area-inset-bottom, 0px)); }
  body.has-tabbar .toast { bottom: calc(16px + 62px + env(safe-area-inset-bottom, 0px)); }
  .content { padding: 0 16px 20px; }
  /* スマホ版（第4部）: one header row — ハンバーガー／ブランド（小）／検索・ベル／アバター */
  .content > header.top { flex-wrap: nowrap; gap: 8px; padding: 10px 0 8px; }
  .mobile-brand { display: flex; flex: 1; min-width: 0; gap: 8px; }
  .mobile-brand .brand-name.sm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-right { gap: 6px; flex-wrap: nowrap; }
  .top-tools { gap: 6px; }
  .who { display: none; }
  .user-chip { padding: 4px; }
  .pill { padding: 5px 9px; }
  /* the page title: out of the header, a small heading at the head of the content (shell.ts moves it) */
  .hello.page-head { flex: none; margin: 2px 0 14px; }
  .hello.page-head h1 { font-size: 19px; }
  .hello.page-head .headline { font-size: 12.5px; letter-spacing: .08em; }
  /* the server switch: at the head of the drawer (shell.ts moves it; one server or none: hidden as before) */
  .guild-pill.in-drawer:not([hidden]) { display: flex; margin: -6px 0 0; }
  .guild-pill.in-drawer select { flex: 1; min-width: 0; max-width: none; }
  /* search: an icon; it opens across the whole header row */
  .search-toggle { display: grid; }
  .search { display: none; }
  header.top.search-open .search { display: flex; position: absolute; inset: 8px 0; z-index: 5; gap: 6px; }
  header.top.search-open .search-input { flex: 1; width: auto; min-width: 0; }
  header.top.search-open .search-close { display: grid; flex: none; }
  header.top.search-open .search-pop { left: 0; right: 0; min-width: 0; max-width: none; }
  header.top.search-open > :not(.top-right), header.top.search-open .top-tools > :not(.search), header.top.search-open .top-right > :not(.top-tools) { visibility: hidden; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; min-height: 0; }
  .tile > :not(.icon-badge) { grid-column: 1; }
  .tile .icon-badge { display: none; }
  .tile .value { font-size: 22px; }
  /* the conclusion strips (miniStats: 通貨・ランク・…): two columns, never three squeezed ones; an odd last one takes the row */
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mini-stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .mini-stat > div { min-width: 0; overflow-wrap: anywhere; }
  .mini-stat strong { font-size: 16px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .cols3 { grid-template-columns: minmax(0, 1fr); }
  .col-side .side-stack { grid-template-columns: minmax(0, 1fr); }
  .field { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .field-label { padding-top: 0; }
  .toggle-row { grid-template-columns: minmax(0, 1fr) auto; }
  .toggle-row small { grid-column: 1 / -1; }
  .desc-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .module-bar { flex-wrap: wrap; }
  .tab { padding: 9px 14px; }
  th, td { padding: 7px 6px; font-size: 13px; }
  th { letter-spacing: .06em; }
  /* スマホ版（第3部）: a list of records as cards — the main column first, then "見出し: 値" in the columns' order.
     Matrices and settings grids are not marked and keep the side scroll above. */
  .table-wrap.cards { overflow: visible; background: none; }
  .table-wrap.cards table, .table-wrap.cards tbody { display: block; }
  .table-wrap.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .table-wrap.cards tr {
    position: relative; display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgb(0 0 0 / 28%);
  }
  .table-wrap.cards tr:last-child { margin-bottom: 0; }
  .table-wrap.cards td { display: grid; grid-template-columns: minmax(5.5em, 34%) minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 3px 0; border: 0; background: none !important; overflow-wrap: anywhere; }
  .table-wrap.cards td::before { content: attr(data-label); color: var(--champagne); font-size: 11.5px; letter-spacing: .06em; }
  /* a column without a header (buttons, a bar) spans the card */
  .table-wrap.cards td:not([data-label]) { display: block; padding-top: 6px; }
  .table-wrap.cards td:not([data-label])::before { content: none; }
  .table-wrap.cards td.card-head { order: -1; display: block; padding: 0 0 6px; margin-bottom: 4px; border-bottom: 1px solid var(--hair); font-size: 15px; font-weight: 600; }
  .table-wrap.cards td.card-head::before { content: none; }
  /* rowLink: the whole card opens the detail (other buttons and links in it stay on top) */
  .table-wrap.cards.row-link td.card-head a:first-of-type::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
  .table-wrap.cards.row-link tr:has(a:first-of-type:active) { border-color: var(--gold); }
  .table-wrap.cards.row-link td:not(.card-head) :is(a, button, select, input) { position: relative; z-index: 1; }
}
/* スマホ版（第4部）: taps of at least 44px on narrow or touch screens (the drawer, the tab bar, the header, in-page tabs) */
@media (max-width: 900px), (pointer: coarse) {
  .nav-item, .tabbar-item, .tab { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .content > header.top .pill { min-height: 44px; }
}
@media (max-width: 420px) {
  .who { display: none; }
  .user-chip { padding: 4px; }
}
.role-multi { min-width: 220px; }
.preset-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.preset-cards .card { text-align: left; }
.steps { list-style: none; padding: 0; margin: 8px 0; }
.preset-cards .card.selected { border-color: var(--line-strong); box-shadow: var(--gold-glow); }
.stat .cur-emoji { font-size: .8em; margin-right: .2em; }

/* R4: the 仕事 area for a department's staff — the page is shown, changes are for the lead (the API refuses them too) */
.notice { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin: 0 0 14px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--gold-2); background: rgba(212, 175, 55, .06); font-size: 13px; }
.readonly :is(input, select, textarea, .switch) { pointer-events: none; opacity: .6; }
/* only choosing what to look at stays: tabs and list items; save / add / delete / reset are not shown */
.readonly button:not(.tab):not(.item-card):not(.unit-tab) { display: none; }
.notice.warn-notice { color: var(--warn); border-color: var(--warn); background: rgba(230, 160, 60, .07); }
/* スマホ版 第5部: a load that failed (not an empty page): what, why, and 再読み込み */
.load-fail { flex-wrap: wrap; justify-content: space-between; }
.load-fail small { margin-left: 4px; }
.load-fail button { flex: none; }

/* R7: マイホーム and the 未対応 inbox */
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 0 0 18px; }
.home-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: rgba(255, 255, 255, .02); display: grid; gap: 6px; align-content: start; }
.home-card-title { display: flex; align-items: center; gap: 6px; color: var(--gold-2); font-size: 12.5px; letter-spacing: .12em; }
.home-line { font-size: 15px; }
.home-line strong { color: var(--gold-2); font-size: 17px; }
.home-card.locked { border-color: var(--warn); }
.home-card.locked .home-card-title { color: var(--warn); }
.home-restriction { font-size: 13px; color: var(--sub); display: grid; gap: 2px; }
.home-more { font-size: 12.5px; color: var(--gold-2); justify-self: start; }
.entrances { display: flex; flex-wrap: wrap; gap: 10px; }
.entrance { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border: 1px solid var(--line); border-radius: 999px; color: inherit; text-decoration: none; }
.entrance:hover { border-color: var(--line-strong); }
.inbox { display: grid; }
.inbox-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.inbox-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inbox-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* R7 後半: ヘルプ (目的語) */
.help { display: grid; gap: 12px; }
.help-input { width: 100%; }
.help-list { display: grid; gap: 8px; }
.help-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: rgba(255, 255, 255, .02); }
.help-item summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; cursor: pointer; }
.help-item summary strong { min-width: 12em; }
.help-go { display: inline-flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.help-item p { margin: 8px 0 0; }

/* Phase 6: パネルの公開の状態 */
.panel-issues { display: grid; gap: 4px; font-size: .92em; }

/* ダッシュボード第2段: メンバー一覧・詳細（既存の色・質感のまま） */
.member-search { width: min(420px, 100%); }
.member-link { color: var(--champagne); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.member-link:hover { color: var(--gold-2); text-decoration: underline; }
.avatar-sm { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); }
.member-head { display: flex; gap: 18px; align-items: center; }
.member-head h2 { margin: 0 0 4px; display: flex; gap: 10px; align-items: center; }
.avatar-lg { width: 72px; height: 72px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.member-sections { display: grid; gap: 14px; }
.member-ops { align-items: flex-start; }
.op-form { margin-top: 10px; display: grid; gap: 8px; max-width: 520px; }
.op-form .notice ul { margin: 6px 0; }
/* 2026-11-15: 評価の「判定と操作」— one row per evaluation, its 判定 form under it */
.judge-list { display: grid; gap: 0; }
.judge-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.judge-item:last-child { border-bottom: 0; }
.judge-item .row { align-items: center; flex-wrap: wrap; }

/* ダッシュボード第3段: くくりのページ（通貨・ランク） */
.section-title { margin: 22px 0 6px; font-size: 1.05em; letter-spacing: .08em; color: var(--champagne); }
.card-preview { display: grid; gap: 8px; justify-items: start; }
.rank-card-img { max-width: min(100%, 720px); border-radius: var(--radius-sm); border: 1px solid var(--line); }

/* ダッシュボード第4段: マイホームの担当の要約・制限カードの導線 */
/* one row = 部門・件数 / 説明 / 開く, always in these three places (wide: one line; narrow: three lines) */
.task-summary { display: grid; }
.task-row { display: grid; grid-template-columns: minmax(9em, auto) minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.task-row:first-child { padding-top: 0; } .task-row:last-child { border-bottom: 0; padding-bottom: 0; }
.task-head { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.task-oldest { min-width: 0; }
@media (max-width: 900px) {
  .task-row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 0; }
  a.button.task-open { justify-self: stretch; justify-content: center; padding: 8px 10px; }
}
/* an empty screen: the next step, in readable text */
.next-step { margin: 0; color: var(--sub); font-size: 14px; }
.way-out { margin: 14px 2px 0; }
/* ---- frames inside frames: the inner one has no line of its own; space and a faint surface separate it ---- */
.panel .panel, .section .panel, .panel .card, .section .card, .panel .tile, .tab-body .panel .panel {
  border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; background: rgb(255 255 255 / 2.5%);
}
.panel .panel::before, .section .panel::before, .panel .card::before, .section .card::before, .panel .tile::before, .panel .tile::after { display: none; }
.panel .panel > .panel-head { border-bottom: 0; padding-bottom: 4px; }
/* a form inside a pane is already framed by the pane; the stat tile keeps its corner marks without the second line */
.panel form.form, .section form.form { padding: 0; border: 0; background: none; }
.tile::after, .section.wide::after { border-color: transparent; }
.inbox-item { border: 0; border-bottom: 1px solid var(--hair); border-radius: 0; padding: 12px 0; }
.inbox-item:first-child { padding-top: 0; } .inbox-item:last-child { border-bottom: 0; padding-bottom: 0; }
.home-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* コマンド整理 PR-C: the member's ショップ — item cards (picture, name, price, what it does, buying) */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.shop-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.shop-card.is-blocked { opacity: .78; }
.shop-img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: rgb(0 0 0 / 35%); border-bottom: 1px solid var(--hair); }
.shop-img.placeholder { display: grid; place-items: center; }
.shop-img.placeholder .ic { width: 40px; height: 40px; color: var(--gold); opacity: .7; }
.shop-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.shop-body h3 { margin: 0; font-size: 16px; color: var(--text); }
.shop-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.shop-price strong { font-size: 18px; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.shop-was { color: var(--faint); text-decoration: line-through; font-size: 13px; }
.shop-effect { display: flex; gap: 6px; align-items: flex-start; font-size: 13.5px; color: var(--champagne); }
.shop-effect .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--gold); }
.shop-desc { margin: 0; font-size: 13px; }
.shop-action { margin-top: auto; display: grid; gap: 6px; padding-top: 6px; }
.shop-action button { width: 100%; }
.shop-confirm { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: rgb(0 0 0 / 30%); }
.shop-confirm p { margin: 0; font-size: 13.5px; }
.shop-confirm .row { display: grid; gap: 6px; }
.shop-confirm .row button { width: 100%; }
/* 一時VC: 追加の権限上書き (ホテルパネル パック §2) */
.ow-list { display: grid; gap: 10px; width: 100%; }
.ow-row { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--hair); border-radius: 10px; background: rgb(0 0 0 / 18%); }
.ow-perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 6px 14px; }
.ow-perm { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--sub); }
/* 一時VC: ホテルパネルの編集（プランの選択と並び） */
.hp-plans { display: grid; gap: 6px; }
.hp-plan { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--hair); border-radius: 8px; }
.hp-plan.off { opacity: .55; }
.item-text .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hp-plan > span, .item-text { min-width: 0; }
