/* LanaTime 7.5 Help Centre
   Layout: fixed left navigation tree, a reading column, and an "On this page" rail
   on wide screens. Colours follow the LanaTime product (indigo accent, cool neutrals);
   each module keeps the colour it has in the LanaTime menu. No external resources:
   the site must work when opened straight from disk. */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --fg: #182033;
  --muted: #5a6478;
  --border: #dde2ee;
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: #eceafe;
  --on-accent: #ffffff;
  --code-bg: #f1f3f9;

  --tip-bg: #e9f7ef;  --tip-line: #2f9e63;
  --note-bg: #eaf2fe; --note-line: #3b78d8;
  --warn-bg: #fff6e5; --warn-line: #d18a12;
  --danger-bg: #fdecef; --danger-line: #d33c5a;
  --fix-bg: #f1edfd;  --fix-line: #7655d6;

  --m-dash: #4f46e5;
  --m-personnel: #db2777;
  --m-device: #0891b2;
  --m-attendance: #16a34a;
  --m-payroll: #ea580c;
  --m-system: #e11d48;
  --m-employee: #0284c7;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  --radius: 10px;
  --nav-w: 288px;
  --toc-w: 220px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10131c; --surface: #171b27; --surface-2: #1f2433; --fg: #e8ebf3; --muted: #a2aac0;
    --border: #2c3346; --accent: #8b85ff; --accent-strong: #a5a0ff; --accent-soft: #252656;
    --on-accent: #10131c; --code-bg: #1d2232;
    --tip-bg: #12271c; --tip-line: #3fbf7f; --note-bg: #142238; --note-line: #6aa3f5;
    --warn-bg: #2a2212; --warn-line: #e3a73b; --danger-bg: #2c1720; --danger-line: #f0718b;
    --fix-bg: #211b39; --fix-line: #a48cf5;
    --m-dash: #8b85ff; --m-personnel: #f472b6; --m-device: #22b8d8; --m-attendance: #34c76b;
    --m-payroll: #fb8a3c; --m-system: #fb6383; --m-employee: #38bdf8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10131c; --surface: #171b27; --surface-2: #1f2433; --fg: #e8ebf3; --muted: #a2aac0;
  --border: #2c3346; --accent: #8b85ff; --accent-strong: #a5a0ff; --accent-soft: #252656;
  --on-accent: #10131c; --code-bg: #1d2232;
  --tip-bg: #12271c; --tip-line: #3fbf7f; --note-bg: #142238; --note-line: #6aa3f5;
  --warn-bg: #2a2212; --warn-line: #e3a73b; --danger-bg: #2c1720; --danger-line: #f0718b;
  --fix-bg: #211b39; --fix-line: #a48cf5;
  --m-dash: #8b85ff; --m-personnel: #f472b6; --m-device: #22b8d8; --m-attendance: #34c76b;
  --m-payroll: #fb8a3c; --m-system: #fb6383; --m-employee: #38bdf8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 76px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
code, kbd, .path { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--code-bg); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
pre code { overflow-wrap: normal; }
kbd {
  display: inline-block; padding: 0 6px; min-width: 1.6em; text-align: center;
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
  background: var(--surface); white-space: nowrap;
}
.path {
  background: var(--surface-2); color: var(--fg); padding: 1px 7px; border-radius: 6px;
  white-space: nowrap; font-family: var(--font); font-size: 0.9em; font-weight: 600;
}
.ui { font-weight: 650; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  height: 60px;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); min-width: 0; }
.brand img { width: 32px; height: 32px; flex: none; }
.brand b { font-size: 16px; line-height: 1.1; display: block; white-space: nowrap; }
.brand span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.nav-toggle { display: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; min-width: 36px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--fg); font: inherit; font-size: 14px; cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.search-box { position: relative; flex: 1 1 auto; max-width: 520px; margin-left: auto; }
.search-box input {
  width: 100%; height: 38px; padding: 0 12px 0 34px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-2); color: var(--fg); font: inherit; font-size: 15px;
}
.search-box input:focus { background: var(--surface); }
.search-box svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--muted); }
.search-results {
  position: absolute; top: 44px; left: 0; right: 0; z-index: 50;
  max-height: min(70vh, 520px); overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 16px 40px rgba(16, 24, 40, .18); padding: 6px;
}
.search-results a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--fg); text-decoration: none; }
.search-results a:hover, .search-results a.active { background: var(--accent-soft); }
.search-results .sr-page { display: block; font-size: 12px; color: var(--muted); }
.search-results .sr-title { display: block; font-weight: 650; }
.search-results .sr-snip { font-size: 13px; color: var(--muted); display: block; }
.search-results mark { background: none; color: var(--accent); font-weight: 700; }
.search-results .sr-empty { padding: 10px; color: var(--muted); font-size: 14px; }

/* ---------- frame ---------- */
.frame { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: calc(100vh - 60px); }
.sidebar {
  position: sticky; top: 60px; align-self: start;
  height: calc(100vh - 60px); overflow: auto;
  border-right: 1px solid var(--border); background: var(--surface);
  padding: 14px 10px 30px;
  font-size: 14.5px;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar .grp { margin-bottom: 6px; }
.sidebar .grp > button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border: 0; border-radius: 8px; background: none;
  color: var(--fg); font: inherit; font-weight: 650; cursor: pointer; text-align: left;
}
.sidebar .grp > button:hover { background: var(--surface-2); }
.sidebar .grp > button .chev { margin-left: auto; color: var(--muted); transition: transform .15s; }
.sidebar .grp.closed > button .chev { transform: rotate(-90deg); }
.sidebar .grp.closed > ul { display: none; }
.sidebar .dot { width: 9px; height: 9px; border-radius: 3px; flex: none; background: var(--c, var(--accent)); }
.sidebar .grp > ul { padding: 2px 0 4px 18px; border-left: 1px solid var(--border); margin-left: 12px; }
.sidebar a {
  display: block; padding: 5px 9px; border-radius: 7px; color: var(--fg); text-decoration: none; line-height: 1.4;
}
.sidebar a:hover { background: var(--surface-2); }
.sidebar a.current { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.sidebar .sub a { font-size: 13.5px; color: var(--muted); padding: 3px 9px; }
.sidebar .sub a:hover { color: var(--fg); }

.page {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--toc-w); gap: 40px;
  max-width: 1180px; width: 100%; margin: 0 auto;
  padding-block: 26px 80px;
  padding-left: max(28px, env(safe-area-inset-left, 0px));
  padding-right: max(28px, env(safe-area-inset-right, 0px));
}
.page.no-toc { grid-template-columns: minmax(0, 1fr); max-width: 980px; }
main { min-width: 0; }
.toc { position: sticky; top: 84px; align-self: start; font-size: 13.5px; max-height: calc(100vh - 110px); overflow: auto; }
.toc b { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.toc a { display: block; padding: 4px 10px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--fg); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 650; }
.toc .lvl3 a { padding-left: 22px; font-size: 13px; }

@media (max-width: 1200px) { .page { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 900px) {
  .frame { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; top: 60px; left: 0; bottom: 0; width: min(320px, 86vw); height: auto; z-index: 45;
    transform: translateX(-102%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.25);
    padding-left: max(10px, env(safe-area-inset-left, 0px));
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 60px 0 0; background: rgba(10, 14, 25, .45); z-index: 44; }
  .page { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 18px 64px; }
  .brand span { display: none; }
  .top-actions .label { display: none; }
}
@media (max-width: 560px) { .brand b { display: none; } }

/* ---------- article ---------- */
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs span[aria-hidden] { opacity: .6; }
h1, h2, h3, h4 { line-height: 1.25; text-wrap: balance; color: var(--fg); }
h1 { font-size: clamp(28px, 3.6vw, 38px); margin: 0 0 10px; letter-spacing: -0.015em; }
h2 { font-size: 25px; margin: 46px 0 12px; padding-top: 4px; letter-spacing: -0.01em; }
h3 { font-size: 19px; margin: 30px 0 8px; }
h4 { font-size: 16px; margin: 22px 0 6px; }
h2 .anchor, h3 .anchor { opacity: 0; margin-left: 8px; font-weight: 400; text-decoration: none; color: var(--muted); }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
.lede { font-size: 18.5px; color: var(--muted); max-width: 68ch; margin: 0 0 18px; }
main p, main li { max-width: 74ch; }
main ul, main ol { padding-left: 22px; }
main li { margin: 4px 0; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); margin: 0 0 20px; padding: 0; list-style: none; }
.meta b { color: var(--fg); font-weight: 650; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; color: var(--c, var(--accent)); border: 1px solid currentColor; }
.role { display: inline-block; font-size: 12.5px; font-weight: 650; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); margin-right: 4px; }

/* module card grid on hub pages */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 16px 0 10px; }
.card {
  display: grid; gap: 4px; align-content: start;
  padding: 16px; border: 1px solid var(--border); border-top: 3px solid var(--c, var(--accent));
  border-radius: var(--radius); background: var(--surface); color: var(--fg); text-decoration: none;
}
.card:hover { border-color: var(--c, var(--accent)); color: var(--fg); }
.card b { font-size: 16px; }
.card span { color: var(--muted); font-size: 14.5px; line-height: 1.5; }

/* numbered procedures */
ol.steps { counter-reset: s; list-style: none; padding: 0; margin: 14px 0 20px; display: grid; gap: 12px; }
ol.steps > li { counter-increment: s; position: relative; padding-left: 42px; margin: 0; }
ol.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 13.5px;
}
ol.steps > li > .result { display: block; margin-top: 4px; color: var(--muted); font-size: 15px; }
ol.steps > li > .result::before { content: "Result: "; font-weight: 650; color: var(--fg); }

/* callouts */
.callout { margin: 16px 0 20px; padding: 12px 16px 12px 14px; border-radius: 9px; border-left: 4px solid var(--note-line); background: var(--note-bg); max-width: 78ch; }
.callout > b:first-child { display: block; margin-bottom: 2px; }
.callout p { margin: 4px 0; }
.callout ul { margin: 4px 0; }
.callout.tip { border-color: var(--tip-line); background: var(--tip-bg); }
.callout.warn { border-color: var(--warn-line); background: var(--warn-bg); }
.callout.danger { border-color: var(--danger-line); background: var(--danger-bg); }
.callout.fix { border-color: var(--fix-line); background: var(--fix-bg); }
.callout.unverified { border-color: var(--warn-line); background: var(--warn-bg); border-left-style: dashed; }

/* tables */
.table-wrap { overflow-x: auto; margin: 12px 0 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--border); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.plain td:first-child { font-weight: 400; }

/* figures */
figure.shot { margin: 16px 0 24px; max-width: 820px; }
figure.shot img { display: block; width: 100%; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 22px rgba(16, 24, 40, .08); background: #fff; }
figure.shot figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
figure.shot figcaption b { color: var(--fg); }
.placeholder { border: 2px dashed var(--border); border-radius: 10px; padding: 18px; color: var(--muted); background: var(--surface); }

/* code */
pre.code { position: relative; margin: 12px 0 20px; padding: 14px 16px; overflow-x: auto; background: var(--code-bg); border: 1px solid var(--border); border-radius: 9px; font-family: var(--mono); font-size: 13.5px; line-height: 1.55; }
pre.code .copy { position: absolute; top: 8px; right: 8px; font: 12px var(--font); padding: 3px 9px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; }
pre.code .copy:hover { color: var(--accent); border-color: var(--accent); }

/* checklist */
.checklist { list-style: none; padding: 0; margin: 14px 0 22px; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); max-width: 78ch; }
.checklist input { margin-top: 5px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.checklist li.done { opacity: .72; }
.checklist li.done label > b { text-decoration: line-through; }
.progress { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.progress .bar { flex: 0 1 260px; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* glossary / definition lists */
dl.terms { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 14px 0; max-width: 80ch; }
dl.terms dt { font-weight: 700; }
dl.terms dd { margin: 0; }
@media (max-width: 600px) { dl.terms { grid-template-columns: minmax(0, 1fr); } dl.terms dd { margin-bottom: 8px; } }

/* troubleshooting entries */
.kb-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 16px; }
.kb-filter input { flex: 1 1 280px; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--fg); font: inherit; }
.kb-filter output { font-size: 14px; color: var(--muted); }
details.kb { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 8px 0; max-width: 86ch; }
details.kb > summary { cursor: pointer; padding: 12px 16px; font-weight: 650; list-style-position: outside; }
details.kb > div { padding: 0 18px 14px; }
details.kb h4 { margin: 12px 0 4px; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
details.kb[hidden] { display: none; }

/* prev / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--border); }
.pager a { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--fg); }
.pager a:hover { border-color: var(--accent); }
.pager a span { font-size: 13px; color: var(--muted); }
.pager a.next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager a.next { grid-column: 1; } }

.to-top {
  position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); bottom: max(18px, env(safe-area-inset-bottom, 0px)); z-index: 30;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--fg); cursor: pointer; box-shadow: 0 6px 18px rgba(16,24,40,.15);
  display: grid; place-items: center; font-size: 18px;
}
.to-top[hidden] { display: none; }
.foot { margin-top: 40px; font-size: 13px; color: var(--muted); }

/* ---------- print ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f3f4f7; --fg: #000; --muted: #333; --border: #bbb; }
  .topbar, .sidebar, .toc, .pager, .to-top, .skip, .anchor, pre.code .copy, .kb-filter, .progress { display: none !important; }
  .frame, .page { display: block; padding: 0; max-width: none; }
  body { font-size: 11.5pt; }
  a { color: #000; text-decoration: none; }
  h2, h3 { break-after: avoid; }
  figure.shot, table, .callout, ol.steps > li { break-inside: avoid; }
  figure.shot img { box-shadow: none; max-width: 15cm; }
  details.kb { border: 0; }
  details.kb > div { display: block !important; }
}
