/* Lilejka brand for the catalog pages, after Project-K/BRANDBOOK.md: fonts are local (self-host
   works offline), one green, one terracotta used only in the mark's centre and the empty-state
   accent, 1px borders, 8px radius on controls and 12px on cards, shadows only on the modal.
   Shared by the public page, /about and /admin, so tokens live here and nowhere else. */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/manrope-var-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/manrope-var-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/manrope-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Neucha";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/neucha-400-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Neucha";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/neucha-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --primary: #0e6e4e;
  --primary-hover: #0b5a40;
  --primary-active: #084733;
  --primary-50: #eaf3ee;
  --on-primary: #ffffff;
  --accent: #d9762f;
  --accent-50: #fbe9dc;
  --accent-700: #a8541b;
  --danger: #b42318;
  --danger-50: #fdecea;
  --ink: #101413;
  --ink-soft: #2e3633;
  --muted: #6e7873;
  --faint: #9aa39f;
  --line: #e4e8e6;
  --surface: #f7f9f8;
  --paper: #ffffff;
  --hover-bg: #f7f9f8;
  --backdrop: rgb(16 20 19 / 0.32);
  --font-ui: Manrope, system-ui, -apple-system, sans-serif;
  --font-hand: Neucha, cursive;
  --page-width: 72rem;
  --tile-pad: 20px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #34c48d;
    --primary-hover: #4fd49e;
    --primary-active: #21a874;
    --primary-50: #1d2e27;
    --on-primary: #052018;
    --accent: #ee9a5a;
    --accent-50: #2a1f16;
    --accent-700: #f3b784;
    --danger: #ff8a80;
    --danger-50: #3a1c1a;
    --ink: #e9edea;
    --ink-soft: #dde2df;
    --muted: #9ba8a2;
    --faint: #6c7570;
    --line: #232a27;
    --surface: #0d1110;
    --paper: #161b19;
    --hover-bg: #1d2320;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary: #34c48d;
  --primary-hover: #4fd49e;
  --primary-active: #21a874;
  --primary-50: #1d2e27;
  --on-primary: #052018;
  --accent: #ee9a5a;
  --accent-50: #2a1f16;
  --accent-700: #f3b784;
  --danger: #ff8a80;
  --danger-50: #3a1c1a;
  --ink: #e9edea;
  --ink-soft: #dde2df;
  --muted: #9ba8a2;
  --faint: #6c7570;
  --line: #232a27;
  --surface: #0d1110;
  --paper: #161b19;
  --hover-bg: #1d2320;
  color-scheme: dark;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; font: 400 15px/1.5 var(--font-ui); color: var(--ink); background: var(--surface); }
h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1.15; text-wrap: pretty; }
h1 { font-size: 28px; letter-spacing: -0.025em; }
h2 { font-size: 24px; letter-spacing: -0.02em; }
h3 { font-size: 17px; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }

/* Buttons: one primary per screen, the rest secondary (outlined) or text. */
button, .button, select, input, textarea { font: inherit; color: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 20px; border-radius: 8px; cursor: pointer;
  font-weight: 600; border: 1px solid var(--primary); background: var(--primary); color: var(--on-primary);
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn:active { background: var(--primary-active); }
.btn-secondary { background: var(--paper); color: var(--primary); }
.btn-secondary:hover { background: var(--primary-50); border-color: var(--primary); }
.btn-text { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-text:hover { background: var(--hover-bg); border-color: transparent; }
button:disabled, .btn:disabled { opacity: 0.4; cursor: default; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Fields: label above in 13px faint, 40px high, focus = primary border + primary-50 ring. */
.field { display: grid; gap: 4px; color: var(--faint); font-size: 13px; font-weight: 600; }
input, select, textarea {
  min-height: 40px; padding: 0 12px; min-width: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  transition: border-color 120ms ease;
}
textarea { padding: 8px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-50); border-color: var(--primary); }

/* Tags: 6px radius, 11px/700. "info" is green, never blue; terracotta is not used for tags here. */
.tag {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 6px;
  font-size: 11px; font-weight: 700; line-height: 1.3;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line);
}
.tag.info { background: var(--primary-50); color: var(--primary-hover); border-color: transparent; }
.tag.danger { background: var(--danger-50); color: var(--danger); border-color: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.info { color: var(--primary); } }
:root[data-theme="dark"] .tag.info { color: var(--primary); }

/* Logo lockup: mark + «Лілейка» in Neucha, gap 0.4× the mark. The centre petal stays terracotta. */
.lockup { display: inline-flex; align-items: center; gap: 13px; color: var(--primary); text-decoration: none; }
.lockup:hover { color: var(--primary); text-decoration: none; }
.lockup svg { width: 32px; height: 32px; flex: none; }
.lockup .wordmark { font-family: var(--font-hand); font-size: 29px; line-height: 1; color: var(--ink); }
.lockup .sub { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.mark-center { stroke: var(--accent); }

/* Toolbar: 56px, paper, 1px bottom line, no shadow. */
.toolbar {
  position: sticky; top: 0; z-index: 2; min-height: 56px;
  display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding: 8px 16px;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.toolbar nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.navlink { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; white-space: nowrap; border-radius: 8px; color: var(--ink-soft); font-weight: 600; }
.navlink:hover { background: var(--hover-bg); color: var(--ink-soft); text-decoration: none; }
.navlink[aria-current="page"] { background: var(--primary-50); color: var(--primary); font-weight: 700; }

/* Page: one column, head above tiles. */
.page { width: min(100% - 2rem, var(--page-width)); margin-inline: auto; padding-block: 2rem; display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.page-head p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.eyebrow { margin: 0 0 4px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: var(--tile-pad); }
.tile h2 { font-size: 17px; letter-spacing: -0.01em; margin-bottom: 8px; }
.tile p + p, .tile p + ul, .tile ul + p { margin-top: 8px; }

/* Empty state: handwritten title, one line, one action. */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 1.5rem; text-align: center;
  border: 1px dashed color-mix(in srgb, var(--muted) 40%, transparent); border-radius: 12px;
}
.empty-state svg { width: 110px; height: 66px; color: var(--line); }
.empty-state .accent { stroke: var(--accent); }
.empty-title { font-family: var(--font-hand); font-size: 24px; line-height: 1.2; color: var(--ink-soft); }
.empty-body { font-size: 13px; color: var(--faint); max-width: 26rem; }

/* Modal: paper, 12px, the one allowed shadow, 32% ink backdrop, actions bottom right. */
dialog {
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink);
  box-shadow: 0 12px 40px rgb(16 20 19 / 0.07); padding: 0;
}
dialog::backdrop { background: var(--backdrop); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

footer.site { padding: 28px 16px 40px; text-align: center; font-size: 13px; color: var(--muted); }

@media (max-width: 768px) {
  .toolbar nav { margin-left: 0; }
}
@media (max-width: 640px) {
  :root { --tile-pad: 16px; }
  .page { padding-block: 1rem; }
  .lockup .sub { display: none; }
}

/* Badge artwork is often black line art; in the dark theme it sits on a light plate (§7). */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) img.art { background: #f7f9f8; border-radius: 12px; padding: 4px; } }
:root[data-theme="dark"] img.art { background: #f7f9f8; border-radius: 12px; padding: 4px; }
