/* Палітра та базові стилі з MWL Admin */
:root {
  --bg:#f4f5f2; --card:#fff; --line:#e2e4dd; --ink:#1c211c; --muted:#5d655c; --hover:#f1f3ee;
  --accent:#2f6b45; --accent-text:#fff; --accent-bg:#e8efe9;
  --ok:#1f8a4c; --ok-bg:#e2f4e8; --err:#b3372f; --err-bg:#fbeceb; --amber:#8a5a00; --amber-bg:#fbf0d4;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:#131613; --card:#1c201c; --line:#2d332d; --ink:#e6e9e3; --muted:#9aa298; --hover:#232823;
    --accent:#4f9d6a; --accent-text:#0d130f; --accent-bg:#223026;
    --ok:#5fd08a; --ok-bg:#1b3325; --err:#f0857c; --err-bg:#3a1f1d; --amber:#e9b860; --amber-bg:#3a2e12;
  }
}
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; background:var(--bg); color:var(--ink); font:15px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; }
a { color:var(--accent); }
.muted { color:var(--muted); } .small { font-size:13px; }

.top { display:flex; align-items:center; gap:12px; padding:10px 24px; background:var(--card); border-bottom:1px solid var(--line); flex-wrap:wrap; }
.brand { font-weight:700; display:flex; align-items:center; gap:8px; }
.dot { width:10px; height:10px; border-radius:50%; background:var(--accent); display:inline-block; }

main { max-width:640px; margin:0 auto; padding:22px 24px 60px; }
h1 { font-size:22px; margin:4px 0 6px; }
h2 { font-size:15px; margin:0 0 10px; }
.lead { color:var(--muted); margin:0 0 18px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:16px; margin-bottom:14px; }

/* Сегментований вибір (як .seg.radio в адмінці) */
.choices.seg { display:grid; grid-template-columns:1fr 1fr; border:1px solid var(--line); border-radius:7px; overflow:hidden; }
.choice { border:0; background:var(--card); color:var(--muted); font:inherit; font-weight:500; padding:10px 8px; cursor:pointer; text-align:center; min-height:52px; }
.choice + .choice { border-left:1px solid var(--line); }
.choice small { display:block; font-size:12.5px; font-weight:400; color:var(--muted); margin-top:1px; }
.choice:hover { background:var(--hover); }
.choice[aria-pressed="true"] { background:var(--accent-bg); color:var(--ink); font-weight:600; box-shadow:inset 0 -2px 0 var(--accent); }

label { display:block; font-size:13.5px; font-weight:600; color:var(--ink); margin:14px 0 4px; }
label:first-child { margin-top:0; }
.req::after { content:" *"; color:var(--err); font-weight:400; }
input, select { width:100%; font:inherit; font-size:16px; color:var(--ink); background:var(--bg); border:1px solid var(--line); border-radius:7px; padding:8px 10px; }
@media (min-width:720px) { input, select { font-size:15px; } }
input.mono { font-family:var(--mono); letter-spacing:.02em; }
input::placeholder { color:var(--muted); opacity:.7; }
input:focus, select:focus, button:focus-visible, summary:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
input.bad, select.bad { border-color:var(--err); background:var(--err-bg); }
.hint { color:var(--muted); font-size:13px; margin:4px 0 0; }
.err { color:var(--err); font-size:13px; font-weight:600; margin:4px 0 0; }
.wmsg { color:var(--ink); background:var(--amber-bg); border-radius:7px; font-size:13px; padding:8px 10px; margin:6px 0 0; }
input.mono { font-variant-numeric:tabular-nums; }
.swap { background:none; border:0; color:var(--accent); font:inherit; font-size:13.5px; padding:6px 0; cursor:pointer; text-align:left; }
.swap:hover { text-decoration:underline; }

details { margin-top:6px; border:1px solid var(--line); border-radius:7px; background:var(--bg); }
summary { cursor:pointer; color:var(--accent); font-weight:600; font-size:13.5px; padding:7px 12px; list-style:none; display:flex; align-items:center; gap:6px; }
summary::-webkit-details-marker { display:none; }
summary::before { content:"›"; display:inline-block; transition:transform .15s; font-size:16px; line-height:1; }
details[open] summary::before { transform:rotate(90deg); }
details[open] summary { border-bottom:1px solid var(--line); }
.helpbody { padding:4px 12px 10px; }
details p { margin:6px 0; }

.submit { width:100%; margin-top:18px; padding:10px; font:inherit; font-weight:600; color:var(--accent-text); background:var(--accent); border:1px solid var(--accent); border-radius:7px; cursor:pointer; }
.submit:hover { filter:brightness(1.08); }
.submit:disabled { opacity:.6; cursor:progress; }
.msg:empty { display:none; }
.msg { margin-top:12px; padding:10px 14px; border-radius:8px; font-size:14px; }
.msg.bad { background:var(--err-bg); color:var(--err); }
.done { text-align:center; padding:28px 16px; }
.done b { display:block; color:var(--ok); font-size:18px; margin-bottom:4px; }
.btn2 { display:inline-block; padding:7px 14px; border-radius:7px; border:1px solid var(--line); background:var(--card); color:var(--ink); font:inherit; font-weight:500; cursor:pointer; margin:4px; }
.btn2:hover { background:var(--hover); }
.hp { position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }
[hidden] { display:none !important; }

code { font-family:var(--mono); font-size:13px; }
.helpbody h3 { font-size:14px; margin:16px 0 4px; }
.helpbody h3:first-child { margin-top:8px; }

/* вкладки систем (як .tabs в адмінці) */
.tabs { display:flex; gap:2px; margin:4px 0 10px; border-bottom:1px solid var(--line); overflow-x:auto; scrollbar-width:none; }
.tab { flex:0 0 auto; font:inherit; font-size:13.5px; font-weight:500; padding:8px 12px; min-height:38px; border:0; border-bottom:2px solid transparent; margin-bottom:-1px; background:none; color:var(--muted); cursor:pointer; white-space:nowrap; }
.tab:hover { color:var(--ink); }
.tab[aria-selected="true"] { color:var(--ink); font-weight:600; border-bottom-color:var(--accent); }

/* зарисовки меню */
.sketch { display:flex; align-items:stretch; gap:4px; overflow-x:auto; scroll-snap-type:x proximity; padding:6px 2px 8px; margin:4px 0 0; -webkit-overflow-scrolling:touch; }
.sketch:focus-visible { outline:3px solid var(--accent); outline-offset:2px; border-radius:8px; }
.scr { position:relative; flex:0 0 156px; scroll-snap-align:start; background:var(--card); border:1.5px solid var(--line); border-radius:10px; overflow:hidden; padding-bottom:30px; }
.sketch.phone .scr { flex-basis:146px; border-radius:20px; border-width:2px; }
.scr .bar { font-weight:700; font-size:12px; text-align:center; padding:9px 8px; border-bottom:1px solid var(--line); background:var(--bg); overflow-wrap:anywhere; }
.sketch.mac .bar { text-align:left; padding-left:50px; position:relative; min-height:34px; }
.sketch.mac .bar::before { content:""; position:absolute; left:10px; top:13px; width:7px; height:7px; border-radius:50%; background:#c4cad1; box-shadow:12px 0 0 #c4cad1, 24px 0 0 #c4cad1; }
.sketch.mac .bar::before { background:#ff5f57; box-shadow:12px 0 0 #febc2e, 24px 0 0 #28c840; }
.row { display:flex; align-items:center; gap:6px; padding:7px 9px; margin:5px 6px; border-radius:7px; border:1px solid transparent; font-size:12.5px; line-height:1.3; overflow-wrap:anywhere; }
.row:not(.hl) { color:var(--muted); }
.row .v { display:block; font-family:var(--mono); font-size:11px; color:var(--muted); font-weight:400; margin-top:2px; }
.row.hl { background:var(--accent-bg); border-color:var(--accent); color:var(--ink); font-weight:700; }
.row.hl .v { color:var(--accent); font-weight:600; }
.row.hl::after { content:""; flex:0 0 10px; height:10px; border-radius:50%; background:var(--accent); margin-left:auto; box-shadow:0 0 0 3px var(--accent-bg); }
.num { position:absolute; bottom:6px; right:6px; width:22px; height:22px; border-radius:50%; background:var(--accent); color:var(--accent-text); font-size:12px; font-weight:700; display:grid; place-items:center; }
.arr { align-self:center; color:var(--muted); font-size:24px; flex:0 0 auto; padding:0 1px; }
.cap { color:var(--muted); font-size:12.5px; margin:2px 0 6px; }

/* кроки, пораді, команди */
.steps { margin:6px 0 8px; padding-left:24px; }
.steps li { margin:6px 0; padding-left:2px; }
.steps li::marker { color:var(--accent); font-weight:700; }
.tip, .warn { font-size:14px; margin:8px 0; padding:8px 10px; border-radius:6px; }
.tip { background:var(--amber-bg); color:var(--ink); }
.warn { background:var(--bg); border:1px dashed var(--line); color:var(--muted); }
.cl { font-size:13px; font-weight:600; margin:10px 0 2px; }
.cmdrow { display:flex; gap:6px; align-items:stretch; margin:4px 0 6px; }
.cmd { flex:1; min-width:0; display:block; font-family:var(--mono); background:var(--card); border:1px solid var(--line); border-radius:7px; padding:9px 10px; overflow-x:auto; white-space:pre; user-select:all; }
.copybtn { flex:0 0 auto; font:inherit; font-size:13px; font-weight:500; padding:0 12px; min-height:40px; border:1px solid var(--line); border-radius:7px; background:var(--card); color:var(--ink); cursor:pointer; }
.copybtn:hover { background:var(--hover); }
.sticker { border:2px dashed var(--line); border-radius:8px; padding:10px 14px; font-family:var(--mono); font-size:13px; background:var(--card); max-width:260px; margin:6px 0; line-height:1.6; }
.sticker .st { font-weight:700; font-family:inherit; font-size:11px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }

@media (max-width:480px) {
  main { padding:16px 12px 48px; } .top { padding:10px 12px; }
  .card { padding:14px 12px; }
  h1 { font-size:20px; }
  details { padding:6px 10px; }
  .scr { flex-basis:150px; }
  .sketch.phone .scr { flex-basis:142px; }
}

/* ---- Windows-екрани ---- */
.wscr { flex-basis:272px !important; border-radius:8px !important; padding-bottom:30px; background:var(--card); }
.wscr.noside { flex-basis:210px !important; }
.wbar { display:flex; justify-content:space-between; align-items:center; font-size:11.5px; padding:6px 0 6px 10px; border-bottom:1px solid var(--line); background:var(--bg); }
.wctl { display:flex; } .wctl i { font-style:normal; width:24px; text-align:center; color:var(--muted); font-size:10px; }
.wlay { display:grid; grid-template-columns:96px 1fr; min-height:130px; }
.noside .wlay { grid-template-columns:1fr; }
.wside { border-right:1px solid var(--line); padding:6px 4px; background:var(--bg); }
.wside .it { position:relative; font-size:11px; line-height:1.25; padding:5px 6px 5px 9px; margin:2px 0; border-radius:4px; color:var(--muted); overflow-wrap:anywhere; border:1px solid transparent; }
.wside .it.sel { background:var(--card); color:var(--ink); font-weight:600; }
.wside .it.sel::before { content:""; position:absolute; left:2px; top:6px; bottom:6px; width:3px; border-radius:2px; background:var(--accent); }
.wside .it.hl { background:var(--accent-bg); border-color:var(--accent); color:var(--ink); font-weight:700; }
.wmain { padding:6px 4px 0; min-width:0; }
.whead { font-weight:700; font-size:12.5px; padding:2px 6px 4px; overflow-wrap:anywhere; }
.row.card { border:1px solid var(--line); background:var(--bg); margin:4px 2px; padding:6px 8px; }
.row.card.hl { border-color:var(--accent); background:var(--accent-bg); }
.row.card .chev { margin-left:auto; color:var(--muted); font-weight:400; }
.row.card.hl::after { display:none; }
.wstart, .wstart10 { flex-basis:200px !important; }
.wsearch { margin:10px 10px 6px; border:1px solid var(--line); border-radius:999px; padding:5px 12px; font-size:11px; color:var(--muted); background:var(--bg); }
.wlbl { font-size:11px; font-weight:700; padding:2px 12px; }
.wgrid { display:grid; grid-template-columns:repeat(3,1fr); gap:4px; padding:4px 8px; }
.wt { display:flex; flex-direction:column; align-items:center; gap:3px; font-size:10.5px; text-align:center; padding:6px 2px; border-radius:6px; border:1px solid transparent; color:var(--muted); }
.wt .ic, .wtile .ic, .wr .ic { width:22px; height:22px; border-radius:6px; background:var(--line); display:grid; place-items:center; font-size:13px; color:var(--ink); }
.wt.hl, .wtile.hl, .wr.hl { border-color:var(--accent); background:var(--accent-bg); color:var(--ink); font-weight:700; }
.wt.hl .ic, .wr.hl .ic { background:var(--accent); color:var(--accent-text); }
.wfoot { display:flex; justify-content:flex-end; padding:6px 12px; border-top:1px solid var(--line); margin-top:6px; }
.wfoot .ic { font-size:12px; color:var(--muted); }
.wrail { padding:8px 6px; }
.wr { display:flex; align-items:center; gap:8px; font-size:11.5px; padding:5px 6px; margin:3px 0; border-radius:4px; border:1px solid transparent; color:var(--muted); }
.wr .ic { background:transparent; }
.whome { padding-bottom:4px; }
.wtiles { display:grid; grid-template-columns:1fr 1fr; gap:4px; padding:2px 8px; }
.wtile { display:flex; align-items:center; gap:6px; font-size:10.5px; line-height:1.2; padding:6px 5px; border-radius:4px; border:1px solid transparent; color:var(--muted); overflow-wrap:anywhere; }
.wtile .ic { flex:0 0 16px; width:16px; height:16px; border-radius:3px; }

/* Підказки моделі (як .picker в адмінці) */
.picker { position:relative; }
.picker-list { position:absolute; z-index:10; left:0; right:0; top:calc(100% + 4px); margin:0; padding:4px; list-style:none;
  background:var(--card); border:1px solid var(--line); border-radius:9px; box-shadow:0 8px 28px rgba(0,0,0,.16); max-height:300px; overflow-y:auto; }
.picker-list li { padding:9px 10px; border-radius:6px; cursor:pointer; font-size:15px; }
.picker-list li:hover, .picker-list li[aria-selected="true"] { background:var(--accent-bg); }
@media (prefers-color-scheme: dark) { .picker-list { box-shadow:0 8px 28px rgba(0,0,0,.6); } }
