/* SROMBot — lapis, brass and silk: the Silk Road's own materials.
   One bold element (the caravan card and its Ruqaa name); everything else quiet. */
@import url("fonts.css");

:root {
  --advice: #e1b85d;
  --lapis-950: #081226;
  --lapis-900: #0c1a33;
  --lapis-800: #13254a;
  --lapis-700: #1c3363;
  --ink: #e9edf6;
  --mist: #93a3c4;
  --dust: #8495b8;
  --brass: #c9a24a;
  --brass-hi: #e6c878;
  --brass-line: rgba(201, 162, 74, 0.22);
  --turquoise: #36b3a8;
  --turquoise-soft: rgba(54, 179, 168, 0.16);
  --silk: #d0503f;
  --silk-soft: rgba(208, 80, 63, 0.16);
  --amber: #e0a33a;

  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --gap: 12px;
  --nav-h: 68px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --text: 15px;
  --small: 13px;
  --tiny: 13px;
  --h2: 19px;
  --display: 34px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--lapis-950); color: var(--ink); }
body {
  font: 400 var(--text)/1.55 "Readex Pro", system-ui, sans-serif;
  min-height: 100vh;
  padding: 0 0 calc(var(--nav-h) + 24px);
  font-variant-numeric: tabular-nums;
  background:
    radial-gradient(120% 50% at 100% -10%, rgba(201, 162, 74, 0.10), transparent 60%),
    radial-gradient(90% 40% at 0% 0%, rgba(54, 179, 168, 0.07), transparent 60%),
    var(--lapis-950);
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  background: linear-gradient(180deg, rgba(8, 18, 38, 0.96), rgba(8, 18, 38, 0.82));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(147, 163, 196, 0.08);
}
.brand { display: inline-flex; align-items: center; gap: 8px; font: 700 26px/1 "Aref Ruqaa", serif; color: var(--brass-hi); letter-spacing: 0.3px; }
.brand img { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.45)); }
.gate-logo { display: block; width: 112px; height: 112px; object-fit: contain; margin: -12px auto -6px; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.38)); }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px; font-size: var(--small);
  background: rgba(147, 163, 196, 0.10); color: var(--mist);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dust); }
.pill.live { background: var(--turquoise-soft); color: #9fe3dc; }
.pill.live::before { background: var(--turquoise); box-shadow: 0 0 0 3px rgba(54, 179, 168, 0.25); }
.pill.warn { background: var(--silk-soft); color: #f2b0a6; }
.pill.warn::before { background: var(--silk); }

main { padding: 16px; display: grid; gap: 18px; max-width: 640px; margin: 0 auto; }
.screen { display: none; gap: 18px; }
.screen.on { display: grid; animation: enter 0.28s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- the caravan card: the one loud thing ---------- */
.caravan {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: 20px 18px 18px;
  background: linear-gradient(160deg, var(--lapis-700), var(--lapis-900) 70%);
  border: 1px solid var(--brass-line);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(230, 200, 120, 0.12);
}
.caravan::after {
  /* a girih star lattice, the tilework of Silk Road caravanserais */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23e6c878' stroke-width='1'%3E%3Cpath d='M28 4l7 17 17 7-17 7-7 17-7-17-17-7 17-7z'/%3E%3Cpath d='M28 14l4 10 10 4-10 4-4 10-4-10-10-4 10-4z'/%3E%3C/g%3E%3C/svg%3E");
}
.caravan .who { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.caravan .name { font: 700 var(--display)/1.1 "Aref Ruqaa", serif; color: var(--brass-hi); }
.caravan .build { color: var(--mist); font-size: var(--small); }
.caravan .doing { margin: 10px 0 16px; font-size: 16px; font-weight: 500; min-height: 1.5em; }
.caravan .doing small { display: block; color: var(--mist); font-weight: 400; font-size: var(--small); margin-top: 2px; }

.vitals { display: grid; gap: 8px; margin-bottom: 16px; }
.bar { height: 8px; border-radius: 999px; background: rgba(8, 18, 38, 0.7); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 0.5s var(--ease); }
.bar.hp > i { background: linear-gradient(90deg, #a8352a, var(--silk)); }
.bar.mp > i { background: linear-gradient(90deg, #2a7fa8, #4fb3de); }
.vital { display: grid; grid-template-columns: 34px 1fr 44px; align-items: center; gap: 8px; font-size: var(--tiny); color: var(--mist); }
/* The buffs on the character, with the game's own icons (the owner, 2026-09-26). */
.buff-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 4px; }
.buff-row:empty { display: none; }
.buff-chip { position: relative; width: 30px; height: 30px; border-radius: 7px; overflow: hidden;
  background: var(--lapis-800); border: 1px solid var(--brass-line); flex: none; }
.buff-chip img { display: block; width: 100%; height: 100%; }
.buff-chip b { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9px; line-height: 12px;
  font-weight: 600; text-align: center; color: #fff; background: rgba(8, 18, 38, 0.72); direction: ltr; }
.buff-chip.ending { border-color: var(--amber); }
.party-buffs { margin-top: 4px; gap: 4px; }
.party-buffs .buff-chip { width: 24px; height: 24px; border-radius: 6px; }
.party-buffs .buff-chip b { font-size: 8px; line-height: 10px; }

.go {
  width: 100%; border: 0; border-radius: var(--r-md); padding: 16px;
  font-weight: 700; font-size: 17px; cursor: pointer;
  background: linear-gradient(180deg, var(--brass-hi), var(--brass));
  color: #20170a; box-shadow: 0 8px 22px -10px rgba(201, 162, 74, 0.8);
  transition: transform 0.12s var(--ease), filter 0.2s;
}
.go:active { transform: scale(0.98); }
.go.stop { background: linear-gradient(180deg, #e0715f, var(--silk)); color: #fff; box-shadow: 0 8px 22px -10px rgba(208, 80, 63, 0.8); }
.go[disabled] { filter: grayscale(0.6) brightness(0.7); }
.go-hint { margin: 8px 2px 0; text-align: center; color: var(--mist); font-size: var(--tiny); }
.why { margin: 10px 0 0; padding: 0; list-style: none; font-size: var(--small); color: #f2b0a6; }
.why li { padding: 3px 0; }

/* ---------- plain surfaces ---------- */
.card { background: var(--lapis-900); border: 1px solid rgba(147, 163, 196, 0.10); border-radius: var(--r-md); padding: 16px; }
.card h2 { margin: 0 0 4px; font-size: var(--h2); font-weight: 600; }
.card .hint { margin: 0 0 12px; color: var(--mist); font-size: var(--small); }
.auction-row { padding: 12px 0; border-bottom: 1px solid rgba(147, 163, 196, 0.15); overflow-wrap: anywhere; }
.auction-row p { margin: 6px 0; font-size: var(--small); }
#auction-items, #auction-bids { max-height: 360px; overflow-y: auto; }
#auction-bids p { font-size: var(--small); overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(147, 163, 196, 0.10); border-radius: var(--r-sm); overflow: hidden; }
.stat { background: var(--lapis-900); padding: 12px 8px; text-align: center; }
.stat b { display: block; font-size: 22px; font-weight: 600; }
.stat span { color: var(--mist); font-size: var(--tiny); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(147, 163, 196, 0.08); }
.row:first-of-type { border-top: 0; }
.row .label { display: grid; }
.row .label small { color: var(--mist); font-size: var(--tiny); }

/* toggle */
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; pointer-events: none; border-radius: 999px; background: rgba(147, 163, 196, 0.25); transition: background 0.2s; }
.switch i::after { content: ""; position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease); }
.switch input:checked + i { background: var(--turquoise); }
.switch input:checked + i::after { transform: translateX(-20px); }

/* segmented choice */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--lapis-950); border-radius: var(--r-sm); }
.seg button { border: 0; border-radius: 8px; padding: 9px 6px; background: none; color: var(--mist); cursor: pointer; font-size: var(--small); }
.seg button.on { background: var(--lapis-700); color: var(--ink); box-shadow: inset 0 0 0 1px var(--brass-line); }

.field { display: grid; gap: 6px; }
.field label { color: var(--mist); font-size: var(--small); }
.input {
  width: 100%; padding: 11px 12px; border-radius: var(--r-sm);
  background: var(--lapis-950); border: 1px solid rgba(147, 163, 196, 0.16); color: var(--ink);
}
.input:focus { border-color: var(--brass); outline: none; }
.picker-select {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 44px; text-align: start; cursor: pointer;
}
.picker-select span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-select b { flex: none; color: var(--brass-hi); font-size: 18px; }
.picker-select[disabled] { opacity: 0.62; cursor: wait; }
.picker-list { display: grid; gap: 6px; margin-top: 12px; }
.picker-option {
  width: 100%; display: grid; gap: 2px; padding: 12px; text-align: start;
  border: 1px solid rgba(147, 163, 196, 0.16); border-radius: var(--r-sm);
  background: var(--lapis-950); color: var(--ink); cursor: pointer;
}
.picker-option small { color: var(--mist); font-size: var(--tiny); }
.picker-option.on { border-color: var(--brass); background: var(--lapis-700); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn {
  border: 1px solid rgba(147, 163, 196, 0.18); background: var(--lapis-800); color: var(--ink);
  border-radius: var(--r-sm); padding: 11px 14px; cursor: pointer; font-weight: 500;
}
.btn.brass { border-color: var(--brass-line); color: var(--brass-hi); }
.btn.danger { color: #f2b0a6; border-color: rgba(208, 80, 63, 0.3); }
.btn:active { transform: scale(0.98); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.actions .btn { flex: 1; }
.btn[disabled], .quick-link[disabled] { opacity: 0.42; cursor: default; filter: grayscale(0.5); }

/* clear first-run progress */
.steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 7px; }
.steps li { display: flex; align-items: center; gap: 10px; color: var(--mist); font-size: var(--small); }
.steps b {
  width: 25px; height: 25px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: var(--lapis-800); border: 1px solid rgba(147, 163, 196, 0.2);
}
.steps li.done { color: #9fe3dc; }
.steps li.done b { color: #071d1b; background: var(--turquoise); border-color: transparent; }
.steps li.done b { font-size: 0; }
.steps li.done b::after { content: "✓"; font-size: 14px; }

/* Trade gets a real workspace, not one button buried in More. */
.card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.state-chip {
  flex: none; padding: 5px 9px; border-radius: 999px; color: var(--mist);
  background: rgba(147, 163, 196, 0.1); font-size: var(--tiny);
}
.state-chip.live { color: #9fe3dc; background: var(--turquoise-soft); }
.status-copy { margin: 8px 0 13px; color: var(--mist); font-size: var(--small); }
.trade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.trade-metric { padding: 11px; border-radius: var(--r-sm); background: var(--lapis-950); }
.trade-metric span { display: block; color: var(--dust); font-size: var(--tiny); }
.trade-metric b { display: block; margin-top: 2px; font-size: 16px; }
.trade-fields { margin: 10px 0; }
.inline-state { margin: 12px 0 0; padding: 9px 11px; border-radius: var(--r-sm); color: var(--mist); background: rgba(147, 163, 196, 0.08); font-size: var(--small); }
.inline-state.live { color: #9fe3dc; background: var(--turquoise-soft); }
/* Goods that will not arrive in the time left, and the nearer cities offered. */
.way-out { margin: 12px 0 0; padding: 11px 12px; border-radius: var(--r-sm); border-inline-start: 3px solid #e0a63a; background: rgba(224, 166, 58, 0.1); }
.way-out-say { margin: 0; color: #f3d9a4; font-size: var(--small); line-height: 1.6; }
.way-out .actions { margin-top: 10px; }
.way-out .hint { margin: 8px 0 0; }
.notice-card { border-color: var(--brass-line); background: linear-gradient(145deg, var(--lapis-900), rgba(201, 162, 74, 0.07)); }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-link {
  min-height: 100px; display: grid; place-items: center; align-content: center; gap: 2px;
  border: 1px solid rgba(147, 163, 196, 0.12); border-radius: var(--r-sm);
  background: var(--lapis-950); color: var(--ink); cursor: pointer;
}
.quick-link span { font-size: 22px; }
.quick-link b { font-size: var(--text); }
.quick-link small { color: var(--mist); font-size: var(--tiny); }
.section-back {
  justify-self: start; border: 0; background: none; color: var(--brass-hi);
  padding: 2px 0; cursor: pointer; font: inherit;
}

/* skills */
.skill { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; padding: 8px 0; }
.skill img, .skill .noicon { width: 40px; height: 40px; border-radius: 9px; background: var(--lapis-800); box-shadow: inset 0 0 0 1px var(--brass-line); }
.skill .meta { display: grid; }
.skill .meta small { color: var(--mist); font-size: var(--tiny); }
.skill .meta small.warn { color: #f2b0a6; }
.jobs-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.jobs-list li { display: grid; padding: 8px 10px; border-radius: 10px; background: var(--lapis-800); box-shadow: inset 0 0 0 1px var(--brass-line); }
.jobs-list li small { color: var(--mist); font-size: var(--tiny); }
.jobs-list li.job-thief { box-shadow: inset 0 0 0 1px #c0564a; }
.jobs-list li.job-thief b { color: #f2b0a6; }
.order { display: flex; gap: 4px; }
.kind-order .kind-ctl { display: flex; align-items: center; gap: 10px; }
.kind-order .order button:disabled { opacity: 0.35; cursor: default; }
.kind-order .row.off .label { color: var(--mist); }
.order button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(147, 163, 196, 0.16); background: var(--lapis-800); color: var(--ink); cursor: pointer; }
.empty { color: var(--mist); font-size: var(--small); padding: 10px 0; }

/* Inventory and beta Tasks are dense data screens: readable rows, not cards
   nested inside cards. */
.inventory-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; }
.inventory-list li { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid rgba(147, 163, 196, 0.08); }
.inventory-list li.empty { display: block; }
.inventory-list .inventory-name { display: grid; min-width: 0; }
.inventory-list .inventory-name b { overflow-wrap: anywhere; }
/* Who hit at the open flower: a name, its counts, and when it was last seen. */
.thieves { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(147, 163, 196, 0.12); }
.thieves h3 { margin: 0; font-size: var(--small); }
.thief-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.thief-list li { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid rgba(147, 163, 196, 0.08); }
.thief-list li.empty { display: block; }
.thief-list li > span { display: grid; min-width: 0; }
.thief-list b { overflow-wrap: anywhere; }
.thief-list small, .thief-list time { color: var(--mist); font-size: var(--tiny); }
/* The game's own picture of an item; an empty tile where it has none. */
.item-icon { display: block; width: 44px; height: 44px; border-radius: 9px; object-fit: contain; background: var(--lapis-800); box-shadow: inset 0 0 0 1px var(--brass-line); }
.inventory-list small { color: var(--mist); font-size: var(--tiny); }
.inventory-kind { padding: 4px 6px; border-radius: 999px; text-align: center; color: #9fe3dc; background: var(--turquoise-soft); font-size: var(--tiny); }
.task-list { display: grid; gap: 16px; margin-top: 14px; }
.task-group h3 { margin: 0 0 5px; color: var(--brass-hi); font-size: var(--small); }
.task-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid rgba(147, 163, 196, 0.08); }
.task-row > div { display: grid; gap: 2px; }
.task-row small { color: var(--mist); font-size: var(--tiny); }
.task-row em { color: #f4b36a; font-size: var(--tiny); font-style: normal; }
.task-row.done em { color: #9fe3dc; }
.task-row .btn { min-width: 62px; }

/* activity */
.feed { list-style: none; margin: 0; padding: 0; font-size: var(--small); }
.feed li { padding: 7px 0; border-top: 1px solid rgba(147, 163, 196, 0.07); color: var(--mist); }
.feed li:first-child { border-top: 0; }
.feed time { color: var(--dust); margin-inline-end: 8px; font-size: var(--tiny); }

/* bottom navigation */
nav.tabs {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 6; height: var(--nav-h);
  /* One column per tab, whatever the count: a sixth tab once pushed
     "More" - and the update button with it - off the screen. */
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: rgba(8, 18, 38, 0.96); backdrop-filter: blur(10px);
  border-top: 1px solid rgba(147, 163, 196, 0.10);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs button { border: 0; background: none; color: var(--dust); display: grid; place-items: center; gap: 2px; font-size: var(--tiny); cursor: pointer; padding-top: 8px; min-width: 0; }
nav.tabs button > :not(svg) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav.tabs svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; }
nav.tabs button.on { color: var(--brass-hi); }

/* sheet (bottom drawer) */
.scrim { position: fixed; inset: 0; background: rgba(4, 9, 20, 0.6); z-index: 8; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 9; max-height: 82vh; overflow: auto;
  background: var(--lapis-900); border-radius: 22px 22px 0 0; padding: 10px 16px 24px;
  border-top: 1px solid var(--brass-line);
  transform: translateY(100%); transition: transform 0.28s var(--ease);
}
.sheet.on { transform: none; }
.pick-title { margin: 0 0 10px; font-size: var(--small); color: var(--dust); }
.pick-list { display: grid; gap: 8px; max-height: 60vh; overflow: auto; }
.pick-list .btn { text-align: right; white-space: normal; }
.pick-list .btn.on { border-color: rgba(212, 175, 95, 0.9); box-shadow: inset 0 0 0 1px rgba(212, 175, 95, 0.6); }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dust) 50%), linear-gradient(135deg, var(--dust) 50%, transparent 50%); background-position: calc(14px) calc(50% - 2px), calc(14px + 6px) calc(50% - 2px); background-size: 6px 6px; background-repeat: no-repeat; }
.sheet .grip { width: 44px; height: 4px; border-radius: 4px; background: rgba(147, 163, 196, 0.3); margin: 4px auto 12px; }

.gate {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  padding: 24px 16px; background: radial-gradient(120% 90% at 50% 0%, #10224a 0%, var(--lapis-900) 60%);
}
.gate[hidden] { display: none; }
.gate-card {
  width: min(460px, 100%); background: var(--lapis-800); border: 1px solid var(--brass-line);
  border-radius: 20px; padding: 22px 18px 18px;
}
.gate-title { font-family: "Aref Ruqaa", serif; color: var(--brass-hi); margin: 0 0 6px; font-size: 1.8rem; }

canvas.map {
  width: 100%; aspect-ratio: 2 / 1; display: block; margin: 10px 0 6px;
  border-radius: 14px; border: 1px solid var(--brass-line); background: rgba(4, 9, 20, 0.6);
  touch-action: none;
}
.pin-card { margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: rgba(229, 72, 77, 0.08); border: 1px solid rgba(229, 72, 77, 0.35); }
.pin-card .pin-where { margin: 0 0 6px; color: var(--mist); font-size: var(--small); }
.map-tools { display: grid; grid-template-columns: 52px 52px 1fr 1fr; gap: 8px; margin-top: 10px; }
.map-tools .btn { padding: 8px 10px; font-size: 18px; }
.map-tools .btn:nth-child(n+3) { font-size: var(--small); }

.toast {
  position: fixed; inset-inline: 16px; bottom: calc(var(--nav-h) + 12px); z-index: 10;
  padding: 12px 14px; border-radius: 12px; background: var(--lapis-700);
  border: 1px solid var(--brass-line); opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s var(--ease); pointer-events: none; font-size: var(--small);
}
.toast.on { opacity: 1; transform: none; }
.toast.bad { border-color: rgba(208, 80, 63, 0.5); }

[hidden] { display: none !important; }

/* inside the floating window over the game */
.bar-end { display: inline-flex; align-items: center; gap: 8px; }
.close {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--brass-line);
  background: var(--lapis-800); color: var(--brass-hi); cursor: pointer; font-size: 15px;
}
body.floating { padding-bottom: calc(var(--nav-h) + 8px); }
body.floating .topbar { padding: 10px 12px 8px; }
body.floating .brand { font-size: 21px; }
body.floating main { padding: 12px; gap: 12px; }
body.floating .caravan .name { font-size: 28px; }
body.floating .only-app { display: none !important; }

.update-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(201, 162, 74, 0.16), rgba(201, 162, 74, 0.08));
  border: 1px solid var(--brass-line); font-size: var(--small);
}

/* Walk script: the maps to continue on, and pins you can tap to open. */
.script-maps { flex-wrap: wrap; }
#script-draft li[data-script-step] { cursor: pointer; }
#script-draft li[data-script-step]:active { background: rgba(122, 72, 210, 0.18); }
/* Editing a script's pins: the selected one, the reorder buttons, the map breaks. */
#script-draft li[data-script-step] { display: flex; align-items: center; gap: 6px; }
#script-draft li[data-script-step] .step { flex: 1; min-width: 0; }
#script-draft li.sel { background: rgba(122, 72, 210, 0.22); border-radius: 8px; padding-inline: 6px; }
#script-draft .step-btn { min-width: 34px; height: 30px; padding: 0 6px; border-radius: 8px; font-size: 14px;
  border: 1px solid var(--brass-line); background: rgba(4, 9, 20, 0.45); color: var(--brass-hi); cursor: pointer; }
#script-draft .step-btn:disabled { opacity: 0.3; cursor: default; }
#script-draft .step-btn.del { color: #ff8f8f; border-color: rgba(229, 72, 77, 0.4); }
#script-draft li.script-map { color: var(--brass-hi); font-weight: 700; padding-top: 10px; cursor: pointer; }
.pin-card.script-sel { background: rgba(122, 72, 210, 0.10); border-color: rgba(122, 72, 210, 0.45); }
.script-box { margin-top: 12px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid rgba(186, 146, 255, 0.35); background: rgba(122, 72, 210, 0.08); }
.script-box h2 { font-size: 1.05em; margin: 0 0 4px; }
.script-box h3 { font-size: 0.95em; margin: 10px 0 4px; }

/* The game's chat. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chip { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line, #26334f); background: transparent; color: inherit; cursor: pointer; }
.chip.on { background: var(--brass, #b8893a); color: #10131c; border-color: transparent; }
.chat-feed { max-height: 60vh; overflow-y: auto; }
.chat-line { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.chat-line small { opacity: 0.75; font-size: 11px; }
.chat-line.ch-1 small { color: #eabf64; }
.chat-line.ch-7 small { color: #55d69a; }
.chat-line.ch-2 small { color: #7fb2ff; }
.chat-line.ch-3 small { color: #ff9ad5; }
.chat-line.ch-4 small, .chat-line.ch-5 small, .chat-line.ch-6 small, .chat-line.ch-12 small { color: #ff8a80; }
.chat-send { display: flex; gap: 6px; margin-top: 10px; }
.chat-send select { flex: 0 0 auto; width: auto; }
.chat-send input { flex: 1 1 auto; min-width: 0; }
.chat-join { margin-top: 4px; font-size: 12px; padding: 4px 10px; }
.team-range { display: flex; align-items: center; gap: 8px; }
.team-range input { width: 76px; text-align: center; }
.team-members li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#team-only { margin-top: 6px; }
.seg.seg-wrap { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); }
.bar.xp > i { background: linear-gradient(90deg, #8a6d2a, var(--brass, #b8893a)); }
.vital.xp-row { grid-template-columns: 62px 1fr 44px; white-space: nowrap; }
.xp-eta { margin: -2px 0 0; font-size: var(--tiny); color: var(--mist); text-align: center; }
.gold-line { margin: 2px 0 0; font-size: var(--small); text-align: center; font-variant-numeric: tabular-nums; }
/* The run's report: this run (or the last) per hour, under the level. */
.rates { margin: 4px 0 0; padding: 6px 8px; border-radius: 8px; background: rgba(184, 137, 58, 0.08); text-align: center; }
.rates-title { margin: 0; font-size: var(--tiny); color: var(--brass, #b8893a); font-weight: 600; }
.rates-line { margin: 2px 0 0; font-size: var(--tiny); color: var(--mist); line-height: 1.5; }

/* The language picker (the sign-in card and More). */
.seg.lang-pick { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.gate .lang-pick { margin-top: 14px; }
/* Left-to-right languages: the switch knob and list text start on the left. */
[dir="ltr"] .switch i::after { right: auto; left: 3px; }
[dir="ltr"] .switch input:checked + i::after { transform: translateX(20px); }
[dir="ltr"] .pick-list .btn { text-align: left; }
[dir="ltr"] .vital.xp-row { grid-template-columns: minmax(62px, auto) 1fr 44px; }
/* Readex Pro is bundled with Latin-1 only: Turkish and Vietnamese letters need the system font. */
html[lang="tr"] body, html[lang="vi"] body { font-family: system-ui, "Roboto", sans-serif; }

/* Two game accounts on one phone: a chip per seat, coloured by its state. */
.seats { display: inline-flex; gap: 4px; margin-inline-end: 6px; }
.seats .seat { border: 1px solid rgba(201, 162, 74, .5); background: rgba(8, 18, 38, .6); color: inherit;
  border-radius: 999px; padding: 2px 10px; font-size: 12px; max-width: 110px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.seats .seat.run { border-color: rgb(201, 162, 74); }
.seats .seat.live { border-color: rgb(54, 179, 168); }
.seats .seat.on { background: rgba(201, 162, 74, .25); font-weight: 600; }

/* ---------- the reorganised screens (the owner, 2026-09-27) ---------- */
/* Whose settings these are, and that a change applies at once. */
.screen-note { margin: -4px 2px 0; display: grid; gap: 2px; color: var(--mist); font-size: var(--tiny); }
.screen-note b { color: var(--brass-hi); font-weight: 600; font-size: var(--small); }
.screen-note b:empty { display: none; }
.field-label { margin: 14px 0 6px; color: var(--mist); font-size: var(--small); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.group-head { margin: 6px 2px -8px; color: var(--dust); font-size: var(--tiny); font-weight: 600; letter-spacing: 0.4px; }
/* Advanced settings fold away; the fold remembers being open. */
details.fold > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  list-style: none; cursor: pointer; font-weight: 600; min-height: 28px;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; flex: none; color: var(--brass-hi); font-size: 20px; line-height: 1; transition: transform 0.2s var(--ease); }
details.fold[open] > summary::after { transform: rotate(45deg); }
details.fold[open] > summary { margin-bottom: 10px; }
details.card.fold > summary { font-size: var(--text); }
.card > details.fold { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(147, 163, 196, 0.08); }
.card > details.fold > summary { color: var(--mist); font-size: var(--small); font-weight: 500; }
/* The small "saved" tick a card shows after a change is kept. */
.card { position: relative; }
.tick {
  position: absolute; top: 10px; inset-inline-end: 12px; z-index: 1;
  padding: 3px 9px; border-radius: 999px; font-size: var(--tiny);
  color: #9fe3dc; background: var(--turquoise-soft);
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity 0.2s, transform 0.2s var(--ease);
}
.tick.on { opacity: 1; transform: none; }
details.card.fold > .tick { top: 14px; inset-inline-end: 44px; }
#radius-chips .chip { min-width: 52px; }

/* Run: what the bot does, one START/STOP, why it stopped, what is missing. */
.mode-label { margin: 0 2px 6px; color: var(--mist); font-size: var(--tiny); }
.seg.modes { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); margin-bottom: 12px; background: rgba(8, 18, 38, 0.55); }
.seg.modes button { line-height: 1.25; }
.items-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: end; margin-bottom: 10px; }
.items-row select { min-width: 0; }
.items-num { display: grid; gap: 2px; font-size: 12px; }
.items-num .input { width: 64px; }
@media (max-width: 380px) { .items-row { grid-template-columns: 1fr 1fr auto; } .items-row select { grid-column: 1 / -1; } }
.uhunt-row .label { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.uhunt-row .label small { flex-basis: 100%; }
.uhunt-moves { display: flex; gap: 6px; flex-shrink: 0; }
.uhunt-moves .btn.small { min-width: 40px; padding: 6px 10px; }
.seg.modes button[disabled] { cursor: default; }
.seg.modes button[disabled]:not(.on) { opacity: 0.45; }
.last-stop { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--silk-soft); }
.last-stop-text { flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: start; color: #f2b0a6; font-size: var(--small); cursor: pointer; }
.last-stop .btn { flex: none; padding: 7px 12px; }
/* Android's "restricted setting" walk-through under the floating-button switch. */
.overlay-guide { display: grid; gap: 8px; margin: 0 0 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--silk-soft); border: 1px solid var(--brass-line); }
.overlay-guide strong { color: #f2b0a6; }
.overlay-guide ol { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: var(--small); line-height: 1.5; }
.overlay-guide small { color: var(--mist); font-size: var(--tiny); }
.overlay-guide .btn { justify-self: start; }
.checklist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.checklist li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(147, 163, 196, 0.08); }
.checklist li:first-child { border-top: 0; }
.checklist li > i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; background: var(--silk-soft); color: #f2b0a6; }
.checklist li > i::after { content: "!"; font-weight: 700; }
.checklist li.optional > i { background: rgba(147, 163, 196, 0.12); color: var(--mist); }
.checklist li.optional > i::after { content: "–"; }
.checklist li.done > i { background: var(--turquoise); color: #071d1b; }
.checklist li.done > i::after { content: "✓"; }
.checklist .label { display: grid; min-width: 0; }
.checklist .label small { color: var(--mist); font-size: var(--tiny); overflow-wrap: anywhere; }
.checklist .btn { padding: 7px 12px; font-size: var(--small); }

/* Sub-tabs at the top of a long screen, each pane a column of cards. The bar
   stays under the top bar while the screen scrolls; wider than the phone, it
   scrolls sideways inside itself and never widens the page. */
.seg.subtabs {
  position: sticky; top: 62px; z-index: 4; box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.8);
  grid-auto-columns: minmax(max-content, 1fr); min-width: 0; max-width: 100%;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
}
.seg.subtabs::-webkit-scrollbar { display: none; }
.seg.subtabs button { white-space: nowrap; }
body.floating .seg.subtabs { top: 54px; }
.pane { display: grid; gap: 18px; }
body.floating .pane { gap: 12px; }
.buff-note { margin-top: 10px !important; }
.rot-list { margin-top: 4px; }
.card > .field, details.fold > .field { margin-top: 12px; }
.card > .field + .hint, details.fold > .field + .hint { margin-top: 6px; }

/* More: a grouped list of doors, each opening its own screen. */
.card.menu { padding: 6px 8px; }
.menu-head { margin: 8px 8px 2px; color: var(--dust); font-size: var(--tiny); font-weight: 600; letter-spacing: 0.4px; }
.menu-item {
  width: 100%; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px;
  padding: 11px 8px; border: 0; border-top: 1px solid rgba(147, 163, 196, 0.08); border-radius: 0;
  background: none; color: var(--ink); cursor: pointer; text-align: start;
}
.menu-head + .menu-item { border-top: 0; }
.menu-item:active { background: rgba(147, 163, 196, 0.08); }
.menu-item::after { content: "‹"; color: var(--brass-hi); font-size: 20px; line-height: 1; }
[dir="ltr"] .menu-item::after { content: "›"; }
.menu-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--lapis-950); font-size: 18px; }
.menu-text { display: grid; min-width: 0; }
.menu-text b { font-weight: 600; }
.menu-text small { color: var(--mist); font-size: var(--tiny); }

/* The run bar, above the tabs on every other screen and in the floating window. */
.runbar {
  position: fixed; inset-inline: 0; bottom: var(--nav-h); z-index: 6;
  display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  background: rgba(19, 37, 74, 0.97); backdrop-filter: blur(10px);
  border-top: 1px solid var(--brass-line);
}
.rb-state { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--ink); padding: 4px 0; cursor: pointer; text-align: start; font-size: var(--small); }
.rb-state span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--dust); }
.dot.live { background: var(--turquoise); box-shadow: 0 0 0 3px rgba(54, 179, 168, 0.25); }
.dot.warn { background: var(--amber); }
.dot.guard { background: #7fa8f5; box-shadow: 0 0 0 3px rgba(127, 168, 245, 0.22); }
.rb-go {
  flex: none; border: 0; border-radius: var(--r-sm); padding: 9px 16px; cursor: pointer; font-weight: 700;
  background: linear-gradient(180deg, var(--brass-hi), var(--brass)); color: #20170a; max-width: 46%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rb-go.stop { background: linear-gradient(180deg, #e0715f, var(--silk)); color: #fff; }
.rb-go[disabled] { filter: grayscale(0.6) brightness(0.7); }
.sheet .hint { margin: 0 0 10px; color: var(--mist); font-size: var(--small); }
.sheet .pick-title { margin: 14px 0 6px; }
body.has-runbar { padding-bottom: calc(var(--nav-h) + 76px); }
body.has-runbar .toast { bottom: calc(var(--nav-h) + 64px); }

/* The floating window is ~367px wide: the top bar keeps the seats and the state
   dot, and drops the brand's words. */
body.floating .brand { font-size: 0; gap: 0; }
body.floating .brand img { width: 30px; height: 30px; }
body.floating .pill { font-size: 0; gap: 0; padding: 7px; }
body.floating .seats .seat { max-width: 92px; padding: 2px 8px; }
body.floating .bar-end { min-width: 0; }
.topbar { gap: 8px; }
.bar-end { min-width: 0; }
.seats { min-width: 0; overflow: hidden; }

/* ---------- short, wide windows: the floating window over the game ----------
   The owner, 2026-09-27: on a phone the window over the game is about 860 x 340;
   the top bar, the run bar and the tabs took half of it and left two lines for
   the screen. There the tabs become a rail on the side, the bars shrink, and
   the cards sit side by side.
   HoudaGamal, 2026-10-01: with the phone's display size set large the window
   was under 640 wide, so none of this applied - tabs at the bottom, one card
   showing. A short window is short whatever its width. */
@media (orientation: landscape) and (max-height: 560px) {
  :root {
  --advice: #e1b85d; --rail-w: 76px; }
  body, body.has-runbar { padding: 0 0 60px; padding-inline-start: var(--rail-w); }
  .topbar { padding: 6px 12px; }
  .brand { font-size: 18px; }
  .brand img, body.floating .brand img { width: 26px; height: 26px; }
  nav.tabs {
    inset-inline-start: 0; inset-inline-end: auto; top: 0; bottom: 0;
    width: var(--rail-w); height: auto;
    grid-auto-flow: row; grid-auto-rows: 1fr; grid-auto-columns: auto;
    border-top: 0; border-inline-end: 1px solid rgba(147, 163, 196, 0.10);
    padding-bottom: 0;
  }
  nav.tabs button { padding-top: 0; }
  .runbar { bottom: 0; inset-inline-start: var(--rail-w); padding: 5px 10px; }
  .rb-go { padding: 7px 14px; }
  body.has-runbar .toast { bottom: 64px; }
  main { max-width: none; padding: 10px 12px; gap: 12px; }
  .screen.on, .pane { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); align-items: start; gap: 12px; }
  .screen.on > .screen-note, .screen.on > .seg.subtabs, .screen.on > .pane { grid-column: 1 / -1; }
  .seg.subtabs, body.floating .seg.subtabs { top: 40px; }
}

/* Shorter still (a large display size on a phone, about 650 x 250): every bar
   thinner, so the screen keeps most of the height. */
@media (orientation: landscape) and (max-height: 340px) {
  :root {
  --advice: #e1b85d; --rail-w: 64px; }
  body, body.has-runbar { padding-bottom: 50px; }
  .topbar, body.floating .topbar { padding: 3px 10px; }
  nav.tabs svg { width: 18px; height: 18px; }
  main, body.floating main { padding: 6px 10px; gap: 8px; }
  .runbar { padding: 3px 8px; }
  .rb-go { padding: 5px 12px; }
  body.has-runbar .toast { bottom: 54px; }
}

/* The pickup filter (the owner, 2026-10-14): kinds, a name search, two lists. */
.loot-kinds .row { padding: 8px 0; }
.loot-found { display: grid; gap: 6px; margin: 8px 0 12px; max-height: 50vh; overflow-y: auto; }
.loot-hit {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: var(--r-sm); background: var(--lapis-950);
}
.loot-hit .label { display: grid; min-width: 0; overflow-wrap: anywhere; }
.loot-hit .label small { color: var(--mist); font-size: var(--tiny); }
.loot-hit .btn { min-height: 44px; padding: 8px 10px; font-size: var(--small); }
.loot-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.loot-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%;
  padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(147, 163, 196, 0.22);
  background: var(--lapis-800); color: var(--ink); font: inherit; font-size: var(--small); cursor: pointer;
}
.loot-chip span { overflow-wrap: anywhere; text-align: start; }
.loot-chip b { color: var(--mist); font-weight: 400; }
.loot-chip:active { transform: scale(0.98); }
@media (max-width: 360px) {
  .loot-hit { grid-template-columns: 1fr 1fr; }
  .loot-hit .label { grid-column: 1 / -1; }
}

/* -- the home minimap (2026-10-17) -------------------------------------- */
.minimap .mm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.minimap .mm-head h2 { margin: 0; }
.mm-zoom { display: inline-flex; background: var(--lapis-950); border: 1px solid var(--brass-line); border-radius: 999px; padding: 3px; gap: 2px; }
.mm-zoom button { border: 0; background: transparent; color: var(--mist); font: 500 var(--tiny) "Readex Pro", system-ui; padding: 5px 11px; border-radius: 999px; cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
.mm-zoom button.on { background: linear-gradient(180deg, var(--brass-hi), var(--brass)); color: var(--lapis-950); font-weight: 600; }
.mm-zoom button:focus-visible { outline: 2px solid var(--turquoise); outline-offset: 2px; }
.mm-summary { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; margin-bottom: 10px; }
.mm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; background: rgba(147, 163, 196, 0.08); border: 1px solid rgba(147, 163, 196, 0.12); font-size: var(--tiny); color: var(--ink); }
.mm-chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.mm-chip.alert { border-color: rgba(255, 77, 109, 0.55); background: rgba(255, 77, 109, 0.12); animation: mm-alert 1.2s ease-in-out infinite; }
@keyframes mm-alert { 50% { background: rgba(255, 77, 109, 0.24); } }
.mm-stage { position: relative; width: min(100%, 380px); margin: 0 auto; aspect-ratio: 1 / 1; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #13254a, #081226 70%); box-shadow: 0 0 0 1px rgba(201, 162, 74, 0.25), 0 14px 40px rgba(0, 0, 0, 0.45), inset 0 0 40px rgba(0, 0, 0, 0.5); }
.mm-stage canvas { width: 100%; height: 100%; display: block; border-radius: 50%; cursor: pointer; touch-action: manipulation; }
.mm-info { margin: 12px auto 0; max-width: 380px; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: var(--r-sm); background: rgba(201, 162, 74, 0.08); border: 1px solid var(--brass-line); }
.mm-info b { font-weight: 600; color: var(--brass-hi); }
.mm-info span { color: var(--mist); font-size: var(--small); }
.mm-legend { margin-top: 12px; font-size: var(--small); color: var(--mist); }
.mm-legend summary { cursor: pointer; color: var(--ink); }
.mm-legend ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.mm-legend li { display: flex; align-items: center; gap: 8px; }
.mm-k { width: 12px; height: 12px; border-radius: 50%; flex: none; display: inline-block; }
.mm-k.self { background: #e6c878; box-shadow: 0 0 6px #e6c878; }
.mm-k.monster { background: #e25c4a; }
.mm-k.target { border: 2px solid #ffd76a; }
.mm-k.player { background: #5aa9ff; border-radius: 2px; transform: rotate(45deg) scale(.8); }
.mm-k.camel { background: #e0a33a; box-shadow: 0 0 0 2px #36d39a; }
.mm-k.thief { border: 2px solid #ff4d6d; }
.mm-k.drop { background: #ffe58a; transform: rotate(45deg) scale(.75); border-radius: 1px; }
.mm-k.route { height: 3px; border-radius: 2px; background: #36b3a8; }
.mm-k.area { border: 2px dashed rgba(201, 162, 74, 0.85); }
.mm-full { display: block; margin: 12px auto 0; }
@media (prefers-reduced-motion: reduce) { .mm-chip.alert { animation: none; } }
.mm-go { margin-top: 8px; align-self: flex-start; }
.mm-tip { margin: 8px 0 4px; color: var(--mist); font-size: var(--tiny); }
.mm-stage canvas { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

.mm-fab { position: absolute; z-index: 2; border: 1px solid var(--brass-line); background: rgba(8, 18, 38, 0.82); color: var(--brass-hi); border-radius: 999px; font: 600 var(--tiny) "Readex Pro", system-ui; padding: 6px 10px; cursor: pointer; backdrop-filter: blur(6px); transition: transform .15s var(--ease), background .2s var(--ease); }
.mm-fab:active { transform: scale(0.94); }
.mm-expand { top: 6%; inset-inline-start: 6%; width: 34px; height: 34px; padding: 0; font-size: 16px; }
.mm-recentre { bottom: 5%; left: 50%; transform: translateX(-50%); animation: mm-in .25s var(--ease); }
.mm-recentre:active { transform: translateX(-50%) scale(0.94); }
@keyframes mm-in { from { opacity: 0; transform: translateX(-50%) translateY(6px); } }
.mm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mm-chip.toggle { cursor: pointer; font: inherit; font-size: var(--tiny); transition: opacity .2s var(--ease), transform .15s var(--ease); }
.mm-chip.toggle:active { transform: scale(0.95); }
.mm-chip.toggle.off { opacity: 0.45; text-decoration: line-through; }
.mm-info { animation: mm-pop .22s var(--ease); }
@keyframes mm-pop { from { opacity: 0; transform: translateY(6px); } }
.minimap.mm-max { position: fixed; inset: 0; z-index: 60; border-radius: 0; overflow: auto; display: flex; flex-direction: column; background: var(--lapis-950); padding: 14px; }
.minimap.mm-max .mm-stage { width: min(96vw, 82vh); }
.minimap.mm-max .mm-info { max-width: min(96vw, 82vh); }
@media (prefers-reduced-motion: reduce) { .mm-info, .mm-recentre { animation: none; } }
.mm-k.flower { background: radial-gradient(circle, #ffe58a 0 30%, #ff78be 32% 60%, rgba(176,108,255,.5) 62%); }
.mm-place { margin: -2px 0 10px; color: var(--brass-hi); font-size: var(--small); font-weight: 500; }

.advisory, .checklist li.advisory small { color: var(--advice); }
.checklist li.advisory > i { color: var(--advice); border-color: var(--advice); }

/* Shared touch targets and the three alert levels. */
.btn, .seg button, .rb-go, .close, .section-back, .step-btn, .mm-fab,
.mm-chip.toggle, .mm-zoom button, .mm-expand, .seats .seat, .order button,
details > summary, .chip { min-height: 44px; min-width: 44px; }
.section-back { display: flex; align-items: center; width: 100%; }
.switch { height: 44px; }
.switch i { top: 8px; bottom: 8px; }
.switch input:focus-visible + i { outline: 2px solid var(--brass-hi); outline-offset: 3px; }
.row > label.label { cursor: pointer; min-height: 44px; align-content: center; flex: 1; }
.go-hint { font-size: var(--small); }
.hint { font-size: max(13px, var(--small)); }
.checklist li.next { outline: 1px solid var(--brass-hi); border-radius: var(--r-sm); }
.checklist #battery-done { grid-column: 3; }
.checklist .game-battery { grid-column: 1 / -1; width: 100%; color: var(--advice); }
.advisory { color: var(--advice); }
.optional { color: var(--mist); }
.stop-summary { text-align: start; width: 100%; white-space: normal; }
.last-stop-text { min-height: 44px; text-decoration: underline; }
html[dir="ltr"] select.input { background-position: right 12px center; padding-right: 34px; padding-left: 12px; }

body:not(.advanced-mode) .advanced-only { display: none; }
.map { aspect-ratio: 1 / 1; height: auto; width: 100%; }
.map-fullscreen { position: fixed; inset: 8px; z-index: 45; margin: 0; overflow: auto; background: var(--lapis-950); }
.map-fullscreen .map { height: min(70vh, 700px); aspect-ratio: auto; }
.setup-wizard { border: 1px solid var(--brass-hi); }
/* The setup wizard: one question a screen, over everything but a sheet. */
.wizard { position: fixed; inset: 0; z-index: 7; display: grid; grid-template-rows: auto 1fr auto; background: var(--lapis-950); }
.wizard[hidden] { display: none; }
.wizard-head { padding: 14px 16px 6px; border-bottom: 1px solid var(--brass-line); }
.wizard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wizard-count { color: var(--dust); font-size: var(--small); }
.wizard-bar { height: 4px; margin: 10px 0; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.wizard-bar i { display: block; height: 100%; width: 0; background: var(--brass-hi); }
.wizard-head h2 { margin: 4px 0; }
.wizard-body { overflow: auto; padding: 12px 16px; display: grid; gap: 10px; align-content: start; }
.wizard-body .row { min-height: 48px; }
.wizard-body .wiz-choice { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--brass-line); border-radius: 14px; }
.wizard-body .wiz-choice:has(input:checked) { border-color: var(--brass-hi); background: rgba(255, 255, 255, 0.04); }
.wizard-body .wiz-choice input { min-width: 24px; min-height: 24px; margin-top: 2px; }
.wizard-body .wiz-choice small, .wizard-body .wiz-more small { display: block; color: var(--mist); font-size: var(--tiny); }
.wizard-body .wiz-more { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid var(--brass-line); border-radius: 14px; }
.wizard-foot { display: flex; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--brass-line); }
.wizard-foot .brass { flex: 1; }
.wizard-foot .btn { white-space: nowrap; }
@media (min-width: 720px) { .wizard-head, .wizard-body, .wizard-foot { width: min(720px, 100%); margin-inline: auto; } }
#monster-table .row { display: grid; grid-template-columns: 1fr minmax(90px, 1fr) auto; }
#monster-table input, [data-skill-pick] { min-height: 44px; min-width: 44px; }
@media (orientation: landscape) and (max-height: 500px) {
  .mm-stage { width: min(100%, 380px, calc(100vh - 110px)); }
  .pill { font-size: 13px; max-width: 180px; }
  .hero { padding: 12px; }
  .go { min-height: 44px; }
}

[data-pane="potions"] .grid2:has(.picker-select) { grid-template-columns: 1fr; }
.picker-select { white-space: normal; height: auto; }
.picker-select span { white-space: normal; overflow: visible; text-overflow: clip; }

.pill.waiting { color: var(--amber, #e8bd73); border-color: #a58548; }
.has-badge::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e8bd73; margin-inline: 5px; }
#rewards-status, #alch-preview, #alch-log, #alch-rates, #quest-now, #tm-needs, #tm-status { white-space: pre-line; }
/* The plus tab: a material's from and to sit side by side, not one under the other. */
#alch-uses select.input { display: inline-block; width: auto; min-width: 84px; margin-inline-start: 6px; }
.screen label[for] { cursor: pointer; }
#toast { bottom: calc(var(--nav-h, 64px) + var(--runbar-h, 64px) + env(safe-area-inset-bottom) + 12px); white-space: pre-line; }
.sheet-body { overscroll-behavior: contain; }

.seat { min-width: 52px; min-height: 44px; max-width: 160px; white-space: normal; }
.seat small { display: block; font-size: 13px; }
.optional-control { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.optional-control input, .row > label > input[type="checkbox"] { width: 24px; height: 24px; margin: 10px; }
.input:disabled { opacity: .5; }
@media (orientation: landscape) and (max-height: 500px) { #trade-live { position: sticky; top: 96px; z-index: 2; } }

.mm-k.npc { background: #ffffff; border-radius: 0; transform: rotate(45deg) scale(.8); }
#trade-live { scroll-margin-top: 10px; }

body.floating .pill { font-size: 13px; gap: 5px; padding: 7px; }
#toast.on { pointer-events: auto; cursor: pointer; }
@media (orientation: landscape) and (max-height: 500px) {
  #toast { inset-inline-start: calc(var(--rail-w, 70px) + 12px); bottom: 64px; }
  #trade-live { max-height: 38vh; overflow-y: auto; }
}

/* What this update brings: shown once per update. */
.whats-new { margin: 8px 0 0; padding-inline-start: 20px; display: grid; gap: 8px; line-height: 1.6; }
.whats-new li::marker { color: var(--brass, currentColor); }
/* Cloud mode: where the bot runs, and how the server's run is doing. */
.cloud-card { border-color: var(--brass-line); }
.cloud-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cloud-head h2 { margin: 0; }
.cloud-line { margin: 6px 0 0; }
.pill.where { color: var(--brass-hi); }

/* The guild board's marks: checked in (turquoise), missing (silk), low (amber). */
.badge { display: inline-block; font-size: var(--small); padding: 2px 8px; border-radius: 999px; margin-inline-start: 4px; white-space: nowrap; }
.badge.ok { background: var(--turquoise-soft); color: #9fe3dc; }
.badge.bad { background: var(--silk-soft); color: #f2b0a6; }
.badge.warn { background: rgba(224, 163, 58, 0.16); color: var(--amber); }
#guild-filter { margin: 10px 0; }

/* The bot log (2026-11-03): each entry marked by what it is. */
.journal { list-style: none; margin: 12px 0 0; padding: 0; }
.journal li { padding: 10px 12px; margin-top: 8px; border-radius: var(--r-sm); background: rgba(147, 163, 196, 0.05); border-inline-start: 3px solid var(--dust); font-size: var(--small); color: var(--mist); }
.journal li time { display: block; color: var(--dust); font-size: var(--tiny); margin-bottom: 2px; }
.journal li b { color: var(--ink); }
.journal li p { margin: 4px 0 0; }
.journal .journal-stop { border-inline-start-color: #f2b0a6; background: var(--silk-soft); }
.journal .journal-start { border-inline-start-color: var(--turquoise); }
.journal .journal-alert { border-inline-start-color: var(--brass); }
.journal .journal-who { color: var(--dust); font-size: var(--tiny); margin-inline-start: 6px; }
.journal .journal-why { color: var(--mist); }
.journal .btn { margin-top: 8px; padding: 7px 12px; }
.journal pre { white-space: pre-wrap; word-break: break-word; }

/* The pocket window's top bar never spills. The owner's phone, 2026-11-13, on
   the cloud: two pills in words ("on the server", "connected to the server")
   and "back to the game" written out in a round button pushed the bar wider
   than the window - the mark slid under the tabs and the words out of the
   button. Here the where-pill is its picture, the state pill is cut to fit,
   and the button is its arrow; the words are all still in the labels. */
body.floating .bar-words { display: none; }
body.floating .topbar { overflow: hidden; }
body.floating .brand { flex: none; }
body.floating .bar-end { flex: 1 1 auto; justify-content: flex-end; }
body.floating .topbar .pill { flex: 0 1 auto; min-width: 0; max-width: 9.5em; white-space: nowrap; overflow: hidden; }
body.floating .topbar .pill::before { flex: none; }
body.floating .topbar .pill.where { flex: none; }
body.floating .topbar .pill.where::before { content: none; }
body.floating .close { flex: none; padding: 0; }

/* ---------------------------------------------------------------- wide screens
   Tablets (a 14-inch one is about 1970 x 1230 here), an opened foldable, the
   floating window on either. The owner, 2026-11-12: the bot was a phone's
   narrow column in the middle of a tablet, two thirds of the screen empty.
   Until now the only side-by-side layout was for a phone held sideways (a
   window no taller than 560); a wide AND tall window got the phone's.

   Nothing here applies under 720 wide or to a window no taller than 560:
   phones, standing or sideways, are exactly as they were. */
@media (min-width: 720px) and (min-height: 561px) {
  /* Cards side by side, as many as fit: two on a small tablet, four on a big one. */
  main { max-width: 1760px; padding: 18px 20px; }
  .screen.on, .pane {
    grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
    align-items: start;
  }
  .screen.on > .screen-note, .screen.on > .seg.subtabs, .screen.on > .pane { grid-column: 1 / -1; }
  /* What slides up from the bottom stays a sheet's width, not the screen's. */
  .sheet { inset-inline: 0; width: min(720px, 100%); margin-inline: auto; border-radius: 22px 22px 0 0; }
  .toast, #toast { inset-inline: 0; width: min(560px, calc(100% - 32px)); margin-inline: auto; }
  .mm-stage { width: min(100%, 460px); }
}

@media (min-width: 900px) and (min-height: 561px) {
  /* Read at arm's length: the words a size up. */
  :root {
    --rail-w: 96px;
    --text: 17px; --small: 15px; --tiny: 14px; --h2: 22px; --display: 40px;
  }
  /* The tabs down the side, where a wide screen has room; the height is the cards'. */
  body, body.has-runbar { padding: 0 0 72px; padding-inline-start: var(--rail-w); }
  nav.tabs {
    inset-inline-start: 0; inset-inline-end: auto; top: 0; bottom: 0;
    width: var(--rail-w); height: auto;
    grid-auto-flow: row; grid-auto-rows: minmax(72px, 110px); grid-auto-columns: auto;
    align-content: center;
    border-top: 0; border-inline-end: 1px solid rgba(147, 163, 196, 0.10);
    padding-bottom: 0;
  }
  nav.tabs button { padding-top: 0; font-size: var(--small); align-content: center; gap: 6px; }
  nav.tabs svg { width: 28px; height: 28px; }
  .runbar { bottom: 0; inset-inline-start: var(--rail-w); padding: 10px 20px; }
  body.has-runbar .toast, body.has-runbar #toast { bottom: 84px; }
  .toast, #toast { bottom: 24px; }
  .sheet { inset-inline-start: var(--rail-w); }
  main { padding: 22px 28px; gap: 20px; }
  .screen.on, .pane { gap: 20px; }
  /* The floating window this big is the whole bot, not its pocket form: the
     name beside the mark and the state in words, as on the full screen. */
  body.floating .brand { font-size: 24px; gap: 8px; }
  body.floating .brand img { width: 34px; height: 34px; }
  body.floating .pill { font-size: var(--small); gap: 6px; padding: 5px 11px; }
  body.floating main { padding: 22px 28px; gap: 20px; }
  body.floating .seats .seat { max-width: 160px; padding: 4px 10px; }
  body.floating .bar-words { display: inline; }
  body.floating .topbar .pill { max-width: none; overflow: visible; }
  body.floating .topbar .pill.where::before { content: ""; }
  /* Back to the game, in words, needs a pill here, not the pocket window's round button. */
  .close { width: auto; height: auto; min-height: 44px; border-radius: 999px; padding: 8px 16px; white-space: nowrap; font-size: var(--small); }
}

/* The language row has its words alone (no picture, no second line): they take
   the picture's place and the words' together, not the picture's 36px alone -
   there they broke into one word a line. */
#more-language > b { grid-column: 1 / span 2; text-align: start; }
