:root {
  color-scheme: light;
  font-family: Tahoma, Arial, sans-serif;
  color: #173a30;
  background: #f7f8f2;
  --ink: #173a30;
  --muted: #58695c;
  --line: #dbe2d4;
  --accent: #d9f86c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header, main { max-width: 1080px; margin-inline: auto; padding-inline: 28px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-block: 25px; }
a { color: var(--ink); text-underline-offset: 4px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 30px; font-weight: bold; }
.brand i { font-style: normal; background: var(--accent); border-radius: 10px; padding: 1px 9px 5px; }
.brand small { font: bold 10px Arial, sans-serif; letter-spacing: 1px; padding-top: 6px; }
nav, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
nav a { padding: 8px; font-size: 14px; }
main { padding-block: 26px 72px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(34px, 4.8vw, 52px); }
h2 { font-size: 22px; line-height: 1.5; }
h3 { font-size: 17px; }
p, small { color: var(--muted); line-height: 1.8; }
small { display: block; font-size: 12px; }
.intro { max-width: 650px; margin: 9px 0 25px; }
.editor { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; }
.panel, dialog { border: 1px solid var(--line); border-radius: 22px; padding: clamp(20px, 3vw, 32px); background: white; min-width: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
label { display: block; font-weight: bold; font-size: 14px; margin: 19px 0 8px; }
input, button { font: inherit; }
input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fcfdf9; color: var(--ink); }
input[type=file] { font-size: 14px; padding-block: 16px; border-style: dashed; }
input[type=file]::file-selector-button { color: var(--ink); font: inherit; padding: 7px 12px; margin-inline-end: 8px; background: #e9eedf; border: 0; border-radius: 7px; cursor: pointer; }
input + small { margin-top: 7px; }
button, .button { color: var(--ink); font-size: 14px; line-height: 1.4; font-weight: bold; border: 1px solid transparent; border-radius: 10px; padding: 11px 15px; cursor: pointer; text-decoration: none; text-align: center; }
.primary { background: var(--accent); }
.secondary { background: white; border-color: var(--line); }
.primary:hover { background: #ceef58; }
.secondary:hover { border-color: #94a78b; }
button:disabled { cursor: wait; opacity: .58; }
:focus-visible { outline: 3px solid #588827; outline-offset: 3px; }
fieldset > button, fieldset > .actions { margin-top: 22px; }
.preview { background: #eef2e5; display: grid; place-items: center; text-align: center; }
.preview h2, .library h3 { overflow-wrap: anywhere; }
.preview a { display: inline-block; font-size: 14px; margin-top: 16px; }
canvas { max-width: 100%; width: 196px; height: auto; margin: 12px auto; background: white; image-rendering: pixelated; }
.centered { justify-content: center; }
.library { margin-top: 22px; scroll-margin-top: 16px; }
.library > p { font-size: 14px; margin-top: 6px; }
ul { list-style: none; padding: 0; margin: 0; }
.library li { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); padding-block: 16px; }
.library li:first-child { margin-top: 14px; }
.library li:last-child { padding-bottom: 0; }
.meta { font-size: 12px; margin-top: 5px; }
.status:empty { display: none; }
.status { margin-top: 10px; font-size: 13px; }
.error { color: #96382a; }
.notice { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; padding: 16px; border-radius: 12px; background: #ecf2df; margin-bottom: 18px; }
dialog { color: var(--ink); width: min(92vw, 460px); box-shadow: 0 20px 65px #173a3025; }
dialog::backdrop { background: #12261d80; }
dialog h2 + p { margin-top: 8px; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  header, main { padding-inline: 16px; }
  .editor { grid-template-columns: 1fr; gap: 15px; }
  .preview { min-height: 215px; }
  .library li { align-items: flex-start; flex-direction: column; gap: 10px; }
  .brand { font-size: 25px; }
}

.menu-output { display: grid; align-content: start; gap: 18px; min-width: 0; }
main:has(#menu-phone) .editor { align-items: start; }
#result { display: block; }
#replace-dialog { max-height: 92vh; max-height: 92dvh; overflow-y: auto; }
.replace-layout { display: grid; gap: 16px; }
@media (min-width: 721px) {
  #replace-dialog:has(#replacement-phone:not([hidden])) { width: min(92vw, 840px); }
  .replace-layout:has(#replacement-phone:not([hidden])) { grid-template-columns: 1.05fr 1fr; align-items: start; }
}
@media (min-width:721px) {
  .menu-output {display:contents}
  #menu-phone {grid-row:1;grid-column:2;position:sticky;top:12px}
  #result {grid-column:1/-1}
}
