/* Components shared by the marketing site, sign-in and the console. Uses tokens.css only. */

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); line-height: 1; min-height: var(--touch); }
.brand-img { height: 28px; width: auto; }
.brand-icon { width: 30px; height: 30px; flex: none; display: block; }
.brand-sm .brand-icon { width: 26px; height: 26px; }
.brand-lg .brand-icon { width: 38px; height: 38px; }
.brand-img-dark { display: none; }
:root[data-theme="dark"] .brand-has-dark .brand-img-light { display: none; }
:root[data-theme="dark"] .brand-has-dark .brand-img-dark { display: block; }
.wordmark { font-family: var(--font-display); font-weight: 900; font-size: 25px; letter-spacing: -0.05em; color: var(--fg); white-space: nowrap; }
.wordmark b { font-weight: 900; color: var(--primary); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none; display: inline-grid; place-items: center;
  background: var(--solid); color: var(--on-solid); font-family: var(--font-display); font-weight: 900; font-size: 17px; letter-spacing: -0.06em;
}
.brand-mark b { color: var(--primary-bright); font-weight: 900; }
.brand-sm .wordmark { font-size: 20px; }
.brand-sm .brand-mark { width: 26px; height: 26px; font-size: 15px; border-radius: 8px; }
.brand-lg .wordmark { font-size: 32px; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--touch); padding: 0 18px; border-radius: var(--r-md);
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn .i { width: 16px; height: 16px; }
.btn-solid { background: var(--solid); color: var(--on-solid); box-shadow: var(--shadow-solid); }
.btn-solid:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary-bright); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary); }
.btn-ghost { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-inset); }
.btn-ghost:hover { box-shadow: 0 0 0 1px var(--border-strong), 0 4px 12px #0d15260f; }
.btn-quiet { background: transparent; color: var(--fg-muted); padding: 0 12px; }
.btn-quiet:hover { background: var(--film-2); color: var(--fg); }
.btn-danger { background: var(--surface); color: var(--danger-ink); box-shadow: 0 0 0 1px var(--danger-soft), 0 0 0 1px var(--hair); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 17px; border-radius: 13px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; box-shadow: none; transform: none; cursor: not-allowed; }
.btn[aria-busy="true"] { color: transparent; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; border: 2px solid currentColor; border-color: var(--on-solid) transparent var(--on-solid) transparent;
  animation: spin .8s linear infinite;
}
.btn-ghost[aria-busy="true"]::after, .btn-quiet[aria-busy="true"]::after { border-color: var(--fg) transparent var(--fg) transparent; }
.btn-primary[aria-busy="true"]::after { border-color: var(--on-primary) transparent var(--on-primary) transparent; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn-row.center, .center .btn-row { justify-content: center; }
.is-hover.btn-solid { transform: translateY(-1px); }
.is-hover.btn-ghost { box-shadow: 0 0 0 1px var(--border-strong), 0 4px 12px #0d15260f; }
.is-focus { outline: 2px solid var(--primary); outline-offset: 2px; }

.icon-btn {
  width: var(--touch); height: var(--touch); border-radius: var(--r-sm);
  display: inline-grid; place-items: center; color: var(--fg-muted); flex: none;
}
.icon-btn:hover { background: var(--film-2); color: var(--fg); }
.icon-btn .i { width: 20px; height: 20px; }

.spinner {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--film-3); border-top-color: var(--primary); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Theme toggle: sun in light, moon in dark ---------- */
.theme-moon { display: none; }
:root[data-theme="dark"] .theme-sun { display: none; }
:root[data-theme="dark"] .theme-moon { display: block; }
/* ---------- Chips, pills, badges, avatars ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 30px; padding: 0 12px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; color: var(--fg-muted);
  background: var(--film-1); box-shadow: inset 0 0 0 1px var(--hair);
}
a.chip:hover { color: var(--fg); background: var(--film-2); }
.chip .i { width: 14px; height: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 9px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; line-height: 1;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-plain::before { display: none; }
.pill-ok { background: var(--ok-soft); color: var(--ok-ink); }
.pill-info { background: var(--info-soft); color: var(--info-ink); }
.pill-warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill-bad { background: var(--danger-soft); color: var(--danger-ink); }
.pill-neutral { background: var(--neutral-soft); color: var(--neutral-ink); }

.status {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 0 16px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
}
.status.status-warn { background: var(--warn); color: var(--on-warn); }
.status.status-ok { background: var(--ok-strong); color: var(--on-ok-strong); }
.status.status-info { background: var(--primary-bright); color: var(--on-primary); }
.status.status-bad { background: var(--danger); color: var(--on-danger); }
.status.status-neutral { background: var(--neutral-soft); color: var(--neutral-ink); }

.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 750; line-height: 1; background: var(--film-3); color: var(--fg-muted);
}
.badge-primary { background: var(--primary-bright); color: var(--on-primary); }
.badge-soon { background: var(--warn-soft); color: var(--warn-ink); font-size: 10.5px; letter-spacing: .02em; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 800; color: var(--on-primary); background: var(--primary-bright);
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.avatar-ok { background: #1f7a44; color: #ffffff; }
.avatar-warn { background: #8a5100; color: #ffffff; }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--space-4); align-content: start; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field-label, .field > label { font-size: 14px; font-weight: 650; color: var(--fg); }
.field-hint { font-size: 13px; color: var(--fg-subtle); line-height: 1.45; }
.field-error { font-size: 13px; color: var(--danger-ink); font-weight: 600; line-height: 1.45; }
.input, .select, .textarea {
  width: 100%; min-height: var(--touch); padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--surface); color: var(--fg); border: 1px solid var(--border);
  box-shadow: 0 1px 2px #0d15260a; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-subtle) 50%), linear-gradient(135deg, var(--fg-subtle) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.input::placeholder, .textarea::placeholder { color: var(--fg-faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible, .is-focus.input {
  outline: none; border-color: var(--primary); box-shadow: var(--focus-ring);
}
.input:disabled, .select:disabled, .textarea:disabled { opacity: .6; cursor: not-allowed; background: var(--surface-muted); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input-code { font-family: var(--font-mono); font-size: 22px; letter-spacing: 0.35em; text-align: center; padding-left: 20px; }
.input-mono { font-family: var(--font-mono); }
input[type="file"].input { padding: 9px 12px; }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 6px 12px; border: 0; border-radius: 8px;
  background: var(--film-3); color: var(--fg); font-weight: 650; cursor: pointer;
}

.check { display: flex; align-items: flex-start; gap: 10px; min-height: var(--touch); padding: 10px 0; font-size: 15px; color: var(--fg); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary-bright); flex: none; }
.check .field-hint { display: block; }

.toggle { display: inline-flex; align-items: center; gap: 10px; min-height: var(--touch); font-size: 14px; color: var(--fg-muted); cursor: pointer; }
.toggle input {
  appearance: none; -webkit-appearance: none; width: 40px; height: 24px; margin: 0; border-radius: var(--r-pill);
  background: var(--film-3); box-shadow: inset 0 0 0 1px var(--hair); position: relative; cursor: pointer; transition: background .2s;
}
.toggle input::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px #0003; transition: transform .2s;
}
.toggle input:checked { background: var(--ok); }
.toggle input:checked::after { transform: translateX(16px); }
.toggle input:focus-visible { box-shadow: var(--focus-ring); }

.copy-field { display: flex; align-items: stretch; gap: 8px; min-width: 0; }
.copy-field code {
  flex: 1; min-width: 0; display: flex; align-items: center; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--surface-muted); color: var(--fg); overflow-wrap: anywhere; font-size: 15px; letter-spacing: 0.06em;
}

/* ---------- Segmented control and tabs ---------- */
.segment { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--film-2); box-shadow: inset 0 0 0 1px var(--hair); }
.segment a, .segment button {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; color: var(--fg-muted); transition: background .2s, color .2s;
}
.segment a:hover, .segment button:hover { color: var(--fg); }
.segment .is-active, .segment [aria-current="page"], .segment [aria-selected="true"] {
  background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px #0d15261f, 0 0 0 1px var(--hair-soft);
}
.segment-lg a, .segment-lg button { min-height: 40px; padding: 0 18px; font-size: 15px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--touch); padding: 0 14px; margin-bottom: -1px;
  font-size: 14px; font-weight: 650; color: var(--fg-muted); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { color: var(--fg); }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { color: var(--fg); border-bottom-color: var(--primary); }

/* ---------- Dropdown menu (details/summary, works without JS) ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--touch); padding: 0 10px; border-radius: var(--r-sm);
  font-size: 15px; font-weight: 550; color: var(--fg-muted);
}
.menu-toggle:hover, .menu[open] .menu-toggle { color: var(--fg); background: var(--film-2); }
.menu-toggle .chev { width: 14px; height: 14px; transition: transform .2s; }
.menu[open] .menu-toggle .chev { transform: rotate(180deg); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 240px; padding: 6px;
  background: var(--glass-thick); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 14px; box-shadow: var(--shadow-float);
}
.menu-panel-left { left: 0; right: auto; }
.menu-panel a, .menu-panel button {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 10px; border-radius: 9px;
  font-size: 14px; font-weight: 550; color: var(--fg-muted); text-align: left;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--film-2); color: var(--fg); }
.menu-panel .i { width: 16px; height: 16px; color: var(--primary); }
.menu-panel form { margin: 0; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--hair-soft); margin-bottom: 6px; }
.menu-head b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.menu-head span { font-size: 12.5px; color: var(--fg-subtle); }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--hair-soft); }

/* ---------- Breadcrumb ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--fg-subtle); margin-bottom: 20px; }
.crumbs a:hover { color: var(--fg); text-decoration: underline; }

/* ---------- Cards ---------- */
.card { padding: 28px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-card); min-width: 0; }
.card-sm { padding: 20px; border-radius: 16px; }
.card-flat { background: var(--surface-muted); box-shadow: none; }
.card h2, .card h3 { font-size: 19px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.3; }
.card > p, .card-text { font-size: 15px; line-height: 1.6; color: var(--fg-muted); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head p { font-size: 14px; color: var(--fg-subtle); margin-top: 2px; }
.card-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--hair-soft); }
.card-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--info-soft); color: var(--primary); margin-bottom: 16px; }
.card-icon .i { width: 19px; height: 19px; }
.card-link { display: block; transition: transform .2s, box-shadow .2s; }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); }
.stat { display: grid; gap: 4px; }
.stat b { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--fg-subtle); }

/* ---------- Key/value lists ---------- */
.kv { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: 0 20px; font-size: 15px; }
.kv dt, .kv dd { padding: 10px 0; border-bottom: 1px solid var(--hair-soft); min-width: 0; }
.kv dt { color: var(--fg-subtle); }
.kv dd { color: var(--fg); font-weight: 550; overflow-wrap: anywhere; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
@media (max-width: 480px) {
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dt { padding-bottom: 0; border-bottom: 0; font-size: 13px; }
  .kv dd { padding-top: 2px; }
}

/* ---------- Alerts and notices ---------- */
.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md);
  font-size: 14.5px; line-height: 1.5; background: var(--info-soft); color: var(--fg);
}
.alert > .i { width: 18px; height: 18px; margin-top: 2px; color: var(--info-ink); }
.alert b { display: block; margin-bottom: 2px; }
.alert p { color: var(--fg-muted); }
.alert-ok { background: var(--ok-soft); }
.alert-ok > .i { color: var(--ok-ink); }
.alert-warn { background: var(--warn-soft); }
.alert-warn > .i { color: var(--warn-ink); }
.alert-error { background: var(--danger-soft); }
.alert-error > .i { color: var(--danger-ink); }
.alert-neutral { background: var(--neutral-soft); }
.alert-neutral > .i { color: var(--neutral-ink); }

.notice {
  position: fixed; left: 50%; bottom: 24px; z-index: 120; transform: translate(-50%, 20px); opacity: 0;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 12px; background: var(--solid); color: var(--on-solid);
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-float);
  transition: opacity .2s, transform .2s; pointer-events: none;
}
.notice.is-on { opacity: 1; transform: translate(-50%, 0); }
.notice-static { position: static; transform: none; opacity: 1; display: inline-flex; }

/* Floating toast used inside illustrations and the component catalogue */
.toast {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; min-width: 200px;
  background: var(--glass-thick); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-radius: 14px; box-shadow: var(--shadow-float); font-size: 13px; line-height: 1.3;
}
.toast b { display: block; font-size: 14px; color: var(--fg); }
.toast span { color: var(--fg-subtle); }
.toast .pill { margin-left: auto; }
.toast-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-bright); color: var(--on-primary); flex: none; }
.toast-icon .i { width: 16px; height: 16px; stroke-width: 2.6; }
.toast-icon-ok { background: var(--ok); color: #fff; }
.toast-dark { background: #0f2240f0; color: #fff; }
.toast-dark b { color: #fff; }
.toast-dark span { color: #b5c8e2; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-card); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--hair-soft); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-subtle); background: var(--bg-1); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--film-1); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-min { min-width: 620px; }
.table a.row-link { font-weight: 650; color: var(--fg); }
.table a.row-link:hover { color: var(--primary); }
.table tr.hl td { background: var(--info-soft); }
.table-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
/* Stacked rows on phones: every cell carries data-label */
@media (max-width: 640px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 12px 16px; border-bottom: 1px solid var(--hair-soft); }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { padding: 4px 0; border: 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table-stack td::before { content: attr(data-label); color: var(--fg-subtle); font-size: 13px; text-align: left; }
  .table-stack td[data-label=""]::before { content: none; }
  .table-stack .table-actions { justify-content: flex-start; }
}

/* ---------- Accordion ---------- */
.accordion { border-top: 1px solid var(--hair); }
.accordion details { border-bottom: 1px solid var(--hair); }
.accordion summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: var(--touch); padding: 14px 0; font-size: 16px; font-weight: 650;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary .i { width: 16px; height: 16px; color: var(--fg-subtle); transition: transform .2s; flex: none; }
.accordion details[open] summary .i { transform: rotate(180deg); }
.accordion details > div { padding: 0 0 18px; color: var(--fg-muted); font-size: 15px; max-width: 760px; }

/* ---------- Empty state ---------- */
.empty {
  display: grid; justify-items: center; text-align: center; gap: 10px;
  padding: 44px 24px; border-radius: 18px; background: var(--film-1); box-shadow: inset 0 0 0 1px var(--hair-soft);
}
.empty-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow-card); color: var(--primary); margin-bottom: 6px; }
.empty-icon .i { width: 22px; height: 22px; }
.empty h2, .empty h3 { font-size: 18px; font-weight: 750; letter-spacing: -0.02em; }
.empty p { max-width: 420px; color: var(--fg-muted); font-size: 15px; }
.empty .btn { margin-top: 8px; }

/* ---------- Skeleton ---------- */
.skeleton { display: grid; gap: 10px; }
.skeleton i {
  display: block; height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, var(--film-2) 0%, var(--film-3) 40%, var(--film-2) 80%);
  background-size: 300% 100%; animation: shimmer 1.4s ease infinite;
}
.skeleton i:nth-child(1) { width: 40%; height: 18px; }
.skeleton i:nth-child(3n) { width: 72%; }
.skeleton i:nth-child(4n) { width: 88%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Progress and timeline ---------- */
.progress { height: 6px; border-radius: 6px; background: var(--film-3); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--primary), var(--ok-strong)); transition: width .5s ease; }
.progress-25 i { width: 25%; }
.progress-50 i { width: 50%; }
.progress-75 i { width: 75%; }
.progress-100 i { width: 100%; }

.timeline { display: grid; gap: 0; padding: 0; margin: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding-bottom: 18px; }
.timeline li::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--hair); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.timeline-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--neutral-soft); color: var(--neutral-ink); }
.timeline-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.timeline .is-ok .timeline-dot { background: var(--ok-soft); color: var(--ok-ink); }
.timeline .is-warn .timeline-dot { background: var(--warn-soft); color: var(--warn-ink); }
.timeline .is-bad .timeline-dot { background: var(--danger-soft); color: var(--danger-ink); }
.timeline .is-info .timeline-dot { background: var(--info-soft); color: var(--info-ink); }
.timeline b { display: block; font-size: 15px; line-height: 22px; }
.timeline time, .timeline small { display: block; font-size: 13px; color: var(--fg-subtle); }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--fg-subtle); }
.pagination nav { display: flex; gap: 6px; }
.pagination a, .pagination span[aria-current] {
  min-width: var(--touch); min-height: var(--touch); padding: 0 12px; border-radius: var(--r-sm);
  display: inline-grid; place-items: center; font-weight: 650; color: var(--fg-muted); box-shadow: var(--shadow-inset); background: var(--surface);
}
.pagination span[aria-current] { background: var(--solid); color: var(--on-solid); box-shadow: none; }
.pagination [aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---------- Modal and drawer (native <dialog>) ---------- */
.modal {
  width: min(520px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; border: 0; border-radius: 20px;
  background: var(--surface); color: var(--fg); box-shadow: var(--shadow-float);
}
.modal::backdrop, .drawer::backdrop { background: var(--backdrop); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 0 24px; }
.modal-head h2 { font-size: 19px; font-weight: 750; letter-spacing: -0.02em; }
.modal-body { padding: 12px 24px 8px; color: var(--fg-muted); }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 16px 24px 24px; }
.drawer {
  margin: 0 0 0 auto; height: 100%; max-height: 100%; width: min(420px, 100%); padding: 0; border: 0;
  background: var(--surface); color: var(--fg); box-shadow: var(--shadow-float);
}
.modal-preview { position: static; display: block; margin: 0; box-shadow: var(--shadow-card); }

/* ---------- Code block and inline code ---------- */
.code-inline { padding: 2px 6px; border-radius: 6px; background: var(--film-2); font-size: 0.9em; overflow-wrap: anywhere; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.codes li { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-muted); font-family: var(--font-mono); font-size: 15px; text-align: center; letter-spacing: 0.06em; }
@media (max-width: 360px) { .codes { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Dropzone ---------- */
.dropzone {
  position: relative; display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: 40px 24px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-card);
}
.dropzone::before {
  content: ""; position: absolute; inset: 12px; border: 2px dashed var(--border); border-radius: 14px;
  pointer-events: none; transition: border-color .2s, background .2s;
}
.dropzone.is-over::before { border-color: var(--primary); background: var(--info-soft); }
.dropzone > * { position: relative; }
.dropzone-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--film-2); }
.dropzone-icon .i { width: 22px; height: 22px; }
.dropzone h2, .dropzone h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.dropzone p { color: var(--fg-muted); font-size: 15px; }
.file-list { display: grid; gap: 8px; width: 100%; max-width: 460px; text-align: left; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg-1); font-size: 14px; min-width: 0; }
.file-list li .i { width: 16px; height: 16px; color: var(--fg-subtle); }
.file-list li span:first-of-type { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file-list li small { font-size: 12px; color: var(--fg-subtle); }

/* Checklist with ok icons */
.checks { display: grid; gap: 10px; font-size: 15px; color: var(--fg-muted); }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks .i { width: 16px; height: 16px; margin-top: 4px; color: var(--ok); stroke-width: 2.6; }
.checks b { color: var(--fg); }
.checks-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
@media (max-width: 600px) { .checks-2 { grid-template-columns: minmax(0, 1fr); } }

.inline-form { display: inline-flex; margin: 0; }
/* Long labels wrap on phones instead of pushing past the edge. */
@media (max-width: 480px) { .btn { white-space: normal; text-align: center; max-width: 100%; } }
