/* Flexoki, grayscale with yellow. Light on :root, dark under [data-theme=dark] and
   under the system preference when no choice is stored. */
:root {
  --bg: #FFFCF0;
  --surface: #F2F0E5;
  --border: #DAD8CE;
  --text: #100F0F;
  --muted: #6F6E69;
  --accent: #AD8301;
  --accent-ink: #FFFCF0;
  --error: #AF3029;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #100F0F; --surface: #1C1B1A; --border: #343331; --text: #CECDC3; --muted: #878580;
    --accent: #D0A215; --accent-ink: #100F0F; --error: #D14D41; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #100F0F; --surface: #1C1B1A; --border: #343331; --text: #CECDC3; --muted: #878580;
  --accent: #D0A215; --accent-ink: #100F0F; --error: #D14D41; color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
code, .shortlink, .shortline, .dest a { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
a { color: inherit; }
a:hover { color: var(--accent); }

.top, .wrap, .foot { width: 100%; max-width: 640px; margin: 0 auto; padding-inline: 16px; }
.top { display: flex; align-items: center; justify-content: space-between; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; letter-spacing: 0.02em; }
.brand img { width: 22px; height: 22px; border-radius: 4px; }
.theme { display: grid; place-items: center; padding: 0; line-height: 1; background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-size: 16px; }
.theme:hover { color: var(--accent); border-color: var(--accent); }
.wrap { flex: 1; padding-block: 8px 32px; display: grid; gap: 20px; align-content: start; }
.foot { padding-block: 16px 24px; color: var(--muted); font-size: 14px; }

h1 { font-size: 1.5rem; line-height: 1.25; margin: 0; text-wrap: balance; }
h2 { font-size: 1.1rem; margin: 16px 0 0; }
p, ul { margin: 0; }
ul { padding-left: 20px; display: grid; gap: 6px; }
.label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
input[type="url"], input[type="text"], select {
  flex: 1; min-width: 0; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
}
input:focus-visible, button:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, .downloads a {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px; padding: 10px 16px;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); text-decoration: none;
}
button[disabled] { opacity: 0.6; cursor: wait; }
.downloads { display: flex; flex-wrap: wrap; gap: 8px; }
.downloads a { background: var(--surface); color: var(--text); border-color: var(--border); font-weight: 500; padding: 8px 12px; font-size: 14px; }
.downloads a:hover { border-color: var(--accent); color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.error { color: var(--error); font-size: 14px; }
.error[hidden] { display: none; }

.result { display: grid; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.result[hidden] { display: none; }
.short { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.shortlink { font-size: 1.25rem; font-weight: 600; word-break: break-all; }
.short button { padding: 6px 12px; font-size: 14px; }
.note { color: var(--muted); font-size: 14px; }
.qr { display: grid; place-items: center; }
.qr img { width: 232px; height: 232px; background: #fff; image-rendering: pixelated; border-radius: 6px; }
.small { font-size: 14px; color: var(--muted); }
.shortline { font-size: 1.1rem; }
.dest a { word-break: break-all; }
.report { display: grid; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.report button { justify-self: start; }

.admin { display: grid; gap: 10px; }
.admin .item { display: grid; gap: 6px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.admin .item .url { word-break: break-all; }
.admin .item .actions { display: flex; gap: 6px; }
.admin .item .actions button { padding: 4px 10px; font-size: 13px; background: var(--surface); color: var(--text); border-color: var(--border); }
.admin .item .actions button:hover { border-color: var(--accent); color: var(--accent); }

@media (prefers-reduced-motion: no-preference) { button, a { transition: color 0.15s, border-color 0.15s; } }
