/* Afkalt — panel */

/* The page background (night sky + stars) and the glass cards come from base.css, like the homepage. */
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--grass); color: #0d1f05; }
.skip-link:focus { left: 8px; }

.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.86em; }
.dim { color: var(--dim); }
.block { display: block; }
.link-sm { font-size: 0.82rem; color: var(--diamond); }
.link-sm:hover { text-decoration: underline; }

.pn { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

/* ---------- sidebar ---------- */
.pn-side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px 14px 18px;
  /* Solid enough to read without a backdrop blur (a blur behind the moving stars costs every frame). */
  background: #080b11;
  border-right: 1px solid var(--line);
  z-index: 40;
}
.pn-brand { padding: 0 8px; font-size: 1rem; }
.pn-brand [data-cube] { --s: 28px; }
.pn-nav { display: flex; flex-direction: column; gap: 3px; }
.pn-nav a {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted); font-weight: 500; font-size: 0.92rem;
  transition: background-color 0.15s, color 0.15s;
}
.pn-ico {
  width: 20px; height: 20px; flex-shrink: 0; margin: 0 3px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  color: var(--dim); transition: color 0.15s;
}
.pn-nav a:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.pn-nav a:hover .pn-ico { color: var(--muted); }
.pn-nav a.is-active {
  background: linear-gradient(90deg, rgba(108, 198, 68, 0.16), rgba(108, 198, 68, 0.04));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(108, 198, 68, 0.26);
}
.pn-nav a.is-active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--grass);
}
.pn-nav a.is-active .pn-ico { color: var(--grass); }
.pn-count { margin-left: auto; min-width: 22px; padding: 1px 6px; border-radius: 10px; background: var(--panel-3); font-size: 0.72rem; text-align: center; color: var(--muted); }
.pn-count:empty { display: none; }

.pn-plan {
  margin-top: auto;
  padding: 14px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
}
.pn-plan-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pn-plan-top span { color: var(--muted); }
.pn-plan-bar { height: 6px; border-radius: 999px; overflow: hidden; background: var(--panel-3); }
.pn-plan-bar span { display: block; height: 100%; border-radius: inherit; background: var(--grass); }
.pn-plan small { display: block; margin-top: 6px; color: var(--dim); }
.pn-discord { margin: -10px 0 0; }
.pn-side-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0 8px; font-size: 0.8rem; }
.pn-side-foot a { color: var(--dim); }
.pn-side-foot a:hover { color: var(--text); }

/* ---------- top bar ---------- */
.pn-main { min-width: 0; display: flex; flex-direction: column; }
.pn-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: 66px; padding: 0 28px;
  background: rgba(8, 11, 17, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.pn-top h1 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.pn-top .pn-menu { display: none; }
.preview-chip {
  padding: 3px 9px; border-radius: 999px;
  background: rgba(242, 201, 76, 0.1); color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(242, 201, 76, 0.25);
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.pn-user {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px;
  border: 0; border-radius: 20px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600; font-size: 0.9rem;
}
.pn-user:hover { background: rgba(255, 255, 255, 0.09); }
.pn-user img { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-3); }

.preview-banner {
  display: flex; align-items: center; gap: 14px;
  margin: 20px 28px 0;
  padding: 12px 14px;
  background: rgba(242, 201, 76, 0.07);
  border: 1px solid rgba(242, 201, 76, 0.25);
  border-radius: 12px;
  font-size: 0.88rem; color: var(--muted);
}
.preview-banner[hidden] { display: none; }
.preview-banner [data-cube] { --s: 30px; }
.preview-banner strong { color: var(--text); }
.preview-banner .icon-btn { margin-left: auto; flex-shrink: 0; }

.pn-view { padding: 28px; outline: none; flex: 1; }
.pn-view.view-full { display: flex; flex-direction: column; padding-bottom: 20px; }

/* ---------- common bits ---------- */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; flex-shrink: 0;
  border: 0; border-radius: 8px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 1.05rem; line-height: 1;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
.btn-danger {
  background: rgba(255, 93, 93, 0.1); color: #ff8a8a;
  box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.35);
}
.btn-danger:hover { background: rgba(255, 93, 93, 0.18); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row.center { justify-content: center; }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.view-head h2 { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.03em; }
.view-head p { color: var(--muted); margin-top: 8px; }

.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
/* No backdrop blur on cards: --glass is 94% opaque, so a blur behind it barely shows, but the browser
   would redo it for every card each time the stars behind them move. Only the top bar blurs. */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  background: var(--glass);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.stat:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-card), var(--elev-2); }
.stat strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; letter-spacing: -0.03em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 0.82rem; }

.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
  padding: 56px 24px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed var(--line-2); border-radius: 10px;
}
.empty h3 { font-size: 1.15rem; margin-top: 8px; }
.empty p { color: var(--muted); max-width: 420px; margin-bottom: 8px; }
.empty-sm { padding: 34px 20px; }

.head-ico {
  display: inline-block; flex-shrink: 0;
  background-size: 100% 100%;
  image-rendering: pixelated; image-rendering: crisp-edges;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5), 0 3px 0 rgba(0, 0, 0, 0.35);
}

.status {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 9px 3px 7px; border-radius: 12px;
  font-size: 0.78rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.05); color: var(--muted);
  white-space: nowrap;
}
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-online { color: var(--grass); background: rgba(108, 198, 68, 0.12); }
.status-online i { box-shadow: 0 0 8px var(--grass); }
.status-connecting, .status-reconnecting { color: var(--gold); background: rgba(242, 201, 76, 0.12); }
.status-connecting i, .status-reconnecting i { animation: blink 0.8s steps(2) infinite; }
.status-banned { color: var(--redstone); background: rgba(255, 93, 93, 0.12); cursor: help; }
@keyframes blink { 50% { opacity: 0.2; } }

/* line icons (ui-kit.js icon / badge) */
.ui-ico { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-badge {
  --s: 40px;
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: var(--s); height: var(--s); border-radius: calc(var(--s) * 0.28);
  color: var(--grass); background: rgba(108, 198, 68, 0.12); box-shadow: inset 0 0 0 1px rgba(108, 198, 68, 0.22);
}
.ico-badge .ui-ico { width: calc(var(--s) * 0.5); height: calc(var(--s) * 0.5); }
.ico-blue { color: var(--diamond); background: rgba(79, 224, 213, 0.1); box-shadow: inset 0 0 0 1px rgba(79, 224, 213, 0.22); }
.ico-gold { color: var(--gold); background: rgba(242, 201, 76, 0.1); box-shadow: inset 0 0 0 1px rgba(242, 201, 76, 0.22); }
.ico-red { color: #ff7a7a; background: rgba(255, 93, 93, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.22); }
.ico-grey { color: var(--muted); background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--line); }

.tag { display: inline-block; padding: 2px 7px; border-radius: 3px; background: var(--panel-3); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; }

/* ---------- accounts ---------- */
.acc-list { display: grid; gap: 10px; }
.acc {
  display: grid;
  grid-template-columns: minmax(200px, 1.2fr) minmax(0, 2.4fr) auto;
  align-items: center; gap: 20px;
  padding: 14px 16px;
  background: var(--glass);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.acc:hover { border-color: var(--line-2); box-shadow: 0 18px 40px -26px rgba(0, 0, 0, 0.9); }
.acc-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.acc-names { min-width: 0; }
.acc-names strong, .acc-names span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-names span { color: var(--muted); font-size: 0.84rem; }
.acc-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; min-width: 0; font-size: 0.88rem; }
.acc-meta > div { min-width: 0; }
.acc-meta small { display: block; color: var(--dim); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 3px; }
.acc-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-meta .status { display: inline-flex; }
.acc-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; align-items: center; }
/* DonutSMP stats strip under an account (real bots with saved /stats) */
.acc-donut { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 0.84rem; color: var(--muted); }
.acc-donut small { color: var(--dim); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
.acc-donut b { color: var(--text, inherit); font-weight: 600; }
.acc-donut .btn { margin-left: auto; }

/* ---------- select + bulk actions ---------- */
.acc-check { display: inline-grid; place-items: center; flex-shrink: 0; cursor: pointer; padding: 2px; }
.acc-check input {
  -webkit-appearance: none; appearance: none; margin: 0; cursor: pointer;
  width: 20px; height: 20px; border-radius: 6px;
  background: #0d1220; box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background-color 0.15s, box-shadow 0.15s;
}
.acc-check input:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.acc-check input:checked {
  background: var(--grass) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0e17' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 13px no-repeat;
  box-shadow: none;
}
.acc-check input:focus-visible { outline: 2px solid var(--diamond); outline-offset: 2px; }
.acc-selectable:has(.acc-check input:checked) { border-color: rgba(108, 198, 68, 0.5); box-shadow: inset 0 0 0 1px rgba(108, 198, 68, 0.25); }

.acc-toolbar {
  position: sticky; top: 74px; z-index: 20;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 10px 14px;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.acc-selall { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.88rem; color: var(--muted); font-weight: 500; }
.acc-selall input {
  -webkit-appearance: none; appearance: none; margin: 0; cursor: pointer;
  width: 20px; height: 20px; border-radius: 6px;
  background: #0d1220; box-shadow: inset 0 0 0 1px var(--line-2);
}
.acc-selall input:checked, .acc-selall input:indeterminate {
  background: var(--grass); box-shadow: none;
}
.acc-selall input:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0e17' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E"); background-position: center; background-size: 13px; background-repeat: no-repeat; }
.acc-selall input:indeterminate { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0e17' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E"); background-position: center; background-size: 13px; background-repeat: no-repeat; }
.acc-selall input:focus-visible { outline: 2px solid var(--diamond); outline-offset: 2px; }
.bulk-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-left: auto; }
.bulk-actions[hidden] { display: none; }
.bulk-count { font-size: 0.84rem; font-weight: 600; color: var(--text); }
.bulk-btns { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) {
  .acc-toolbar { top: 66px; }
  .bulk-actions { width: 100%; margin-left: 0; }
}

.srv-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -6px; }
.srv-quick .btn { font-family: var(--font-mono); font-size: 0.78rem; }

/* ---------- trash (deleted accounts) ---------- */
.trash-list { display: grid; gap: 10px; }
.trash-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.trash-info { flex: 1; min-width: 0; }
.trash-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-info span { display: block; font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-acts { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
:is(.pn, .modal, .drawer) :is(input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='search'], select, textarea):not(.mb-input):not(.mb-select):not(.bk-f) {
  width: 100%; min-height: 42px;
  padding: 0 12px;
  background: #0d1220;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  font-size: 0.94rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.modal textarea, .pn textarea { padding: 10px 12px; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.85rem; resize: vertical; }
:is(.pn, .modal, .drawer) select:not(.mb-select):not(.bk-f) { cursor: pointer; }
:is(.pn, .modal, .drawer) :is(input, select, textarea):not(.mb-input):not(.mb-select):not(.bk-f):focus { outline: none; border-color: var(--diamond); box-shadow: 0 0 0 3px rgba(79, 224, 213, 0.16); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--redstone); }
.field-hint { font-size: 0.78rem; color: var(--dim); margin-top: 6px; }
.field-error { font-size: 0.78rem; color: var(--redstone); margin-top: 6px; }
.field-error:empty { display: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 14px 14px 0; margin: 4px 0 0; }
.fieldset legend { padding: 0 6px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.proxy-sub { margin-top: 14px; }
.proxy-sub[hidden] { display: none; }

.radio-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.radio-card {
  position: relative; display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; cursor: pointer;
  background: #0d1220; border: 1px solid var(--line-2); border-radius: 10px;
  font-size: 0.86rem;
}
.radio-card input { position: absolute; opacity: 0; }
.radio-card small { display: block; color: var(--dim); font-size: 0.74rem; }
.radio-dot { flex-shrink: 0; width: 14px; height: 14px; margin-top: 2px; background: var(--panel-3); box-shadow: inset 0 0 0 2px var(--line-2); }
.radio-card:has(input:checked) { border-color: var(--grass); background: rgba(108, 198, 68, 0.07); }
.radio-card input:checked + .radio-dot { background: var(--grass); box-shadow: inset 0 0 0 3px #0d1220; }
.radio-card input:focus-visible + .radio-dot { outline: 2px solid var(--diamond); outline-offset: 2px; }

/* add-account form: numbered steps with big choice cards */
.acc-form { display: grid; gap: 22px; }
.acc-form .field { margin-bottom: 0; }

/* ----- add-account wizard ----- */
.acc-methods { display: grid; gap: 10px; }
.acc-setup { display: grid; gap: 22px; }
.acc-methods[hidden], .acc-setup[hidden] { display: none !important; }
.acc-method {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line-2); color: var(--text);
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}
.acc-method:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(108, 198, 68, 0.5); }
.acc-method:active { transform: translateY(1px); }
.acc-method-ico { flex-shrink: 0; }
.acc-method-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acc-method-body strong { font-size: 0.98rem; }
.acc-method-body small { color: var(--muted); font-size: 0.82rem; }
.acc-method-chev { color: var(--dim); font-size: 1.5rem; line-height: 1; }

.acc-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 18px 8px 6px; }
.acc-done strong { font-size: 1.2rem; }
.acc-done p { color: var(--muted); font-size: 0.9rem; max-width: 440px; margin: 0; }

.acc-sec { display: grid; gap: 12px; }
.acc-sec[hidden], .acc-secure[hidden] { display: none !important; }
.acc-sec-title { display: flex; align-items: center; gap: 8px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.acc-sec-title b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(108, 198, 68, 0.15); color: var(--grass); font-size: 0.72rem; letter-spacing: 0; }
.acc-sec .field-hint[hidden] { display: none; }
.acc-form .proxy-sub:not([hidden]) { display: grid; gap: 12px; margin: 0; }
.acc-form .proxy-sub .grid-2 { gap: 12px 14px; }
.choice-row { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 10px; }
.choice {
  position: relative; display: flex; gap: 12px; align-items: flex-start; min-width: 0;
  padding: 14px 34px 14px 14px; cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)), #0d1220;
  border: 1px solid var(--line-2); border-radius: 10px;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.choice:hover { border-color: rgba(255, 255, 255, 0.2); transform: translateY(-1px); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > [data-cube], .choice > .ico-badge { flex-shrink: 0; }
.choice-body { min-width: 0; }
.choice strong { display: block; font-size: 0.95rem; line-height: 1.25; }
.choice small { display: block; margin-top: 2px; color: var(--dim); font-size: 0.76rem; }
.choice-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.choice-chips span { padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: var(--muted); font-size: 0.7rem; font-weight: 600; }
.choice-row.is-compact .choice { flex-direction: column; gap: 8px; padding: 12px; }
.choice-check { position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-2); transition: background-color 0.15s; }
.choice:has(input:checked) { border-color: var(--grass); background-color: rgba(108, 198, 68, 0.08); box-shadow: 0 0 0 3px rgba(108, 198, 68, 0.12); }
.choice:has(input:checked) .choice-check { box-shadow: none; background: var(--grass) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0e17' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat; }
.choice:has(input:checked) .choice-chips span { background: rgba(108, 198, 68, 0.15); color: #b8f5a0; }
.choice input:focus-visible ~ .choice-check { outline: 2px solid var(--diamond); outline-offset: 2px; }
.acc-secure { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid rgba(79, 224, 213, 0.2); border-radius: 10px; background: rgba(79, 224, 213, 0.06); }
.acc-secure p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.acc-secure strong { color: var(--text); }
.acc-secure .ico-badge { flex-shrink: 0; }
@media (max-width: 640px) {
  .choice-row { grid-template-columns: 1fr; }
  .choice-row.is-compact .choice { flex-direction: row; align-items: center; }
}

.toggles { display: grid; gap: 12px; margin: 6px 0 18px; }
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track {
  position: relative; flex-shrink: 0;
  width: 40px; height: 22px; border-radius: 999px;
  background: var(--panel-3); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background-color 0.15s;
}
.toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #cfd5e3; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s;
}
.toggle input:checked + .toggle-track { background: var(--grass); box-shadow: none; }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); background: #fff; }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--diamond); outline-offset: 2px; }
.toggle-text strong { display: block; font-size: 0.9rem; }
.toggle-text small { color: var(--dim); font-size: 0.78rem; }
.form-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- Microsoft sign-in step (add account) ---------- */
.modal form[hidden], .ms-signin[hidden], .modal-foot .btn[hidden] { display: none; }
.ms-steps { display: grid; gap: 12px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: ms; }
.ms-steps li {
  counter-increment: ms; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px 12px 46px; position: relative;
  background: #0d1220; border: 1px solid var(--line-2); border-radius: 10px; font-size: 0.9rem;
}
.ms-steps li::before {
  content: counter(ms); position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-soft); color: var(--grass); font-weight: 700; font-size: 0.75rem;
}
.ms-code-row { display: flex; align-items: center; gap: 8px; }
.ms-code {
  padding: 6px 12px; background: var(--panel-3); border: 1px dashed var(--line-2);
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 1.25rem; font-weight: 700; letter-spacing: 0.12em; color: var(--text);
  user-select: all;
}
.ms-wait { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.88rem; }
.ms-error { padding: 12px 14px; margin-bottom: 14px; border: 1px solid rgba(255, 93, 93, 0.4); border-left: 3px solid var(--redstone); background: rgba(255, 93, 93, 0.06); border-radius: 10px; }
.ms-error p { margin: 4px 0 0; color: var(--muted); font-size: 0.88rem; }
.spinner { flex-shrink: 0; width: 14px; height: 14px; background: var(--grass); animation: ms-spin 1s steps(4) infinite; }
@keyframes ms-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: 24px 16px;
  background: rgba(4, 6, 12, 0.7);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.18s;
  overflow-y: auto;
}
.modal-backdrop.is-open { opacity: 1; }
/* minmax(0, …): a popup fits the screen; wide content (tabs, tables) scrolls inside it instead of pushing it out. */
.modal-backdrop { grid-template-columns: minmax(0, 1fr); }
.modal { justify-self: center; }
.modal {
  width: 100%; max-width: 560px;
  background: var(--glass);
  border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9);
  transform: translateY(12px) scale(0.98); transition: transform 0.2s cubic-bezier(.2, .8, .2, 1);
}
.modal-backdrop.is-open .modal { transform: none; }
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 780px; }
.modal-head { display: flex; align-items: center; gap: 14px; padding: 20px 22px 0; }
.modal-titles { flex: 1; min-width: 0; }
.modal-titles h2 { font-size: 1.1rem; }
.modal-titles p { color: var(--muted); font-size: 0.86rem; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; }
.modal-body { padding: 20px 22px; }
.modal-text { color: var(--muted); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; }
body.has-modal { overflow: hidden; }

/* ---------- menu + toast ---------- */
.menu {
  position: fixed; z-index: 90; min-width: 190px;
  padding: 6px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 20px 50px -14px rgba(0, 0, 0, 0.8);
}
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; font-size: 0.9rem;
}
.menu-item:hover, .menu-item:focus { background: rgba(255, 255, 255, 0.07); outline: none; }
.menu-item.is-danger { color: var(--redstone); }
.menu-item[disabled] { opacity: 0.4; cursor: not-allowed; }

.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 95; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  max-width: 360px; padding: 11px 14px;
  background: var(--panel-3); border-left: 3px solid var(--diamond); border-radius: 10px;
  box-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.9);
  font-size: 0.9rem;
  transform: translateY(10px); opacity: 0; transition: transform 0.2s, opacity 0.2s;
}
.toast.is-in { transform: none; opacity: 1; }
.toast-ok { border-left-color: var(--grass); }
.toast-warn { border-left-color: var(--gold); }
.toast-error { border-left-color: var(--redstone); }

/* ---------- console drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(4, 6, 12, 0.55); opacity: 0; transition: opacity 0.2s; }
.drawer-scrim.is-open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70;
  width: min(780px, 100%);
  display: flex; flex-direction: column;
  background: #0c101b;
  border-left: 1px solid var(--line-2);
  box-shadow: -40px 0 80px -30px rgba(0, 0, 0, 0.9);
  transform: translateX(100%); transition: transform 0.22s cubic-bezier(.2, .8, .2, 1);
}
.drawer.is-open { transform: none; }
body.has-drawer { overflow: hidden; }
.drawer-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.drawer-titles { flex: 1; min-width: 0; }
.drawer-titles h2 { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.drawer-titles h2 .status { font-family: var(--font-body); font-weight: 600; }
.drawer-titles p { color: var(--muted); font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.console-bar { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.console-group { display: flex; gap: 8px; flex: 1 1 260px; }
.console-group input, .console-group select { min-height: 34px !important; font-size: 0.86rem !important; }
.console-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.chip-btn {
  padding: 5px 10px; border: 0; border-radius: 3px; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); color: var(--muted);
  font-size: 0.78rem; font-weight: 600;
}
.chip-btn:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.console-log { flex: 1; min-height: 0; padding: 14px 18px; background: #070a12; outline: none; }
.console-form { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel); }
.console-prompt { font-family: var(--font-pixel); color: var(--grass); }
.console-input { flex: 1; min-height: 38px !important; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace !important; font-size: 0.88rem !important; }
.console-note { padding: 0 18px 12px; background: var(--panel); color: var(--dim); font-size: 0.74rem; }
/* Bedrock server forms in the console */
.console-mcform { display: flex; flex-direction: column; gap: 10px; max-height: 55%; overflow-y: auto; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.console-mcform[hidden] { display: none; }
.console-mcform-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.console-mcform-head small { display: block; color: var(--dim); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; }
.console-mcform-head strong { color: var(--text); font-size: 0.95rem; }
.console-mcform-body { display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 0.85rem; }
.console-mcform-body p { margin: 0; white-space: pre-wrap; }
.console-mcform-body h4 { margin: 4px 0 0; color: var(--text); font-size: 0.85rem; }
.console-mcform-body hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 2px 0; }
.console-mcform-field { display: flex; flex-direction: column; gap: 4px; }
.console-mcform-field > span { color: var(--text); font-weight: 600; font-size: 0.8rem; }
.console-mcform-field :is(input[type=text], select) { width: 100%; min-height: 36px; }
.console-mcform-toggle { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 0.8rem; cursor: pointer; }
.console-mcform-toggle input { width: 18px; height: 18px; }
.console-mcform-range { display: flex; align-items: center; gap: 10px; }
.console-mcform-range input { flex: 1; }
.console-mcform-range output { min-width: 2.5em; color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.console-mcform-buttons { display: flex; flex-direction: column; gap: 6px; }
.console-mcform-buttons.is-row { flex-direction: row; }
.console-mcform-buttons.is-row .btn { flex: 1; }
.console-mcform-buttons .btn { min-height: 38px; justify-content: center; }
.edition-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px; background: rgba(77, 163, 255, 0.16); color: #8cc4ff; font-size: 0.7rem; font-weight: 700; vertical-align: 1px; }
.edition-tag.token-tag { background: rgba(242, 201, 76, 0.16); color: var(--gold); cursor: help; }

/* MSA refresh-token input in the add/edit account modal */
.acc-token {
  width: 100%;
  padding: 10px 12px; border-radius: 8px;
  background: #0b0f16; color: var(--text);
  border: 1px solid var(--line-2);
  font-family: var(--font-mono); font-size: 0.82rem;
}
.acc-token:focus { outline: none; border-color: var(--grass); }

/* ---------- inspect ---------- */
.tabs-line { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -6px 0 18px; overflow-x: auto; }
.tab-btn {
  padding: 10px 14px; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: 0.9rem; white-space: nowrap;
  box-shadow: inset 0 -2px 0 transparent;
}
.tab-btn:hover { color: var(--text); }
.tab-btn[aria-selected='true'] { color: var(--text); box-shadow: inset 0 -2px 0 var(--grass); }
.inspect-panel { min-height: 280px; }
.donut-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.donut-head .field-hint { margin: 0; flex: 1 1 260px; }
.donut-title { margin: 18px 0 10px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); }
.field-hint.is-error { color: #ff7a7a; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; margin: 0; }
.kv dt { font-size: 0.72rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 3px; }
.kv dd { margin: 0; font-size: 0.92rem; word-break: break-word; }

.hud { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; padding: 16px; margin-bottom: 20px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); border-radius: 6px; }
.hud small { display: block; font-size: 0.72rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.hud-num { display: block; margin-top: 4px; font-size: 0.8rem; color: var(--muted); }
.hud-xp { grid-column: 1 / -1; }
.meter { display: flex; gap: 3px; }
.mi { width: 18px; height: 18px; background: #2a2f40; }
.meter-health .mi {
  clip-path: polygon(11% 0, 44% 0, 44% 11%, 56% 11%, 56% 0, 89% 0, 89% 11%, 100% 11%, 100% 44%, 89% 44%, 89% 56%, 78% 56%, 78% 67%, 67% 67%, 67% 78%, 56% 78%, 56% 89%, 44% 89%, 44% 78%, 33% 78%, 33% 67%, 22% 67%, 22% 56%, 11% 56%, 11% 44%, 0 44%, 0 11%, 11% 11%);
}
.meter-health .mi.full { background: linear-gradient(180deg, #ff6b6b 30%, #d32f2f 30%); }
.meter-health .mi.half { background: linear-gradient(90deg, #e53935 50%, #2a2f40 50%); }
.meter-food .mi { border-radius: 50% 50% 50% 8%; transform: rotate(45deg) scale(0.82); }
.meter-food .mi.full { background: linear-gradient(135deg, #e0a35a 40%, #a8642e 40%); }
.meter-food .mi.half { background: linear-gradient(90deg, #c47f3b 50%, #2a2f40 50%); }
.xp-bar { height: 10px; background: #1a2a12; box-shadow: inset 0 0 0 1px #000; }
.xp-bar span { display: block; height: 100%; background: linear-gradient(180deg, #b8ff6a, #6cc644); }

.inv { display: inline-flex; flex-direction: column; gap: 10px; padding: 14px; background: #1b2030; border-radius: 6px; box-shadow: inset 0 0 0 2px #000, inset 3px 3px 0 #2c3349, inset -3px -3px 0 #10131c; max-width: 100%; }
.inv-grid { display: grid; grid-template-columns: repeat(9, 42px); gap: 4px; }
.inv-hotbar { margin-top: 6px; }
.slot {
  position: relative; width: 42px; height: 42px;
  background: #0f131e;
  box-shadow: inset 2px 2px 0 #070910, inset -2px -2px 0 #2b3249;
  display: grid; place-items: center;
}
.slot.is-selected { box-shadow: 0 0 0 2px #fff, inset 2px 2px 0 #070910, inset -2px -2px 0 #2b3249; }
.item-tex { width: 28px; height: 28px; background-size: 100% 100%; image-rendering: pixelated; image-rendering: crisp-edges; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
.item-glyph {
  width: 28px; height: 28px; display: grid; place-items: center;
  background: var(--c); color: rgba(0, 0, 0, 0.7);
  font-family: var(--font-game); font-size: 0.6rem; font-weight: 700;
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.25), inset 3px 3px 0 rgba(255, 255, 255, 0.3);
}
.slot-count { position: absolute; right: 3px; bottom: 1px; font-family: var(--font-game); font-size: 0.68rem; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }

/* ---------- live view (viewer.js, viewer-ui.js): game-style HUD, chat, menus, overlays ----------
   `.mc-tex` is set when the game's textures are in assets/textures/minecraft/ (sprites come in as
   CSS variables from viewer.js); without it everything uses the drawn fallback below.
   --s is the GUI scale (1-3), like the game's "GUI Scale: Auto". */
.vw { --mc-font: var(--font-body); position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; background: #05070d; }
/* Normal (Inter) text in the game view, slightly heavier so it reads well over the world with the game's drop shadow. */
.vw :is(.vw-chat, .vw-chat-input, .vw-actionbar, .vw-heldname, .vw-status, .vw-hint, .vw-camtag, .mc-dialog-text, .mc-dialog-label, .mc-sidebar, .mc-tab, .mc-boss-title, .mc-effect-time, .mc-button, .mc-title-text, .mc-screen-title, .mc-label) { font-weight: 500; }
.vw :is(.mc-count, .vw-level) { font-weight: 700; }
.vw-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.vw-top .icon-btn { margin-left: auto; }
.vw-form-close { position: absolute; top: 8px; right: 8px; z-index: 2; color: #fff; }
.vw-server, .vw-coords, .vw-fps { color: var(--dim); font-size: 0.78rem; }
.vw-stage { --s: 2; position: relative; flex: 1; min-height: 0; overflow: hidden; user-select: none; }
.vw-canvas { display: block; width: 100%; height: 100%; outline: none; cursor: pointer; }
.vw.is-locked .vw-canvas { cursor: none; }
.vw-cross { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; pointer-events: none; mix-blend-mode: difference; }
.vw-cross::before, .vw-cross::after { content: ''; position: absolute; background: #fff; }
.vw-cross::before { left: 8px; top: 0; width: 2px; height: 18px; }
.vw-cross::after { left: 0; top: 8px; width: 18px; height: 2px; }
.vw.mc-tex .vw-cross { width: 30px; height: 30px; margin: -15px 0 0 -15px; background: var(--tex-cross) 0 0 / 100% 100%; image-rendering: pixelated; }
.vw.mc-tex .vw-cross::before, .vw.mc-tex .vw-cross::after { display: none; }
.vw-status { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); max-width: 90%; padding: 10px 16px; background: rgba(0, 0, 0, 0.6); color: #fff; font-family: var(--mc-font); text-align: center; text-shadow: 2px 2px 0 #3f3f3f; }
.vw-hint { position: absolute; left: 8px; top: 8px; max-width: min(420px, calc(100% - 140px)); padding: 5px 10px; background: rgba(0, 0, 0, 0.5); color: #fff; font-family: var(--mc-font); font-size: 0.8rem; text-align: center; text-shadow: 1px 1px 0 #3f3f3f; pointer-events: none; transition: opacity 0.3s; }
.vw.is-locked .vw-hint, .vw.has-screen .vw-hint { opacity: 0; }
/* ESP switches in the top bar (remembered per browser) */
.vw-esp { display: flex; gap: 6px; }
.vw-esp-btn { padding: 4px 9px; border: 1px solid var(--line); background: transparent; color: var(--dim); font-size: 0.78rem; cursor: pointer; }
.vw-esp-btn:hover { color: var(--text); }
.vw-esp-btn[aria-pressed='true'] { border-color: var(--grass); background: rgba(108, 198, 68, 0.12); color: var(--text); }
.vw-esp-btn[hidden] { display: none; }
.vw-seg { display: flex; }
.vw-seg .vw-esp-btn + .vw-esp-btn { margin-left: -1px; }
/* Minecraft look: asks for the customer's own game textures */
.vw-pack { position: absolute; left: 50%; top: 50%; z-index: 8; width: min(440px, calc(100% - 32px)); transform: translate(-50%, -50%); padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); color: var(--text); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
.vw-pack p { margin: 8px 0; color: var(--dim); font-size: 0.85rem; line-height: 1.45; }
.vw-pack .vw-pack-msg { color: var(--text); min-height: 1.2em; }
.vw-pack-btns { display: flex; gap: 8px; margin-top: 12px; }
/* camera modes: no crosshair in third person / freecam (like the game), and a short note which mode is on */
.vw.is-third .vw-cross { display: none; }
.vw-cross.is-hit { filter: drop-shadow(0 0 0 #ff3030) drop-shadow(0 0 3px #ff3030); mix-blend-mode: normal; }
.vw-cross.is-hit::before, .vw-cross.is-hit::after { background: #ff4040; }
.mc-tip-ench { line-height: 19px; }
.vw-camtag { position: absolute; left: 50%; top: calc(50% + 44px); transform: translateX(-50%); max-width: calc(100% - 32px); padding: 4px 12px; background: rgba(0, 0, 0, 0.55); color: #fff; font-family: var(--mc-font); font-size: 0.85rem; text-align: center; text-shadow: 1px 1px 0 #3f3f3f; pointer-events: none; z-index: 2; }
/* break progress under the crosshair while the attack button is held on a block */
.vw-dig { position: absolute; left: 50%; top: calc(50% + 22px); width: 64px; height: 6px; margin-left: -32px; background: rgba(0, 0, 0, 0.55); pointer-events: none; }
.vw-dig span { display: block; height: 100%; width: 0; background: #fff; }

/* chat: the game's translucent box, white text with a hard shadow */
/* Like the game: the last 10 lines while playing (fading out), up to 20 with a scrollbar while the chat is open */
.vw-chat { position: absolute; left: 6px; bottom: 150px; width: min(500px, calc(100% - 12px)); max-height: min(180px, 40%); overflow: hidden; font-family: var(--mc-font); font-size: 15px; line-height: 18px; pointer-events: none; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.35) transparent; }
.vw.is-chatting .vw-chat { max-height: min(360px, 55%); }
.vw-chat::-webkit-scrollbar { width: 6px; }
.vw-chat::-webkit-scrollbar-track { background: transparent; }
.vw-chat::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.35); }
.vw-chat-line { padding: 0 4px; background: rgba(0, 0, 0, 0.5); color: #fff; text-shadow: 2px 2px 0 #3f3f3f; white-space: pre-wrap; word-break: break-word; transition: opacity 0.6s; }
.vw-chat-line.is-old { opacity: 0; }
/* Resource-pack fonts (viewer-ui.js): each glyph is a 0-high box as wide as its advance, sitting on the
   baseline; the sprite hangs off it (tall glyphs stick out without making the line taller) and is
   tinted by the text colour like the game (multiply, cut to the glyph's shape by the mask). */
.mc-g { display: inline-block; position: relative; height: 0; vertical-align: baseline; }
.mc-g > i {
  position: absolute; left: 0; display: block; pointer-events: none;
  background-repeat: no-repeat; background-color: currentColor; background-blend-mode: multiply;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
.mc-sp { display: inline-block; height: 0; }
.mc-w { white-space: nowrap; } /* glyphs between spaces never break apart */
/* A letter in pack-styled text, as wide as in the game (viewer-ui.js vanillaEl); squeezed from the left when wider. */
/* position: the game paints in string order; positioned like the glyphs, so a pack's panel drawn
   before a letter can't end up on top of it. */
.mc-v { position: relative; display: inline-block; white-space: pre; text-align: left; transform-origin: 0 50%; }
.vw.is-chatting .vw-chat { overflow-y: auto; pointer-events: auto; }
.vw-chat-input { position: absolute; left: 6px; right: 6px; bottom: 6px; width: auto; min-height: 30px !important; padding: 4px 8px !important; border: 0 !important; border-radius: 0 !important; background: rgba(0, 0, 0, 0.6) !important; color: #fff !important; font-family: var(--mc-font) !important; font-size: 15px !important; z-index: 6; }
.vw.is-chatting .vw-hud { opacity: 0.4; }

/* HUD: armor + hearts left, air + hunger right, XP bar, hotbar (182×22 at 2×) */
.vw-hud { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 364px; display: flex; flex-direction: column; align-items: stretch; pointer-events: none; }
.vw-hud button { pointer-events: auto; }
.vw-bars { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 2px; }
.vw-left, .vw-right { display: flex; flex-direction: column; gap: 2px; }
.vw-right { align-items: flex-end; }
.mc-icons { display: flex; gap: 0; }
.mc-icons.rtl { flex-direction: row-reverse; }
.mc-icons i { width: 16px; height: 18px; margin-right: 0; background-size: 18px 18px; background-repeat: no-repeat; image-rendering: pixelated; }
.mc-icons i:last-child { width: 18px; }
.vw-xp { position: relative; height: 10px; margin: 6px 0 2px; background: #000; box-shadow: inset 0 0 0 2px #1d3a0d; }
.vw-xp > span { display: block; height: 100%; background: #80ff20; box-shadow: inset 0 -3px 0 #4caf18; }
.vw.mc-tex .vw-xp { background: var(--tex-xp-bg) 0 0 / 364px 10px; box-shadow: none; image-rendering: pixelated; }
.vw.mc-tex .vw-xp > span { background: var(--tex-xp) 0 0 / 364px 10px; box-shadow: none; image-rendering: pixelated; }
.vw-level { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); font-family: var(--mc-font); font-size: 18px; line-height: 1; color: #80ff20;
  text-shadow: 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000; }
.vw-hotbar-row { position: relative; display: flex; justify-content: center; }
.vw-hotbar { position: relative; display: flex; width: 364px; height: 44px; padding: 2px; background: rgba(20, 20, 20, 0.55); box-shadow: inset 0 0 0 2px #000, inset 0 0 0 4px #7a7a7a; }
.vw-offhand { position: absolute; right: 100%; bottom: 0; width: 58px; height: 48px; margin-right: 10px; display: grid; place-items: center; padding-left: 6px; background: rgba(20, 20, 20, 0.55); box-shadow: inset 0 0 0 2px #000, inset 0 0 0 4px #7a7a7a; }
.vw.mc-tex .vw-offhand { background: var(--tex-offhand) 0 0 / 100% 100%; box-shadow: none; image-rendering: pixelated; }
.vw-offhand[hidden], .vw-tab[hidden] { display: none; }
.vw-hslot { position: relative; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; box-shadow: inset -2px -2px 0 #3a3a3a, inset 2px 2px 0 #9a9a9a; }
.vw-hslot.is-selected { box-shadow: 0 0 0 2px #000, inset 0 0 0 3px #fff, inset 0 0 0 5px #000; z-index: 1; }
.vw.mc-tex .vw-hotbar { padding: 2px 2px; background: var(--tex-hotbar) 0 0 / 364px 44px; box-shadow: none; image-rendering: pixelated; }
.vw.mc-tex .vw-hslot { box-shadow: none; }
.vw.mc-tex .vw-hslot.is-selected::before { content: ''; position: absolute; left: -4px; top: -4px; width: 48px; height: 46px; background: var(--tex-select) 0 0 / 100% 100%; image-rendering: pixelated; pointer-events: none; }
.vw-actionbar, .vw-heldname { align-self: center; margin-bottom: 4px; font-family: var(--mc-font); font-size: 16px; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; opacity: 0; transition: opacity 0.4s; white-space: nowrap; }
.vw-actionbar.is-on, .vw-heldname.is-on { opacity: 1; }

/* item icons (32×32: a 16 px texture at 2×) */
.mc-item { position: relative; width: 32px; height: 32px; display: grid; place-items: center; pointer-events: none; }
.mc-item img { width: 32px; height: 32px; image-rendering: pixelated; }
.mc-item .item-glyph { width: 28px; height: 28px; }
.mc-count { position: absolute; right: -2px; bottom: -4px; font-family: var(--mc-font); font-size: 16px; line-height: 1; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }
.mc-item.is-glint::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(190, 120, 255, 0.55) 50%, transparent 70%) 0 0 / 300% 100%; animation: mc-glint 2.6s linear infinite; mix-blend-mode: screen;
  -webkit-mask: var(--glint-mask, none); pointer-events: none; }
@keyframes mc-glint { to { background-position: -300% 0; } }

/* menus */
.mc-screen-wrap { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(16, 16, 16, 0.55); cursor: default; }
.mc-screen-wrap.mc-dark { background: rgba(16, 16, 16, 0.75); }
.mc-screen { position: relative; padding: 10px 12px 12px; background: #c6c6c6; border-radius: 3px; box-shadow: 0 0 0 2px #000, inset 3px 3px 0 #fff, inset -3px -3px 0 #555; max-width: calc(100% - 16px); max-height: calc(100% - 16px); overflow: auto; }
.mc-screen.is-tex { padding: 0; background: none; box-shadow: none; border-radius: 0; overflow: visible; }
.mc-bg { position: absolute; left: 0; right: 0; top: 0; background-repeat: no-repeat; image-rendering: pixelated; }
.mc-label { position: absolute; font-family: var(--mc-font); font-size: calc(8px * var(--s) + 1px); line-height: 1; color: #404040; white-space: nowrap; pointer-events: none; }
.mc-screen-title { margin: 0 0 4px 2px; font-family: var(--mc-font); font-size: 16px; color: #404040; }
.mc-close { position: absolute; top: 4px; right: 6px; z-index: 2; border: 0; background: none; color: #404040; font-size: 20px; line-height: 1; cursor: pointer; }
.mc-grid { display: grid; grid-template-columns: repeat(9, 36px); }
.mc-gap { height: 8px; }
.mc-armor { display: flex; gap: 0; margin-bottom: 8px; }
.mc-slot { position: relative; width: 36px; height: 36px; padding: 0; border: 0; background: #8b8b8b; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; display: grid; place-items: center; cursor: pointer; }
.mc-slot.is-tex { position: absolute; width: calc(18px * var(--s)); height: calc(18px * var(--s)); background: none; box-shadow: none; }
.mc-slot.is-tex .mc-item, .mc-slot.is-tex .mc-item img { width: calc(16px * var(--s)); height: calc(16px * var(--s)); }
.mc-slot:hover::after { content: ''; position: absolute; inset: 2px; background: rgba(255, 255, 255, 0.45); pointer-events: none; }
.mc-slot.is-tex:hover::after { inset: calc(1px * var(--s)); }
.mc-cursor { position: fixed; z-index: 90; transform: translate(-50%, -50%); pointer-events: none; }
.mc-anvil-text { position: absolute; height: calc(12px * var(--s)); padding: 0 4px !important; min-height: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; color: #fff !important; font-family: var(--mc-font) !important; font-size: calc(8px * var(--s)) !important; text-shadow: 2px 2px 0 #3f3f3f; outline: none; }
.mc-trades { position: absolute; left: calc(4px * var(--s)); top: calc(17px * var(--s)); width: calc(89px * var(--s)); max-height: calc(140px * var(--s)); overflow-y: auto; display: flex; flex-direction: column; }
.mc-trade { display: flex; align-items: center; gap: 2px; height: calc(20px * var(--s)); padding: 0 calc(2px * var(--s)); border: 0; background: #8b8b8b; box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #373737; cursor: pointer; }
.mc-trade:hover { background: #a0a8d8; }
.mc-trade.is-off { opacity: 0.5; }
.mc-trade .mc-item, .mc-trade .mc-item img { width: calc(16px * var(--s)); height: calc(16px * var(--s)); }
.mc-trade-arrow { margin: 0 2px; color: #404040; font-weight: 700; }
/* padding: the purple border is drawn 3px into the box and the text shadow hangs 2px under each line,
   so the last line needs more room below than 4px (it ran into the border). */
.mc-tip { position: fixed; z-index: 95; max-width: 360px; padding: 6px 9px 8px; background: rgba(16, 0, 16, 0.94); box-shadow: inset 0 0 0 2px #2a0a5e, inset 0 0 0 3px #5000aa; font-family: var(--font-body); font-weight: 500; font-size: 14px; line-height: 19px; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; pointer-events: none; }
.mc-tip-name { margin-bottom: 2px; }
.mc-tip-lore { color: #aa00aa; }

/* buttons, sign editor, server dialogs */
.mc-center { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: calc(100% - 24px); max-height: calc(100% - 24px); overflow: auto; padding: 8px; }
.mc-title-text { font-family: var(--mc-font); font-size: 18px; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; text-align: center; }
.mc-button { min-width: 120px; height: 40px; padding: 0 12px; border: 0; background: #6f6f6f; box-shadow: inset 2px 2px 0 #aaa, inset -2px -4px 0 #3a3a3a, 0 0 0 2px #000; color: #fff; font-family: var(--mc-font); font-size: 16px; text-shadow: 2px 2px 0 #3f3f3f; cursor: pointer; }
.mc-button:hover { background: #7a86c4; }
.vw.mc-tex .mc-button { background: none; box-shadow: none; border-style: solid; border-width: 6px; border-image: var(--tex-button) 3 fill / 6px stretch; image-rendering: pixelated; }
.vw.mc-tex .mc-button:hover { border-image: var(--tex-button-hover) 3 fill / 6px stretch; }
.mc-sign { width: 384px; max-width: 100%; padding: 14px 10px; background: #9c7a4e 0 0 / 64px 64px; image-rendering: pixelated; box-shadow: 0 0 0 4px #4a3520; display: flex; flex-direction: column; gap: 4px; }
.mc-sign-line { width: 100%; min-height: 0 !important; height: 28px; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: rgba(0, 0, 0, 0.08) !important; color: #000 !important; text-align: center; font-family: var(--mc-font) !important; font-size: 18px !important; outline: none; }
.mc-sign-line:focus { background: rgba(255, 255, 255, 0.2) !important; }
.mc-dialog { width: min(640px, 100%); }
.mc-dialog-body { display: flex; flex-direction: column; gap: 8px; width: 100%; }
/* Server dialogs (1.21.6+), laid out like the game's dialog screen in GUI pixels (× --s): 1 font pixel =
   --s px = 1/9 em. Packs draw whole menus as a message of exact width, so nothing here may wrap,
   clip or pad differently from the game. */
.mc-dialog-screen { display: grid; grid-template-rows: calc(33px * var(--s)) minmax(0, 1fr) calc(33px * var(--s)); place-items: stretch; font-size: calc(9px * var(--s)); }
.mc-dialog-head, .mc-dialog-foot { display: flex; align-items: center; justify-content: center; min-width: 0; }
.mc-dialog-title { font-family: var(--mc-font); line-height: 1em; color: #fff; white-space: pre; text-shadow: calc(1px * var(--s)) calc(1px * var(--s)) 0 #3f3f3f; }
.mc-dialog-scroll { display: flex; min-height: 0; overflow-x: hidden; overflow-y: auto; }
.mc-dialog-screen .mc-dialog-body { width: auto; margin: auto; padding: calc(4px * var(--s)) 0; gap: calc(4px * var(--s)); align-items: center; }
.mc-dialog-msg { flex: none; font-family: var(--mc-font); line-height: 1em; color: #fff; text-align: center; white-space: pre-wrap; }
.mc-dialog-foot .mc-dialog-buttons { gap: calc(4px * var(--s)); }
.mc-dialog-foot .mc-button { min-width: 0; max-width: calc(100vw - 16px); height: calc(20px * var(--s)); padding: 0; font-size: 1em; line-height: 1em; white-space: pre; overflow: visible; }
.mc-dialog-text { display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--mc-font); font-size: 15px; color: #fff; text-align: center; text-shadow: 2px 2px 0 #3f3f3f; white-space: pre-wrap; }
.mc-dialog-input { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mc-dialog-label { font-family: var(--mc-font); font-size: 15px; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }
.mc-input { width: 400px; max-width: 100%; min-height: 34px !important; border: 2px solid #a0a0a0 !important; border-radius: 0 !important; background: #000 !important; color: #fff !important; font-family: var(--mc-font) !important; font-size: 15px !important; }
.mc-range { display: flex; align-items: center; gap: 8px; color: #fff; font-family: var(--mc-font); }
.mc-dialog-buttons { display: grid; gap: 6px; justify-content: center; }

/* scoreboard sidebar, tab list, boss bars, titles, effects */
.vw-sidebar { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); pointer-events: none; z-index: 1; }
/* The game's sidebar metrics (1 font pixel = 1/9 em, so 15px text = 9px lines): every line exactly one
   9px line tall (empty ones too), the title one line above the first row, 2px padding. Servers like
   HugoSMP draw a frame glyph in the title sized for exactly these lines. */
.mc-sidebar { min-width: 120px; font-family: var(--mc-font); font-size: 15px; line-height: 1em; color: #fff; }
.mc-sidebar-title { height: 1em; padding: 0 0.222em; background: rgba(0, 0, 0, 0.4); text-align: center; white-space: pre; }
.mc-sidebar-row { display: flex; justify-content: space-between; gap: 14px; height: 1em; padding: 0 0.222em; background: rgba(0, 0, 0, 0.3); white-space: pre; }
.mc-sidebar-num { color: #ff5555; }
.vw-tab { position: absolute; left: 50%; top: 20px; transform: translateX(-50%); z-index: 3; max-width: calc(100% - 20px); pointer-events: none; }
.mc-tab { padding: 4px; background: rgba(0, 0, 0, 0.5); font-family: var(--mc-font); font-size: 15px; line-height: 18px; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }
.mc-tab-hf { text-align: center; white-space: pre-wrap; padding: 2px 6px; }
.mc-tab-grid { display: grid; grid-auto-flow: column; gap: 2px; margin: 4px 0; }
.mc-tab-cell { display: flex; justify-content: space-between; gap: 10px; padding: 0 4px; background: rgba(255, 255, 255, 0.12); white-space: nowrap; }
.mc-tab-cell.is-spectator { opacity: 0.6; font-style: italic; }
.mc-ping { width: 20px; height: 14px; align-self: center; background: linear-gradient(to right, #3f3 0 3px, transparent 3px 4px, #3f3 4px 7px, transparent 7px 8px, #3f3 8px 11px, transparent 11px 12px, #3f3 12px 15px, transparent 15px 16px, #3f3 16px 19px, transparent 19px) bottom / 100% 100% no-repeat; clip-path: polygon(0 80%, 100% 0, 100% 100%, 0 100%); }
.mc-ping[data-n='4'] { filter: hue-rotate(-40deg); }
.mc-ping[data-n='3'], .mc-ping[data-n='2'] { filter: hue-rotate(-80deg); }
.mc-ping[data-n='1'], .mc-ping[data-n='0'] { filter: hue-rotate(-120deg); }
.vw-boss { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); z-index: 1; pointer-events: none; }
.mc-bossbars { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mc-boss { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mc-boss-title { font-family: var(--mc-font); font-size: 15px; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; white-space: nowrap; }
.mc-boss-bar { position: relative; width: 364px; height: 10px; background: #3a1a3a; box-shadow: inset 0 0 0 2px #000; }
.mc-boss-bar > span { display: block; height: 100%; background: #e44fe4; }
.mc-boss-bar.is-tex { background-size: 364px 10px; box-shadow: none; image-rendering: pixelated; }
.mc-boss-bar.is-tex > span { background-size: 364px 10px; background-color: transparent; image-rendering: pixelated; }
.mc-boss-bar[data-color='red'] > span { background-color: #e43f3f; }
.mc-boss-bar[data-color='green'] > span { background-color: #3fe43f; }
.mc-boss-bar[data-color='blue'] > span { background-color: #3f8fe4; }
.mc-boss-bar[data-color='yellow'] > span { background-color: #e4e43f; }
.mc-boss-bar[data-color='white'] > span { background-color: #eee; }
.mc-boss-bar.is-tex > span { background-color: transparent !important; }
.vw-title { position: absolute; left: 0; right: 0; top: 30%; z-index: 2; text-align: center; font-family: var(--mc-font); color: #fff; text-shadow: 4px 4px 0 #3f3f3f; opacity: 0; pointer-events: none; }
.vw-title.is-on { opacity: 1; }
.vw-title-main { font-size: 64px; line-height: 1.1; }
.vw-title-sub { font-size: 28px; text-shadow: 2px 2px 0 #3f3f3f; }
.vw-effects { position: absolute; right: 8px; top: 8px; z-index: 1; pointer-events: none; }
.mc-effects { display: flex; gap: 4px; }
.mc-effect-row { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mc-effect { width: 48px; height: 48px; display: grid; place-items: center; background: rgba(0, 0, 0, 0.5); color: #fff; font-family: var(--mc-font); }
.mc-effect.is-tex { background-color: transparent; background-size: 36px 36px, 48px 48px; background-position: center, 0 0; background-repeat: no-repeat; image-rendering: pixelated; }
.mc-effect-time { font-family: var(--mc-font); font-size: 13px; color: #fff; text-shadow: 1px 1px 0 #3f3f3f; }

@media (max-width: 640px) {
  .vw-coords, .vw-fps, .vw-server { display: none; }
  .vw-top { gap: 8px; flex-wrap: wrap; }
  .vw-esp { flex-wrap: wrap; }
  .vw-hud { transform: translateX(-50%) scale(0.8); transform-origin: bottom center; }
  .vw-title-main { font-size: 40px; }
  .mc-grid { grid-template-columns: repeat(9, 30px); }
  .mc-slot { width: 30px; height: 30px; }
}

/* Live view on phones and tablets (viewer.js adds .is-touch): a walk pad on the left, actions on the right. */
.vw.is-touch .vw-canvas { touch-action: none; cursor: default; }
.vw-tpad, .vw-tacts { position: absolute; bottom: 96px; z-index: 6; }
.vw-tpad { left: 12px; display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(2, 52px); gap: 6px; grid-template-areas: '. up .' 'left down right'; }
.vw-tup { grid-area: up; } .vw-tleft { grid-area: left; } .vw-tdown { grid-area: down; } .vw-tright { grid-area: right; }
.vw-tacts { right: 12px; display: grid; grid-template-columns: repeat(2, 62px); gap: 6px; }
.vw-tbtn {
  min-height: 52px; padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 12px;
  background: rgba(10, 14, 24, 0.55); color: #fff;
  font: 700 0.86rem/1 var(--font-body); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.vw-tbtn.is-down, .vw-tbtn[aria-pressed='true'] { background: rgba(108, 198, 68, 0.55); border-color: var(--grass); }
.vw-thit { background: rgba(184, 58, 58, 0.5); }
.vw-tsmall { min-height: 40px; font-size: 0.78rem; }
/* Phone sideways: little height, so the controls sit in the bottom corners beside the hotbar. */
@media (max-height: 520px) { .vw-tpad, .vw-tacts { bottom: 10px; } .vw-tpad { grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(2, 46px); } .vw-tbtn { min-height: 46px; } }

/* ---------- proxies ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--glass); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; padding: 12px 16px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); font-weight: 600; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td small { color: var(--dim); font-size: 0.78rem; }
.td-actions { text-align: right; width: 1%; }

.rent-card { display: flex; align-items: center; gap: 20px; margin-top: 22px; padding: 20px 22px; border-color: rgba(79, 224, 213, 0.3); flex-wrap: wrap; }
.rent-copy { flex: 1 1 260px; }
.rent-copy h3 { font-size: 1rem; }
.rent-copy p { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.rent-buy { display: flex; align-items: center; gap: 14px; }
.rent-buy strong { font-family: var(--font-pixel); color: var(--diamond); min-width: 90px; text-align: right; }
.stepper { display: flex; }
.stepper button { width: 34px; height: 36px; border: 0; cursor: pointer; background: var(--panel-2); color: var(--text); font-size: 1.05rem; box-shadow: inset 0 0 0 1px var(--line-2); }
.stepper button:hover { background: #454d66; }
.stepper input[type='number'] { width: 56px !important; min-height: 36px !important; border: 0 !important; border-radius: 0 !important; text-align: center; padding: 0 !important; font-family: var(--font-pixel); -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- macros ---------- */
.macro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.macro-card { display: flex; flex-direction: column; overflow: hidden; transition: border-color 0.15s, transform 0.15s; }
.macro-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.macro-main { display: block; padding: 18px 18px 14px; flex: 1; }
.macro-main h3 { font-size: 1rem; margin-top: 14px; }
.macro-main p { color: var(--muted); font-size: 0.86rem; margin-top: 6px; }
.macro-preview { display: flex; flex-direction: column; gap: 4px; padding: 12px; min-height: 88px; background: #10162a; border-radius: 4px; }
.macro-preview span { height: 8px; border-radius: 2px; max-width: 80%; opacity: 0.9; }
.macro-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.macro-foot small { flex: 1; color: var(--dim); font-size: 0.76rem; }

.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tpl {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 16px; cursor: pointer;
  background: #0d1220; border: 1px solid var(--line-2); border-radius: 8px;
  transition: border-color 0.15s, transform 0.15s;
}
.tpl:hover, .tpl:focus-visible { border-color: var(--grass); transform: translateY(-2px); }
.tpl .ico-badge { margin-bottom: 6px; }
.tpl span { color: var(--muted); font-size: 0.84rem; }
.tpl small { color: var(--dim); font-size: 0.74rem; margin-top: auto; }

/* ---------- macro builder (macro/builder.js) ---------- */
.mk { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.mk-bar { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.mk-back { flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line-2); border-radius: 8px; color: var(--muted); font-size: 1.05rem; }
.mk-back:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.mk-names { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
/* Repeated classes: beat the panel's general input rule (.pn input…:not()…). */
.pn .mk-names input.mk-name.mk-name.mk-name { min-height: 38px; padding: 0 8px; font: 700 1.25rem/1.2 var(--font-display); letter-spacing: -0.01em; background: transparent; border-color: transparent; border-radius: 7px; }
.pn .mk-names input.mk-desc.mk-desc.mk-desc { min-height: 28px; padding: 0 8px; font-size: 0.84rem; color: var(--muted); background: transparent; border-color: transparent; border-radius: 7px; }
.pn .mk-names input.mk-name.mk-name.mk-name:hover, .pn .mk-names input.mk-desc.mk-desc.mk-desc:hover { border-color: var(--line-2); }
.pn .mk-names input.mk-name.mk-name.mk-name:focus, .pn .mk-names input.mk-desc.mk-desc.mk-desc:focus { background: #0d1220; border-color: var(--diamond); }
.mk-state { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(108, 198, 68, 0.12); color: var(--grass); font-size: 0.76rem; font-weight: 600; white-space: nowrap; }
.mk-state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mk-state.is-dirty { background: rgba(242, 201, 76, 0.12); color: var(--gold); }
.mk-tools { display: flex; align-items: center; gap: 8px; }
.mk-tabs, .mk-dock { display: none; }

.mk-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; align-items: start; }
.mk-side { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 100px); min-height: 0; }
.mk-panel { border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); min-width: 0; }
.mk-panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.mk-panel-head > div { flex: 1; min-width: 0; }
.mk-panel-head h3 { font-size: 0.98rem; }
.mk-panel-head small { display: block; margin-top: 2px; color: var(--dim); font-size: 0.78rem; }
.mk-steps-list { padding: 14px; }
.mk-sum { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.mk-sum > div:last-child { overflow-y: auto; min-height: 0; padding: 14px 16px 16px; }
.mk-test { display: flex; flex-direction: column; flex: none; }
.mk-test .icon-btn { width: 30px; height: 30px; font-size: 0.8rem; }
.mk-logbody { height: 190px; padding: 10px 14px; border-radius: 0 0 12px 12px; background: #070a12; }
.mk-log-empty { color: var(--dim); font-family: var(--font-body); font-size: 0.84rem; line-height: 1.5; white-space: normal; }
.mk-log-empty strong { color: var(--muted); }

/* step cards */
.bk { --bk-gap: 8px; }
.bk-lane { display: flex; flex-direction: column; gap: var(--bk-gap); }
.bk-step { position: relative; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel-2); transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s; }
.bk-step:focus { outline: none; }
.bk-step:focus-visible { box-shadow: 0 0 0 2px var(--c); }
.bk-step::before { content: ''; position: absolute; left: -1px; top: 10px; height: 26px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.bk-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 8px 8px 4px; }
.bk-grip { flex: none; display: grid; place-items: center; width: 26px; height: 36px; border: 0; border-radius: 6px; background: none; color: var(--dim); cursor: grab; touch-action: none; }
.bk-grip:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.bk-svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bk-svg.is-filled { fill: currentColor; stroke: none; }
.bk-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.bk-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 36px; padding: 1px 0; font-size: 0.93rem; line-height: 1.35; }
.bk-txt { color: var(--text); font-weight: 500; }
.bk-hat { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 10%, var(--panel-2)), var(--panel-2) 60%); }
.bk-hat .bk-body::before { content: 'START'; padding: 3px 7px; border-radius: 5px; background: var(--c); color: #1a1205; font: 700 0.66rem/1 var(--font-body); letter-spacing: 0.06em; }
.bk-cap .bk-body::after { content: 'END'; padding: 3px 7px; border-radius: 5px; background: rgba(255, 93, 93, 0.16); color: #ff9090; font: 700 0.66rem/1 var(--font-body); letter-spacing: 0.06em; }

/* fields inside a step: compact pills */
.bk-f { max-width: 100%; min-height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 7px; background: #0b0f19; color: var(--text); font: 600 0.88rem/1.2 var(--font-body); transition: border-color 0.15s, box-shadow 0.15s; }
.bk-f:hover { border-color: rgba(255, 255, 255, 0.22); }
.bk-f:focus { outline: none; border-color: var(--c, var(--diamond)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--diamond)) 22%, transparent); }
.bk-in.is-num { text-align: center; font-variant-numeric: tabular-nums; }
.bk-sel { cursor: pointer; padding-right: 26px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0a9b9' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 12px; }
.bk-sel option { background: #10151d; color: var(--text); }
.pn textarea.bk-area { width: min(100%, 360px); padding: 7px 10px; font: 500 0.88rem/1.4 var(--font-body); resize: vertical; }
.bk-cond, .bk-cond-arg { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; }

.bk-acts { flex: none; display: flex; align-items: center; gap: 2px; }
.bk-act { display: grid; place-items: center; width: 32px; height: 36px; border: 0; border-radius: 7px; background: none; color: var(--dim); cursor: pointer; }
.bk-act:hover, .bk-act:focus-visible { color: var(--text); background: rgba(255, 255, 255, 0.07); outline: none; }
.bk-act-move { opacity: 0; transition: opacity 0.15s; }
.bk-row:hover > .bk-acts .bk-act-move, .bk-step:focus-within > .bk-row .bk-act-move { opacity: 1; }

/* loops and ifs: their inner steps on a coloured rail */
.bk-inner { margin: 0 10px 10px 30px; padding: 4px 0 2px 14px; border-left: 2px solid color-mix(in srgb, var(--c) 55%, transparent); }
.bk-inner .bk-step { background: #191f2b; }
.bk-else { margin: 10px 0 8px -14px; padding: 3px 10px 3px 12px; width: max-content; border-radius: 0 6px 6px 0; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--text); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.02em; }

.bk-add { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 12px; border: 1.5px dashed var(--line-2); border-radius: 10px; background: none; color: var(--muted); font: 600 0.86rem/1.2 var(--font-body); cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.bk-add:hover, .bk-add:focus-visible { border-color: var(--grass); color: var(--grass); background: rgba(108, 198, 68, 0.06); outline: none; }
.bk-add .bk-svg { width: 16px; height: 16px; }
.bk-add-inner { justify-content: flex-start; min-height: 36px; padding: 6px 10px; font-size: 0.8rem; border-color: rgba(255, 255, 255, 0.09); }
.bk-lane-root > .bk-add { min-height: 48px; margin-top: 4px; }

/* inline help on a step */
.bk-step.has-issue { border-color: rgba(242, 201, 76, 0.45); }
.bk-issue { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: -2px 10px 10px 72px; padding: 7px 10px; border-radius: 7px; background: rgba(242, 201, 76, 0.08); color: #f3dc94; font-size: 0.8rem; line-height: 1.4; }
.bk-issue .bk-svg { width: 15px; height: 15px; flex: none; }
.bk-issue span { flex: 1 1 200px; }
.bk-fix { padding: 5px 10px; border: 0; border-radius: 6px; background: var(--gold); color: #1a1405; font: 700 0.76rem/1.2 var(--font-body); cursor: pointer; }
.bk-fix:hover { filter: brightness(1.08); }

/* states: running in the test, just added / jumped to, being dragged */
.bk-step.is-running { border-color: var(--grass); box-shadow: 0 0 0 3px rgba(108, 198, 68, 0.22); }
.bk-step.is-running > .bk-row .bk-ico { background: var(--grass); color: #0b1a05; }
.bk-step.is-flash { animation: bk-flash 1.1s ease-out; }
@keyframes bk-flash { 0% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 70%, transparent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.bk-step.is-dragging { opacity: 0.35; }
.bk-ghost { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; border: 1px solid var(--c); border-radius: 10px; background: var(--panel-3); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6); opacity: 0.95; }
.bk-ghost .bk-acts { display: none; }
.bk-drop { height: 4px; margin: -2px 0; border-radius: 3px; background: var(--grass); box-shadow: 0 0 10px rgba(108, 198, 68, 0.6); }
body.bk-is-dragging, body.bk-is-dragging * { cursor: grabbing !important; user-select: none; }

/* empty macro: starters */
.bk-empty { padding: 18px 8px 8px; text-align: center; }
.bk-empty h3 { font-size: 1.2rem; }
.bk-empty > p { max-width: 520px; margin: 6px auto 0; color: var(--muted); font-size: 0.9rem; }
.bk-starters { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 20px 0 16px; text-align: left; }
.bk-starter { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel-2); color: var(--text); text-align: left; cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.bk-starter:hover, .bk-starter:focus-visible { border-color: var(--c); transform: translateY(-1px); outline: none; }
.bk-starter-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bk-starter-text strong { font-size: 0.92rem; }
.bk-starter-text span { color: var(--muted); font-size: 0.8rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bk-empty-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* "What your bot will do" */
.bk-sum-empty { color: var(--dim); font-size: 0.88rem; line-height: 1.5; }
.bk-checks { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 10px 12px; border-radius: 8px; background: rgba(108, 198, 68, 0.1); color: var(--grass); font-size: 0.84rem; font-weight: 600; }
.bk-checks .bk-svg { width: 17px; height: 17px; flex: none; }
.bk-checks.has-issues { display: block; background: rgba(242, 201, 76, 0.08); color: var(--gold); }
.bk-checks-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bk-check { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid rgba(242, 201, 76, 0.14); }
.bk-check-text { flex: 1 1 180px; padding: 0; border: 0; background: none; color: #f3dc94; font: 500 0.8rem/1.4 var(--font-body); text-align: left; cursor: pointer; }
.bk-check-text:hover { text-decoration: underline; }
.bk-story { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; counter-reset: bk; }
.bk-story .bk-story { margin: 2px 0 4px 9px; padding-left: 12px; border-left: 2px solid var(--line-2); }
.bk-story > li { position: relative; }
.bk-story-line { display: block; width: 100%; padding: 4px 6px 4px 18px; border: 0; border-radius: 6px; background: none; color: var(--text); font: 500 0.86rem/1.45 var(--font-body); text-align: left; cursor: pointer; }
.bk-story-line::before { content: ''; position: absolute; left: 4px; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.bk-story-line:hover { background: rgba(255, 255, 255, 0.05); }
.bk-story-hat > .bk-story-line { color: var(--c); font-weight: 700; }
.bk-story-else { margin: 4px 0 0 9px; color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.bk-story-none { margin: 0 0 4px 21px; color: var(--dim); font-size: 0.8rem; font-style: italic; }

/* "Add a step" picker: a drawer on the right, a bottom sheet on phones */
.bk-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(4, 6, 12, 0.55); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.bk-scrim.is-open { opacity: 1; pointer-events: auto; }
.bk-picker {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91; width: min(440px, 100vw);
  display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line-2); box-shadow: -30px 0 60px -20px rgba(0, 0, 0, 0.8);
  transform: translateX(100%); visibility: hidden; transition: transform 0.24s cubic-bezier(.2, .8, .2, 1), visibility 0s 0.24s;
  color: var(--text); font-family: var(--font-body);
}
.bk-picker.is-open { transform: none; visibility: visible; transition: transform 0.24s cubic-bezier(.2, .8, .2, 1); }
body.bk-picking { overflow: hidden; }
.bk-pk-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 18px 12px; }
.bk-pk-titles { flex: 1; min-width: 0; }
.bk-pk-titles strong { display: block; font: 700 1.15rem/1.2 var(--font-display); }
.bk-pk-where { display: block; margin-top: 3px; color: var(--muted); font-size: 0.8rem; }
.bk-pk-close { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, 0.06); color: var(--text); cursor: pointer; }
.bk-pk-close:hover { background: rgba(255, 255, 255, 0.12); }
.bk-pk-search { display: flex; align-items: center; gap: 8px; margin: 0 18px 10px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px; background: #0b0f19; color: var(--dim); }
.bk-pk-search:focus-within { border-color: var(--diamond); box-shadow: 0 0 0 3px rgba(79, 224, 213, 0.16); }
.bk-pk-search input { flex: 1; min-width: 0; min-height: 42px; border: 0; background: none; color: var(--text); font: 500 0.95rem var(--font-body); outline: none; }
.bk-pk-goals { display: flex; gap: 6px; padding: 0 18px 10px; overflow-x: auto; scrollbar-width: none; }
.bk-pk-goals::-webkit-scrollbar { display: none; }
.bk-pk-goals[hidden] { display: none; }
.bk-pk-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px 6px 9px; border: 1px solid var(--line-2); border-radius: 999px; background: none; color: var(--muted); font: 600 0.78rem/1.2 var(--font-body); white-space: nowrap; cursor: pointer; }
.bk-pk-chip .bk-svg { width: 14px; height: 14px; color: var(--c); }
.bk-pk-chip:hover { color: var(--text); border-color: var(--c); }
.bk-pk-list { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 16px; border-top: 1px solid var(--line); overscroll-behavior: contain; }
.bk-pk-sec { padding-top: 10px; }
.bk-pk-sec-head { display: flex; align-items: baseline; gap: 8px; margin: 4px 6px 6px; }
.bk-pk-sec-head strong { color: var(--c); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.bk-pk-sec-head span { color: var(--dim); font-size: 0.76rem; }
.bk-pk-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px 8px; border: 0; border-radius: 9px; background: none; color: var(--text); text-align: left; cursor: pointer; }
.bk-pk-item:hover, .bk-pk-item:focus-visible { background: rgba(255, 255, 255, 0.06); outline: none; }
.bk-pk-item .bk-ico { width: 32px; height: 32px; }
.bk-pk-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bk-pk-text strong { font-size: 0.9rem; font-weight: 600; line-height: 1.45; }
.bk-pk-text small { color: var(--dim); font-size: 0.78rem; line-height: 1.4; }
.bk-pk-val { display: inline-block; margin: 0 1px; padding: 0 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); color: var(--muted); font-weight: 600; }
.bk-pk-adv-tag { flex: none; margin-top: 4px; padding: 2px 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); color: var(--dim); font-size: 0.66rem; font-style: normal; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.bk-pk-none { padding: 20px 8px; color: var(--muted); font-size: 0.88rem; }
.bk-pk-adv { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.82rem; cursor: pointer; }
.bk-pk-adv input { width: 18px; height: 18px; accent-color: var(--grass); flex: none; }
@media (prefers-reduced-motion: reduce) { .bk-picker, .bk-picker.is-open, .bk-scrim { transition: none; } .bk-step.is-flash { animation: none; } }

/* Build with AI */
.btn-ai { display: inline-flex; align-items: center; gap: 6px; background: rgba(242, 201, 76, 0.14); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(242, 201, 76, 0.45); }
.btn-ai:hover { background: rgba(242, 201, 76, 0.24); }
.btn-ai .ui-ico { width: 15px; height: 15px; }
.ai-box { padding: 16px 18px; border: 1px solid rgba(242, 201, 76, 0.35); border-radius: 10px; background: linear-gradient(180deg, rgba(40, 36, 22, 0.55), rgba(20, 26, 43, 0.96)); }
.ai-box[hidden] { display: none; }
.ai-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ai-head > div { flex: 1; min-width: 0; }
.ai-head strong { display: block; font-size: 1rem; }
.ai-usage { color: var(--dim); font-size: 0.78rem; }
.ai-lead { color: var(--muted); font-size: 0.9rem; margin-bottom: 10px; }
.pn textarea.ai-input { font-family: var(--font-body); font-size: 0.95rem; line-height: 1.45; min-height: 78px; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.ai-chip { padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 14px; background: rgba(255, 255, 255, 0.03); color: var(--muted); font-size: 0.78rem; text-align: left; cursor: pointer; }
.ai-chip:hover { color: var(--text); border-color: var(--gold); }
.ai-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.ai-mode { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.ai-mode input { margin-top: 3px; accent-color: var(--grass); }
.ai-mode strong, .ai-mode small { display: block; }
.ai-mode small { color: var(--dim); font-size: 0.74rem; }
.ai-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.ai-status { color: var(--muted); font-size: 0.84rem; flex: 1; min-width: 200px; }
.ai-card { padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 8px; background: rgba(0, 0, 0, 0.2); }
.ai-card > strong { font-size: 1rem; }
.ai-card p { color: var(--muted); font-size: 0.86rem; margin-top: 4px; }
.ai-card ol { margin: 8px 0 6px; padding-left: 20px; display: grid; gap: 3px; font-size: 0.88rem; }
.ai-card small { color: var(--dim); font-size: 0.76rem; }
.ai-locked { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ai-locked p { flex: 1 1 260px; color: var(--muted); }
.tpl.tpl-ai { border-color: rgba(242, 201, 76, 0.45); background: linear-gradient(180deg, rgba(40, 36, 22, 0.5), rgba(20, 26, 43, 0.9)); }

/* ---------- settings ---------- */
.avatar-lg { width: 64px; height: 64px; border-radius: 50%; background: var(--panel-3); }

/* profile + plan hero */
.set-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px 24px; margin-bottom: 16px; }
.set-hero .avatar-lg { width: 72px; height: 72px; box-shadow: 0 0 0 1px var(--line-2), var(--elev-1); }
.set-hero-id { min-width: 160px; }
.set-hero-id strong { display: block; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.set-hero-id span { display: block; color: var(--muted); font-size: 0.9rem; }
.set-hero-id small { display: block; color: var(--dim); font-size: 0.8rem; margin-top: 3px; }
.set-hero-plan {
  margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  padding: 14px 16px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.02); box-shadow: inset 0 0 0 1px var(--line);
}
.set-plan-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--muted); }
.set-plan-name.is-active { color: var(--grass); }
.set-plan-detail { font-size: 0.82rem; color: var(--muted); }
.set-plan-status { font-size: 0.74rem; color: var(--dim); }
.set-hero-plan .btn { margin-top: 8px; }
@media (max-width: 600px) {
  .set-hero-plan { margin-left: 0; width: 100%; align-items: flex-start; }
  .set-hero-plan .btn { align-self: stretch; }
}

/* setting cards with an icon header */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.set-card { padding: 20px 22px; }
.set-head { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.set-head-t h3 { font-size: 1rem; }
.set-head-t p { color: var(--muted); font-size: 0.82rem; margin-top: 2px; line-height: 1.45; }
.set-body > p { color: var(--muted); font-size: 0.9rem; margin-bottom: 14px; }
.set-card .toggles { margin: 0; }
.set-body .btn-row { margin-bottom: 0; }

/* a label + control row inside a card */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.set-row > span { color: var(--muted); font-size: 0.9rem; }

/* danger zone */
.set-danger {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 16px; padding: 14px 16px;
  border: 1px solid rgba(255, 93, 93, 0.25); border-radius: var(--radius);
  background: rgba(255, 93, 93, 0.05);
}
.set-danger strong { display: block; font-size: 0.9rem; }
.set-danger span { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.set-danger .btn { flex-shrink: 0; }
@media (max-width: 760px) { .settings-grid { grid-template-columns: 1fr; } }

/* ---------- billing ---------- */
.plan-banner p { flex: 1; }
.plan-banner .btn { flex-shrink: 0; }
.bill-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.bill-side { display: grid; gap: 16px; }
.bill-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.bill-line[hidden] { display: none; }
.bill-line strong, .bill-line small { display: block; }
.bill-line small { color: var(--dim); font-size: 0.78rem; margin-top: 2px; }
.bill-total { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 14px 0 4px; border-top: 1px solid var(--line); color: var(--muted); }
.bill-price { font-family: var(--font-pixel); font-size: 1.6rem; color: var(--grass); }
.bill-pick .field-hint { margin-bottom: 14px; }
.bill-pick .bill-pay-hint { margin: 10px 0 0; text-align: center; }
.bill-notice {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px; padding: 14px 16px;
  background: rgba(242, 201, 76, 0.07); border: 1px solid rgba(242, 201, 76, 0.25); border-radius: 6px;
  color: var(--muted); font-size: 0.9rem;
}
.bill-notice.is-ok { background: rgba(108, 198, 68, 0.08); border-color: rgba(108, 198, 68, 0.35); }
.bill-notice strong { color: var(--text); }
.tag-ok { background: rgba(108, 198, 68, 0.15); color: var(--grass); }

/* ---------- on-site crypto checkout ---------- */
.co { min-height: 260px; }
.co-lead { color: var(--muted); font-size: 0.9rem; margin-bottom: 12px; }
.co-promo { display: flex; gap: 8px; }
.co-promo input { flex: 1; min-width: 0; text-transform: uppercase; }
.co .co-promo + .field-hint { margin: 6px 0 14px; min-height: 1em; }
.co [hidden] { display: none !important; }
.co-loading { padding: 80px 0; text-align: center; color: var(--muted); }
.co > input[type='search'] { width: 100%; margin-bottom: 12px; }
.co-coins { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; max-height: 330px; overflow-y: auto; padding: 2px; }
.co-coin {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
  background: var(--panel); color: var(--text); text-align: left;
}
.co-coin:hover { border-color: var(--line-2); background: var(--panel-2); }
.co-coin.is-on { border-color: var(--grass); background: rgba(108, 198, 68, 0.08); }
.co-coin:focus-visible { outline: 2px solid var(--diamond); outline-offset: 1px; }
.co-coin span { min-width: 0; }
.co-coin strong, .co-coin small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-coin small { color: var(--dim); font-size: 0.72rem; }
.co-logo { flex-shrink: 0; border-radius: 50%; }
.co-badge {
  flex-shrink: 0; display: inline-grid; place-items: center; border-radius: 50%;
  background: var(--panel-3); color: var(--gold); font-size: 0.55rem; font-weight: 700; letter-spacing: 0.02em;
}
.co .btn-block { margin-top: 8px; }
/* "How do you want to pay?" */
.co-methods { display: grid; gap: 10px; }
.co-methods[hidden] { display: none; }
.co-method {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer;
  background: var(--panel); color: var(--text); text-align: left;
  transition: border-color 0.15s, background-color 0.15s;
}
.co-method:hover, .co-method:focus-visible { border-color: var(--grass); background: var(--panel-2); outline: none; }
.co-method > span:nth-child(2) { flex: 1; min-width: 0; }
.co-method strong, .co-method small { display: block; }
.co-method small { color: var(--muted); font-size: 0.82rem; margin-top: 3px; line-height: 1.4; }
.co-method-go { color: var(--dim); font-size: 1.2rem; }
.co-back { margin-top: 10px; }
.bill-rent > p { color: var(--muted); font-size: 0.9rem; margin-bottom: 12px; }
.bill-rent .bill-pay-hint { margin: 10px 0 0; text-align: center; }

/* ---------- free trial (Billing card, account form note) ---------- */
.bill-trial { border-color: rgba(108, 198, 68, 0.35); }
.bill-trial[hidden] { display: none; }
.bill-trial .plan-row { margin-bottom: 14px; }
.bill-trial > .field-hint { margin: 10px 0 0; text-align: center; }
.bill-trial .bill-trial-why { margin: 0; padding: 10px 12px; text-align: left; color: var(--text);
  background: rgba(242, 201, 76, 0.07); border: 1px solid rgba(242, 201, 76, 0.25); border-radius: 6px; }
.proxy-trial { display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: rgba(86, 156, 214, 0.08); border: 1px solid rgba(86, 156, 214, 0.3); border-radius: 6px; }
.proxy-trial p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.proxy-trial strong { display: block; color: var(--text); }

.co-pay { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: start; }
.co-qr-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.co-qr-col small { color: var(--dim); font-size: 0.75rem; }
.co-qr { padding: 10px; background: #fff; border-radius: 6px; line-height: 0; }
.co-qr[hidden], .co-qr[hidden] + small { display: none; }
.co-qr img, .co-qr canvas { display: block; }
.co-field { margin-bottom: 14px; }
.co-field > label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.co-value { display: flex; align-items: center; gap: 10px; }
.co-value > :first-child { flex: 1; min-width: 0; }
.co-amount { font-family: var(--font-pixel); font-size: 1.25rem; color: var(--grass); word-break: break-all; }
.co-address {
  display: block; padding: 10px 12px; border-radius: 4px; background: #0d1220; border: 1px solid var(--line);
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.82rem; word-break: break-all; user-select: all;
}
.co-field small { display: block; margin-top: 6px; font-size: 0.78rem; }
.co-memo small { color: var(--gold); }
.co-copy { flex-shrink: 0; }
.co-warn { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 6px; background: rgba(255, 93, 93, 0.08); border: 1px solid rgba(255, 93, 93, 0.25); color: var(--muted); font-size: 0.84rem; }
.co-warn strong { color: var(--text); }
.co-warn-ico { flex-shrink: 0; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--redstone); color: #fff; font-weight: 700; font-size: 0.75rem; }

.co-status { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.co-steps { display: flex; gap: 8px; list-style: none; margin: 0 0 10px; padding: 0; counter-reset: co; }
.co-steps li {
  flex: 1; position: relative; padding: 8px 10px 8px 34px; border-radius: 4px;
  background: var(--panel); border: 1px solid var(--line); color: var(--dim); font-size: 0.82rem; counter-increment: co;
}
.co-steps li::before {
  content: counter(co); position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--panel-3); font-size: 0.68rem;
}
.co-steps li.is-now { color: var(--text); border-color: var(--gold); }
.co-steps li.is-now::before { background: var(--gold); color: #1a1405; animation: blink 1.2s steps(2) infinite; }
.co-steps li.is-done { color: var(--text); border-color: rgba(108, 198, 68, 0.4); }
.co-steps li.is-done::before { content: '✓'; background: var(--grass); color: #0b1406; }
.co-status-text { color: var(--muted); font-size: 0.86rem; }
.co-timer { display: block; margin-top: 6px; color: var(--dim); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.co-timer:empty { display: none; }

.co-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 34px 10px; }
.co-state h3 { font-size: 1.15rem; }
.co-state p { color: var(--muted); max-width: 440px; }

@media (max-width: 640px) {
  .co-pay { grid-template-columns: 1fr; }
  .co-steps { flex-direction: column; }
  .co-coins { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- statistics (owner) ---------- */
.pn-nav a[hidden] { display: none; }
.stat small.st-sub { display: block; margin-top: 2px; color: var(--dim); font-size: 0.74rem; }
.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.st-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.st-card-head h3 { margin-bottom: 0; }
.st-card-head small { color: var(--dim); font-size: 0.78rem; }
.st-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 150px auto auto; column-gap: 10px; }
.st-axis-y { display: flex; flex-direction: column; justify-content: space-between; color: var(--dim); font-size: 0.72rem; text-align: right; font-variant-numeric: tabular-nums; }
.st-plot {
  position: relative; display: flex; align-items: stretch; gap: 2px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(var(--line), var(--line)) top / 100% 1px no-repeat;
}
.st-col { flex: 1; display: flex; align-items: flex-end; min-width: 0; cursor: default; outline: none; }
.st-bar { display: block; width: 100%; background: var(--grass); border-radius: 4px 4px 0 0; transition: filter 0.12s; }
.st-col.is-hover .st-bar, .st-col:focus-visible .st-bar { filter: brightness(1.25); }
.st-col:focus-visible { box-shadow: inset 0 0 0 1px var(--diamond); }
.st-tip {
  position: absolute; top: 4px; transform: translateX(-50%); z-index: 2; pointer-events: none;
  padding: 4px 8px; border-radius: 4px; white-space: nowrap;
  background: #0d1220; border: 1px solid var(--line-2); color: var(--text); font-size: 0.78rem;
}
.st-tip[hidden] { display: none; }
.st-axis-x { grid-column: 2; display: flex; justify-content: space-between; margin-top: 6px; color: var(--dim); font-size: 0.72rem; }
.st-chart .field-hint { grid-column: 2; }
.st-hbars { display: grid; gap: 8px; }
.st-hrow { display: grid; grid-template-columns: minmax(80px, 34%) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 0.86rem; }
.st-hlabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.st-htrack { height: 10px; background: var(--panel-3); border-radius: 0 4px 4px 0; }
.st-htrack span { display: block; height: 100%; background: var(--grass); border-radius: 0 4px 4px 0; }
.st-hval { font-variant-numeric: tabular-nums; font-size: 0.82rem; }
.st-kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.st-kv small, .st-top > small { display: block; color: var(--dim); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 3px; }
.st-kv strong { font-family: var(--font-pixel); font-size: 1.1rem; }
.st-top { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.st-top ol { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: 0.86rem; }
.st-top li small { color: var(--dim); }
.st-top li strong { float: right; font-variant-numeric: tabular-nums; }

.st-wide { grid-column: 1 / -1; }
.st-tabs { display: flex; gap: 4px; margin: -8px 0 20px; border-bottom: 1px solid var(--line); }
.st-tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: 0.9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.st-tabs a:hover { color: var(--text); }
.st-tabs a.is-on { color: var(--text); border-bottom-color: var(--grass); }
.view-head .st-range { width: auto !important; }
.st-stack { display: grid; gap: 8px; }
.st-stack > small { color: var(--dim); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 6px; }
.st-stack > small:first-child { margin-top: 0; }
/* active hours: 7 x 24 cells, one hue whose strength is the share of the busiest hour */
.st-heat-plot { position: relative; display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; }
.st-heat-day { color: var(--dim); font-size: 0.72rem; }
.st-heat-cell { display: block; aspect-ratio: 1; min-height: 10px; border-radius: 2px; outline: none;
  background: linear-gradient(rgba(108, 198, 68, var(--a, 0)), rgba(108, 198, 68, var(--a, 0))), var(--panel-3); }
.st-heat-cell:hover, .st-heat-cell:focus-visible { box-shadow: 0 0 0 1px var(--text); }
.st-heat-hour { color: var(--dim); font-size: 0.66rem; text-align: left; white-space: nowrap; }
.st-heat-plot .st-tip { top: 0; }
.st-heat-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 0.82rem; color: var(--muted); }
.st-heat-legend { display: inline-flex; align-items: center; gap: 4px; color: var(--dim); font-size: 0.74rem; }
.st-heat-legend i { width: 12px; height: 12px; border-radius: 2px; background: linear-gradient(rgba(108, 198, 68, var(--a)), rgba(108, 198, 68, var(--a))), var(--panel-3); }
/* checkout funnel */
.st-funnel { display: grid; gap: 10px; }
.st-frow { display: grid; grid-template-columns: minmax(150px, 26%) minmax(0, 1fr) 80px 110px; align-items: center; gap: 12px; font-size: 0.88rem; }
.st-frow.is-site { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.st-flabel { color: var(--muted); }
.st-fnote { color: var(--dim); font-size: 0.78rem; }
.st-frow .st-htrack { height: 14px; }
.st-frow .st-hval { text-align: right; }
.st-fdrop { color: var(--dim); font-size: 0.78rem; font-variant-numeric: tabular-nums; }

/* ---------- admin ---------- */
.adm-pay { margin-bottom: 20px; }
.adm-tools { display: flex; gap: 10px; margin-bottom: 16px; }
.adm-tools input { flex: 1; min-width: 0; }
.adm-tools select { width: auto !important; flex-shrink: 0; }
.adm-table .adm-tr { cursor: pointer; }
.adm-table .adm-tr:hover td { background: rgba(255, 255, 255, 0.025); }
.adm-table .adm-tr.is-banned { opacity: 0.65; }
.adm-table td { white-space: nowrap; }
.adm-user { display: flex; align-items: center; gap: 10px; }
.adm-avatar { border-radius: 50%; background: var(--panel-3); flex-shrink: 0; }
.adm-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; color: var(--dim); }
.adm-pager small { margin-right: auto; }
.tag-role-admin { background: rgba(79, 224, 213, 0.14); color: var(--diamond); }
.tag-role-owner { background: rgba(242, 201, 76, 0.15); color: var(--gold); }
.tag-bad { background: rgba(255, 93, 93, 0.14); color: #ff7a7a; }
.adm-summary { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.adm-summary span, .adm-summary small { display: block; }
.adm-summary span { margin-top: 6px; }
.adm-summary small { color: var(--dim); font-size: 0.8rem; margin-top: 2px; }
.adm-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.adm-ban-note { margin-bottom: 16px; background: rgba(255, 93, 93, 0.08); border-color: rgba(255, 93, 93, 0.3); }
.adm-h { font-size: 0.9rem; margin: 18px 0 10px; }
.adm-detail .table td { white-space: nowrap; }
.adm-acts { display: grid; gap: 12px; margin-top: 20px; }
.adm-act { padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255, 255, 255, 0.015); }
.adm-act h4 { font-size: 0.86rem; margin-bottom: 10px; }
.adm-act .field { margin-bottom: 10px; }
.adm-act .field[hidden] { display: none; }
.adm-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0 12px; }
.adm-act .field-hint { margin: 0 0 10px; }
.adm-none { margin-top: 18px; }
.adm-payouts .aff-list li { align-items: flex-start; }
.adm-payouts .btn-row { margin-top: 8px; }

/* ---------- admin · Discord ---------- */
.adm-discord { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.adm-discord .dc-announce { grid-column: 1 / -1; }
.dc-body { display: grid; gap: 14px; }
.dc-state { display: flex; align-items: flex-start; gap: 12px; }
.dc-state strong { display: block; font-size: 0.95rem; }
.dc-state small { color: var(--muted); font-size: 0.82rem; }
.dc-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--grey, #8590a8); box-shadow: 0 0 0 3px rgba(133, 144, 168, 0.18); }
.dc-dot.is-on { background: #6cc644; box-shadow: 0 0 0 3px rgba(108, 198, 68, 0.2); }
.dc-dot.is-warn { background: #f2c94c; box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.2); }
.dc-dot.is-off { background: #ff5d5d; box-shadow: 0 0 0 3px rgba(255, 93, 93, 0.2); }
.dc-server { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.015); }
.dc-server strong { display: block; font-size: 0.92rem; }
.dc-server small { color: var(--dim); font-size: 0.8rem; }
.dc-ico { border-radius: 12px; flex-shrink: 0; }
.dc-chanlist { display: grid; gap: 2px; }
.dc-chrow { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.dc-chrow:last-child { border-bottom: 0; }
.dc-chlabel { flex: 1; font-size: 0.86rem; }
.dc-chan { color: var(--diamond); font-size: 0.84rem; font-weight: 600; }
.dc-off { color: var(--dim); font-size: 0.82rem; }
.dc-gone { color: #ff7a7a; font-size: 0.8rem; }
.dc-text { width: 100%; resize: vertical; min-height: 120px; font: inherit; line-height: 1.5; }
.dc-arow { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.dc-ping { width: auto !important; flex-shrink: 0; }
.dc-count { color: var(--dim); margin-left: auto; font-variant-numeric: tabular-nums; }
.dc-announce .btn-row { margin-top: 12px; }

/* invites management */
.dc-invites { grid-column: 1 / -1; }
.dc-invites .field-label { display: block; margin-bottom: 8px; }
.dc-inv-results { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.dc-inv-results:empty { margin: 0; }
.dc-inv-cand { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.02); cursor: pointer; color: inherit; }
.dc-inv-cand:hover { border-color: var(--diamond); }
.dc-inv-cand img, .dc-inv-brow img { border-radius: 50%; flex-shrink: 0; }
.dc-inv-user:empty { display: none; }
.dc-inv-user { margin: 12px 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.015); }
.dc-inv-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dc-inv-head .dc-ico { border-radius: 50%; }
.dc-inv-head strong { display: block; font-size: 0.95rem; }
.dc-inv-head small { color: var(--dim); font-size: 0.8rem; }
.dc-inv-counts { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 14px; }
.dc-inv-stat { display: flex; flex-direction: column; }
.dc-inv-stat strong { font-size: 1.15rem; line-height: 1.1; }
.dc-inv-stat span { color: var(--dim); font-size: 0.74rem; }
.dc-inv-stat.is-green strong { color: #8fe36a; }
.dc-inv-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.dc-inv-amt { width: 5rem; }
.dc-inv-sep { flex: 1; min-width: 8px; }
.dc-inv-h { margin: 18px 0 10px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.dc-inv-blist { display: grid; gap: 4px; }
.dc-inv-brow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 6px 10px; border: 1px solid transparent; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.015); cursor: pointer; color: inherit; font-size: 0.86rem; }
.dc-inv-brow:hover { border-color: var(--line); background: rgba(255, 255, 255, 0.03); }
.dc-inv-rank { color: var(--muted); font-variant-numeric: tabular-nums; width: 2.2rem; }
.dc-inv-bname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-inv-bcount { color: var(--diamond); font-weight: 600; font-variant-numeric: tabular-nums; }
.dc-inv-resetall { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.dc-del { color: #ff8e8e !important; }

/* direct message a member */
.dc-dm { grid-column: 1 / -1; }
.dc-dm .field-label { display: block; margin-bottom: 8px; }
.dc-dm-compose { margin-top: 14px; }
.dc-dm-row { display: flex; align-items: center; gap: 12px; }
.dc-dm-row .field-label { margin-bottom: 0; }
.dc-dm-who { margin: 14px 0 10px; }
.dc-dm-who:empty { display: none; }
.dc-dm-embed { display: grid; gap: 10px; margin: 12px 0; }
.dc-dm-in { width: 100%; }
.dc-dm-color { width: 7rem !important; flex-shrink: 0; }
.dc-dm .dc-text { margin-top: 2px; min-height: 100px; }
.dc-dm .btn-row { margin-top: 12px; }
@media (max-width: 760px) { .adm-discord { grid-template-columns: 1fr; } }

/* ---------- admin · Reminder bot (bot2) ---------- */
.adm-bot2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.adm-bot2 .bot2-wide { grid-column: 1 / -1; }

/* hero / status */
.bot2-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.bot2-hero-main { display: flex; align-items: center; gap: 14px; min-width: 260px; }
.bot2-hero-t h3 { margin: 0; }
.bot2-hero-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bot2-hero-t p { margin: 4px 0 0; font-size: 0.85rem; max-width: 46ch; }
.bot2-tag { color: var(--dim); }
.bot2-pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.bot2-pill.is-green { color: #8fe36a; border-color: rgba(108, 198, 68, 0.4); }
.bot2-pill.is-red { color: #ff8e8e; border-color: rgba(255, 93, 93, 0.4); }
.bot2-pill.is-gold { color: #f2c94c; border-color: rgba(242, 201, 76, 0.4); }
.bot2-pill.is-grey { color: var(--muted); }
.bot2-pill .dc-dot { margin: 0; width: 8px; height: 8px; box-shadow: none; }
.bot2-stats { display: flex; flex-wrap: wrap; gap: 22px; }
.bot2-stat { display: flex; flex-direction: column; }
.bot2-stat strong { font-size: 1.3rem; line-height: 1.1; }
.bot2-stat span { color: var(--dim); font-size: 0.76rem; }

/* forms */
.bot2-toggle { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-weight: 600; cursor: pointer; }
.bot2-toggle input, .bot2-check input { width: 18px; height: 18px; flex-shrink: 0; }
.bot2-check { display: flex; align-items: center; gap: 9px; margin: 12px 0 2px; font-size: 0.86rem; cursor: pointer; }
.adm-bot2 .field-label { display: block; margin: 12px 0 6px; }
.bot2-grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.bot2-token { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; }
.bot2-interval { display: flex; align-items: center; gap: 10px; }
.bot2-interval input { width: 6rem; }
.bot2-gate { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.bot2-gate .bot2-check { align-items: center; flex-wrap: wrap; margin: 0; }
.bot2-gatenum { width: 4.2rem; margin: 0 2px; }
.bot2-pxrow { display: flex; gap: 8px; }
.bot2-pxrow input:first-child { flex: 1; min-width: 0; }
.bot2-pxport { width: 6rem; flex-shrink: 0; }
.bot2-pxtype { width: 100%; }
.bot2-actcount { margin-left: auto; font-size: 0.72rem; font-variant-numeric: tabular-nums; color: var(--muted); background: rgba(255, 255, 255, 0.04); border-radius: 999px; padding: 1px 7px; }
.bot2-actcount.is-ready { color: #8fe36a; background: rgba(108, 198, 68, 0.14); }

/* channel picker */
.bot2-pickerbar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.bot2-search { flex: 1; min-width: 200px; }
.bot2-selcount { color: var(--diamond); font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.bot2-guilds { display: grid; gap: 8px; margin: 8px 0 4px; max-height: 460px; overflow-y: auto; padding-right: 4px; }
.bot2-guild { border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.015); overflow: hidden; }
.bot2-guild > summary { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; font-size: 0.88rem; list-style: none; }
.bot2-guild > summary::-webkit-details-marker { display: none; }
.bot2-guild > summary::before { content: "▸"; color: var(--muted); font-size: 0.8rem; transition: transform 0.12s; }
.bot2-guild[open] > summary::before { transform: rotate(90deg); }
.bot2-gmeta { margin-left: auto; color: var(--dim); font-size: 0.76rem; white-space: nowrap; }
.bot2-gcount { color: var(--diamond); font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
.bot2-guild .dc-ico { border-radius: 6px; }
.bot2-chans { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; padding: 2px 12px 12px; max-height: 320px; overflow-y: auto; }
.bot2-chan { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 0.84rem; cursor: pointer; }
.bot2-chan[hidden] { display: none; }
.bot2-chan input { width: 15px; height: 15px; flex-shrink: 0; }
.bot2-chan span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot2-nochan { grid-column: 1 / -1; margin: 0; }
.bot2-actions { margin-top: 12px; }

/* activity log */
.bot2-log { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; }
.bot2-logrow { display: flex; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 0.82rem; }
.bot2-logrow:last-child { border-bottom: 0; }
.bot2-logtime { color: var(--dim); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.bot2-logrow.is-ok span:last-child { color: #6cc644; }
.bot2-logrow.is-warn span:last-child { color: #f2c94c; }
.bot2-logrow.is-error span:last-child { color: #ff7a7a; }
@media (max-width: 760px) { .adm-bot2 { grid-template-columns: 1fr; } .bot2-grid2 { grid-template-columns: 1fr; } }

/* ---------- Clip Studio access (Admin tab) ---------- */
.adm-clip .field-label { display: block; margin-bottom: 8px; }
.adm-clip-results { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 4px; }
.adm-clip-results:empty { margin: 0; }
.adm-clip-h { margin: 20px 0 10px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.adm-clip-list { display: flex; flex-direction: column; gap: 6px; }
.adm-clip-row { display: flex; align-items: center; gap: 11px; padding: 9px 12px; background: var(--panel-2, rgba(255,255,255,0.03)); border: 1px solid var(--line, rgba(255,255,255,0.07)); border-radius: 10px; }
.adm-clip-row .adm-avatar { border-radius: 50%; flex: none; }
.adm-clip-who { min-width: 0; flex: 1; }
.adm-clip-who strong { display: block; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-clip-who small.block { color: var(--muted); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-clip-row .btn, .adm-clip-row .tag { flex: none; }

/* ---------- affiliates ---------- */
.link-btn { background: none; border: 0; padding: 0; color: var(--diamond); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.aff-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.aff-stat { padding: 16px 18px; }
.aff-stat small { display: block; color: var(--dim); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
.aff-stat span { display: block; color: var(--muted); font-size: 0.82rem; }
/* Numbers and % in the body font: the pixel font draws "%" like a "Z". */
.aff-big { display: block; font-family: var(--font-body); font-weight: 800; font-size: 1.8rem; font-variant-numeric: tabular-nums; color: var(--grass); margin: 6px 0 4px; }
.aff-link { display: flex; gap: 10px; }
.aff-link input { flex: 1; min-width: 0; }
.aff-link .btn { flex-shrink: 0; }
.aff-code { margin: 10px 0 6px; font-size: 0.9rem; color: var(--muted); }
.aff-code strong { color: var(--text); letter-spacing: 0.06em; }
.aff-tiers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.aff-tier { padding: 10px 8px; border: 1px solid var(--line); border-radius: 6px; text-align: center; color: var(--muted); }
.aff-tier strong { display: block; font-family: var(--font-body); font-weight: 800; font-size: 1.35rem; font-variant-numeric: tabular-nums; color: var(--text); }
.aff-tier small { display: block; font-size: 0.72rem; color: var(--dim); margin-top: 2px; }
.aff-tier.is-done { border-color: rgba(108, 198, 68, 0.35); }
.aff-tier.is-on { border-color: var(--grass); background: rgba(108, 198, 68, 0.1); color: var(--text); }
.aff-tier.is-on strong { color: var(--grass); }
.aff-bar { margin-bottom: 10px; }
.aff-h4 { font-size: 0.86rem; margin: 4px 0 10px; }
.aff-h4 ~ .aff-h4 { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.aff-list { list-style: none; margin: 0; padding: 0; display: grid; max-height: 420px; overflow-y: auto; }
.aff-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.aff-list li:first-child { border-top: 0; }
.aff-list li > div { flex: 1; min-width: 0; }
.aff-list strong, .aff-list small { display: block; }
.aff-list small { color: var(--dim); font-size: 0.8rem; overflow-wrap: anywhere; }
.aff-list .aff-right { flex: 0 0 auto; text-align: right; }
.aff-list .aff-right small { margin-top: 4px; }
.aff-amt { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.aff-amt.is-plus { color: var(--grass); }
.aff-amt.is-minus { color: var(--muted); }
.aff-payouts { margin-top: 12px; }

/* ---------- responsive ---------- */
.pn-scrim { display: none; }
@media (max-width: 1180px) {
  .acc { grid-template-columns: minmax(0, 1fr) auto; }
  .acc-meta { grid-column: 1 / -1; grid-row: 2; }
  .acc-actions { grid-column: 2; grid-row: 1; }
  .acc-donut { grid-row: 3; }
}
@media (max-width: 980px) {
  .pn { grid-template-columns: minmax(0, 1fr); }
  .pn-side {
    position: fixed; left: 0; top: 0; bottom: 0; width: 260px;
    transform: translateX(-100%); transition: transform 0.22s cubic-bezier(.2, .8, .2, 1);
  }
  .pn-side.is-open { transform: none; box-shadow: 30px 0 60px -20px rgba(0, 0, 0, 0.8); }
  .pn-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(4, 6, 12, 0.55); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
  .pn-scrim.is-open { opacity: 1; pointer-events: auto; }
  .pn-top .pn-menu { display: inline-grid; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* minmax(0, …): cards shrink to the screen instead of growing to fit a wide table or chart. */
  .settings-grid, .bill-grid, .st-grid { grid-template-columns: minmax(0, 1fr); }
  .tpl-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .pn-top { padding: 0 16px; gap: 10px; }
  .pn-user span { display: none; }
  .pn-user { padding: 4px; }
  .preview-chip { display: none; }
  .preview-banner { margin: 16px 16px 0; }
  .pn-view { padding: 20px 16px; }
  .acc-meta { grid-template-columns: 1fr 1fr; }
  .acc { grid-template-columns: 1fr; }
  .acc-actions { grid-column: 1; grid-row: auto; }
  .acc-actions .btn { flex: 1; }
  .acc-donut { grid-row: auto; }
  .grid-2, .kv-grid, .hud { grid-template-columns: 1fr; }
  .st-kv { grid-template-columns: 1fr 1fr; }
  .aff-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .aff-stats .aff-stat:first-child { grid-column: 1 / -1; }
  .aff-link { flex-direction: column; }
  .aff-tiers { grid-template-columns: 1fr 1fr; }
  .aff-list { max-height: none; }
  .stats { gap: 10px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .stat .ico-badge { --s: 34px !important; }
  .st-frow { grid-template-columns: minmax(0, 1fr) auto; }
  .st-frow .st-htrack, .st-frow .st-fnote { grid-column: 1 / -1; grid-row: 2; }
  .st-fdrop { display: none; }
  .st-heat-plot { grid-template-columns: 28px repeat(24, minmax(0, 1fr)); gap: 1px; }
  .adm-tools { flex-direction: column; }
  .adm-tools select { width: 100% !important; }
  .radio-row { grid-template-columns: 1fr; }
  .tpl-grid { grid-template-columns: 1fr; }
  .inv-grid { grid-template-columns: repeat(9, 30px); gap: 3px; }
  .slot { width: 30px; height: 30px; }
  .item-tex, .item-glyph { width: 20px; height: 20px; font-size: 0.5rem; }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
  .modal-foot { padding: 0 16px 16px; }
  .rent-buy { width: 100%; justify-content: space-between; }
}

/* Phones: popups start at the top (a tall one scrolls instead of losing its top), bigger touch targets,
   the console header wraps (name on top, buttons below). */
@media (max-width: 760px) {
  .modal-backdrop { place-items: start center; padding: 12px 10px 24px; }
  .modal-head { padding: 16px 16px 0; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 0 16px 16px; flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; }
  .icon-btn { width: 40px; height: 40px; }
  .chip-btn { min-height: 38px; padding: 6px 12px; }
  .tab-btn { padding: 12px 14px; }
  .pn-side-foot a { display: inline-block; padding: 8px 0; }
  .link-sm { display: inline-block; padding: 6px 0; }
  .mpal-cat { padding: 7px 11px 7px 9px; font-size: 0.8rem; }
  .drawer-head { flex-wrap: wrap; gap: 10px 12px; padding: 12px 14px; }
  .drawer-titles { flex: 1 1 calc(100% - 110px); order: 1; }
  .drawer-head > .head-ico { order: 0; }
  .drawer-head > .icon-btn { order: 2; }
  .drawer-head > .btn { order: 3; flex: 1 1 40%; }
  .console-bar, .console-quick, .console-form { padding-left: 14px; padding-right: 14px; }
  .console-log { padding: 12px 14px; }
  .st-heat-hour { font-size: 0.6rem; }
  .st-heat-day { font-size: 0.68rem; }
}

/* Macro builder, tablets: the summary and test run go under the steps. */
@media (max-width: 1100px) {
  .mk-body { grid-template-columns: minmax(0, 1fr); }
  .mk-side { position: static; max-height: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mk-sum > div:last-child { max-height: 340px; }
}
/* Macro builder on phones: one panel at a time (Steps / Summary / Test run tabs), Add, Test and Save in a bar
   at the bottom, and the step picker is a sheet that slides up. */
@media (max-width: 760px) {
  .mk { gap: 10px; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .mk-bar { gap: 8px; }
  .mk-names { order: 1; flex-basis: calc(100% - 46px); }
  .mk-back { order: 0; }
  .mk-state { order: 2; }
  .mk-tools { order: 3; flex: 1; justify-content: flex-end; }
  .mk-top-only, .mk-add, .mk-test-btn { display: none; }
  .pn .mk-names input.mk-name.mk-name.mk-name { font-size: 1.1rem; }
  .mk-tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); position: sticky; top: 64px; z-index: 5; }
  .mk-tab { flex: 1; min-height: 38px; border: 0; border-radius: 7px; background: none; color: var(--muted); font: 600 0.86rem/1.2 var(--font-body); cursor: pointer; }
  .mk-tab[aria-selected='true'] { background: var(--panel-3); color: var(--text); }
  .mk-body, .mk-side { display: block; }
  .mk-side { position: static; max-height: none; }
  .mk-body[data-tab='steps'] [data-pane]:not([data-pane='steps']),
  .mk-body[data-tab='summary'] [data-pane]:not([data-pane='summary']),
  .mk-body[data-tab='test'] [data-pane]:not([data-pane='test']) { display: none; }
  .mk-body[data-tab='steps'] .mk-side { display: none; }
  .mk-sum > div:last-child { max-height: none; }
  .mk-logbody { height: 55vh; }
  .mk-panel-head { padding: 12px 14px; }
  .mk-steps-list { padding: 10px; }
  .mk-dock {
    display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(12, 16, 23, 0.96); border-top: 1px solid var(--line-2); backdrop-filter: blur(8px);
  }
  .mk-dock .btn { flex: 1 1 0; min-height: 46px; justify-content: center; padding-left: 8px; padding-right: 8px; }
  body.bk-picking .mk-dock { display: none; }
  .btn-ai span { display: none; }

  .bk-row { gap: 6px; padding: 8px 4px 8px 2px; }
  .bk-row .bk-ico, .bk-act-move { display: none; }
  .bk-body { font-size: 0.92rem; }
  .bk-f { min-height: 36px; font-size: 16px; } /* 16px: no zoom-in when tapping a field on iPhone */
  .bk-inner { margin: 0 6px 8px 14px; padding-left: 10px; }
  .bk-issue { margin-left: 10px; }
  .bk-starters { grid-template-columns: 1fr; }
  .bk-empty-acts .btn { flex: 1 1 100%; justify-content: center; }

  .bk-picker {
    top: auto; left: 0; width: 100%; height: 88vh; height: 88dvh; border-left: 0; border-top: 1px solid var(--line-2);
    border-radius: 16px 16px 0 0; transform: translateY(100%); box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bk-picker::before { content: ''; align-self: center; width: 40px; height: 4px; margin-top: 8px; border-radius: 2px; background: var(--line-2); }
  .bk-pk-head { padding-top: 10px; }
  .bk-pk-search input { font-size: 16px; }
  .bk-pk-item { padding: 11px 8px; }
  .ai-box { padding: 14px; }
  .ai-modes { grid-template-columns: 1fr; }
  .ai-actions .btn { flex: 1 1 auto; }
}

/* ---------- live 3D view (prismarine-viewer) ---------- */
.pv { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; }
.pv-shade { position: absolute; inset: 0; background: rgba(3, 5, 10, 0.72); backdrop-filter: blur(3px); }
.pv-panel {
  position: relative; display: flex; flex-direction: column;
  width: min(1100px, 94vw); height: min(760px, 92vh);
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); overflow: hidden;
}
.pv-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.pv-id { display: flex; flex-direction: column; min-width: 0; }
.pv-id strong { font-size: 0.98rem; line-height: 1.2; }
.pv-server { color: var(--dim); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pv-x { width: 34px; height: 34px; flex-shrink: 0; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--panel-3); color: var(--text); font-size: 0.95rem; cursor: pointer; line-height: 1; }
.pv-x:hover { background: var(--panel); color: #fff; }
.pv-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; background: #0a0d14; }
.pv-frame { flex: 1; width: 100%; border: 0; display: block; background: #0a0d14; }
.pv-hint { margin: 0; padding: 7px 12px; font-size: 0.76rem; color: var(--dim); border-top: 1px solid var(--line); background: var(--panel-2); text-align: center; }
.pv-note { margin: auto; max-width: 420px; padding: 32px 24px; text-align: center; }
.pv-note h3 { margin: 14px 0 6px; font-size: 1.05rem; }
.pv-note p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
@media (max-width: 680px) { .pv-panel { width: 100vw; height: 100vh; border: 0; border-radius: 0; } }

/* Client spoofing (account settings + bulk manager) */
.spoof-section { display: grid; gap: 10px; padding-bottom: 14px; }
.spoof-section > .btn { justify-self: start; }
.spoof-section .dim { margin: 0; font-size: 0.85rem; }
.spoof-sub { margin: 4px 0 0; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.spoof-form { display: grid; gap: 10px; }
