/* IT Asset Register — clean, print-friendly styling */
/* Fonts: Roboto & Roboto Mono (Google, Apache 2.0), bundled so they work without internet */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/roboto-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/roboto-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/roboto-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/roboto-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/roboto-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/roboto-mono-latin-500-normal.woff2) format("woff2"); }

:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #4b5563;
  --line: #e3e6eb;
  --line-strong: #cfd4dc;
  --accent: #1f3a5f;
  --accent-ink: #ffffff;
  --accent-soft: #e8eef6;
  --ok: #157f3b;   --ok-bg: #e6f4ea;
  --info: #1d5fa8; --info-bg: #e7f0fb;
  --warn: #9a5b00; --warn-bg: #fdf1dc;
  --bad: #b42318;  --bad-bg: #fde8e7;
  --mute: #555e6b; --mute-bg: #eef0f3;
  --radius: 8px;
  --font: "Roboto", "Segoe UI", Arial, sans-serif;
  --mono: "Roboto Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 700; margin: 0 0 4px; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 13px; font-weight: 700; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .05em; color: #374151; }
p { margin: 0 0 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
code, kbd { font-family: var(--mono); font-size: 12px; background: var(--mute-bg); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
kbd { border: 1px solid var(--line-strong); }
pre { background: var(--mute-bg); padding: 10px; border-radius: 6px; overflow: auto; font-size: 12px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; }
.light { font-weight: 400; color: var(--muted); }
.inline { display: inline; }
.req { color: var(--bad); font-style: normal; }
.eyebrow { font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.print-only { display: none; }

/* top bar */
.topbar { background: var(--accent); color: var(--accent-ink); }
.topbar-in { display: flex; align-items: center; gap: 20px; min-height: 56px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 34px; height: 34px; border-radius: 8px; background: #fff; padding: 2px; flex: 0 0 34px; object-fit: contain; }
.brand > span { min-width: 0; }
.brand strong, .brand small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand strong { display: block; font-size: 14px; line-height: 1.2; }
.brand small { display: block; font-size: 11px; opacity: .75; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.nav a { color: rgba(255,255,255,.82); padding: 7px 11px; border-radius: 6px; white-space: nowrap; }
.nav a:hover { background: rgba(255,255,255,.1); text-decoration: none; color: #fff; }
.nav a.on { background: rgba(255,255,255,.18); color: #fff; }
.userbox { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.userbox a { color: #fff; }
.linkbtn { background: none; border: 0; color: rgba(255,255,255,.8); cursor: pointer; font: inherit; padding: 0; }
.linkbtn:hover { color: #fff; text-decoration: underline; }

main.wrap { padding-top: 20px; padding-bottom: 40px; min-height: 70vh; }
.foot { color: var(--muted); font-size: 12px; padding: 16px 0 24px; }

/* blocks */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.narrow { max-width: 560px; margin: 24px auto; }
.card.login { max-width: 400px; }
.card.empty { text-align: center; color: var(--muted); padding: 32px; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead p { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.alert { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid; }
.a-ok { background: var(--ok-bg); border-color: #b9e0c5; color: #0f5c2b; }
.a-info { background: var(--info-bg); border-color: #bcd5f2; color: #17497f; }
.a-warn { background: var(--warn-bg); border-color: #f2d49e; color: #7a4800; }
.a-bad { background: var(--bad-bg); border-color: #f5c2bf; color: #8f1c13; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 6px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; line-height: 1.3; }
.btn:hover { background: #f0f2f5; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #172d4a; }
.btn.danger { color: var(--bad); border-color: #f0b8b4; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--mute-bg); color: var(--ink); }
.btn.sm { padding: 3px 9px; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; padding: 10px; }
.btn.on { background: var(--accent-soft); border-color: #b9c9de; color: var(--accent); }

.dropdown { position: relative; }
.dropdown .menu { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(16,24,40,.12); min-width: 270px; padding: 6px; z-index: 20; }
.dropdown.open .menu { display: block; }
.dropdown .menu a { display: block; padding: 8px 10px; border-radius: 5px; color: var(--ink); }
.dropdown .menu a:hover { background: var(--bg); text-decoration: none; }
.dropdown .menu hr { margin: 4px 0; }

/* badges */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-mute { background: var(--mute-bg); color: var(--mute); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius); padding: 10px 14px; color: var(--ink); }
.stat:hover { text-decoration: none; border-color: var(--line-strong); }
.stat b { display: block; font-size: 22px; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.ok { border-left-color: var(--ok); } .stat.info { border-left-color: var(--info); }
.stat.warn { border-left-color: #d98e04; } .stat.bad { border-left-color: var(--bad); }
.stat.on { background: var(--accent-soft); }

/* filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input[type=search] { flex: 1 1 260px; }
.filters select { flex: 0 1 190px; }

/* forms */
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b9c9de; border-color: var(--accent); }
textarea { resize: vertical; }
input[type=checkbox] { width: auto; }
input.slim, select.slim { padding: 4px 8px; }
.form label, .form .fld { display: block; font-weight: 500; margin-bottom: 14px; min-width: 0; }
.form .fld > input, .form .fld > select, .form .fld > textarea { margin-top: 4px; display: block; }
.form .fld small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 3px; }
.form .fld.has-err input, .form .fld.has-err select { border-color: var(--bad); }
.lbl { display: block; color: #1f2937; }
input.up { text-transform: uppercase; }
input.up::placeholder { text-transform: none; }
.form label > input, .form label > select, .form label > textarea { margin-top: 4px; display: block; }
.form label small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 3px; }
.form label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.form label.has-err input, .form label.has-err select { border-color: var(--bad); }
.form small.err { color: var(--bad) !important; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset.card { margin: 0 0 14px; }
legend { font-weight: 600; padding: 0 6px; margin-left: -6px; }
.assetform .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.assetform .grid.one, .assetform .grid.two { grid-template-columns: 1fr 1fr; }
.formlayout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.tips { position: sticky; top: 12px; font-size: 13px; }
.tips p { margin-bottom: 12px; }
.formbar { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.uprows { display: grid; gap: 8px; }
.uprow { display: grid; grid-template-columns: 1fr 120px 130px; gap: 8px; }
.upadd { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; display: grid; gap: 8px; }
.upadd .btn { justify-self: start; }
.copybox { display: flex; gap: 6px; margin: 10px 0 6px; }
.copybox input { font-family: var(--mono); font-size: 12px; }

/* tables */
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card .tablewrap { border: 0; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line); padding: 9px 10px; white-space: nowrap; }
.tbl th a { color: var(--muted); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tfoot td { border-top: 2px solid var(--line-strong); border-bottom: 0; }
.tbl.hover tbody tr { cursor: pointer; }
.tbl.hover tbody tr:hover { background: #f7f9fc; }
.tbl.compact th, .tbl.compact td { padding: 5px 8px; }

/* asset view */
.viewlayout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dgroup { margin-bottom: 18px; }
.dgroup:last-child { margin-bottom: 0; }
.dgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 16px; margin: 0; }
.dgrid.wide { grid-template-columns: 1fr 1fr; }
.dgrid dt { font-size: 12.5px; color: var(--muted); }
.dgrid dd { font-weight: 500; }
.dgrid dd { margin: 0; word-break: break-word; }
.upitem { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.upitem.closed b { text-decoration: line-through; color: var(--muted); }
.upactions { display: flex; gap: 4px; align-items: flex-start; }
.history { list-style: none; margin: 0 0 10px; padding: 0; max-height: 360px; overflow: auto; }
.history li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }

/* guide */
.guide .steps, .steps { padding-left: 20px; }
.steps li { margin-bottom: 8px; }
.guidegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.guidegrid .card { margin: 0; }
.guidegrid ul { padding-left: 18px; margin: 0 0 10px; }
.guidegrid li { margin-bottom: 4px; }

/* report / shared view */
body.report { background: #e9ebee; }
.reportbar { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.reportbar .wrap { display: flex; gap: 8px; align-items: center; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.reportbar .spacer { flex: 1; }
.sharesearch { display: flex; gap: 6px; }
.sharesearch input { width: 220px; }
.sharesearch select { width: 170px; }
.paper { background: #fff; padding: 28px; margin-top: 16px; margin-bottom: 32px; border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.rhead { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 16px; }
.rhead h1 { font-size: 20px; }
.rhead h2 { font-size: 15px; font-weight: 500; color: var(--muted); margin: 0; }
.rmeta { text-align: right; font-size: 12px; }
.summary { display: flex; gap: 16px; margin-bottom: 16px; align-items: flex-start; flex-wrap: wrap; }
.summary .tbl { width: auto; min-width: 200px; border: 1px solid var(--line); }
.print-tbl { font-size: 12.5px; }
.print-tbl td.notes div { margin-bottom: 2px; }
.record { border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin-bottom: 14px; break-inside: avoid; }
.rechead { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 12px; }
.rechead h3 { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 15px; margin: 0; }
.record .dgroup { margin-bottom: 10px; }
.record .dgroup h3 { font-size: 11px; margin-bottom: 6px; }
.signoff { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 48px; }
.signoff div { border-top: 1px solid var(--ink); padding-top: 4px; font-size: 12px; color: var(--muted); }
.signoff div::after { content: "Name, signature & date"; display: block; font-size: 10px; }

/* labels */
.labels { display: grid; gap: 4mm; padding: 16px; max-width: 210mm; margin: 0 auto; background: #fff; }
.labels.medium { grid-template-columns: repeat(3, 1fr); }
.labels.small { grid-template-columns: repeat(4, 1fr); }
.label { border: 1px dashed #b5bcc6; border-radius: 3mm; padding: 2.5mm; display: flex; gap: 2.5mm; align-items: center; break-inside: avoid; min-height: 30mm; overflow: hidden; }
.labels.small .label { min-height: 24mm; }
.label .qr { width: 22mm; flex: 0 0 22mm; }
.labels.small .label .qr { width: 16mm; flex-basis: 16mm; }
.label .qr img, .label .qr canvas { width: 100% !important; height: auto !important; display: block; }
.label .qr canvas { display: none !important; }
.ltext { min-width: 0; line-height: 1.25; }
.lco { font-size: 8pt; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ltag { font-size: 13pt; font-weight: 800; letter-spacing: .02em; }
.labels.small .ltag { font-size: 11pt; }
.lmodel, .lsn { font-size: 7.5pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsn { font-family: var(--mono); }
.lfoot { font-size: 6.5pt; color: #666; margin-top: 1mm; }

/* responsive */
@media (max-width: 980px) {
  .formlayout, .viewlayout { grid-template-columns: 1fr; }
  .tips { position: static; }
  .assetform .grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  h1 { font-size: 21px; }
  main.wrap { padding-top: 14px; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  body.is-form main.wrap { padding-bottom: 24px; }
  .foot { display: none; }
  /* top bar: back · logo + company · avatar */
  .topbar { position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top); }
  .topbar-in { flex-wrap: nowrap; gap: 10px; min-height: 54px; padding-top: 4px; padding-bottom: 4px; }
  .topbar .nav, .topbar .userbox { display: none; }
  .backbtn span { display: none; }
  .backbtn { padding: 6px; margin-left: -6px; }
  .brand { flex: 1; min-width: 0; }
  .avatar { display: grid; }
  /* layout */
  .pagehead { align-items: stretch; gap: 10px; margin-bottom: 12px; }
  .pagehead > div:first-child { min-width: 0; }
  .pagehead .actions { width: 100%; }
  .pagehead .actions .btn { flex: 1 1 auto; justify-content: center; }
  .pagehead .actions form.inline { display: contents; }
  .assetform .grid, .assetform .grid.one, .assetform .grid.two, .row2, .dgrid.wide { grid-template-columns: 1fr; }
  .dgrid { grid-template-columns: 1fr 1fr; }
  .uprow { grid-template-columns: 1fr 1fr; }
  .uprow input:first-child { grid-column: 1 / -1; }
  .filters input[type=search] { flex: 1 1 100%; }
  .filters select, .filters .sp { flex: 1 1 45%; }
  .filters .btn { flex: 1 1 auto; justify-content: center; }
  .card { padding: 14px; border-radius: 10px; }
  fieldset.card { padding-top: 10px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat { padding: 8px 12px; }
  .stat b { font-size: 20px; }
  .paper { padding: 14px; }
  .rhead { flex-direction: column; }
  .rmeta { text-align: left; }
  .labels.medium, .labels.small { grid-template-columns: repeat(2, 1fr); }
  .sharesearch input, .sharesearch select { width: 100%; }
  .sharesearch { flex-wrap: wrap; width: 100%; }
  input, select, textarea, .sp-btn { font-size: 16px; min-height: 44px; }
  .btn { min-height: 42px; }
  .btn.sm { min-height: 34px; }
  .formbar { bottom: 0; margin: 0 -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; box-shadow: 0 -4px 14px rgba(16,24,40,.08); z-index: 20; }
  .formbar .btn { justify-content: center; }
  .formbar .btn.primary { grid-column: 1 / -1; }
  .formbar .btn.ghost { display: none; }
  .formlayout .tips { order: 2; }
  .dropdown .menu { right: auto; left: 0; min-width: 0; width: calc(100vw - 32px); }
  /* lists become cards */
  .tablewrap.cards { background: none; border: 0; overflow: visible; }
  .cards .tbl, .cards .tbl tbody, .cards .tbl tr, .cards .tbl td { display: block; width: 100%; }
  .cards .tbl thead { display: none; }
  .cards .tbl tr { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; position: relative; }
  .cards .tbl td { border: 0; padding: 2px 0; }
  .cards .tbl td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
  .cards .tbl td.c-head { font-size: 16px; padding-right: 110px; }
  .cards .tbl td.c-right { position: absolute; top: 10px; right: 12px; width: auto; text-align: right; }
  .cards .tbl td.c-inline { display: inline-block; width: auto; margin-right: 6px; }
  .cards .tbl td:empty { display: none; }
  .cards .tbl tfoot td { display: block; }
}
@media (max-width: 380px) {
  .dgrid { grid-template-columns: 1fr; }
}

/* print */
@media print {
  body, body.report { background: #fff; font-size: 10.5pt; }
  .no-print, .topbar, .foot, .formbar, .reportbar, .bottomnav, .sheet { display: none !important; }
  .print-only { display: block; }
  .wrap { max-width: none; padding: 0; }
  main.wrap { padding: 0; }
  .paper { box-shadow: none; padding: 0; margin: 0; }
  .card, .tablewrap { border: 0; padding: 0; box-shadow: none; }
  .tbl th { background: #f1f3f5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tbl tr { break-inside: avoid; }
  .print-tbl { font-size: 8.5pt; }
  .print-tbl th, .print-tbl td { padding: 4px 5px; }
  .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; }
  thead { display: table-header-group; }
  .labels { padding: 0; max-width: none; gap: 3mm; }
  .label { border-color: #999; }
  .viewlayout { grid-template-columns: 1fr; }
}

/* v1.1 — standard pickers, password fields */
.fld > select[data-combo] { margin-top: 4px; }
.combo-new { display: flex; gap: 8px; margin-top: 6px; align-items: center; }
.combo-new input { flex: 1; }
.linkish { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 12.5px; padding: 0; white-space: nowrap; }
.linkish:hover { text-decoration: underline; }
.pick { display: grid; gap: 6px; margin-top: 4px; align-items: start; }
.pick.two { grid-template-columns: 1fr 1fr; }
.pick.cap { grid-template-columns: 1.2fr 1fr; }
.pick .other { display: none; grid-template-columns: 1fr 76px; gap: 6px; grid-column: 1 / -1; }
.pick .other.on { display: grid; }
.drive2 { margin-top: 6px; }
.legacy { font-size: 12px; background: var(--warn-bg); color: #7a4800; border-radius: 6px; padding: 5px 8px; margin-top: 6px; font-weight: 400; }
.pw-wrap { position: relative; display: block; margin-top: 4px; }
.pw-wrap input { padding-right: 64px; margin-top: 0 !important; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--accent);
  font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; padding: 4px 6px; }
.secret .mono { letter-spacing: .05em; }
.secret.shown .mono { letter-spacing: 0; }
.form label { color: #1f2937; }
.listedit textarea { font-size: 13px; }
.listgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.listgrid label { margin: 0; }
.diff { font-size: 13px; }
.diff del { color: var(--bad); text-decoration: line-through; }
.diff ins { color: var(--ok); text-decoration: none; font-weight: 500; }

/* v1.2 — back button, avatar, phone bottom menu, "More" sheet */
.backbtn { display: inline-flex; align-items: center; gap: 4px; color: #fff; padding: 6px 10px 6px 4px; border-radius: 8px; font-size: 14px; }
.backbtn:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.avatar { display: none; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; place-items: center; font-weight: 700; flex: 0 0 36px; }
.avatar:hover { text-decoration: none; }
.ic { display: block; flex: 0 0 auto; }
.bottomnav { display: none; }
@media (max-width: 720px) {
  .bottomnav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -2px 12px rgba(16,24,40,.06); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  body.is-form .bottomnav { display: none; }
  .bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #4b5563; font: 500 11.5px var(--font);
    background: none; border: 0; padding: 6px 2px; border-radius: 10px; cursor: pointer; }
  .bottomnav a:hover { text-decoration: none; }
  .bottomnav .on { color: var(--accent); }
  .bottomnav .on .ic { stroke-width: 2.3; }
  .bottomnav a.add .ic { background: var(--accent); color: #fff; border-radius: 50%; width: 42px; height: 42px; padding: 9px; margin-top: -14px; box-shadow: 0 4px 10px rgba(31,58,95,.35); }
  .bottomnav a.add { color: var(--accent); }
}
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet-bg { position: absolute; inset: 0; background: rgba(15,23,42,.45); }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 16px 16px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 80vh; overflow: auto; }
.sheet-head { display: flex; flex-direction: column; padding: 2px 4px 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sheet-grid a, .sheet-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 12px; color: var(--ink);
  background: var(--bg); border: 0; font: 500 13px var(--font); cursor: pointer; width: 100%; text-align: center; }
.sheet-grid a:hover { text-decoration: none; }
.sheet-grid .ic { color: var(--accent); }
.sheet-grid form { margin: 0; }

/* searchable drop-down */
.sp-native { display: none !important; }
.sp { display: block; margin-top: 4px; min-width: 0; position: relative; }
.filters .sp { margin-top: 0; flex: 0 1 190px; }
.pick .sp { margin-top: 0; }
.sp-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 10px; cursor: pointer; min-height: 38px; }
.sp-btn:focus { outline: 2px solid #b9c9de; border-color: var(--accent); }
.sp-btn[aria-expanded=true] { border-color: var(--accent); }
.sp-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-btn.placeholder .sp-val { color: #6b7280; }
.sp-btn svg { flex: 0 0 auto; color: #6b7280; }
.fld.has-err .sp-btn { border-color: var(--bad); }
.sp-panel { position: fixed; z-index: 80; background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 12px 32px rgba(16,24,40,.18);
  display: flex; flex-direction: column; overflow: hidden; }
.sp-searchbox { padding: 8px; border-bottom: 1px solid var(--line); }
.sp-search { width: 100%; padding: 8px 10px; }
.sp-list { list-style: none; margin: 0; padding: 4px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.sp-item { padding: 9px 10px; border-radius: 6px; cursor: pointer; line-height: 1.3; }
.sp-item.act { background: var(--accent-soft); }
.sp-item.sel { font-weight: 700; color: var(--accent); }
.sp-item.sel::after { content: " ✓"; }
.sp-new { color: var(--accent); font-weight: 500; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; margin-top: 2px; }
.sp-clear { color: var(--muted); font-size: 13px; }
.sp-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 10px 4px; font-weight: 700; }
.sp-hint { font-size: 12px; color: var(--muted); padding: 4px 10px 6px; }
.sp-empty { padding: 12px 10px; color: var(--muted); }
.sp-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 79; }
.sp-sheet { left: 0; right: 0; bottom: 0; top: auto; border-radius: 16px 16px 0 0; height: min(78vh, 640px); border: 0; padding-bottom: env(safe-area-inset-bottom); }
.sp-sheet .sp-item { padding: 13px 12px; font-size: 16px; border-bottom: 1px solid #f1f3f6; border-radius: 0; }
.sp-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 4px; font-size: 16px; }
.sp-close { background: var(--bg); border: 0; border-radius: 50%; width: 34px; height: 34px; font-size: 15px; cursor: pointer; color: var(--muted); }
html.sp-lock, html.sp-lock body { overflow: hidden; }
.spec-note { margin: -4px 0 10px; }
.draftbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.installbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
