/* EW-BOT panel: mobile first, one column; on wide screens the column stays phone-width */

:root {
  --bg: #0d0e12;
  --card: #16181f;
  --card2: #1c1f27;
  --line: #2a2e38;
  --text: #ece8df;
  --muted: #8d909a;
  --gold: #e2b65c;
  --gold-dark: #b8893a;
  --hp: #e0464b;
  --mp: #3d8bf0;
  --he: #49c46f;
  --warn: #f0a83a;
  --danger: #e05252;
  --g-ex: #d06bff;
  --g-el: #ff9f43;
  --g-ba: #5ab0ff;
  --radius: 14px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.35 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .45; cursor: default; }
img { display: block; }
[hidden] { display: none !important; }
.gold { color: var(--gold); }

main, .hdr, .tabbar, .offline-banner { max-width: 560px; margin-left: auto; margin-right: auto; }
main { padding: 12px 14px calc(var(--tabbar-h) + var(--safe-b) + 16px); }
.view { display: flex; flex-direction: column; gap: 10px; }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #171a22, #12141a);
  border-bottom: 1px solid var(--line);
}
.class-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; }
/* Class emblem: the game's class mark in a round badge, the ring colour says main / subclass */
.emblem {
  --ring: var(--gold);
  width: 42px; height: 42px; flex: none; border-radius: 50%; position: relative; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #2b2f3a, #121419 70%);
  box-shadow: inset 0 0 0 2px var(--ring), 0 0 8px color-mix(in srgb, var(--ring) 35%, transparent);
}
.emblem[data-type="1"] { --ring: var(--mp); }
.emblem[data-type="2"] { --ring: var(--he); }
.emblem img { position: absolute; inset: 18%; width: 64%; height: 64%; object-fit: contain; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.who-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-sub { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; }
.who-sub #char-class { overflow: hidden; text-overflow: ellipsis; }
.swap { color: var(--gold); font-size: 13px; }
.hdr-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.adena { display: flex; align-items: center; gap: 4px; color: var(--gold); font-weight: 700; font-size: 13px; }
.adena img { width: 18px; height: 14px; object-fit: contain; }
.pill {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  border: 1px solid currentColor; background: color-mix(in srgb, currentColor 14%, transparent);
}
.pill.farming { color: var(--he); }
.pill.under_attack { color: var(--warn); }
.pill.in_town { color: var(--mp); }
.pill.dead { color: var(--danger); }
.pill.offline { color: var(--muted); }
.offline-banner {
  background: #3a2a12; color: #ffd28a; font-size: 13px; text-align: center; padding: 6px 14px;
  border-bottom: 1px solid #5a4218;
}

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.card-t { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-t h2 { font: 700 16px Philosopher, Georgia, serif; color: var(--gold); }
.aux { color: var(--muted); font-size: 12px; }
.hint { color: var(--muted); font-size: 12px; white-space: pre-line; }
.card .hint { margin-top: 8px; }
.empty-note { color: var(--muted); font-size: 13px; padding: 14px 0; text-align: center; grid-column: 1 / -1; }

/* ---------- vitals ---------- */
.vital + .vital { margin-top: 9px; }
.vital-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 4px; }
.vital-row span { color: var(--muted); font-weight: 500; }
.bar { height: 7px; border-radius: 4px; background: #0a0b0e; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 4px; transition: width .35s ease; }
.bar i.hp { background: linear-gradient(90deg, #b52a30, var(--hp)); }
.bar i.mp { background: linear-gradient(90deg, #2560b8, var(--mp)); }
.bar i.he { background: linear-gradient(90deg, #2f8e4c, var(--he)); }

/* ---------- auto-hunt and hunting energy ---------- */
.tile-lbl { display: block; font-size: 12px; color: var(--muted); }
.tile-st { display: block; font-weight: 700; font-size: 15px; }
.tile-note { display: block; font-size: 11px; color: var(--warn); margin-top: 2px; }
.tile-note:empty { display: none; }
.row-text { flex: 1; min-width: 0; }
.row-card { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; }
.row-card > img { width: 46px; height: 46px; object-fit: contain; flex: none; }
.row-card.on { border-color: rgba(224, 70, 75, .55); }
.row-card.on .tile-st { color: var(--he); }
.row-card.on > img { filter: drop-shadow(0 0 8px rgba(224, 70, 75, .6)); }
.switch { width: 46px; height: 26px; border-radius: 13px; background: #2a2e38; position: relative; flex: none; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #8d909a; transition: transform .2s, background .2s; }
.row-card.on .switch { background: rgba(73, 196, 111, .35); }
.row-card.on .switch i { transform: translateX(20px); background: var(--he); }

.he-card { display: flex; flex-direction: column; gap: 10px; }
.he-card.on { border-color: rgba(226, 182, 92, .55); }
.he-card.on .tile-st { color: var(--he); }
.he-head { display: flex; align-items: center; gap: 12px; }
/* The status window's hunting energy button: a lime bolt on a dark green plate */
.he-icon {
  width: 40px; height: 40px; flex: none; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(180deg, #4f7a2a, #2c4a16); border: 1px solid #7aa64a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15);
}
.he-icon svg { width: 24px; height: 24px; fill: #b6f05a; filter: drop-shadow(0 0 3px rgba(182, 240, 90, .6)); }
.he-card:not(.on) .he-icon { filter: grayscale(.6) brightness(.8); }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg button {
  padding: 8px 0; border-radius: 9px; background: var(--card2); font-weight: 700; font-size: 14px;
  border: 1px solid transparent;
}
.seg button.cur { border-color: var(--gold); color: var(--gold); background: rgba(226, 182, 92, .1); }
.btn-small {
  padding: 8px 14px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line);
  font-weight: 700; font-size: 13px; flex: none;
}
.btn-small.stop { color: var(--he); border-color: rgba(73, 196, 111, .4); }
.effects { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.effects:empty { display: none; }
.effect { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; padding: 3px 0; border-bottom: 1px dashed #262a33; }
.effect span { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.effect b.up { color: var(--he); }
.effect b.down { color: var(--danger); }
.he-card .hint:empty { display: none; }
#autohunt-hint { margin-top: -4px; padding: 0 4px; }
#autohunt-hint.warn { color: var(--warn); }

/* ---------- hotbar ---------- */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  padding: 6px 12px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--muted); flex: none;
}
.chips button.cur { background: rgba(226, 182, 92, .12); border-color: var(--gold); color: var(--gold); }
/* cells stay near the icons' own size: a 32-64 px icon stretched to a desktop-wide cell turns to mush */
.grid6 { display: grid; grid-template-columns: repeat(6, minmax(0, 56px)); justify-content: center; gap: 6px; margin-top: 10px; }
.slot {
  aspect-ratio: 1; border-radius: 9px; background: #0b0c10; border: 1px solid #262a33;
  position: relative; overflow: hidden; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; touch-action: manipulation;
}
.slot img { width: 100%; height: 100%; pointer-events: none; }
.slot .num { position: absolute; inset: 0; display: grid; place-items: center; color: #3a3e48; font-size: 12px; }
.slot.auto { border-color: #ff8a3d; }
.slot.auto::before {
  content: ''; position: absolute; top: 3px; right: 3px; z-index: 3; width: 7px; height: 7px;
  border-radius: 50%; background: #ff8a3d; box-shadow: 0 0 6px #ff8a3d;
}
.slot.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 10px rgba(226, 182, 92, .55); }
.slot.flash { animation: flash .35s ease; }
@keyframes flash { 50% { filter: brightness(1.8); } }
.slot .cnt, .it .q {
  position: absolute; right: 2px; bottom: 1px; z-index: 2; font-size: 11px; font-weight: 700;
  text-shadow: 0 0 2px #000, 0 0 3px #000, 0 0 3px #000;
}
.slot .cnt.zero { color: var(--danger); }
.slot .cd {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; text-shadow: 0 0 3px #000;
}
.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--card2); border-radius: 10px; padding: 3px; margin-top: 10px; }
.mode button { font-size: 12px; font-weight: 700; padding: 7px 4px; border-radius: 8px; color: var(--muted); }
.mode button.cur { background: #2a2414; color: var(--gold); }

.cons { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cons::-webkit-scrollbar { display: none; }
.con {
  display: flex; align-items: center; gap: 6px; background: var(--card2); border: 1px solid var(--line);
  border-radius: 10px; padding: 4px 10px 4px 4px; flex: none;
}
.con img { width: 30px; height: 30px; border-radius: 6px; }
.con b { font-size: 13px; }
.con.low b { color: var(--warn); }
.con.zero b { color: var(--danger); }

/* ---------- bag ---------- */
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.stat small { display: block; color: var(--muted); font-size: 11px; }
.stat b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search {
  width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; font-size: 15px; outline: none;
}
.search:focus { border-color: var(--gold-dark); }
/* 7 cells a row on a phone; icons stay near their own 32-64 px instead of being blown up */
.grid-bag { display: grid; grid-template-columns: repeat(auto-fill, minmax(41px, 1fr)); gap: 4px; }
.bag-top { display: flex; align-items: center; gap: 12px; }
.cap { flex: 1; min-width: 0; }
.cap-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.cap-row b { color: var(--text); }
.capbar { height: 5px; border-radius: 3px; background: #0a0b0e; margin-top: 4px; overflow: hidden; }
.capbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8a6a2e, var(--gold)); }
.capbar i.full { background: linear-gradient(90deg, #a33, var(--danger)); }
.bag-tools { display: flex; gap: 6px; }
.bag-tools .search { flex: 1; min-width: 0; padding: 8px 10px; font-size: 14px; }
.bag-tools .tool { padding: 6px 9px; gap: 5px; font-size: 12px; }
.bag-tools .tool img { width: 20px; height: 20px; }
.chips button b { color: var(--text); font-weight: 500; margin-left: 3px; }
.chips button.cur b { color: var(--gold); }
#bag-view { margin-top: 0; }
#bag-body { display: flex; flex-direction: column; gap: 8px; }
.it {
  aspect-ratio: 1; border-radius: 10px; background: #0b0c10; border: 1px solid #262a33;
  position: relative; overflow: hidden;
}
.it img { width: 100%; height: 100%; }
.it.empty { background: #101217; border-style: dashed; display: grid; place-items: center; cursor: default; }
.it.empty span { font-size: 8px; line-height: 1.1; color: #4a4e59; text-align: center; padding: 1px; }
.it.locked { background: repeating-linear-gradient(135deg, #15171c, #15171c 4px, #0e1013 4px, #0e1013 8px); border-style: solid; border-color: #1d2027; }
.it.locked::after { content: '🔒'; font-size: 11px; opacity: .55; }
.it .rk {
  position: absolute; right: 1px; top: 1px; z-index: 2; font-size: 9px; font-weight: 700; line-height: 1;
  padding: 1px 3px; border-radius: 4px; background: rgba(0, 0, 0, .7); color: #f0d48a;
}
.it .en {
  position: absolute; left: 2px; top: 1px; z-index: 2; font-size: 10px; font-weight: 700;
  color: #ffd36a; text-shadow: 0 0 3px #000, 0 0 3px #000;
}
.it.eq::after {
  content: 'E'; position: absolute; right: 2px; top: 2px; z-index: 2; font-size: 9px; font-weight: 700;
  background: var(--gold); color: #1a1205; border-radius: 4px; padding: 0 3px;
}
.it.EX, .big.EX { border-color: rgba(208, 107, 255, .75); }
.it.EL, .big.EL { border-color: rgba(255, 159, 67, .75); }
.it.BA, .big.BA { border-color: rgba(90, 176, 255, .65); }
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-weight: 700; font-size: 13px;
}
.tool img { width: 26px; height: 26px; object-fit: contain; }

/* ---------- equipped (paperdoll) ---------- */
.eq-sec { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.eq-t { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font: 700 14px Philosopher, Georgia, serif; color: var(--gold); }
.eq-t span { font: 12px Roboto, sans-serif; color: var(--muted); }
.car-h { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.car-h .it { width: 44px; flex: none; }
.car-n { font-weight: 700; font-size: 13px; }
.car-s { color: var(--muted); font-size: 11px; }
.ranks { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; }
.ranks > span { font-size: 11px; color: var(--muted); }

/* ---------- bag list ---------- */
.bag-list { display: flex; flex-direction: column; }
.bag-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid #1f2229; text-align: left; width: 100%; }
.bag-row .it { width: 40px; flex: none; }
.bag-row-t { flex: 1; min-width: 0; }
.bag-row-n { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bag-row-s { font-size: 11px; color: var(--muted); }
.bag-row-q { color: var(--gold); font-weight: 700; flex: none; }

/* ---------- screen ---------- */
.frame {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); position: relative;
  aspect-ratio: 16 / 10; background: #000;
}
.frame img { width: 100%; height: 100%; object-fit: contain; }
.live, .ago {
  position: absolute; top: 8px; font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, .65);
  padding: 3px 8px; border-radius: 999px;
}
.live { left: 8px; display: flex; align-items: center; gap: 5px; }
.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.live.stale::before { background: var(--muted); }
.ago { right: 8px; color: #ccc; font-weight: 500; }
.ago:empty { display: none; }
.btn-wide {
  width: 100%; padding: 11px; border-radius: 12px; background: var(--card); border: 1px solid var(--line);
  font-weight: 700;
}
.btn-wide.danger { color: var(--danger); border-color: rgba(224, 82, 82, .35); margin-top: 6px; }
.loot { display: flex; flex-direction: column; }
.drop { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #22252e; }
.drop:last-child { border-bottom: none; }
.drop img { width: 32px; height: 32px; border-radius: 7px; flex: none; }
.drop-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop-q { font-weight: 700; color: var(--gold); }
.drop-t { color: var(--muted); font-size: 12px; width: 40px; text-align: right; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: #101217; border-top: 1px solid var(--line);
  padding: 5px 4px calc(8px + var(--safe-b));
}
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 2px 0; }
.tabbar img { width: 34px; height: 34px; filter: grayscale(.7) brightness(.75); transition: filter .2s; }
.tabbar button.cur { color: var(--gold); }
.tabbar button.cur img { filter: none; }

/* ---------- bottom sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto;
  max-height: 88vh; overflow-y: auto; overscroll-behavior: contain;
  background: #14161c; border-top: 1px solid var(--gold-dark); border-radius: 20px 20px 0 0;
  padding: 8px 16px calc(18px + var(--safe-b));
  animation: sheet-in .2s ease;
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
.grab { width: 44px; height: 5px; border-radius: 3px; background: #3a3e48; margin: 2px auto 12px; cursor: pointer; }
/* the handle and ✕ stay on top while the sheet scrolls; pulled down, the sheet closes */
.sheet-head { position: sticky; top: -8px; z-index: 4; display: flex; align-items: center; justify-content: center;
  min-height: 40px; margin: -8px -16px 6px; padding: 0 16px; background: #14161c; touch-action: none; }
.sheet-head .grab { width: 54px; margin: 0; padding: 0; background-clip: content-box; }
.sheet-x { position: absolute; right: 10px; top: 6px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1; }
.sheet h3 { font: 700 18px Philosopher, Georgia, serif; color: var(--gold); margin-bottom: 10px; }
.ihead { display: flex; gap: 12px; align-items: center; }
.big { width: 64px; height: 64px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; flex: none; background: #0b0c10; }
.big img { width: 100%; height: 100%; }
.iname { font-weight: 700; font-size: 17px; line-height: 1.25; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--card2); color: var(--muted); }
.tag.EX { background: rgba(208, 107, 255, .15); color: var(--g-ex); }
.tag.EL { background: rgba(255, 159, 67, .15); color: var(--g-el); }
.tag.BA { background: rgba(90, 176, 255, .15); color: var(--g-ba); }
.tag.en { background: rgba(255, 211, 106, .12); color: #ffd36a; }
.tag.eq { background: rgba(226, 182, 92, .12); color: var(--gold); }
.props { margin: 14px 0 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 13px; }
.props div { display: flex; justify-content: space-between; gap: 6px; border-bottom: 1px dashed #262a33; padding-bottom: 4px; }
.props span { color: var(--muted); }
.desc { color: #c9c5bc; font-size: 13px; margin-top: 10px; white-space: pre-line; }
.tip-wait { color: var(--muted); font-size: 12px; margin-top: 10px; }
.gtip { margin-top: 10px; padding: 8px 10px; background: #0b0c10; border: 1px solid var(--line); border-radius: 10px;
  color: #c9c5bc; font-size: 13px; line-height: 1.4; max-height: 52vh; overflow-y: auto; }
.gtip-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.gtip-line img { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 5px; }
.gtip-sep { height: 1px; background: var(--line); margin: 7px 0; }
.qty { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.qty span { color: var(--muted); font-size: 13px; flex: 1; }
.qty input { width: 90px; text-align: center; padding: 8px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.act { padding: 12px 8px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.act.pri { grid-column: span 2; background: linear-gradient(180deg, #e2b65c, #b8893a); color: #1a1205; border: none; font-size: 15px; }
.act.dng { color: var(--danger); border-color: rgba(224, 82, 82, .35); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { color: var(--muted); font-size: 12px; }
.field select, .field input { padding: 10px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); width: 100%; }
.log { max-height: 160px; overflow-y: auto; background: #0b0c10; border-radius: 10px; padding: 8px; margin-top: 12px; font-size: 13px; }
.log:empty::before { content: attr(data-empty); color: var(--muted); }
.log .ok { color: var(--he); }
.log .fail { color: var(--danger); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 480px); padding: 10px 14px; line-height: 1.35; border-radius: 12px;
  background: #23262f; border: 1px solid var(--line); font-size: 13px; text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* very narrow phones */
@media (max-width: 350px) {
  main { padding-left: 10px; padding-right: 10px; }
  .effects { grid-template-columns: 1fr; }
}

/* ---------- watch: death, alerts, events ---------- */
.zone-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.zone-row:has(#zone-name:empty) { display: none; }
.zone-row #zone-name { color: var(--text); font-weight: 500; }
.peace { color: var(--mp); font-weight: 700; }
.death-card { border-color: rgba(224, 82, 82, .6); background: linear-gradient(180deg, #2a1416, var(--card)); }
.death-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.death-skull { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; color: var(--danger); background: rgba(224, 82, 82, .15); flex: none; }
.death-title { display: block; font-weight: 700; font-size: 16px; color: #ff8a8a; }
.death-timer { display: block; font-size: 13px; color: var(--muted); }
.death-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.death-options button { padding: 11px 8px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.death-options button:first-child:last-child { grid-column: span 2; }
.alert-strip {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px;
  background: rgba(240, 168, 58, .12); border: 1px solid rgba(240, 168, 58, .45); color: #ffd28a; font-size: 13px;
}
.notify-strip {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px;
  background: rgba(226, 182, 92, .1); border: 1px solid rgba(226, 182, 92, .45); color: var(--gold); font-size: 13px; font-weight: 500;
}
.notify-bell { font-size: 16px; flex: none; }
.notify-x { color: var(--muted); padding: 0 4px; flex: none; }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 8px var(--warn); flex: none; }
.alert-text { flex: 1; min-width: 0; }
.alert-time { color: var(--muted); font-size: 12px; flex: none; }
.events { display: flex; flex-direction: column; }
.event { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid #22252e; font-size: 13px; }
.event:last-child { border-bottom: none; }
.event-t { color: var(--muted); font-size: 12px; width: 40px; flex: none; padding-top: 1px; }
.event.alert .event-text { color: #ffd28a; }
.event.death .event-text { color: #ff8a8a; }
.link-btn { color: var(--gold); font-size: 12px; font-weight: 700; padding: 2px 0; }

/* ---------- classes ---------- */
.class-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.class-opt {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 12px; min-width: 0;
  background: var(--card2); border: 1px solid var(--line); text-align: left;
}
.class-opt .emblem { width: 36px; height: 36px; }
.class-opt.cur { border-color: var(--gold); background: rgba(226, 182, 92, .08); }
.class-opt.busy { opacity: .6; }
.class-opt-text { min-width: 0; }
.class-opt-name { font-weight: 700; font-size: 13px; line-height: 1.2; overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.class-opt-sub { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.class-opt.cur .class-opt-sub { color: var(--gold); }

/* ---------- class picker ---------- */
.classes { display: flex; flex-direction: column; gap: 8px; }
.cls {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px;
  background: var(--card2); border: 1px solid var(--line); text-align: left; width: 100%;
}
.cls.cur { border-color: var(--gold); background: rgba(226, 182, 92, .08); }
.cls .emblem { width: 52px; height: 52px; }
.cls-name { font-weight: 700; font-size: 15px; }
.cls-sub { color: var(--muted); font-size: 12px; }
.cls-badge { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--gold); white-space: nowrap; }
.sheet .note { color: var(--muted); font-size: 12px; margin-top: 10px; }

/* ---------- market ---------- */
#view-market { display: flex; flex-direction: column; gap: 8px; }
#view-market[hidden] { display: none; }
#mk-side { margin-top: 0; }
.mk-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; }
#mk-side-hint { font-size: 12px; }
.mk-grade {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--text);
  padding: 0 6px; font-size: 13px; flex: none; max-width: 92px;
}
.mk-status { color: var(--muted); font-size: 12px; min-height: 16px; padding: 0 2px; }
.mk-status.err { color: var(--warn); }
#mk-list { display: flex; flex-direction: column; }
.mk-price { text-align: right; flex: none; }
.mk-price b { display: block; color: var(--gold); font-size: 14px; }
.mk-price small { color: var(--muted); font-size: 11px; }
.lot-info { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin-top: 10px; font-size: 13px; }
.lot-info span { color: var(--muted); }
.lot-info b { text-align: right; }
.lot-info b.gold { color: var(--gold); }
.mk-catbar { display: flex; gap: 6px; }
.mk-cat {
  flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px;
}
.mk-cat::after { content: '▾'; margin-left: auto; color: var(--muted); }
.mk-cat small { color: var(--muted); font-size: 12px; flex: none; }
.mk-cat b { color: var(--gold); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-cat-clear { flex: none; width: 42px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.sheet-t { font: 700 16px Philosopher, Georgia, serif; color: var(--gold); margin-bottom: 8px; }
.mk-tree { display: flex; flex-direction: column; gap: 4px; }
.mk-node {
  text-align: left; padding: 10px 12px; border-radius: 10px; background: var(--card2);
  border: 1px solid var(--line); font-size: 14px;
}
.mk-node.closed::before, .mk-node.open::before { display: inline-block; width: 18px; color: var(--muted); }
.mk-node.closed::before { content: '+'; }
.mk-node.open::before { content: '−'; }
.mk-node.cur { border-color: var(--gold); color: var(--gold); background: rgba(226, 182, 92, .1); }
.mk-subs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 2px 0 6px 12px; }
.mk-subs .mk-node { padding: 8px 10px; font-size: 13px; }
#mk-browse, #mk-mine { display: flex; flex-direction: column; gap: 8px; }
#mk-browse[hidden], #mk-mine[hidden] { display: none; }
.mk-page button { flex: 1; }
#mine-allowed { margin-top: 10px; }
#mine-type { margin-top: 0; margin-bottom: 6px; }
.reg-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.reg-form input, .reg-form select {
  width: 100%; padding: 9px 10px; border-radius: 10px; background: var(--card2);
  border: 1px solid var(--line); color: var(--text); font-size: 15px;
}
.svc { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid #1f2229; font-size: 13px; }
.svc:last-child { border-bottom: 0; }
.svc b { color: var(--gold); white-space: nowrap; }
.hint.warn { color: var(--warn); }

/* ---------- modification ---------- */
.ench { display: flex; flex-direction: column; gap: 10px; }
.ench-sec .ench-t { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.it.chosen { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 8px rgba(226, 182, 92, .5); }
.it.dim { opacity: .4; }
.ench-card { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ench-head { display: flex; align-items: center; gap: 10px; }
.ench-prog { font-size: 12px; color: var(--muted); }
.ench-rates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.ench-rates > div { background: #0b0c10; border-radius: 8px; padding: 6px 2px; display: flex; flex-direction: column; }
.ench-rates small { font-size: 11px; color: var(--muted); }
.ench-rates b { font-size: 17px; }
.ench-rates .bad b { color: #e0464b; } .ench-rates .mid b { color: #e8c44c; } .ench-rates .good b { color: #49c46f; }
.ench-rates .good small:last-child { color: #49c46f; } .ench-rates .bad small:last-child { color: #e0464b; }
.ench-chance { font-size: 15px; color: #e8c44c; text-align: center; }
.lot-info b.bad { color: #e0464b; }
.ench-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* the action buttons of a long sheet (modification, properties, blessing, upgrade) stay at its bottom
   edge: the owner did not see that «Модификация» was below and had to be scrolled to */
.ench-acts, .acts.stick { position: sticky; bottom: calc(-18px - var(--safe-b)); z-index: 3; background: #14161c;
  margin: 12px -16px 0; padding: 10px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line);
  box-shadow: 0 -10px 18px -8px rgba(0, 0, 0, .7); }
.ench-acts .act { flex: 1; }
.ench-target { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.ench-target b { color: var(--gold); font-size: 16px; min-width: 32px; text-align: center; }
.ench-target .tool { padding: 4px 10px; }
.ench-auto { font-size: 13px; display: flex; align-items: center; gap: 4px; }
.ench-log { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 10px;
  display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.ench-log-head { display: flex; justify-content: space-between; align-items: baseline; }
.ench-log-t { font-weight: 600; font-size: 13px; }
.ench-log-n { color: var(--muted); }
.ench-totals { display: flex; flex-wrap: wrap; gap: 4px; }
.ench-final { background: rgba(73, 196, 111, .1); color: #49c46f; border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.ench-final.fail { background: rgba(224, 70, 75, .1); color: #e0464b; }
.ench-rows { max-height: 132px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
  background: #0b0c10; border-radius: 8px; padding: 4px; }
.ench-row { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 6px; padding: 2px 4px; }
.ench-row:first-child { background: rgba(255, 255, 255, .04); border-radius: 6px; }
.ench-row-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.ench-row-v { font-variant-numeric: tabular-nums; }
.ench-row .chip { justify-self: start; }
.chip { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; line-height: 16px;
  background: rgba(255, 255, 255, .06); color: var(--muted); white-space: nowrap; }
.chip.good { background: rgba(73, 196, 111, .15); color: #49c46f; }
.chip.up { background: rgba(80, 160, 230, .15); color: #6fb3ee; }
.chip.mid { background: rgba(232, 196, 76, .13); color: #e8c44c; }
.chip.warn { background: rgba(232, 140, 60, .15); color: #ec9a52; }
.chip.bad { background: rgba(224, 70, 75, .15); color: #e0464b; }

/* ---------- upgrade / exchange ---------- */
.upg, .chests { display: flex; flex-direction: column; gap: 10px; }
.upg-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; background: var(--card2);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.upg-one { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.upg-one small { color: var(--muted); font-size: 11px; }
.upg-name { font-size: 13px; font-weight: 600; }
.upg-arrow { color: var(--gold); font-size: 22px; }

/* ---------- modification result effects ---------- */
.ench-card { position: relative; --fx-delay: 0ms; }
.ench-card[class*="fx-"], .ench-card[class*="fx-"] .big, .ench-burst { animation-delay: var(--fx-delay) !important; }
.ench-card.fx-success { animation: fx-glow 1.5s ease-out both; }
.ench-card.fx-success .big { animation: fx-pop .7s cubic-bezier(.2, 1.6, .4, 1) both; }
.ench-card.fx-success::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at 42px 42px, rgba(255, 215, 110, .55), rgba(255, 215, 110, 0) 60%);
  animation: fx-fade 1.5s ease-out both; animation-delay: var(--fx-delay); }
.ench-burst { position: absolute; left: 10px; top: 10px; width: 64px; height: 64px; display: grid; place-items: center;
  font-size: 26px; font-weight: 800; color: #ffd76e; pointer-events: none;
  text-shadow: 0 0 10px rgba(255, 200, 80, .9), 0 2px 0 #6b4a00; animation: fx-rise 1.5s ease-out both; z-index: 2; }
.ench-card.fx-progress { animation: fx-blue 1s ease-out both; }
.ench-card.fx-progress_lost { animation: fx-orange 1s ease-out both; }
.ench-card.fx-downgraded, .ench-card.fx-destroyed { animation: fx-red 1.2s ease-out both, fx-shake .45s ease-in-out both; }
.ench-card.fx-destroyed .big { animation: fx-break 1.5s ease-out both; }
@keyframes fx-glow {
  0% { box-shadow: 0 0 0 0 rgba(255, 215, 110, 0); border-color: var(--line); }
  15% { box-shadow: 0 0 26px 4px rgba(255, 215, 110, .65); border-color: #ffd76e; }
  100% { box-shadow: 0 0 0 0 rgba(255, 215, 110, 0); border-color: var(--line); } }
@keyframes fx-pop { 0% { transform: scale(1); } 35% { transform: scale(1.22) rotate(-4deg); } 100% { transform: scale(1); } }
@keyframes fx-fade { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fx-rise { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 15% { opacity: 1; transform: translateY(0) scale(1.15); }
  70% { opacity: 1; transform: translateY(-14px) scale(1); } 100% { opacity: 0; transform: translateY(-26px) scale(.95); } }
@keyframes fx-blue { 0%, 100% { box-shadow: 0 0 0 0 rgba(80, 160, 230, 0); } 20% { box-shadow: 0 0 18px 2px rgba(80, 160, 230, .45); } }
@keyframes fx-orange { 0%, 100% { box-shadow: 0 0 0 0 rgba(236, 154, 82, 0); } 20% { box-shadow: 0 0 16px 2px rgba(236, 154, 82, .4); } }
@keyframes fx-red { 0%, 100% { box-shadow: 0 0 0 0 rgba(224, 70, 75, 0); border-color: var(--line); }
  15% { box-shadow: 0 0 22px 3px rgba(224, 70, 75, .55); border-color: #e0464b; } }
@keyframes fx-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes fx-break { 0% { filter: none; opacity: 1; } 100% { filter: grayscale(1) brightness(.5); opacity: .5; } }
@media (prefers-reduced-motion: reduce) {
  .ench-card[class*="fx-"], .ench-card[class*="fx-"] .big, .ench-burst, .ench-card.fx-success::before { animation-duration: 1ms !important; } }

/* ---------- bag feature tiles (modification, upgrade, chests) ---------- */
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.feat { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 4px 9px; border-radius: 14px; color: var(--text); text-align: center;
  background: linear-gradient(160deg, rgba(226, 182, 92, .16), rgba(226, 182, 92, .03) 55%), var(--card);
  border: 1px solid rgba(226, 182, 92, .45); box-shadow: 0 2px 10px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .05); }
.feat::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 60%; pointer-events: none;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 230, 170, .10) 45%, rgba(255, 240, 200, .16) 50%,
    rgba(255, 230, 170, .10) 55%, transparent 80%);
  transform: translateX(-120%);
  /* one sweep, the same moment on every tile: no tile shines on its own */
  animation: feat-shine 7s cubic-bezier(.45, 0, .25, 1) infinite; }
.feat:active { transform: scale(.97); border-color: var(--gold); }
.feat-i { width: 46px; height: 46px; border-radius: 12px; overflow: hidden; flex: none;
  border: 1px solid rgba(226, 182, 92, .6); box-shadow: 0 0 12px rgba(226, 182, 92, .25); }
.feat-i img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feat b { font: 700 13px Philosopher, Georgia, serif; color: var(--gold); line-height: 1.1; }
.feat small { font-size: 10.5px; color: var(--muted); line-height: 1.1; }
@keyframes feat-shine { 0%, 72% { transform: translateX(-120%); } 100% { transform: translateX(220%); } }
@media (prefers-reduced-motion: reduce) { .feat::after { animation: none; } }

/* ---------- modification: ranks on cells, the chosen thing's description ---------- */
/* long lists: what is off the screen is not laid out or painted until it scrolls near
   (the bag's 220 items, the letters); the size kept is the one last drawn */
.grid-bag .it, .bag-list .bag-row, .mail-line { content-visibility: auto; contain-intrinsic-size: auto 48px; }
.it .rk { position: absolute; right: 2px; top: 2px; font-size: 9px; font-weight: 800; line-height: 1; padding: 2px 3px;
  border-radius: 4px; background: rgba(0, 0, 0, .7); color: var(--gold); }
.ench-desc { margin-top: 6px; background: #0b0c10; border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px;
  display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.ench-desc-h { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.ench-desc-n { margin-left: auto; color: var(--muted); font-size: 12px; }
.gtip.mini { font-size: 12px; max-height: 4.6em; background: none; border: 0; padding: 0; margin: 0; overflow: hidden; position: relative;
  -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.ench-desc.open .gtip.mini { max-height: none; -webkit-mask-image: none; mask-image: none; }

/* ---------- upgrade materials ---------- */
.upg-points { display: flex; flex-wrap: wrap; gap: 6px; }
.upg-points .chip { font-size: 12px; padding: 3px 9px; }
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.mat { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px 6px; border-radius: 10px;
  background: var(--card2); border: 1px solid rgba(73, 196, 111, .45); text-align: center; min-width: 0; }
.mat.lack { border-color: rgba(224, 70, 75, .55); background: linear-gradient(180deg, rgba(224, 70, 75, .08), transparent), var(--card2); }
.mat-i { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; background: #0b0c10; }
.mat-i img { width: 100%; height: 100%; }
.mat-n { font-size: 10.5px; color: var(--muted); line-height: 1.15; max-width: 100%; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.3em; }
.mat-c { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.mat-c b { color: #49c46f; }
.mat.lack .mat-c b { color: #e0464b; }

/* ---------- mail ---------- */
.mail-top { display: flex; align-items: center; gap: 8px; }
.mail-top .mode { flex: 1; margin-top: 0; }
.mail-write { flex: none; padding: 9px 14px; }
.mail-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.mail-i { width: 42px; height: 42px; flex: none; border-radius: 10px; overflow: hidden; background: #0b0c10; }
.mail-i img { width: 100%; height: 100%; }
.mail-row.unread { border-color: rgba(226, 182, 92, .55); }
.mail-row.unread .bag-row-n { color: var(--gold); font-weight: 700; }
.mail-left { flex: none; color: var(--muted); font-size: 12px; }
.letter { display: flex; flex-direction: column; gap: 10px; }
.letter-body { white-space: pre-wrap; overflow-wrap: anywhere; background: #0b0c10; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px; font-size: 14px; line-height: 1.45; }
.mail-text { width: 100%; padding: 10px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line);
  color: var(--text); font: inherit; resize: vertical; }
.tab-i { position: relative; display: inline-block; line-height: 0; }
.tab-i .dot { position: absolute; top: 1px; right: 1px; width: 10px; height: 10px; border-radius: 50%;
  background: #e0464b; box-shadow: 0 0 0 2px #101217; }
#mail-status:empty { display: none; }

/* ---------- item properties (augmentation) ---------- */
.refine { display: flex; flex-direction: column; gap: 10px; }
.ref-now, .ref-pending { display: flex; flex-direction: column; gap: 3px; }
.ref-opt { font-size: 13px; font-weight: 600; }
.ref-pending { background: #0b0c10; border: 1px dashed rgba(226, 182, 92, .5); border-radius: 10px; padding: 8px; }
.ref-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto;
  background: #0b0c10; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.ref-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.ref-row.on { background: rgba(226, 182, 92, .12); }
.ref-row input { width: 18px; height: 18px; accent-color: var(--gold); flex: none; }
.ref-limit { width: 80px; padding: 6px 8px; border-radius: 8px; background: var(--card2); border: 1px solid var(--line); color: var(--text); }
.ref-rows .ench-row { grid-template-columns: 44px 1fr auto; }
.ref-row-t { display: flex; flex-direction: column; }
.ench-row.hit { background: rgba(73, 196, 111, .14); border-radius: 6px; }
.ench-row.hit .ench-row-v { color: #49c46f; font-weight: 700; }
.refine .ench-head .link-btn { margin-left: auto; flex: none; }
.bless-eff { display: flex; flex-direction: column; gap: 3px; background: #0b0c10; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.bless-line { line-height: 1.35; }

/* the game's own frame over an icon (stone and scroll quality ...) */
.it > img.panel { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.it .rk { z-index: 1; }

/* worn items, wherever a cell shows them */
.it.worn { box-shadow: inset 0 0 0 2px rgba(73, 196, 111, .55), inset 0 0 10px rgba(73, 196, 111, .35); }
.it.chosen.worn { box-shadow: 0 0 0 1px var(--gold), 0 0 8px rgba(226, 182, 92, .5), inset 0 0 0 2px rgba(73, 196, 111, .55); }
.it .worn-mark { position: absolute; left: 2px; bottom: 2px; z-index: 2; font-size: 9px; font-weight: 800; line-height: 1;
  padding: 2px 3px; border-radius: 4px; background: #49c46f; color: #06200f; }

/* ---------- writing a letter: kinds, attachments ---------- */
.mail-kinds { grid-template-columns: repeat(3, 1fr); margin: 4px 0 6px; }
.mail-kinds button { font-size: 11.5px; }
.mail-attach { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.mail-chosen { display: flex; flex-direction: column; gap: 4px; }
.mail-chosen-row { display: flex; align-items: center; gap: 8px; }
.mail-chosen-row .it { width: 40px; height: 40px; flex: none; }
.mail-chosen-n { flex: 1; font-size: 13px; }
.mail-pool { max-height: 220px; overflow-y: auto; }
.mail-count { width: 72px; padding: 6px 8px; border-radius: 8px; background: var(--card2); border: 1px solid var(--line); color: var(--text); }
.deal-note { font-size: 13px; color: #ec9a52; background: rgba(236, 154, 82, .1); border-radius: 10px; padding: 8px 10px; }

/* ---------- mail: ticks to delete, the send fee ---------- */
.mail-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; }
.mail-tick { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer;
  min-height: 40px; padding: 0 4px; }
.mail-tick input { width: 20px; height: 20px; margin: 0; accent-color: var(--gold); }
.mail-line { display: flex; align-items: center; gap: 4px; }
.mail-line > .mail-tick { min-width: 40px; justify-content: center; padding: 0; align-self: stretch; }
.mail-line > .mail-row { flex: 1; min-width: 0; }
.mail-line.picked > .mail-row { outline: 1px solid rgba(212, 166, 74, .45); }
.mail-del { width: auto; padding: 8px 14px; min-height: 36px; }
.mail-del:disabled { opacity: .45; }
.mail-fee { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 10px; font-size: 13px; }
.mail-fee .mail-coins { color: var(--gold); }
.mail-fee .mail-coins.short, .mail-fee .err { color: var(--danger); }

/* ---------- "Получено": the session's sum, tiles per item, a short feed ---------- */
.loot-sum { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.loot-gold { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.loot-gold img { width: 20px; height: 20px; }
.loot-n { color: var(--muted); font-size: 13px; }
.loot-mode { margin: 8px 0 8px; }
.loot-grid { max-height: 260px; overflow-y: auto; }
.drop-gold .drop-name { color: var(--gold); }
.loot-more { display: block; margin: 6px auto 0; }

/* ---------- remote control: the live screen over everything ---------- */
.screen-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.screen-acts .act.pri { grid-column: auto; }
.screen-acts .btn-wide { margin: 0; }
#screen-img { cursor: pointer; }
body.rc-on { overflow: hidden; }
.rc { position: fixed; inset: 0; z-index: 200; background: #000; touch-action: none; user-select: none;
  -webkit-user-select: none;
  /* what the phone and Telegram keep for themselves: the status bar, and in Telegram's full screen
     its own "Закрыть ⌄ ⋮" over the page (telegram-web-app.js sets these variables) */
  --it: max(env(safe-area-inset-top), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)));
  --ib: max(env(safe-area-inset-bottom), calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px))); }
/* a phone held upright: the page turns the remote sideways itself (Telegram does not rotate a Mini App);
   the box's top runs along the screen's right edge, so its left side is the screen's top */
.rc.rot { inset: auto; left: 0; top: 0; width: 100vh; width: 100dvh; height: 100vw;
  transform-origin: 0 0; transform: translateX(100vw) rotate(90deg); }
.rc.rot .rc-stage { left: var(--it); right: var(--ib); }
.rc.rot .rc-top { top: 6px; left: calc(var(--it) + 6px); right: calc(var(--ib) + 6px); }
.rc.rot .rc-stick { bottom: 18px; }
.rc.rot .rc-move { left: calc(var(--it) + 18px); }
.rc.rot .rc-camera { right: calc(var(--ib) + 18px); }
.rc-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.rc-canvas { display: block; background: #050505; touch-action: none; }
.rc-top { position: absolute; top: calc(var(--it) + 6px); left: 6px; right: 6px; display: flex;
  align-items: center; gap: 6px; pointer-events: none; }
.rc-top > * { pointer-events: auto; }
.rc-btn { min-width: 38px; height: 38px; border-radius: 10px; background: rgba(20, 20, 24, .72); color: #fff;
  font-size: 18px; border: 1px solid rgba(255, 255, 255, .12); }
.rc-select { height: 38px; border-radius: 10px; background: rgba(20, 20, 24, .8); color: var(--gold);
  border: 1px solid rgba(255, 255, 255, .12); padding: 0 6px; font-size: 13px; max-width: 150px; }
.rc-stats { flex: 1; min-width: 0; font-size: 11px; color: #ddd; background: rgba(0, 0, 0, .5); padding: 4px 8px;
  border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-stick { position: absolute; bottom: calc(var(--ib) + 18px); width: 128px; height: 128px;
  border-radius: 50%; background: rgba(255, 255, 255, .07); border: 2px solid rgba(255, 255, 255, .18);
  touch-action: none; }
.rc-move { left: 18px; }
.rc-camera { right: 18px; }
.rc-knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px;
  border-radius: 50%; background: rgba(226, 182, 92, .55); border: 2px solid rgba(255, 255, 255, .35);
  pointer-events: none; }
.rc-stick-l { position: absolute; left: 0; right: 0; top: -18px; text-align: center; font-size: 11px;
  color: rgba(255, 255, 255, .6); pointer-events: none; }
.rc-keys { position: absolute; left: 160px; right: 160px; bottom: 10px; display: flex; flex-direction: column;
  gap: 4px; background: rgba(10, 10, 14, .78); padding: 6px; border-radius: 12px; }
.rc-row { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.rc-key { min-width: 34px; height: 32px; padding: 0 6px; border-radius: 8px; background: rgba(255, 255, 255, .1);
  color: #fff; font-size: 12px; font-weight: 700; }
.rc-key.pri { background: var(--gold-dark); color: #1a1205; }
.rc-text { flex: 1; min-width: 120px; height: 32px; border-radius: 8px; background: rgba(255, 255, 255, .08);
  color: #fff; border: 1px solid rgba(255, 255, 255, .15); padding: 0 8px; }
.rc-mark { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  border: 2px solid var(--gold); pointer-events: none; animation: rc-ping .5s ease-out forwards; }
.rc-mark.right { border-color: #6fb3ff; }
@keyframes rc-ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
@media (max-width: 700px) and (orientation: portrait) {
  .rc:not(.rot) .rc-stick { width: 110px; height: 110px; }
  .rc:not(.rot) .rc-keys { left: 6px; right: 6px; bottom: 150px; }
  .rc:not(.rot) .rc-top { flex-wrap: wrap; }
  .rc:not(.rot) .rc-select { flex: 1; max-width: none; }
  .rc:not(.rot) .rc-stats { order: 9; flex-basis: 100%; text-align: center; }
}

/* ---------- the guide ("?"): what it does, what it needs, the player's choice ---------- */
.help-btn { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(226, 182, 92, .45);
  color: var(--gold); font-weight: 800; font-size: 14px; background: rgba(226, 182, 92, .08); align-self: flex-end; }
.guide { position: fixed; inset: 0; z-index: 150; background: var(--bg); display: flex; flex-direction: column;
  overflow: hidden; animation: guide-in .22s ease-out; padding-bottom: env(safe-area-inset-bottom); }
.guide.out { animation: guide-out .22s ease-in forwards; }
@keyframes guide-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes guide-out { to { opacity: 0; transform: translateY(12px); } }
.guide-skip { position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(12px, calc((100% - 592px) / 2)); z-index: 2; color: var(--muted);
  font-size: 13px; padding: 6px 10px; }
.guide-track { flex: 1; display: flex; transition: transform .3s ease; min-height: 0; }
/* a column as wide as the panel itself, also on a wide screen */
.guide-slide { flex: 0 0 100%; overflow-y: auto; box-sizing: border-box; -webkit-overflow-scrolling: touch;
  padding: max(44px, env(safe-area-inset-top)) max(18px, calc((100% - 560px) / 2)) 12px; }
.guide-hero { width: 88px; height: 88px; margin: 18px auto 10px; border-radius: 24px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(226, 182, 92, .28), rgba(226, 182, 92, .04));
  border: 1px solid rgba(226, 182, 92, .35); box-shadow: 0 0 40px rgba(226, 182, 92, .15); }
.guide-hero img { width: 56px; height: 56px; }
.guide-h { font: 700 22px Philosopher, Georgia, serif; color: var(--gold); margin: 6px 0 12px; text-align: center; }
.guide-tag { text-align: center; color: var(--muted); font-size: 13px; letter-spacing: .3px; margin: -6px 0 12px; }
.guide-p { font-size: 15px; line-height: 1.5; margin: 0 0 12px; text-align: center; }
.guide-p.muted, .guide-row-t span, .guide-tile span { color: var(--muted); }
.guide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 560px) { .guide-grid { grid-template-columns: repeat(3, 1fr); } }
.guide-tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px;
  display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 1.35; }
.guide-tile b { font: 700 14px Philosopher, Georgia, serif; color: var(--gold); }
.guide-ic { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--card2); border: 1px solid var(--line); }
.guide-ic img { width: 26px; height: 26px; }
.guide-ic.big { width: 42px; height: 42px; }
.guide-ic.big img { width: 32px; height: 32px; }
.guide-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.guide-row { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px; }
.guide-list.yes .guide-row { border-color: rgba(90, 190, 120, .35); }
.guide-row-t { display: flex; flex-direction: column; gap: 3px; font-size: 13px; line-height: 1.4; }
.guide-row-t b { font-size: 14px; color: var(--text); }
.guide-sub { color: var(--gold); font-weight: 700; font-size: 14px; margin: 14px 0 8px; }
.guide-no { margin: 0 0 12px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.guide-no li { position: relative; padding: 8px 12px 8px 34px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; font-size: 13px; }
.guide-no li::before { content: '✕'; position: absolute; left: 12px; top: 8px; color: var(--danger); font-weight: 800; }
.guide-note { font-size: 12.5px; line-height: 1.45; color: var(--muted); background: var(--card2); border-radius: 12px;
  padding: 10px 12px; border-left: 3px solid rgba(226, 182, 92, .5); }
.guide-note.warn { border-left-color: var(--danger); }
.guide-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.guide-choice { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.guide-choice b { font: 700 16px Philosopher, Georgia, serif; color: var(--text); }
.guide-choice.on { border-color: var(--gold); background: rgba(226, 182, 92, .1); box-shadow: 0 0 0 1px var(--gold) inset; }
.guide-choice.on b { color: var(--gold); }
.guide-dots { display: flex; justify-content: center; gap: 6px; padding: 8px 0; }
.guide-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: all .2s; }
.guide-dots i.cur { width: 20px; border-radius: 4px; background: var(--gold); }
.guide-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px 14px; width: 100%;
  max-width: 592px; margin: 0 auto; box-sizing: border-box; }
.guide-nav .act[hidden] { display: none; }
.guide-nav .act.pri.wide { grid-column: 1 / -1; }
.guide-nav .act.pri { grid-column: auto; }
.screen-off { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.screen-off > div { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.screen-off > div span { color: var(--muted); }
.screen-off .act.pri { grid-column: auto; padding: 10px 16px; }

/* ---------- chat: the game's channels in their colours, an answer from the phone ---------- */
#view-chat { gap: 8px; }
.chat-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chat-filters::-webkit-scrollbar { display: none; }
.chat-chip { flex: none; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px; font-weight: 700; }
.chat-chip.cur { color: var(--ch, var(--gold)); border-color: var(--ch, var(--gold));
  background: color-mix(in srgb, var(--ch, var(--gold)) 12%, var(--card)); }
.chat-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  height: calc(100dvh - var(--tabbar-h) - var(--safe-b) - 250px); min-height: 200px; padding-right: 2px; }
.chat-msg { align-self: flex-start; max-width: 88%; background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--ch); border-radius: 12px; padding: 6px 10px; }
.chat-msg.mine { align-self: flex-end; border-left: 1px solid var(--line); border-right: 3px solid var(--ch);
  background: color-mix(in srgb, var(--ch) 8%, var(--card)); }
.chat-head { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; margin-bottom: 2px; }
.chat-tag { color: var(--ch); font-weight: 700; text-transform: uppercase; letter-spacing: .3px; font-size: 10px; }
.chat-who { color: var(--ch); font-weight: 700; font-size: 12.5px; padding: 0; }
.chat-time { color: var(--muted); margin-left: auto; font-size: 10.5px; }
.chat-text { font-size: 14px; line-height: 1.35; white-space: pre-wrap; word-break: break-word; }
/* typing in the chat: the tab bar gives its place to the keyboard and the list (fitChat) */
body.typing .tabbar { display: none; }
/* the keyboard leaves ~400 px on a phone (measured over ADB: 397 of 680): the panel's header goes
   too, the chat and its input keep the screen, as in a messenger */
body.typing .hdr, body.typing .offline-banner { display: none; }
.chat-compose { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px;
  display: flex; flex-direction: column; gap: 6px; }
.chat-compose-top { display: flex; gap: 6px; position: relative; }
.chat-channel { flex: none; height: 34px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line);
  padding: 0 26px 0 10px; font-weight: 700; font-size: 13px; color: var(--ch); position: relative; min-width: 96px;
  text-align: left; border-left: 3px solid var(--ch); }
.chat-channel::after { content: ''; position: absolute; right: 10px; top: 13px; border: 4px solid transparent;
  border-top-color: var(--muted); }
.chat-menu { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 5; display: flex; flex-direction: column;
  min-width: 160px; padding: 4px; background: #15171d; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.chat-menu button { text-align: left; padding: 9px 12px 9px 14px; border-radius: 8px; font-weight: 700; font-size: 14px;
  color: var(--ch); position: relative; }
.chat-menu button::before { content: ''; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 3px;
  border-radius: 2px; background: var(--ch); }
.chat-menu button.cur { background: color-mix(in srgb, var(--ch) 14%, transparent); }
.chat-to { flex: 1; min-width: 0; height: 34px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line);
  padding: 0 10px; font-size: 14px; }
.chat-compose-row { display: flex; gap: 6px; }
.chat-input { flex: 1; min-width: 0; height: 42px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line);
  padding: 0 12px; font-size: 15px; }
.chat-send { flex: none; width: 46px; height: 42px; border-radius: 12px; font-size: 18px; color: #1a1205;
  background: linear-gradient(180deg, #e2b65c, #b8893a); }
.chat-send:disabled { opacity: .5; }

/* ---------- counts on tabs and buttons: unread letters, chat lines, answers ---------- */
.count-badge { position: absolute; top: -4px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: #e05252; color: #fff; font: 700 11px/18px Roboto, sans-serif; font-style: normal;
  text-align: center; box-shadow: 0 0 0 2px #101217; box-sizing: border-box; }
.count-badge.only-dot { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 0; right: -2px; }
.count-badge[hidden] { display: none; }
.help-btn { position: relative; }
.help-btn .count-badge { top: -6px; right: -8px; }
.support-item .count-badge, .support-ticket-h .count-badge { position: static; box-shadow: none; margin-left: auto; }

/* ---------- help menu, bug reports and ideas ---------- */
.support-menu { display: flex; flex-direction: column; gap: 8px; }
.support-item { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.support .mode { margin-top: 0; }
.support-body { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.support-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.support-kinds button { padding: 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line);
  font-weight: 700; color: var(--muted); }
.support-kinds button.cur { color: var(--gold); border-color: var(--gold); background: rgba(226, 182, 92, .1); }
.support-text { width: 100%; box-sizing: border-box; border-radius: 12px; background: var(--card2);
  border: 1px solid var(--line); padding: 10px 12px; font-size: 15px; resize: vertical; }
.support-attach { align-self: flex-start; padding: 8px 12px; border-radius: 10px; border: 1px dashed rgba(226, 182, 92, .5);
  color: var(--gold); font-size: 13px; font-weight: 700; }
.support-file { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.support-file:empty { display: none; }
.support-ticket { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px; }
.support-ticket-h { display: flex; align-items: baseline; gap: 8px; }
.support-msg { align-self: flex-start; max-width: 90%; background: var(--card2); border-radius: 12px; padding: 7px 10px;
  font-size: 14px; line-height: 1.35; white-space: pre-wrap; word-break: break-word; }
.support-msg.answer { align-self: flex-end; background: rgba(226, 182, 92, .12); border: 1px solid rgba(226, 182, 92, .35); }
.support-who { color: var(--gold); font-weight: 700; font-size: 12px; margin-bottom: 2px; }
.support-reply summary { color: var(--gold); font-size: 13px; font-weight: 700; cursor: pointer; }
.support-reply[open] { display: flex; flex-direction: column; gap: 8px; }

.guide-steps { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 6px; }
.guide-steps li { counter-increment: step; position: relative; padding: 9px 12px 9px 44px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; font-size: 13px; line-height: 1.4; }
.guide-steps li::before { content: counter(step); position: absolute; left: 12px; top: 8px; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(226, 182, 92, .16); color: var(--gold); font-weight: 800; font-size: 12px;
  display: grid; place-items: center; }

/* ---------- bag: pick several items, delete them ---------- */
.bag-tools { display: flex; gap: 8px; align-items: center; }
.bag-tools .mode { flex: 1; margin-top: 0; }
.bag-pick-btn { flex: none; padding: 9px 14px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line);
  font-weight: 700; font-size: 12px; color: var(--muted); }
.bag-pick-btn.cur { color: var(--gold); border-color: var(--gold); }
.picked { outline: 2px solid var(--danger); outline-offset: -2px; position: relative; }
.it.picked::after, .bag-row.picked::after { content: '✓'; position: absolute; right: 3px; top: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--danger); color: #fff; font: 800 12px/18px Roboto, sans-serif; text-align: center; }
.pick-off { opacity: .35; }
.bag-pickbar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b)); z-index: 31;
  max-width: 560px; margin: 0 auto; display: flex; gap: 8px; align-items: center; padding: 8px 12px;
  background: #15171d; border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(0, 0, 0, .4); }
.bag-pickbar[hidden] { display: none; }
.bag-pickbar span { flex: 1; font-weight: 700; font-size: 14px; }
.bag-pickbar .act { padding: 9px 14px; }
.bag-pickbar .act:disabled { opacity: .45; }

/* character switcher (web/characters.js): shown with more than one character, says what it is */
.char-switch { flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 9px;
  border: 1px solid rgba(226, 182, 92, .45); border-radius: 10px; background: rgba(226, 182, 92, .08); color: var(--gold); line-height: 1.1; }
.char-switch b { font-size: 13px; font-weight: 800; white-space: nowrap; }
.char-switch small { font-size: 10px; color: var(--muted); white-space: nowrap; }
/* account and help: two equal round buttons in one row */
.hdr-btns { display: flex; gap: 6px; }
.hdr-btns .help-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; }
.acc-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.char-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; margin: 0 6px; }
.char-dot.on { background: var(--he); box-shadow: 0 0 6px var(--he); }

/* ---------- Telegram notices: a switch per kind (openNotifySettings) ---------- */
.notify-row { margin-top: 8px; padding: 14px 16px; font-weight: 600; }
.notify-row.on { border-color: rgba(73, 196, 111, .45); }
.notify-set .acts { margin-top: 14px; }

/* the hidden sizes readout of the chat (chatDiag): five quick taps on "Все" */
.chat-diag { position: fixed; left: 4px; top: 4px; z-index: 300; margin: 0; padding: 6px 8px; border-radius: 8px;
  background: rgba(0, 0, 0, .82); color: #8f8; font: 11px/1.35 monospace; pointer-events: none; white-space: pre; }
