/* Editor chrome. Tokens and base styles are in theme.css; the card itself is in card.css. */

/* ---------- layout ---------- */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; align-items: stretch; background: var(--bg); color: var(--ink); }
.panel { flex: 0 1 400px; min-width: 300px; max-width: 100%; background: var(--bg); display: flex; flex-direction: column; }
.stage-wrap { flex: 1 1 420px; min-width: 0; display: flex; align-items: flex-start; justify-content: center; padding: 32px 24px; overflow: hidden; position: sticky; top: 0; align-self: flex-start; max-height: 100vh; box-sizing: border-box; }
.stage-col { display: flex; flex-direction: column; align-items: center; gap: 16px; min-width: 0; }

@media (max-width: 759.98px) {
  .app { flex-direction: column; }
  .panel { order: 2; flex: 1 1 auto; width: 100%; min-width: auto; max-width: none; }
  .stage-wrap { order: 1; flex: none; width: 100%; padding: 20px 16px 8px; position: static; align-self: auto; max-height: none; }
}

/* ---------- side panel ---------- */
.panel-head { padding: 22px 20px 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.brand h1 { font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: -0.03em; white-space: nowrap; }
.brand h1 a { color: inherit; text-decoration: none; }
.brand h1 a:hover { color: var(--accent); }
.brand h1 em { font-size: 1.12em; }
/* the card mark from assets/logo.svg, inline so it follows the app theme rather than the OS one */
.brand-mark { flex: none; width: 15px; height: 21px; fill: var(--ink); }
.save-note { font-size: 12px; font-weight: 600; color: var(--faint); }
.panel-body { padding: 10px 16px 32px; display: flex; flex-direction: column; gap: 14px; overflow: auto; }

.group { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--line2); border-radius: 22px; box-shadow: 0 12px 34px -28px var(--shadow); }
.group-tight { gap: 10px; }
.group-head { display: flex; justify-content: space-between; align-items: center; }
.group-title { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; text-wrap: pretty; }
.hint-tuck { margin-top: -2px; }
.row { display: flex; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px; }

.field-label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.field { width: 100%; box-sizing: border-box; padding: 10px 13px; border: 1px solid var(--line2); border-radius: 12px; font-size: 15px; font-weight: 500; background-color: var(--bg); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.field:hover { border-color: var(--line3); }
.field:focus { border-color: var(--accent); background-color: var(--surface); box-shadow: 0 0 0 3px var(--accent-ring); }
select.field { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%239a9386' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }

.slider { display: grid; grid-template-columns: 72px 1fr 40px; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.slider-value { font-size: 12px; font-weight: 600; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; height: 4px; margin: 8px 0; border-radius: 2px; background: var(--track); appearance: none; -webkit-appearance: none; accent-color: var(--ink); cursor: pointer; }
input[type=range]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line3); transition: background .15s; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line3); transition: background .15s; }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:focus-visible::-webkit-slider-thumb { background: var(--accent); }
input[type=range]:hover::-moz-range-thumb, input[type=range]:focus-visible::-moz-range-thumb { background: var(--accent); }
input[type=range]:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.attacks { display: flex; flex-direction: column; gap: 12px; }
.attack { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.attack-row { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 8px; align-items: center; }
.attack-row-dmg { grid-template-columns: minmax(0, 1fr) 72px; }
.attack .field { padding: 9px 12px; font-size: 14px; background-color: var(--surface); }
.attack select.field { padding-right: 34px; }
.attack .dmg { text-align: right; }
.attack textarea { resize: vertical; line-height: 1.45; }
.attack-remove { width: 32px; height: 32px; padding: 0; border: 1px solid transparent; background: none; color: var(--muted); border-radius: 10px; font-size: 18px; line-height: 1; cursor: pointer; transition: border-color .15s, color .15s; }
.attack-remove:hover { border-color: var(--line3); color: var(--accent); }

@media print {
  @page { size: 2.5in 3.5in; margin: 0; }
  body, .app { background: #fff; }
  [data-ui] { display: none !important; }
  .stage-wrap { padding: 0 !important; display: block !important; width: auto !important; height: auto !important; overflow: visible !important; }
  .stage { height: auto !important; position: fixed; left: 0; top: 0; }
  .card { transform: none !important; zoom: .32; }
}
