/* 地球bonk — 樣式。主題以 CSS 變數切換，只換外觀 */
:root, [data-theme="leaf"] {
  --bg: #FBF6E4; --panel: #FFFDF4; --panel2: #FBF6E4; --line: #EADFC2; --ink: #3E3A2F; --muted: #5C5646;
  --accent: #5A7530; --accent-ink: #FFFDF4; --accent2: #F2C94C; --accent2-ink: #3E3A2F;
  --soft-g: #E3EBCF; --ink-g: #3B5220; --soft-y: #FBEBB5; --ink-y: #6B4E00;
  --soft-w: #EEDFC8; --ink-w: #6B4E2A; --soft-b: #DCE6F0; --ink-b: #2E4F6E;
  --danger-bg: #F4D6CC; --danger: #8A3B22; --badge: #B8452B; --badge-ink: #FFFFFF;
  --track: #EFE6CC; --bar-exp: #E8B930; --sel: #FBEBB5; --sel-line: #C9A77C;
  --r: 16px; --r-sm: 10px; --glow: none; --glow2: none;
  --font: 'LXGW WenKai TC', 'PingFang TC', 'Noto Sans TC', serif;
  --font-num: var(--font);
}
[data-theme="tech"] {
  --bg: #07090D; --panel: #0F141C; --panel2: #0B1016; --line: #1F4E52; --ink: #E6F1F5; --muted: #8FA3B0;
  --accent: #2EE6D6; --accent-ink: #07090D; --accent2: #FF4FA3; --accent2-ink: #07090D;
  --soft-g: #12333A; --ink-g: #2EE6D6; --soft-y: #33300F; --ink-y: #F5D547;
  --soft-w: #3A1229; --ink-w: #FF8CC4; --soft-b: #14243A; --ink-b: #7FB8FF;
  --danger-bg: #3A1229; --danger: #FF8CC4; --badge: #FF4FA3; --badge-ink: #07090D;
  --track: #1A2530; --bar-exp: #F5D547; --sel: rgba(46,230,214,.12); --sel-line: #2EE6D6;
  --r: 4px; --r-sm: 3px; --glow: 0 0 14px rgba(46,230,214,.35); --glow2: 0 0 16px rgba(255,79,163,.5);
  --font: 'Noto Sans TC', 'PingFang TC', sans-serif;
  --font-num: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px;
  overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-text-size-adjust: 100%;
}
input, textarea, select { -webkit-user-select: text; user-select: text; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[data-theme="tech"] body::after, [data-theme="tech"] .scan {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px);
}

#app {
  height: 100dvh; display: grid; grid-template-rows: auto 1fr auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}

/* ---------- 頂列 ---------- */
.top { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); min-height: 56px; }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; background: none; border: 0; padding: 0; text-align: left; }
.me .ava { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; border: 2px solid var(--line); flex-shrink: 0; background: var(--panel); }
[data-theme="tech"] .me .ava { border-radius: 6px; border-color: var(--accent); box-shadow: var(--glow); }
.me .ava svg { width: 100%; height: 100%; display: block; }
.me .who { display: flex; flex-direction: column; gap: 3px; width: 150px; }
.me .name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .lv { font-size: 12px; color: var(--muted); margin-left: 6px; font-family: var(--font-num); font-weight: 400; }
.bar { height: 7px; border-radius: 5px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--bar-exp); border-radius: 5px; }
[data-theme="tech"] .bar, [data-theme="tech"] .bar > i { border-radius: 0; }
.spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 5px 11px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); white-space: nowrap; font-family: var(--font-num); }
[data-theme="tech"] .pill { border-radius: 0; color: var(--accent); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--panel); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-theme="tech"] .icon-btn { border-radius: 0; color: var(--accent); }
.icon-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- 底部導覽 ---------- */
.nav { display: flex; align-items: center; gap: 4px; padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); overflow-x: auto; }
.nav button { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 0; background: none; color: var(--muted); border-radius: 14px; white-space: nowrap; font-size: 14px; }
.nav button svg { width: 20px; height: 20px; }
.nav button.on { background: var(--soft-y); color: var(--ink-g); font-weight: 700; }
[data-theme="tech"] .nav button { border-radius: 0; }
[data-theme="tech"] .nav button.on { background: var(--sel); color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- 共用 ---------- */
main { min-height: 0; overflow: hidden; }
.view { height: 100%; display: flex; gap: 14px; padding: 12px 16px; min-height: 0; }
.col { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
[data-theme="tech"] .panel, [data-theme="tech"] .cut { clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); }
.h { font-size: 16px; font-weight: 700; margin: 0; }
.sub { font-size: 12px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 8px; white-space: nowrap; line-height: 1.6; }
[data-theme="tech"] .tag { border-radius: 0; }
.t-g { background: var(--soft-g); color: var(--ink-g); }
.t-y { background: var(--soft-y); color: var(--ink-y); }
.t-w { background: var(--soft-w); color: var(--ink-w); }
.t-b { background: var(--soft-b); color: var(--ink-b); }
.t-d { background: var(--danger-bg); color: var(--danger); }
.t-m { background: var(--track); color: var(--muted); }
.t-a { background: var(--accent); color: var(--accent-ink); }
.btn { min-height: 40px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn.pri { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; box-shadow: var(--glow); }
.btn.hot { background: var(--accent2); color: var(--accent2-ink); border-color: var(--accent2); font-weight: 700; box-shadow: var(--glow2); }
.btn.dash { border-style: dashed; background: transparent; color: var(--muted); }
.btn.danger { color: var(--danger); border-color: var(--danger-bg); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .45; }
[data-theme="tech"] .btn { border-radius: 0; }
.seg { display: grid; gap: 4px; }
.seg button { min-height: 32px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--panel2); font-size: 13px; padding: 0 4px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
[data-theme="tech"] .seg button { border-radius: 0; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; background: none; border: 0; padding: 0; font-size: 13px; width: 100%; text-align: left; }
.switch .trk { width: 40px; height: 23px; border-radius: 12px; background: var(--line); display: flex; align-items: center; padding: 3px; flex-shrink: 0; transition: background .15s; }
.switch .trk i { width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch.on .trk { background: var(--accent); }
.switch.on .trk i { transform: translateX(17px); }
.field { width: 100%; min-height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--panel2); padding: 0 10px; font-size: 16px; outline: none; }
.field:focus { border-color: var(--accent); }
[data-theme="tech"] .field { border-radius: 0; }
.stamp { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
[data-theme="tech"] .stamp { border-radius: 0; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 18px 8px; }

/* ---------- 首頁 ---------- */
.home-left { width: 34%; max-width: 330px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tile { position: relative; border: 1px solid var(--line); border-bottom-width: 4px; border-radius: 14px; background: var(--panel); padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 84px; justify-content: center; }
[data-theme="tech"] .tile { border-radius: 0; border-bottom-width: 1px; }
.tile .nm { font-size: 13px; font-weight: 700; }
.tile .lv { font-size: 10px; color: var(--muted); font-family: var(--font-num); }
.badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--badge); color: var(--badge-ink); font-size: 11px; display: flex; align-items: center; justify-content: center; font-family: var(--font-num); }
[data-theme="tech"] .badge { top: 4px; right: 4px; border-radius: 0; }
.ob-item { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 5px 0; }
.ob-item .ck { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--accent); display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.ob-item.done { color: var(--muted); text-decoration: line-through; }
.ob-item.done .ck { background: var(--accent); color: var(--accent-ink); }
.home-mid { flex: 1; align-items: center; justify-content: center; position: relative; overflow: hidden; gap: 6px; }
.quote { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 8px 14px; font-size: 14px; max-width: 260px; text-align: center; position: relative; }
.quote::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; background: var(--panel); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }
[data-theme="tech"] .quote { border-radius: 0; border-color: var(--accent2); color: #FFC2DF; }
[data-theme="tech"] .quote::after { border-color: var(--accent2); }
.stage { position: relative; display: flex; flex-direction: column; align-items: center; }
.stage .fig { height: min(180px, calc(100dvh - 300px)); aspect-ratio: 4 / 5; position: relative; z-index: 1; }
.stage .fig svg { width: 100%; height: 100%; display: block; border-radius: 22px; }
[data-theme="tech"] .stage .fig svg { border-radius: 0; box-shadow: var(--glow); }
.stage .plat { width: 210px; height: 32px; border-radius: 50%; background: var(--soft-g); margin-top: -14px; border: 2px solid var(--line); }
[data-theme="tech"] .stage .plat { background: transparent; border-color: var(--accent); box-shadow: 0 0 16px rgba(46,230,214,.6); }
.moods { display: flex; gap: 6px; }
.moods button { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--panel); font-size: 22px; line-height: 1; }
.moods button.on { border-color: var(--accent); background: var(--soft-g); transform: scale(1.08); }
[data-theme="tech"] .moods button { border-radius: 0; }
.home-right { width: 310px; flex-shrink: 0; }
.mission { background: var(--accent); color: var(--accent-ink); border-radius: 20px; padding: 12px; display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; }
[data-theme="tech"] .mission { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 0; clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week div { text-align: center; font-size: 10px; display: flex; flex-direction: column; gap: 3px; opacity: .9; }
.week i { display: block; height: 7px; border-radius: 4px; background: rgba(255,253,244,.25); }
.week i.ok { background: var(--accent2); }
.week i.rp { background: repeating-linear-gradient(45deg, var(--accent2) 0 3px, transparent 3px 6px); }
.week i.now { outline: 2px solid var(--accent2); outline-offset: 1px; }
[data-theme="tech"] .week i { background: var(--track); border-radius: 0; }
[data-theme="tech"] .week i.ok { background: var(--accent); box-shadow: 0 0 6px rgba(46,230,214,.6); }
[data-theme="tech"] .week i.now { outline-color: var(--accent2); }
.pick { display: flex; gap: 6px; align-items: stretch; }
.pick .main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 42px; border-radius: 10px; border: 0; background: rgba(255,253,244,.15); color: inherit; padding: 0 8px; text-align: left; font-size: 13px; }
[data-theme="tech"] .pick .main { background: var(--panel2); border: 1px solid var(--line); border-radius: 0; }
.pick .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--accent2); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; color: var(--accent2-ink); }
[data-theme="tech"] .pick .box { border-radius: 0; border-color: var(--accent); color: var(--accent-ink); }
.pick.done .box { background: var(--accent2); }
[data-theme="tech"] .pick.done .box { background: var(--accent); }
.pick.done .txt { text-decoration: line-through; opacity: .8; }
.pick .dom { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--bg); color: var(--ink-g); flex-shrink: 0; }
[data-theme="tech"] .pick .dom { background: transparent; border: 1px solid var(--accent2); color: #FF8CC4; border-radius: 0; }
.pick .txt { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pick .rr { width: 42px; border-radius: 10px; border: 1.5px solid rgba(255,253,244,.5); background: transparent; color: inherit; font-size: 16px; flex-shrink: 0; }
[data-theme="tech"] .pick .rr { border-radius: 0; border-color: var(--accent); color: var(--accent); }
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rcard { border-radius: 10px; border: 1.5px solid var(--accent2); background: var(--panel); color: var(--ink); padding: 8px 6px; text-align: left; display: flex; flex-direction: column; gap: 4px; min-height: 86px; }
.rcard b { font-size: 13px; }
.rcard span { font-size: 11px; color: var(--muted); }
[data-theme="tech"] .rcard { border-radius: 0; box-shadow: var(--glow2); }
.mini { font-size: 12px; }

/* ---------- 管理頁 ---------- */
.m-left { width: 190px; flex-shrink: 0; }
.proj { min-height: 50px; padding: 6px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); display: flex; flex-direction: column; align-items: stretch; gap: 5px; text-align: left; width: 100%; }
.proj.on { background: var(--soft-g); border-color: var(--accent); }
[data-theme="tech"] .proj { border-radius: 0; }
.proj .nm { font-size: 14px; font-weight: 700; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.proj .bar { height: 5px; }
.proj .bar > i { background: var(--accent); }
.m-mid { flex: 1; }
.quick { display: flex; align-items: center; gap: 8px; height: 44px; background: var(--panel2); border: 1.5px solid var(--sel-line); border-radius: 12px; padding: 0 5px 0 12px; }
[data-theme="tech"] .quick { border-radius: 0; }
.quick label { font-size: 13px; color: var(--ink-g); font-weight: 700; flex-shrink: 0; }
.quick input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 16px; }
.task { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px; border-radius: 10px; background: var(--panel2); border: 1.5px solid transparent; }
.task.sel { background: var(--sel); border-color: var(--sel-line); }
.task.lock { opacity: .6; }
[data-theme="tech"] .task { border-radius: 0; }
.task .ck { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--accent); background: var(--panel); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.task.done .ck { background: var(--accent); color: var(--accent-ink); }
[data-theme="tech"] .task .ck { border-radius: 0; }
.task .body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 0; text-align: left; }
.task .ty { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.task .tt { font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task.done .tt { text-decoration: line-through; color: var(--muted); }
.task .idx { font-size: 12px; color: var(--muted); width: 14px; text-align: center; font-family: var(--font-num); }
.m-right { width: 250px; flex-shrink: 0; }

/* ---------- 角色、商店、成長 ---------- */
.av-big { width: 220px; flex-shrink: 0; align-items: center; }
.av-big .fig { height: min(240px, calc(100dvh - 250px)); aspect-ratio: 4 / 5; }
.av-big .fig svg { width: 100%; height: 100%; display: block; border-radius: 20px; }
[data-theme="tech"] .av-big .fig svg { border-radius: 0; box-shadow: var(--glow); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; flex-shrink: 0; }
.tabs button { min-height: 34px; padding: 0 12px; border-radius: 17px; border: 1.5px solid var(--line); background: var(--panel); white-space: nowrap; font-size: 13px; }
.tabs button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
[data-theme="tech"] .tabs button { border-radius: 0; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; align-content: start; }
.opt { position: relative; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.opt.on { border-color: var(--accent); background: var(--soft-g); box-shadow: var(--glow); }
.opt .th { width: 64px; height: 80px; }
.opt .th svg { width: 100%; height: 100%; display: block; border-radius: 6px; }
.opt .sw { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); margin: 18px 0; }
.opt .price { position: absolute; top: 4px; right: 4px; font-size: 10px; padding: 1px 5px; border-radius: 6px; background: var(--accent2); color: var(--accent2-ink); font-family: var(--font-num); }
.opt.locked .th, .opt.locked .sw { opacity: .55; }
[data-theme="tech"] .opt { border-radius: 0; }
.skill-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.skill-row:last-child { border-bottom: 0; }
.node { flex: 1; min-height: 46px; border-radius: 10px; border: 1.5px dashed var(--line); padding: 4px 8px; display: flex; flex-direction: column; justify-content: center; font-size: 12px; color: var(--muted); }
.node.lit { border-style: solid; border-color: var(--accent); background: var(--soft-g); color: var(--ink); box-shadow: var(--glow); }
.node b { font-size: 13px; }
[data-theme="tech"] .node { border-radius: 0; }
.ms { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.ms .bar { flex: 1; }
.ms.got { color: var(--muted); }

/* ---------- 設定 ---------- */
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; align-content: start; }
.theme-card { border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel2); padding: 8px 10px; display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; }
.theme-card.on { border-color: var(--accent); box-shadow: var(--glow); }
.theme-card .sw3 { display: flex; gap: 3px; }
.theme-card .sw3 i { width: 14px; height: 22px; border-radius: 4px; display: block; }
[data-theme="tech"] .theme-card { border-radius: 0; }

/* ---------- 彈窗、提示、鎖定 ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20,18,12,.45); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
[data-theme="tech"] .overlay { background: rgba(0,0,0,.7); }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 16px; width: min(460px, 100%); max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
[data-theme="tech"] .modal { border-radius: 0; border-color: var(--accent); box-shadow: var(--glow); }
.modal h2 { margin: 0; font-size: 18px; }
.toasts { position: fixed; bottom: calc(66px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 60; pointer-events: none; align-items: center; }
.toast { background: var(--ink); color: var(--bg); padding: 6px 14px; border-radius: 18px; font-size: 13px; animation: pop .25s ease-out; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
[data-theme="tech"] .toast { background: var(--accent); color: var(--accent-ink); border-radius: 0; }
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.lockscreen { position: fixed; inset: 0; background: var(--bg); z-index: 70; display: flex; align-items: center; justify-content: center; }
.lockscreen .box { width: min(340px, 90vw); display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }

/* ---------- 直向時改成上下堆疊 ---------- */
@media (orientation: portrait) {
  main { overflow-y: auto; }
  .view { flex-direction: column; height: auto; min-height: 100%; }
  .home-left, .home-right, .m-left, .m-right, .av-big { width: 100%; max-width: none; }
  .home-right .mission { height: auto; }
  .me .who { width: 110px; }
  .set-grid { grid-template-columns: 1fr; }
  .hide-portrait { display: none !important; }
}
@media (max-height: 400px) and (orientation: landscape) {
  .tile { min-height: 72px; }
  .quote { font-size: 13px; padding: 6px 12px; }
}

.mhead { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.mhead .ttl { font-size: 17px; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
@media (orientation: portrait) { .stage .fig { height: 180px; } .av-big .fig { height: 240px; } }
#app { grid-template-columns: minmax(0, 1fr); }
.top { min-width: 0; overflow: hidden; }
@media (orientation: portrait) { .pill { padding: 4px 8px; font-size: 12px; } .top { gap: 8px; padding: 8px 10px; } .view { padding: 10px; } }

svg[shape-rendering] { image-rendering: pixelated; }
