/* EU5 console command builder (src/console.js) at the top of /console-commands/ and /cheats/. Colours are the site's
   own 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 (it stays in view while you scroll the commands); phones: a list of commands instead. */
.cb { 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); }
.cb h2 { margin: 0 0 4px; }
.cb > p { margin: 0 0 10px; color: var(--ink-soft); max-width: 780px; }
.cb-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, 1fr); gap: 14px 26px; align-items: start; margin-top: 12px; }
.cb-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; }

.cb-cmds { display: grid; gap: 10px; }
.cb-row { display: grid; gap: 4px; }
.cb-row > div { display: flex; flex-wrap: wrap; gap: 6px; }
.cb-g { font-weight: 700; font-size: 13.5px; color: var(--muted); }
.cb-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; }
.cb-cmds button.w { font-family: var(--body); font-weight: 600; }
.cb-cmds button:hover { border-color: var(--ac); color: var(--ac); }
.cb-cmds button[aria-pressed="true"] { background: var(--ac); border-color: var(--ac); color: #14110a; }
.cb-sel { display: none; }

.cb-help { font-size: 15px; color: var(--ink-soft); margin: 0 0 12px; }
.cb-help .gametext { color: var(--muted); }
.cb-args { display: flex; flex-direction: column; gap: 12px; }
.cb-args[hidden] { display: none; }
.cb-args label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-weight: 600; font-size: 14px; color: var(--ink-soft); }
.cb-args input, .cb-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%; }
.cb-args input:focus, .cb-args select:focus, .cb-sel select:focus { outline: 2px solid var(--ac); outline-offset: 1px; border-color: transparent; }
.cb-args input[type="number"] { width: 160px; font-family: var(--mono); }
.cb-pick { position: relative; }
.cb-pick > label { display: block; margin: 0 0 4px; }
.cb-wait { margin: 0; color: var(--muted); }

.cb-list { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; width: 100%; min-width: min(380px, 86vw); max-height: 340px; overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 12px 30px rgba(0, 0, 0, .4); }
.cb-list[hidden] { display: none; }
.cb-list button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 6px 10px; border: 0; border-bottom: 1px solid var(--line); background: none; font: 15px/1.3 var(--body); color: var(--ink); cursor: pointer; }
.cb-list button:last-child { border-bottom: 0; }
.cb-list button:hover, .cb-list button.on { background: var(--panel-2); }
.cb-list button > span { min-width: 0; overflow-wrap: anywhere; }
.cb-list code { color: var(--ac); font-size: 13px; flex: none; }
.cb-list span code { margin-left: 4px; }
.cb-list small { margin-left: auto; padding-left: 10px; text-align: right; flex: 0 1 auto; }
.cb-none { margin: 0; padding: 9px 12px; color: var(--muted); }
.cb-flag { width: 24px; height: 16px; flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }
span.cb-flag { box-shadow: none; }
.cb-icon { width: 28px; height: 28px; flex: none; object-fit: contain; border: 1px solid var(--frame); border-radius: 5px; background: #0e161a; padding: 1px; }
span.cb-icon { border-color: var(--line-2); background: none; }
/* the game's gold is set on <body> for every theme; on the light background the list keys take its dark tone */
[data-theme="light"] .cb-list code { color: var(--ac-light, #8a5d08); }

.cb-out { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 0; }
.cb-out code.cmd { flex: 1 1 100%; font-size: 17px; padding: 8px 12px; white-space: normal; word-break: break-all; background: var(--panel); }
.cb-out button.copy { margin-left: 0; font-size: 14px; padding: 8px 16px; background: var(--ac); border-color: var(--ac); color: #14110a; }
.cb-out button.copy:hover { color: #14110a; background: var(--ac-ink); }
.cb-add, .cb-del, #cb-clear { font: 600 13px/1 var(--body); padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); color: var(--ink); cursor: pointer; }
.cb-add:hover, .cb-del:hover, #cb-clear:hover { border-color: var(--ac); color: var(--ac); }
.cb-note { font-size: 14px; color: var(--muted); margin: 12px 0 0; max-width: 800px; }
.cb-saved { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.cb-saved[hidden] { display: none; }
.cb-saved h3 { margin: 0 0 6px; font-size: 19px; }
.cb-saved ol { margin: 0; padding-left: 24px; }
.cb-saved li { margin: 6px 0; }
.cb-saved li .cmd { word-break: break-all; }
.cb-saved .cb-del { margin-left: 6px; }

@media (max-width: 980px) {
  .cb-body { grid-template-columns: 1fr; }
  .cb-work { position: static; }
}
@media (max-width: 760px) {
  .cb { padding: 14px 12px 16px; }
  .cb-body { margin-top: 6px; }
  .cb-work { padding: 12px; }
  .cb-cmds { display: none; }
  .cb-sel { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; font-size: 14px; color: var(--ink-soft); }
  .cb-sel select { font: 16px/1.3 var(--mono); padding: 9px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); width: 100%; min-width: 0; }
  .cb-args input, .cb-args select, .cb-args input[type="number"] { width: 100%; font-size: 16px; }
  .cb-list { min-width: 0; max-height: 300px; }
  .cb-out code.cmd { font-size: 16px; }
}
