/* Layout: инструмент из двух панелей — ввод слева, QR справа; на телефоне одна колонка */
:root {
  --bg: #eef2f0;
  --panel: #ffffff;
  --ink: #15201b;
  --muted: #5a6962;
  --line: #d3dcd7;
  --accent: #1d6b57;
  --accent-ink: #ffffff;
  --accent-soft: #dcebe5;
  --warn: #9a5310;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Roboto Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1513; --panel: #17201c; --ink: #e5ece8; --muted: #98a79f; --line: #2a3631;
    --accent: #52bb9c; --accent-ink: #0b1310; --accent-soft: #1d3029; --warn: #e3a75b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* Своим display (grid/flex) элементы иначе перебивают атрибут hidden */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.5;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.wrap { max-width: 1040px; margin: 0 auto; padding-inline: 20px; padding-block: 28px 40px; display: grid; gap: 20px; }

h1 { margin: 0; font-size: clamp(26px, 4vw, 34px); line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
h2 { margin: 0 0 8px; font-size: 18px; }
.lead { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs button {
  font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
}
.tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 780px) { .grid { grid-template-columns: minmax(0, 1fr); } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 12px; min-width: 0; }
.pane { display: grid; gap: 8px; }
.label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

input[type="text"], input[type="password"], input[type="url"], input[type="tel"], input[type="email"], textarea, select {
  width: 100%; min-width: 0; font: inherit; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
textarea { resize: vertical; min-height: 140px; }
#secret, #wpass, #url { font-family: var(--mono); font-size: 15px; }
select { width: auto; }
.field { display: flex; gap: 8px; }
.field input { flex: 1; }

button { font: inherit; font-weight: 600; border-radius: 10px; padding: 10px 16px; cursor: pointer; border: 1px solid var(--line); }
button.ghost { background: transparent; color: var(--ink); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.center { justify-content: center; }
.actions { justify-content: space-between; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 15px; }
.hint { margin: 0; font-size: 14px; color: var(--muted); }
.warn { margin: 0; font-size: 14px; color: var(--warn); }
.bytes { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.qrpanel { justify-items: center; text-align: center; }
.qrframe {
  width: min(100%, 420px); aspect-ratio: 1; background: #ffffff; border-radius: 12px;
  border: 1px solid var(--line); display: grid; place-items: center; padding: 14px;
}
.qrframe canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.empty { margin: 0; color: #6a766f; font-size: 15px; padding: 20px; }
.meta { margin: 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pager { display: flex; gap: 12px; align-items: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.pager button { padding: 6px 14px; font-size: 20px; line-height: 1; }

.howto { color: var(--ink); }
.howto ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.privacy { margin: 12px 0 0; font-size: 14px; color: var(--muted); max-width: 80ch; }

/* Во весь экран: белый фон, код максимально крупно */
.fs {
  position: fixed; inset: 0; background: #ffffff; z-index: 10; display: grid;
  grid-template-rows: 1fr auto auto; justify-items: center; align-items: center; gap: 12px;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
}
.fs canvas { width: min(92vw, 80vh); height: min(92vw, 80vh); image-rendering: pixelated; }
.fsnote { margin: 0; color: #333d38; font-size: 16px; }

@media (prefers-reduced-motion: no-preference) {
  .tabs button, button { transition: background-color .15s, border-color .15s; }
}
