:root {
  --bg: #F3F4F1;
  --surface: #FFFFFF;
  --border: #DDE0DA;
  --ink: #18201C;
  --muted: #5A635D;
  --accent: #1E6B47;
  --accent-soft: #E7F0EA;
  --amber-bg: #FDF1DC; --amber: #8A4B06;
  --red-bg: #FBE5E2;   --red: #A3241B;
  --plate: #F6CB3F;
  --font: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.topbar { display: flex; align-items: center; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; }

.page { max-width: 1100px; margin: 0 auto; padding: 32px 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; max-width: 560px; }
.card h1 { margin: 0 0 8px; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.card p { margin: 0 0 12px; color: var(--muted); }
.status { display: flex; align-items: center; gap: 8px; color: var(--accent) !important; font-weight: 600; margin-bottom: 0 !important; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

.auth-page { min-height: 100vh; }
.auth { max-width: 400px; margin: 0 auto; padding: 64px 24px 32px; display: flex; flex-direction: column; gap: 24px; }
.auth-logo { width: 56px; height: 56px; border-radius: 14px; background: var(--accent); display: grid; place-items: center; align-self: center; }
.auth h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; text-align: center; }
.auth p { margin: 0; color: var(--muted); }
.auth form { display: flex; flex-direction: column; gap: 16px; }
.auth form > p, .field { display: flex; flex-direction: column; gap: 6px; }
.auth label { font-size: 13px; font-weight: 600; color: #3E4641; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row a { font-size: 13px; font-weight: 500; }
.auth input[type=email], .auth input[type=password], .auth input[type=text] {
  height: 48px; padding: 0 14px; background: var(--surface); border: 1px solid #C9CEC6;
  border-radius: 10px; font: inherit; font-size: 15px; color: var(--ink); width: 100%;
}
.auth input:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.hint { font-size: 13px; }
.btn, .auth button { display: flex; align-items: center; justify-content: center; height: 52px; border-radius: 12px;
  font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-primary, .auth button { border: 0; background: var(--accent); color: #fff; margin-top: 4px; }
.btn-primary:hover, .auth button:hover { background: #14492F; }
.btn-secondary { height: 48px; border: 1px solid #C9CEC6; background: var(--surface); color: var(--ink); font-size: 15px; }
.divider { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-foot { text-align: center; font-size: 14px; }
.alert { background: var(--red-bg); color: var(--red); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--red); font-size: 13px; }
.messages { display: flex; flex-direction: column; gap: 8px; }
.message { background: var(--accent-soft); color: var(--accent) !important; border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.signout { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.signout button { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }

.narrow { max-width: 560px; margin: 0 auto; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-md { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.page-title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.lead { margin: 0; font-size: 16px; color: #3E4641; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page .btn { gap: 8px; }
.page .btn-primary { border: 0; background: var(--accent); color: #fff; height: 54px; }
.btn-small { height: 44px !important; padding: 0 16px; font-size: 15px; border-radius: 10px; }
.page .messages { margin-bottom: 16px; }
.page .message { margin: 0; }

.steps { list-style: none; margin: 0; padding: 20px; display: flex; flex-direction: column; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps li div { display: flex; flex-direction: column; gap: 2px; }
.steps strong { font-size: 15px; font-weight: 600; }
.steps li div span { font-size: 14px; color: var(--muted); }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: #ECEEEA; color: #3E4641; font-size: 14px;
  font-weight: 600; display: grid; place-items: center; flex-shrink: 0; }
.steps .current .step-num { background: var(--accent); color: #fff; }

.asset-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.asset-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 64px; }
.asset-row + .asset-row { border-top: 1px solid #ECEEEA; }
.asset-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.asset-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.asset-text strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-text span { font-size: 14px; color: var(--muted); }

.plate { background: var(--plate); border: 2px solid var(--ink); border-radius: 10px; font-family: var(--mono);
  font-weight: 600; letter-spacing: 0.08em; color: #111; text-align: center; text-transform: uppercase; }
input.plate { height: 56px; font-size: 22px; width: 100%; padding: 0 16px; }
input.plate::placeholder { color: rgba(17,17,17,.35); }
.plate-small { font-size: 13px; padding: 2px 8px; border-width: 1.5px; border-radius: 6px; flex-shrink: 0; }

.form-head { display: flex; align-items: center; gap: 8px; margin-left: -10px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink); border-radius: 10px; }
button.icon-btn { border: 0; background: none; padding: 0; cursor: pointer; }
.field-label { font-size: 15px; font-weight: 600; padding: 0; }
.optional { font-weight: 400; color: var(--muted); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.input { height: 48px; padding: 0 14px; background: var(--surface); border: 1px solid #C9CEC6; border-radius: 10px;
  font: inherit; font-size: 15px; color: var(--ink); width: 100%; }
.input:focus, input.plate:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.center { text-align: center; font-size: 14px; }

.type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .type-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.type-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: #3E4641; cursor: pointer; }
.type-card span { font-size: 15px; font-weight: 600; color: var(--ink); }
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card:has(input:checked) { border: 2px solid var(--accent); padding: 15px; background: var(--accent-soft); color: var(--accent); }
.type-card:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.asset-form:not(:has(input[value="car_van"]:checked, input[value="motorbike"]:checked)) .reg-field { display: none; }

.stack-xs { display: flex; flex-direction: column; gap: 6px; }
.crumb { font-size: 15px; color: var(--muted); }
.asset-row { color: inherit; text-decoration: none; }
.asset-list li + li .asset-row { border-top: 1px solid #ECEEEA; }
.asset-row:hover { background: #F8F9F7; }
.asset-list li:first-child .asset-row { border-radius: 14px 14px 0 0; }
.asset-list li:last-child .asset-row { border-radius: 0 0 14px 14px; }
.asset-list li:only-child .asset-row { border-radius: 14px; }
.chevron { color: var(--muted); flex-shrink: 0; }
.asset-hero { display: flex; align-items: center; gap: 14px; }
.asset-icon-lg { width: 56px; height: 56px; border-radius: 14px; }
.hero-meta { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.tile-label { font-size: 12px; color: var(--muted); }
.tile strong { font-size: 16px; font-weight: 600; }
.tile-sub { font-size: 12px; color: var(--muted); }
.muted-value { color: var(--muted); font-weight: 500 !important; }
.mono { font-family: var(--mono); font-weight: 600; }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #ECEEEA; color: #3E4641; }
.pill-amber { background: var(--amber-bg); color: var(--amber); }
.pill-red { background: var(--red-bg); color: var(--red); }
.section-title { margin: 0; font-size: 16px; font-weight: 600; }
.year-label { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; }
.record-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.record-main { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.record-top { display: flex; justify-content: space-between; gap: 10px; }
.record-top strong { font-size: 15px; font-weight: 600; }
.record-meta { font-size: 13px; color: var(--muted); }
.record-items { background: #F8F9F7; border-top: 1px solid #ECEEEA; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.record-items div { display: flex; justify-content: space-between; gap: 10px; }
.record-items .mono { font-weight: 400; }
.empty { background: var(--surface); border: 1px dashed #C9CEC6; border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 4px; text-align: center; }
.empty span { font-size: 14px; color: var(--muted); }

.form-head .menu { margin-left: auto; position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:focus { outline: none; }
.menu summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.menu-list { position: absolute; right: 0; top: 48px; z-index: 10; min-width: 180px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(24,32,28,.12); padding: 6px; display: flex; flex-direction: column; }
.menu-list a { padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px; }
.menu-list a:hover { background: var(--bg); }
.menu-list a.danger { color: var(--red); }

.page .btn-secondary { height: 52px; }
.btn-danger { border: 0; background: var(--red); color: #fff; height: 52px; }
.btn-danger:hover { background: #7F1C15; }

.shell { min-height: 100vh; }
.side { display: none; }
.main-col { min-width: 0; }
.topbar { justify-content: space-between; }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg);
  display: grid; place-items: center; font-weight: 600; cursor: pointer; list-style: none; }
.avatar::-webkit-details-marker { display: none; }
.account-menu { position: relative; }
.account-menu .menu-list { top: 48px; }
.menu-email { padding: 10px 12px; font-size: 13px; color: var(--muted); border-bottom: 1px solid #ECEEEA; margin-bottom: 4px; overflow-wrap: anywhere; }
.menu-list form button { width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: 8px;
  font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; }
.menu-list form button:hover { background: var(--bg); }

.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  background: var(--surface); border-top: 1px solid var(--border); padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); }
.bottom-nav a { flex: 1; max-width: 120px; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); font-size: 11px; font-weight: 500; text-decoration: none; }
.bottom-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
body:has(.bottom-nav) .page { padding-bottom: 96px; }

@media (min-width: 821px) {
  .shell:has(.side) { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh;
    background: var(--surface); border-right: 1px solid var(--border); padding: 22px 16px; }
  .side .brand { padding: 0 8px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav a { display: flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 8px; color: #3E4641;
    font-size: 14px; font-weight: 500; text-decoration: none; }
  .side-nav a:hover { background: var(--bg); }
  .side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .side-account { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px 8px 0; border-top: 1px solid #ECEEEA; }
  .side-email { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
  .side-link { font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none; }
  .side-link:hover { color: var(--accent); }
  .side-account button { align-self: flex-start; border: 0; background: none; padding: 0; color: var(--accent); font: inherit;
    font-size: 14px; font-weight: 600; cursor: pointer; }
  .shell:has(.side) .topbar { display: none; }
  .bottom-nav { display: none; }
  body:has(.bottom-nav) .page { padding-bottom: 40px; }
  .page { padding: 28px 36px 40px; }
}

.wide { max-width: 1100px; margin: 0 auto; }
.stack-xl { display: flex; flex-direction: column; gap: 28px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.section-head a { font-size: 14px; font-weight: 500; }
.empty-sm { padding: 16px; }
.pill-lg { font-size: 12px; padding: 4px 10px; }

.due-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.due-item { display: flex; flex-direction: row-reverse; align-items: center; gap: 12px; padding: 14px; }
.due-item + .due-item { border-top: 1px solid #ECEEEA; }
.due-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.due-text strong { font-size: 15px; font-weight: 600; }
.due-text span, .recent-text span { font-size: 13px; color: var(--muted); }
@media (min-width: 821px) {
  .due-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; background: none; border: 0; border-radius: 0; }
  .due-cards .due-item { flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px; background: var(--surface);
    border: 1px solid var(--border) !important; border-radius: 14px; }
  .due-cards .due-item > .pill { order: 1; }
  .due-cards .due-item > .due-text { order: 2; }
  .due-cards .due-item > form { order: 3; margin-top: auto; }
  .due-cards .due-text strong { font-size: 16px; }
}

.asset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .asset-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; } }
.asset-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; color: var(--ink); text-decoration: none; min-width: 0; }
.asset-card:hover { border-color: #C9CEC6; }
.asset-card strong { font-size: 15px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-card-icon { color: var(--accent); display: flex; }
.asset-card-sub { font-size: 12px; color: var(--muted); }
.asset-card .plate-small { font-size: 12px; padding: 1px 6px; }
.asset-card-add { align-items: center; justify-content: center; background: none; border: 1.5px dashed #B9BFB5; color: #3E4641; min-height: 120px; }
.asset-card-add span { font-size: 14px; font-weight: 500; }

.recent-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.recent-list li { display: flex; align-items: center; gap: 12px; padding: 13px 14px; }
.recent-list li + li { border-top: 1px solid #ECEEEA; }
.recent-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.recent-text strong { font-size: 15px; font-weight: 500; }
.recent-list .mono { font-weight: 500; font-size: 14px; }

[hidden] { display: none !important; }

.btn-add-record { height: 48px !important; font-size: 15px; gap: 8px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235A635D' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.mono-input, .money-input { font-family: var(--mono); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid #C9CEC6; background: var(--surface); font-size: 14px; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

.items { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.item-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-bottom: 1px solid #ECEEEA; }
.item-desc { flex: 1; min-width: 0; height: 40px; border: 0; font: inherit; font-size: 15px; color: var(--ink); background: none; }
.item-desc:focus { outline: none; }
.item-row:focus-within { background: #F8F9F7; }
.item-price { width: 96px; height: 40px; border: 1px solid var(--border); border-radius: 8px; text-align: right; padding: 0 8px;
  font-size: 14px; color: var(--ink); background: var(--surface); }
.remove-item { width: 36px; height: 40px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; border-radius: 8px; }
.remove-item:hover { color: var(--red); }
.item-errors { flex-basis: 100%; }
.item-more { flex-basis: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 44px 6px 0; }
@media (min-width: 640px) { .item-more { grid-template-columns: 104px minmax(0, 1fr) 150px 170px; } }
.item-small { height: 36px; width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px;
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); }
.item-kind { appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A635D' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; }
.item-num { font-family: var(--mono); text-align: right; }
.item-field { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted); }
.item-field span { white-space: nowrap; }
.item-small::placeholder { color: #A3AAA5; }
.item-small:focus, .item-price:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.add-item { display: flex; align-items: center; gap: 8px; width: 100%; height: 48px; padding: 0 14px; border: 0; background: none;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--accent); cursor: pointer; border-radius: 0 0 14px 14px; }
.add-item:hover { background: #F8F9F7; }
.total-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.total-row .money-input { width: 140px; text-align: right; font-size: 17px; font-weight: 600; }
.amount-row .money-input { font-size: 15px; font-weight: 400; }
.amount-row .field-label { font-weight: 400; }
.items-sum.ok { color: var(--accent); }
.field-warning { margin: 0; font-size: 13px; color: var(--amber); }
.file-error a { color: inherit; font-weight: 600; }
.total-check { color: var(--amber); }
.input.has-warning, .items.has-warning { border-color: #D9A45B; }
.field-notice { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.field-notice .notice-actions { margin-top: 0; }
.use-total { width: auto; }
.items-sum.warn { color: var(--amber); }

.input::placeholder, .item-desc::placeholder, .item-price::placeholder { color: #A3AAA5; }

.medium { max-width: 960px; margin: 0 auto; }
@media (min-width: 821px) { .narrow { max-width: 680px; } }

a.record-card { display: block; color: inherit; text-decoration: none; }
a.record-card:hover { border-color: #C9CEC6; }
.recent-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; color: inherit; text-decoration: none; }
.recent-list li { padding: 0; }
.recent-row:hover { background: #F8F9F7; }
.recent-list li:first-child .recent-row { border-radius: 14px 14px 0 0; }
.recent-list li:last-child .recent-row { border-radius: 0 0 14px 14px; }
.recent-list li:only-child .recent-row { border-radius: 14px; }
.record-asset { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); text-decoration: none; align-self: flex-start; }
.record-asset:hover span:last-child { text-decoration: underline; }
.record-total { font-size: 22px; }
.facts { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; font-size: 15px; }
.facts > div + div { border-top: 1px solid #ECEEEA; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; }
.facts-total { font-weight: 600; border-top-color: var(--border) !important; }
.facts-sub { font-weight: 400; color: var(--muted); }
.facts-sub + .facts-total { border-top-color: #ECEEEA !important; }
.facts .item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mono-plain { font-family: var(--mono); }
.notes { margin: 0; font-size: 15px; line-height: 1.6; color: #3E4641; white-space: normal; overflow-wrap: anywhere; }
.record-meta-foot { text-align: center; }
.record-plate { align-self: flex-start; }

.head-action { margin-left: auto; padding: 10px 12px; font-size: 15px; font-weight: 600; text-decoration: none; border-radius: 8px; }
.head-action:hover { background: var(--accent-soft); }
.btn-danger-outline { height: 48px; border: 1px solid #E8C3BE; background: var(--surface); color: var(--red); font-size: 15px; }
.btn-danger-outline:hover { background: var(--red-bg); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 8px; font-size: 14px; }
.pager a { font-weight: 500; }

.recent-list li { display: block; }
.recent-row .mono { margin-left: auto; }

.quiet-link { align-self: center; font-size: 14px; color: var(--muted); padding: 8px; }
.deleted-row { display: flex !important; align-items: center; gap: 12px; padding: 13px 14px; }
.deleted-row + .deleted-row { border-top: 1px solid #ECEEEA; }
.btn-restore { height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid #C9CEC6; background: var(--surface);
  font: inherit; font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer; flex-shrink: 0; }
.btn-restore:hover { background: var(--accent-soft); border-color: var(--accent); }

.recent-list li.deleted-row { padding: 13px 14px; }
@media (min-width: 821px) {
  .page:has(> .narrow) .messages { max-width: 680px; }
  .page:has(> .wide) .messages { max-width: 1100px; }
}

.add-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.choice { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; width: 100%; }
.choice:hover { border-color: #C9CEC6; }
.choice-primary { border: 0; background: var(--accent); color: #fff; }
.choice-primary:hover { background: #14492F; }
.choice-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.choice-primary .choice-icon { background: rgba(255,255,255,.16); color: #fff; }
.choice-text { display: flex; flex-direction: column; gap: 3px; }
.choice-text strong { font-size: 17px; font-weight: 600; }
.choice-text span { font-size: 13px; color: var(--muted); }
.choice-primary .choice-text span { color: rgba(255,255,255,.9); }
.file-card { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
.file-thumb { width: 64px; height: 84px; border-radius: 6px; background: #FAFAF8; border: 1px solid var(--border); display: grid; place-items: center;
  overflow: hidden; flex-shrink: 0; color: var(--accent); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.file-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { align-self: flex-start; border: 0; background: none; padding: 0; font: inherit; font-size: 14px; font-weight: 500; color: var(--accent); cursor: pointer; text-decoration: underline; }
.btn-attach { height: 48px !important; font-size: 15px; }

.bottom-nav .nav-camera { flex: 0 0 56px; max-width: 56px; height: 56px; min-height: 56px; border-radius: 50%; background: var(--accent);
  color: #fff; margin-top: -24px; border: 4px solid var(--bg); box-sizing: content-box; }
.bottom-nav .nav-camera:hover { background: #14492F; }
@media (max-width: 820px) { .desktop-only { display: none !important; } }

.add-actions .btn { margin-top: 0; }

.file-card-link { color: inherit; text-decoration: none; }
.file-card-link:hover { border-color: #C9CEC6; }
.file-card-link .file-info strong { font-size: 15px; font-weight: 600; }
.doc-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.doc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.doc-row + .doc-row { border-top: 1px solid #ECEEEA; }
.doc-link { font-size: 15px; font-weight: 500; }
.doc-remove { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--red); cursor: pointer; }
.doc-remove input { width: 18px; height: 18px; accent-color: var(--red); }

.doc-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 13px; }
.doc-removing { display: none; font-size: 13px; color: var(--red); font-weight: 500; }
.doc-row.is-removing .doc-link { text-decoration: line-through; color: var(--muted); }
.doc-row.is-removing .doc-meta { display: none; }
.doc-row.is-removing .doc-removing { display: block; }
.doc-remove-btn { flex-shrink: 0; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid #E8C3BE; background: var(--surface);
  color: var(--red); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.doc-remove-btn:hover { background: var(--red-bg); }
.doc-row.is-removing .doc-remove-btn { border-color: #C9CEC6; color: var(--ink); }

.mfa-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.mfa-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mfa-on { font-size: 14px; font-weight: 600; color: var(--accent); }
.mfa-card .btn { flex-shrink: 0; margin-top: 0; }
.mfa-btn { display: inline-flex; align-items: center; text-decoration: none; }
.mfa-qr { width: 200px; height: 200px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.mfa-secret { font-family: "IBM Plex Mono", monospace; font-size: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; overflow-wrap: anywhere; }
.mfa-code { font-family: "IBM Plex Mono", monospace; font-size: 20px; letter-spacing: 0.2em; max-width: 220px; }
.mfa-codes { list-style: none; margin: 0; padding: 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  font-family: "IBM Plex Mono", monospace; font-size: 17px; }
.auth .auth-cancel { background: var(--surface); color: var(--ink); border: 1px solid #C9CEC6; margin-top: 0; }
.auth .auth-cancel:hover { background: var(--bg, #F3F4F1); }

.staff-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.staff-bar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.staff-tag { font-size: 12px; font-weight: 600; color: var(--amber); background: var(--amber-bg); border-radius: 6px; padding: 2px 8px; }
.staff-bar button { border: 0; background: none; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 821px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat span { font-size: 13px; color: var(--muted); }
.stat strong { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat em { font-style: normal; font-size: 12px; color: var(--muted); }
.week-bars { list-style: none; margin: 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; display: flex; flex-direction: column; gap: 8px; }
.week-bars li { display: grid; grid-template-columns: 80px 1fr 40px; align-items: center; gap: 12px; font-size: 14px; }
.week-label { color: var(--muted); }
.week-bar { height: 10px; background: #ECEEEA; border-radius: 5px; overflow: hidden; }
.week-bar span { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.week-n { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.staff-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.staff-table th, .staff-table td { padding: 10px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid #ECEEEA; }
.staff-table th { font-size: 12px; font-weight: 600; color: var(--muted); }
.staff-table tr:last-child td { border-bottom: 0; }

.settings-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.settings-list li + li { border-top: 1px solid #ECEEEA; }
.settings-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; color: var(--ink); text-decoration: none; }
.settings-list a:hover { background: #FAFAF8; }
.settings-row { padding: 14px 18px; }
.settings-list svg { flex-shrink: 0; color: var(--muted); }
.settings-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.settings-text > span { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.settings-text > span.mfa-on { color: var(--accent); font-weight: 600; }
.notice { background: var(--amber-bg); border-radius: 12px; padding: 14px 16px; }
.notice p { margin: 0; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.notice-actions .btn { margin-top: 0; }
.notice-cancel { color: var(--red); }
.plain-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: #3E4641; }
.danger-text { color: var(--red); }

.reminder-row form { margin: 0; flex-shrink: 0; }
.btn-done { height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid #C9CEC6; background: var(--surface);
  color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-done:hover { background: var(--accent-soft); border-color: var(--accent); }
.due-title { font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; }
.due-title:hover { color: var(--accent); text-decoration: underline; }
.done-list .due-text strong { color: var(--muted); font-weight: 500; }
.next-reminder { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.check-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.check-row > span { display: flex; flex-direction: column; gap: 2px; }
.next-fields { padding-top: 8px; }
.next-card { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; color: var(--ink); text-decoration: none; }
.next-card:hover { border-color: #C9CEC6; }
.next-text { display: flex; flex-direction: column; gap: 2px; }
.next-text span { font-size: 13px; color: var(--muted); }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.search-box { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; background: var(--surface);
  border: 1px solid #C9CEC6; border-radius: 12px; color: var(--muted); }
.search-box:focus-within { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 15px; color: var(--ink); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-clear { font-size: 14px; font-weight: 500; }
mark { background: #FCE9A8; color: inherit; border-radius: 3px; padding: 0 1px; }
.match-item { display: block; font-size: 13px; color: #3E4641; }

.scan-wait { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 56px 0; text-align: center; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

@media (hover: hover) and (pointer: fine) {
  .touch-only { display: none; }
}
