/* AlesLab Info — svetla "strojnica": borovo-zelena, podatki v mono pisavi */
:root {
  --bg: #f2f4f1;
  --panel: #ffffff;
  --panel2: #f6f8f5;
  --text: #1a201c;
  --muted: #68746d;
  --border: #e0e6e1;
  --accent: #17715b;
  --accent-contrast: #ffffff;
  --accent-soft: #e3efe9;
  --accent-ink: #135c4b;
  --danger: #b23c2e;
  --pill-bg: #eef2ee;
  --pill-border: #dde4de;
  --shadow: 0 1px 2px rgba(20, 30, 25, .05), 0 4px 16px rgba(20, 30, 25, .05);
  --r: 14px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }

/* potegni-dol indikator */
#ptr {
  position: fixed; top: -48px; left: 50%; transform: translateX(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--panel); color: var(--muted);
  box-shadow: 0 2px 10px rgba(20, 30, 25, .15);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; z-index: 60; pointer-events: none;
  transition: none;
}
#ptr.ready { background: var(--accent); color: var(--accent-contrast); }
#ptr:not(.pull) { transition: transform .2s; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
button { font: inherit; cursor: pointer; color: inherit; }
:is(button, input, select, textarea, [role="button"]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input, select, textarea {
  font: inherit;
  font-size: 16px; /* prepreči iOS zoom ob fokusu */
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  width: 100%;
}
input.mono, .secret-row input { font-family: var(--mono); }
textarea { resize: vertical; min-height: 76px; }
.loading { padding: 60px 20px; text-align: center; color: var(--muted); }
.meta { font-size: 13.5px; color: var(--muted); }
.spacer { flex: 1; }

/* ---- znak ---- */
.brand { display: flex; align-items: center; font-size: 19px; letter-spacing: -.01em; }
.brand b { font-weight: 700; }
.led {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  margin-right: 9px;
  flex: none;
}

/* ---- gumbi ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: var(--accent-contrast);
  border: 1px solid transparent; border-radius: 999px;
  padding: 10px 18px; font-weight: 600; font-size: 15px;
  transition: filter .12s;
}
.btn:hover { filter: brightness(1.07); }
.btn.full { width: 100%; margin-top: 20px; padding: 11px; font-size: 15px; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); font-weight: 500; }
.btn.ghost:hover { background: var(--panel2); filter: none; }
.btn.danger { background: transparent; color: var(--danger); border-color: transparent; font-weight: 500; }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); filter: none; }
.tool {
  border: 0; background: none; color: var(--muted);
  width: 42px; height: 42px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; flex: none;
}
.tool:hover { background: var(--panel2); color: var(--text); }
.tool.add { color: var(--accent); font-weight: 700; }

/* ---- prijava / namestitev ---- */
.auth-wrap { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 30px 26px calc(26px + env(safe-area-inset-bottom, 0px));
  width: 100%; max-width: 380px; box-shadow: var(--shadow);
}
.auth-box .brand { font-size: 21px; margin-bottom: 4px; }
.auth-box .sub { color: var(--muted); margin: 0 0 22px; font-size: 13.5px; }
.auth-box label { display: block; font-size: 12.5px; color: var(--muted); margin: 13px 0 5px; }
.fp-btn {
  width: 100%; margin: 4px 0 16px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--accent-soft); color: var(--accent-ink);
  border: 1px solid transparent; border-radius: 12px;
  padding: 13px; font-weight: 650; font-size: 15px;
}
.fp-btn:hover { filter: brightness(1.03); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---- ogrodje ---- */
.shell {
  max-width: 720px; margin: 0 auto;
  padding: 0 14px calc(100px + env(safe-area-inset-bottom, 0px));
}
.appbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 2px 10px;
}
.brand-btn { border: 0; background: none; padding: 4px; margin-left: -4px; border-radius: 10px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
  border: 1px solid transparent;
  font-weight: 700; font-size: 15px; letter-spacing: .02em;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.avatar.active { border-color: var(--accent); }
.appbar-right { display: flex; gap: 8px; align-items: center; }
.avatar.ghosted { background: var(--panel); font-size: 18px; }
.search-row input {
  border-radius: 13px; padding: 13px 16px;
  background: var(--panel); box-shadow: var(--shadow); border-color: transparent;
}
.search-row input::placeholder { color: var(--muted); }

/* projekti kot čipi */
.chips {
  display: flex; gap: 7px; align-items: center;
  margin: 12px -14px 4px; padding: 2px 14px 8px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--border); background: var(--panel);
  border-radius: 999px; padding: 10px 17px;
  font-size: 15px; font-weight: 600; white-space: nowrap; flex: none;
  color: var(--text);
}
.chip .cnt { color: var(--muted); font-weight: 400; font-size: 14px; font-variant-numeric: tabular-nums; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.chip.active .cnt { color: var(--accent-contrast); opacity: .75; }
.chip.ghost { color: var(--muted); background: transparent; border-style: dashed; }
.chip-sep { width: 1px; height: 20px; background: var(--border); flex: none; margin: 0 2px; }
.proj-note { color: var(--muted); font-size: 13px; margin: 6px 2px 0; }

/* ---- skupine (kategorije) ---- */
.grp { margin-top: 28px; }
.grp-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 6px 9px;
}
/* harmonika (seznam zapisov): strnjena kategorija = kartica */
.acc { margin-top: 12px; }
.acc .grp-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 0; border-radius: 16px;
  padding: 16px; box-shadow: var(--shadow); cursor: pointer;
  text-align: left;
}
.acc .grp-head:hover { background: var(--panel2); }
.acc .grp-head h2 { flex: 1; }
.acc .chev {
  color: var(--muted); font-size: 20px; line-height: 1; flex: none;
  transition: transform .15s;
}
.acc.open .grp-head { border-radius: 16px 16px 0 0; }
.acc.open .chev { transform: rotate(90deg); }
.acc .grp-list {
  border-radius: 0 0 16px 16px;
  border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}
.acc:first-child { margin-top: 18px; }
.grp-head h2 {
  margin: 0; font-size: 15.5px; font-weight: 650; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.grp-head .cnt { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.grp-list {
  background: var(--panel);
  border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
}
.row { border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.row:first-child { border-top: 0; }
.row-head {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 14px 16px; cursor: pointer; min-height: 60px;
}
.row-t { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.row-t .row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 13px; color: var(--muted); }
.row-head:hover { background: var(--panel2); }
.row.open .row-head { background: var(--panel2); }
.row-title { font-weight: 650; font-size: 16.5px; }
.tag {
  font-size: 13px; font-weight: 600; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: 999px; padding: 3px 11px;
  white-space: nowrap;
}
.pill {
  font-family: var(--mono); font-size: 13.5px;
  color: var(--muted);
  background: var(--pill-bg); border: 0;
  border-radius: 9px; padding: 8px 12px;
  white-space: nowrap; flex: none; max-width: 48%;
  overflow: hidden; text-overflow: ellipsis;
}
.pill:hover, .pill:active { color: var(--accent-ink); background: var(--accent-soft); }
.pill.secret { letter-spacing: .15em; }
.empty-all { color: var(--muted); text-align: center; padding: 56px 0 10px; line-height: 1.8; }
.footer-tools { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 30px; flex-wrap: wrap; }
.footer-tools .dot { color: var(--muted); }
.linklike { border: 0; background: none; color: var(--muted); font-size: 14px; padding: 8px 6px; border-radius: 8px; white-space: nowrap; }
.linklike:hover { color: var(--text); }

/* dnevnik sprememb */
.grp.log { margin-top: 26px; }
.log-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 11px 16px; font-size: 13.5px; color: var(--muted);
}
.log-row b { font-weight: 600; color: var(--text); }
.log-row time { flex: none; font-variant-numeric: tabular-nums; }

/* ---- pregled zapisa ---- */
.detail {
  padding: 14px 16px 16px;
  background: var(--panel2);
  border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}
.d-grid { display: grid; gap: 2px; }
.d-row { display: grid; grid-template-columns: 118px 1fr; gap: 8px; align-items: center; }
.d-label { font-size: 13px; color: var(--muted); }
.d-vals { display: flex; align-items: center; gap: 2px; min-width: 0; }
.d-val {
  font-family: var(--mono); font-size: 14px; color: var(--text);
  background: none; border: 0; border-radius: 7px; padding: 6px 8px;
  text-align: left; word-break: break-all; min-width: 0;
}
.d-val:hover { background: var(--pill-bg); }
.d-val.secret { letter-spacing: .12em; color: var(--muted); }
.d-val.secret.shown { letter-spacing: 0; color: var(--text); }
.detail .tool { width: 36px; height: 36px; font-size: 15px; }
a.tool { text-decoration: none; }
.d-note { margin-top: 12px; }
.d-note .d-label { display: block; margin-bottom: 5px; }
.d-text {
  white-space: pre-wrap; font-size: 15px; line-height: 1.55;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  overflow-wrap: break-word;
}
.detail .actions { margin-top: 16px; }

/* zgodovina: razlike */
.h-line { font-size: 14.5px; margin: 3px 0; overflow-wrap: break-word; }
.h-label { color: var(--muted); }
.h-old { color: var(--muted); text-decoration: line-through; }
.h-new { font-weight: 600; }

/* ---- urejanje ---- */
.editor { padding: 14px; background: var(--panel2); border-top: 1px solid var(--border); }
.row.open > .editor:only-child, .row.open .editor:first-child { border-top: 0; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.fgrid .wide { grid-column: 1 / -1; }
.flabel { font-size: 13.5px; color: var(--muted); margin-bottom: 4px; display: block; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.edit-meta { margin-top: 10px; }
.secret-row { display: flex; gap: 4px; align-items: center; }
.user-body { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; }
.user-body .actions { margin-top: 14px; }
.acc-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.acc-row select { width: auto; min-width: 140px; margin-left: auto; padding: 6px 10px; font-size: 14px; }
.acc-name { font-size: 14px; }

/* ---- pogovorno okno ---- */
dialog {
  border: 1px solid var(--border); border-radius: 18px;
  background: var(--panel); color: var(--text);
  padding: 22px; max-width: 460px; width: calc(100% - 32px);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(10, 15, 12, .5); }
dialog h3 { margin: 0 0 16px; font-size: 17px; }
.frow { display: flex; gap: 7px; align-items: center; margin-bottom: 7px; }
.frow select { width: auto; flex: none; }
.hist { max-height: 50vh; overflow: auto; display: grid; gap: 10px; }
.hist-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.hist-f { font-size: 13px; font-family: var(--mono); }

/* ---- globalni ＋ in izbirnik ---- */
.fab {
  position: fixed; right: 18px; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--accent); color: var(--accent-contrast);
  border: 0; font-size: 30px; line-height: 1; font-weight: 600;
  box-shadow: 0 4px 14px rgba(20, 60, 45, .3);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.fab:hover { filter: brightness(1.07); }
.sheet { max-width: 400px; }
.sheet h3 { margin-bottom: 12px; }
.sheet-list { display: grid; gap: 8px; margin-bottom: 14px; }
.sheet-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 15px; font-size: 16px; font-weight: 600; text-align: left;
}
.sheet-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.sheet-ico { font-size: 20px; flex: none; }
.sheet .btn.full { margin-top: 0; }

/* ✕ v iskalniku */
.search-row { position: relative; }
.search-row input { padding-right: 46px; }
.search-row input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: var(--pill-bg); color: var(--muted);
  font-size: 15px; display: none; align-items: center; justify-content: center;
}
.search-clear.show { display: flex; }
.search-clear:hover { color: var(--text); }

/* ---- obvestilo ---- */
#toast {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--text); color: var(--bg);
  padding: 9px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 550;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  z-index: 99; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- ozek zaslon ---- */
@media (max-width: 560px) {
  .row-head { padding: 12px; }
  .pills { margin-left: 0; width: 100%; }
  .fgrid { grid-template-columns: 1fr; }
  .acc-row select { min-width: 120px; }
}
