/* Project Zomboid admin pages (sections/admin.mjs): the command builder on /commands/ (src/admin.js), example lists
   and the wide sandbox tables. Colours are the site's tokens (src/styles.css), so the light theme works too.
   Wide screens: the commands on the left, the fields and the line on the right; phones: a list of commands. */
.ab { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px 18px; margin: 14px 0 30px; scroll-margin-top: calc(var(--top, 100px) + 8px); }
.ab h2 { margin: 0 0 4px; }
.ab > p { margin: 0 0 10px; color: var(--ink-soft); max-width: 780px; }
.ab-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); gap: 14px 26px; align-items: start; margin-top: 12px; }
.ab-work { position: sticky; top: calc(var(--top, 100px) + 12px); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 16px; min-width: 0; }
.ab-cmds { display: grid; gap: 10px; }
.ab-row { display: grid; gap: 4px; }
.ab-row > div { display: flex; flex-wrap: wrap; gap: 6px; }
.ab-g { font-weight: 700; font-size: 13.5px; color: var(--muted); }
.ab-cmds button { font: 500 13.5px/1.2 var(--mono); padding: 5px 9px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink); border-radius: 6px; cursor: pointer; }
.ab-cmds button:hover { border-color: var(--ac); color: var(--ac); }
.ab-cmds button[aria-pressed="true"] { background: var(--ac); border-color: var(--ac); color: #14110a; }
.ab-sel { display: none; }
.ab-help { font-size: 15px; color: var(--ink-soft); margin: 0 0 12px; }
.ab-help .gametext { color: var(--muted); }
.ab-args { display: flex; flex-direction: column; gap: 12px; }
.ab-args[hidden] { display: none; }
.ab-args label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-weight: 600; font-size: 14px; color: var(--ink-soft); }
.ab-args label.ab-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.ab-args input, .ab-args select { width: 100%; font: 15px/1.3 var(--body); padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); min-width: 0; max-width: 100%; box-sizing: border-box; }
.ab-args input[type="checkbox"] { width: auto; }
.ab-args input:focus, .ab-args select:focus, .ab-sel select:focus { outline: 2px solid var(--ac); outline-offset: 1px; border-color: transparent; }
.ab-args input[type="number"] { font-family: var(--mono); }
.ab-two, .ab-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.ab-two { grid-template-columns: minmax(0, 2fr) minmax(90px, 1fr); }
.ab-xyz { display: flex; flex-direction: column; gap: 10px; }
.ab-xyz [hidden] { display: none; }
.ab-pick { position: relative; }
.ab-pick > label { display: block; margin: 0 0 4px; }
.ab-chosen { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); }
.ab-chosen code { color: var(--ac); margin-right: 4px; }
.ab-list { position: absolute; top: 66px; left: 0; z-index: 30; width: 100%; max-height: 320px; overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 12px 30px rgba(0, 0, 0, .4); }
.ab-list[hidden] { display: none; }
.ab-list button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 5px 10px; border: 0; border-bottom: 1px solid var(--line); background: none; font: 15px/1.3 var(--body); color: var(--ink); cursor: pointer; }
.ab-list button:last-child { border-bottom: 0; }
.ab-list button:hover { background: var(--panel-2); }
.ab-list button > span { min-width: 0; overflow-wrap: anywhere; }
.ab-list img, .ab-noicon { width: 24px; height: 24px; flex: none; image-rendering: pixelated; }
.ab-list code { margin-left: auto; padding-left: 8px; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; text-align: right; }
.ab-none { margin: 0; padding: 9px 12px; color: var(--muted); }
.ab-out { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 0; }
.ab-out code.cmd { flex: 1 1 100%; font-size: 17px; padding: 8px 12px; white-space: normal; word-break: break-all; background: var(--panel); }
.ab-out button.copy { margin-left: 0; font-size: 14px; padding: 8px 16px; background: var(--ac); border-color: var(--ac); color: #14110a; }
.ab-out button.copy:hover { color: #14110a; background: var(--ac-ink); }
.ab-note { font-size: 14px; color: var(--muted); margin: 12px 0 0; max-width: 800px; }
[data-theme="light"] .ab-chosen code { color: var(--ac-light, #9a3c16); }
@media (max-width: 860px) {
  .ab-body { grid-template-columns: 1fr; }
  .ab-cmds { display: none; }
  .ab-sel { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; color: var(--ink-soft); margin: 0 0 10px; }
  .ab-sel select { font: 15px/1.3 var(--mono); padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); }
  .ab-work { position: static; padding: 12px; }
  .ab { padding: 14px 12px; }
}

/* examples on a command page */
ul.ab-ex { list-style: none; padding: 0; margin: 6px 0 10px; }
ul.ab-ex li { margin: 8px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
ul.ab-ex li span { color: var(--muted); }

/* sandbox tables: the setting's name, key, tooltip and choices in one cell; a preset that differs from the default */
table.sb tbody th { min-width: 200px; max-width: 300px; font-weight: 600; }
table.sb thead th { white-space: nowrap; }
table.sb tbody th small { font-weight: 400; color: var(--muted); }
table.sb tbody th small code { color: var(--ink-soft); }
table.sb td { min-width: 76px; }
table.sb td.ab-diff { background: color-mix(in srgb, var(--ac) 16%, transparent); }
code.ab-str { white-space: normal; word-break: break-word; font-size: 12px; display: inline-block; max-width: 260px; }
