/* Sapienta Tower: the tower is one full-screen canvas; over it sit the HUD (pause, coins, reputation, stars, crews),
   a hint strip and a mode banner, the card at the bottom for a room or an empty spot, and the bar of sheets. The
   title screen and the sheets are shared/mainmenu.js (menu.css, loaded after this); only their colors are set
   here (--sg-*). */
:root {
  --bg: #0d1030; --bg-hi: #2b2f6b; --ink: #fff7ec; --ink-soft: #c9bfd9; --line: rgba(255, 220, 170, 0.18);
  --accent: #ffcf7a; --accent-ink: #2a1a08; --panel: #1a1838; --panel-edge: #3c3670; --gold: #f4c542;
  --good: #6ff0a0; --bad: #ff6b8a; --sheet: #1a1838; --sheet-ink: #fff7ec; --sheet-soft: #c9bfd9;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
* { touch-action: manipulation; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { font-family: "Baloo 2", ui-rounded, system-ui, sans-serif; color: var(--ink); overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.app { position: fixed; inset: 0; overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#tower { position: absolute; inset: 0; display: block; touch-action: none; }

/* ---- the HUD ---- */
.hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5;
  padding: var(--sg-corner-top) 8px 6px; /* the corner's menu button heads the first row (shared/menu.css) */
  display: grid; gap: 6px;
  background: linear-gradient(rgba(13, 16, 48, 0.92), rgba(13, 16, 48, 0.6) 75%, rgba(13, 16, 48, 0));
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hud-row > .sg-corner-slot { margin-left: calc(var(--sg-corner-left) - 8px); }
.pill.lvl { gap: 3px; padding: 0 8px 0 7px; position: relative; color: var(--ink); min-width: 44px; justify-content: center; }
/* the pills are 34px to look; the level pill and the Tower | Mall buttons take a 44px tap (PRINCIPLES 3) */
.pill.lvl::after, .seg button::after { content: ''; position: absolute; inset: -6px 0; }
.pill.lvl .lv-tag { font-size: 11px; font-weight: 800; color: var(--accent); }
.pill.lvl .lv-bar { position: absolute; left: 6px; right: 6px; bottom: 3px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.15); }
.pill.lvl .lv-bar b { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--accent); padding: 0; }
.crews { display: flex; gap: 5px; min-width: 0; }
.crew { flex: 1 1 0; min-width: 0; max-width: 130px; min-height: 44px; display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; column-gap: 5px; padding: 3px 7px 3px 5px; border-radius: 12px; border: 1px solid var(--panel-edge); background: rgba(26, 24, 56, 0.92); color: var(--ink); text-align: left; font: inherit; position: relative; overflow: hidden; }
.crew svg { grid-row: 1 / 3; width: 26px; height: 26px; }
.crew b { font-size: 12px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crew small { font-size: 11px; line-height: 1.1; color: var(--ink-soft); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crew i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); }
.crew.free { border-color: var(--accent); }
.crew.free small { color: var(--accent); }
.crew.busy svg { opacity: 0.85; }
/* four or five chips: no hat, all the width for the words */
.crews.many .crew { grid-template-columns: minmax(0, 1fr); padding: 3px 6px; }
.crews.many .crew svg { display: none; }
.seg { flex: none; display: flex; height: 44px; padding: 3px; border-radius: 14px; background: rgba(26, 24, 56, 0.92); border: 1px solid var(--panel-edge); }
.seg button { position: relative; border: 0; min-width: 56px; padding: 0 10px; border-radius: 11px; background: transparent; font-weight: 800; font-size: 14px; color: var(--ink-soft); }
.seg button.on { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2); }
.goal {
  flex: 1 1 0; min-width: 0; height: 44px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center;
  text-align: left; padding: 3px 10px; border-radius: 14px; border: 1px solid var(--panel-edge); background: rgba(26, 24, 56, 0.92);
}
/* GOAL over its reward on the left, the goal itself in up to two lines on the right ("Open a newsstand in the mall"
   no longer ends in "...") */
.goal .goal-k { grid-row: 1; grid-column: 1; align-self: end; font-size: 11px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; line-height: 1.1; }
.goal b { grid-row: 1 / 3; grid-column: 2; font-size: 12.5px; line-height: 1.12; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.goal small { grid-row: 2; grid-column: 1; align-self: start; font-size: 12px; line-height: 1.1; color: var(--gold); font-weight: 800; }
.goal.flash { animation: goalflash 0.9s ease-out; }
@keyframes goalflash { 0% { background: #4fd88a; } 100% { background: rgba(26, 24, 56, 0.92); } }
.icon-btn.zoom .minus { display: none; }
.icon-btn.zoom.in .plus { display: none; }
.icon-btn.zoom.in .minus { display: inline; }
.icon-btn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 1px solid var(--panel-edge);
  border-radius: 14px; background: rgba(26, 24, 56, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}
.icon-btn svg { width: 22px; height: 22px; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; fill: none; }
.icon-btn:active { transform: scale(0.94); }
.pill {
  flex: 1 1 0; min-width: 0; height: 34px; display: flex; align-items: center; gap: 4px; padding: 0 8px 0 5px;
  border-radius: 17px; background: rgba(26, 24, 56, 0.88); border: 1px solid var(--panel-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}
.pill.small { flex: 0 0 auto; }
.pill svg { width: 20px; height: 20px; flex: none; }
.pill b { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1; padding-top: 2px; }

.hint, .banner {
  position: absolute; left: 8px; right: 8px; top: calc(env(safe-area-inset-top, 0px) + 106px); z-index: 6;
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 14px;
  background: rgba(26, 24, 56, 0.94); border: 1px solid var(--panel-edge); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  font-weight: 700; font-size: 14px; line-height: 1.25; animation: rise 0.25s ease-out;
}
.banner { border-color: var(--accent); }
.hint { top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 78px); }
.hint span, .banner span { flex: 1; min-width: 0; }
.hint button, .banner button {
  flex: none; min-width: 64px; height: 44px; border-radius: 12px; border: 0; font-weight: 800;
  background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}
.hint button { background: rgba(255, 255, 255, 0.12); color: var(--ink); }

/* ---- the bar ---- */
.bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex;
  padding: 6px 4px calc(env(safe-area-inset-bottom, 0px) + 6px); gap: 4px;
  background: linear-gradient(rgba(13, 16, 48, 0), rgba(13, 16, 48, 0.85) 25%, rgba(13, 16, 48, 0.97));
}
.bar button {
  position: relative; flex: 1 1 0; min-width: 0; height: 56px; border-radius: 14px; border: 1px solid var(--panel-edge);
  background: rgba(26, 24, 56, 0.92); display: grid; place-items: center; align-content: center; gap: 1px; padding: 4px 2px 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -3px 0 rgba(0, 0, 0, 0.3);
}
.bar button:active { transform: scale(0.95); }
.bar svg { width: 24px; height: 24px; stroke: var(--accent); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.bar span { font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap; }
.bar .badge {
  position: absolute; top: 3px; right: 8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--bad); color: #fff; font: 800 12px/20px "Baloo 2", sans-serif; font-style: normal; animation: pop 0.3s;
}
.bar .dot { position: absolute; top: 6px; right: 12px; width: 10px; height: 10px; border-radius: 5px; background: var(--good); }
.bar .badge.tok { background: var(--accent); color: var(--accent-ink); }

/* ---- the card at the bottom ---- */
.panel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; max-height: min(46vh, 440px); overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 12px); border-radius: 20px 20px 0 0;
  background: var(--panel); border-top: 1px solid var(--panel-edge); box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
  animation: rise 0.2s ease-out;
}
.tw-phead { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.tw-phead > div { flex: 1; min-width: 0; }
.tw-phead h2 { margin: 0; font-size: 20px; line-height: 1.15; }
.tw-phead .sub { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.25; }
.tw-x { width: 44px; height: 44px; flex: none; border-radius: 12px; border: 0; background: rgba(255, 255, 255, 0.08); display: grid; place-items: center; }
.tw-x svg { width: 18px; height: 18px; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; }

.tw-row { display: flex; gap: 8px; margin: 8px 0; }
.tw-row.three .tw-btn { padding: 6px 4px; }
.tw-btn {
  flex: 1 1 0; min-width: 0; min-height: 50px; border-radius: 14px; border: 1px solid var(--panel-edge);
  background: rgba(255, 255, 255, 0.07); display: grid; place-items: center; align-content: center; padding: 6px 8px; text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -3px 0 rgba(0, 0, 0, 0.25);
}
.tw-btn b { font-size: 15px; line-height: 1.1; font-weight: 800; }
.tw-btn small { font-size: 12px; line-height: 1.2; color: var(--ink-soft); }
.tw-btn.go { background: linear-gradient(#ffd98f, #f4b955); color: var(--accent-ink); border-color: #c58a2a; }
.tw-btn.go small { color: rgba(42, 26, 8, 0.75); }
.tw-btn.danger { background: #c94b5b; border-color: #8a2a3a; width: 100%; margin-top: 8px; }
.tw-btn.small { flex: 0 0 auto; min-width: 78px; min-height: 48px; }
.tw-btn.off { opacity: 0.45; }
.tw-btn:active { transform: scale(0.96); }
.tw-note { margin: 6px 0; font-size: 14px; line-height: 1.3; color: var(--ink-soft); }
.tw-note.good { color: var(--good); }
.tw-note.bad { color: var(--bad); }
.tw-why { margin: -2px 0 6px; font-size: 13px; color: var(--bad); text-align: center; }
.tw-progress, .tw-meter { margin: 8px 0; display: grid; gap: 4px; font-size: 14px; font-weight: 700; }
.tw-progress i, .tw-meter i { display: block; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.tw-progress b, .tw-meter b { display: block; height: 100%; background: linear-gradient(90deg, #4fd88a, #9ff0c0); border-radius: 5px; transition: width 0.4s; }
.tw-meter i.over b { background: linear-gradient(90deg, #ff6b8a, #ffb0c0); }

.tw-res { display: grid; gap: 4px; }
.tw-who { display: flex; gap: 10px; align-items: center; }
.tw-who b { display: block; font-size: 17px; line-height: 1.15; }
.tw-who small { display: block; font-size: 13px; color: var(--ink-soft); line-height: 1.25; }
.tw-faces { display: flex; align-items: flex-end; gap: 0; flex: none; padding: 4px 6px 2px; border-radius: 12px; background: rgba(255, 255, 255, 0.07); }
.tw-faces canvas { display: block; }
.tw-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip { font-size: 12px; font-weight: 700; line-height: 1; padding: 5px 8px 4px; border-radius: 10px; background: rgba(255, 255, 255, 0.1); }
.chip.sens { background: rgba(127, 216, 255, 0.2); color: #bfeaff; }
.chip.loud { background: rgba(255, 107, 138, 0.22); color: #ffc2cf; }
.chip.cat { background: rgba(244, 197, 66, 0.25); color: #ffe7a0; }
.tw-mood { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.tw-mood b { font-size: 30px; line-height: 1; font-weight: 800; }
.tw-mood.good b { color: var(--good); }
.tw-mood.ok b { color: #ffd166; }
.tw-mood.bad b { color: var(--bad); }
.tw-mood span { font-size: 14px; color: var(--ink-soft); }
.tw-parts { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 2px; }
.tw-parts li { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
.tw-parts li.neg b { color: var(--bad); }
.tw-parts li.pos b { color: var(--good); }

.tw-build { display: grid; gap: 6px; }
.tw-brow {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; min-height: 56px; border-radius: 14px; text-align: left;
  border: 1px solid var(--panel-edge); background: rgba(255, 255, 255, 0.06);
}
.tw-brow .pic { flex: none; width: 72px; display: grid; place-items: center; }
.tw-brow .pic canvas { border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.4); }
.tw-brow .txt { flex: 1; min-width: 0; display: grid; }
.tw-brow .txt b { font-size: 15px; line-height: 1.15; }
.tw-brow .sz { margin-left: 6px; font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 8px; vertical-align: 1px; background: rgba(255, 255, 255, 0.12); color: var(--ink-soft); }
.tw-brow .sz.s2 { background: rgba(127, 216, 255, 0.2); color: #bfeaff; }
.tw-brow .sz.s3 { background: rgba(244, 197, 66, 0.25); color: #ffe7a0; }
.tw-brow .sz.s4 { background: rgba(255, 143, 184, 0.25); color: #ffd0e0; }
.tw-brow .txt small { font-size: 12px; line-height: 1.25; color: var(--ink-soft); }
.tw-brow .txt em { font-style: normal; font-size: 12px; color: var(--bad); }
.tw-brow .cost { flex: none; text-align: right; display: grid; }
.tw-brow .cost b { font-size: 15px; color: var(--gold); }
.tw-brow .cost small { font-size: 12px; color: var(--ink-soft); }
.tw-brow.off { opacity: 0.6; }
.tw-brow.locked { opacity: 0.4; }
.tw-brow:active { transform: scale(0.98); }

/* ---- sheets ---- */
.tw-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tw-tabs button { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 2px; border-radius: 12px; border: 1px solid var(--panel-edge); background: rgba(255, 255, 255, 0.06); font-weight: 800; font-size: 14px; }
@media (max-width: 370px) { .tw-tabs button { font-size: 13px; } } /* Stars' five tabs on one row at 360 */
.tw-tabs button.on { background: var(--accent); color: var(--accent-ink); border-color: #c58a2a; }
.tw-guests { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.tw-guest { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); text-align: center; }
.tw-guest.no { opacity: 0.45; }
.tw-guest.no img { filter: grayscale(1) brightness(0.6); }
.tw-guest b { font-size: 13px; line-height: 1.15; }
.tw-guest small { font-size: 12px; color: var(--sg-ink-soft, var(--ink-soft)); }
.tw-face { display: block; border-radius: 50%; background: rgba(255, 255, 255, 0.08); }
.tw-looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
.tw-look { min-height: 50px; border-radius: 12px; border: 1px solid var(--panel-edge); background: rgba(255, 255, 255, 0.06); display: grid; place-items: center; padding: 4px; }
.tw-look b { font-size: 13px; line-height: 1.1; }
.tw-look small { font-size: 12px; color: var(--sg-ink-soft, var(--ink-soft)); }
.tw-look.on { border-color: var(--accent); background: rgba(255, 207, 122, 0.18); }
.tw-look.locked { opacity: 0.45; }
.tw-opens { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; }
.tw-opens li { padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.07); font-weight: 700; }
.tw-star .big.lv { font-size: 34px; letter-spacing: 0; }

/* ---- the arcade's games (arcade.js) ---- */
.tw-game { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-rows: auto 1fr auto; background: #0d1030; -webkit-user-select: none; user-select: none; touch-action: none; }
.tw-game canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.tw-game-top { display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 8px 14px; background: #1a1838; }
.tw-game-top b { font-size: 18px; }
.tw-game-stat { flex: 1; text-align: right; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.tw-game-x { width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, 0.1); font-size: 18px; }
.tw-game-tip { margin: 0; padding: 10px 14px calc(env(safe-area-inset-bottom, 0px) + 12px); text-align: center; font-weight: 700; background: #1a1838; }
.tw-list { display: grid; gap: 8px; }
.tw-list h3 { margin: 10px 0 0; font-size: 16px; }
.tw-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); }
.tw-item .txt { flex: 1; min-width: 0; display: grid; }
.tw-item .txt b { font-size: 15px; line-height: 1.2; }
.tw-item .txt small { font-size: 13px; line-height: 1.25; color: var(--sg-ink-soft, var(--ink-soft)); }
.tw-item .txt small.next { color: var(--good); }
.tw-item .face { flex: none; }
.tw-item .tick { flex: none; width: 48px; text-align: center; font-size: 22px; color: var(--good); }
.tw-item.done { opacity: 0.6; }
.tw-item.locked { opacity: 0.55; }
.tw-apps { display: grid; gap: 10px; }
.tw-app { padding: 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); }
.tw-starrow { text-align: center; font-size: 34px; letter-spacing: 4px; }
.tw-starrow i { font-style: normal; color: rgba(255, 255, 255, 0.18); }
.tw-starrow i.on { color: var(--gold); text-shadow: 0 0 12px rgba(244, 197, 66, 0.7); }
.tw-star { text-align: center; }
.tw-star .big { font-size: 44px; color: var(--gold); letter-spacing: 4px; animation: pop 0.5s; text-shadow: 0 0 16px rgba(244, 197, 66, 0.7); }
.tw-ach { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tw-ach li { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); }
.tw-ach li.no { opacity: 0.45; }
.tw-ach .medal { flex: none; width: 30px; height: 30px; border-radius: 15px; display: grid; place-items: center; background: var(--gold); color: #5a3a08; font-weight: 800; }
.tw-ach li.no .medal { background: rgba(255, 255, 255, 0.15); color: rgba(255, 255, 255, 0.5); }
.tw-ach b { display: block; font-size: 15px; line-height: 1.2; }
.tw-ach span { font-size: 13px; color: var(--sg-ink-soft, var(--ink-soft)); }
.tw-how p { margin: 0 0 10px; line-height: 1.35; }
.tw-away p { margin: 0 0 8px; font-size: 16px; }

.toast {
  position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 162px); z-index: 9; transform: translate(-50%, -10px);
  margin: 0; max-width: calc(100% - 32px); width: max-content; padding: 8px 14px; border-radius: 14px; text-align: center;
  background: rgba(26, 24, 56, 0.96); border: 1px solid var(--accent); font-weight: 700; font-size: 14px; line-height: 1.25;
  opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---- the title screen's colors (the layout is shared/mainmenu.js) ---- */
#mm {
  --sg-bg: radial-gradient(ellipse 110% 60% at 50% 20%, var(--bg-hi), transparent 75%), radial-gradient(ellipse 90% 50% at 70% 95%, rgba(255, 150, 90, 0.22), transparent 70%), var(--bg);
  --sg-ink: var(--ink); --sg-ink-soft: var(--ink-soft);
  --sg-title: #ffe7b8; --sg-title-shadow: 0 0 18px rgba(255, 95, 162, 0.6), 0 2px 0 #7a2a5a;
  --sg-accent: var(--accent); --sg-accent-ink: var(--accent-ink);
  --sg-card: #221f48; --sg-card-ink: var(--ink); --sg-line: rgba(255, 220, 170, 0.2);
}
#mm .tw-title-art { width: 165px; height: 150px; }
.sg-bare #mm .tw-title-art, #mm .sg-bare .tw-title-art { width: 235px; height: 214px; }
#mm .tw-title-art svg { display: block; width: 100%; height: 100%; }
.sg-sheet { --sg-sheet-bg: var(--sheet); --sg-sheet-ink: var(--sheet-ink); --sg-accent: var(--accent); --sg-accent-ink: var(--accent-ink); --sg-ink-soft: var(--sheet-soft); }

@keyframes pop { 0% { transform: scale(0.6); opacity: 0.4; } 55% { transform: scale(1.18); opacity: 1; } 100% { transform: scale(1); } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .hint, .banner, .panel, .bar .badge, .tw-star .big { animation: none; }
  .toast { transition: opacity 0.2s; }
}
@media (max-width: 370px) {
  .seg button { min-width: 48px; padding: 0 7px; font-size: 13px; }
  .goal { padding: 3px 7px; }
  .pill { padding: 0 6px 0 4px; }
  .pill b { font-size: 14px; }
  .bar span { font-size: 11px; }
}
/* the welcome-back card: how time away paid (full, half, nothing) */
.tw-awayhow { margin: 4px 0 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); display: grid; gap: 6px; }
.tw-awaybar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; }
.tw-awaybar i { display: block; flex: 1 1 0; min-width: 4px; }
.tw-awaybar .full, .tw-awayrow.full .dot { background: var(--good); }
.tw-awaybar .half, .tw-awayrow.half .dot { background: var(--gold); }
.tw-awaybar .none, .tw-awayrow.none .dot { background: rgba(255, 255, 255, 0.22); }
.tw-awayrow { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; font-size: 15px; }
.tw-awayrow .dot { width: 10px; height: 10px; border-radius: 5px; }
.tw-awayrow b { font-variant-numeric: tabular-nums; }
.tw-awayrow.none { color: var(--sg-ink-soft, var(--ink-soft)); }
