/* Moje poznámky – zošitový vzhľad, IBM Plex ako v poznámkach od Claude. */
:root {
  --bg: #f5f3ee; --surface: #ffffff; --surface-2: #faf8f4; --ink: #1d2327; --muted: #5d676d;
  --line: #e1ddd3; --accent: #0f766e; --accent-ink: #ffffff; --accent-soft: #dff3f0;
  --danger: #b4332b; --danger-soft: #fbe4e1; --warn: #a15c07; --warn-soft: #fbefd9;
  --shadow: 0 1px 2px rgba(30, 25, 15, .06), 0 4px 14px rgba(30, 25, 15, .05);
  --radius: 12px;
  --f-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121618; --surface: #1a2023; --surface-2: #161b1e; --ink: #e6ebed; --muted: #98a5ab;
    --line: #2c3539; --accent: #4fd1c0; --accent-ink: #0b1513; --accent-soft: #15322e;
    --danger: #ff8f85; --danger-soft: #3b1b18; --warn: #f0b45a; --warn-soft: #3a2c12;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121618; --surface: #1a2023; --surface-2: #161b1e; --ink: #e6ebed; --muted: #98a5ab;
  --line: #2c3539; --accent: #4fd1c0; --accent-ink: #0b1513; --accent-soft: #15322e;
  --danger: #ff8f85; --danger-soft: #3b1b18; --warn: #f0b45a; --warn-soft: #3a2c12;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--f-sans); }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Hlavička */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.08rem; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: .95rem; }
.search { margin-left: auto; display: flex; flex: 1 1 220px; max-width: 360px; }
.search input { flex: 1; min-width: 0; font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px 0 0 999px; background: var(--surface-2); color: var(--ink); }
.search button { font: inherit; border: 1px solid var(--line); border-left: 0; border-radius: 0 999px 999px 0; background: var(--surface-2); color: var(--ink); padding: 0 14px; cursor: pointer; }
.search input:focus-visible, .search button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

main { padding: 28px 0 56px; }
.page-head { margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 65ch; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .9rem; color: var(--muted); margin-bottom: 10px; padding: 0; list-style: none; }
.crumbs li + li::before { content: "›"; margin-right: 8px; color: var(--line); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }

/* Mriežka kariet */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card { --farba: var(--accent); position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 14px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; transition: transform .12s ease, border-color .12s ease; overflow: hidden; }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--farba); }
a.card:hover { transform: translateY(-2px); border-color: var(--farba); }
a.card:focus-visible { outline: 2px solid var(--farba); outline-offset: 2px; }
.card-title { font-weight: 600; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.card-icon { font-size: 1.3rem; line-height: 1; }
.card-meta { font-size: .85rem; color: var(--muted); }
.card-path { font-size: .8rem; color: var(--muted); }
.big .card-title { font-size: 1.35rem; }
.big { min-height: 96px; justify-content: center; }

.section { margin-top: 36px; }
.section h2 { margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; }

/* Zoznam poznámok */
.list { display: grid; gap: 10px; }
.row { --farba: var(--accent); display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--line); border-left: 5px solid var(--farba); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
a.row:hover { border-color: var(--farba); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; }
.row-sub { font-size: .85rem; color: var(--muted); }
.snippet { font-size: .9rem; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }

.tags { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.tag { --t: var(--warn); display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 500; padding: 2px 9px;
  border-radius: 999px; background: color-mix(in srgb, var(--t) 14%, transparent); color: var(--ink); border: 1px solid color-mix(in srgb, var(--t) 40%, transparent); }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--t); }

.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Stránka poznámky */
body.note-page { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.note-bar { --farba: var(--accent); flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line); border-top: 4px solid var(--farba); flex-wrap: wrap; }
.note-bar .brand-mark { width: 26px; height: 26px; font-size: .8rem; }
.note-bar .crumbs { margin: 0; font-size: .82rem; }
.note-bar h1 { font-size: 1rem; font-weight: 600; }
.note-info { flex: 1; min-width: 0; }
.note-actions { display: flex; gap: 8px; }
.note-frame { flex: 1; width: 100%; border: 0; background: #fff; display: block; }

/* Tlačidlá a formuláre */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: .9rem; font-weight: 500;
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn-sm { padding: 4px 10px; font-size: .82rem; }

dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 22px; max-width: min(92vw, 380px); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(10, 14, 16, .5); }
.share-qr { display: block; width: 100%; max-width: 260px; margin: 12px auto; background: #fff; padding: 10px; border-radius: 8px; }
.share-url { display: flex; gap: 6px; margin-top: 8px; }
.share-url input { flex: 1; min-width: 0; font: .85rem var(--f-mono); padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--ink); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 18px 0; }

@media (max-width: 560px) {
  .search { max-width: none; order: 3; flex-basis: 100%; }
  .note-bar { padding: 6px 12px; gap: 8px; }
  .note-bar .crumbs { display: none; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 12px 12px 12px 16px; }
}
@media (max-width: 380px) { .grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
