:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #cbd5e1;
  --border-light: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --primary: #0f4c81;
  --primary-hover: #0c3d68;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --success: #15803d;
  --success-soft: #dcfce7;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.12);
  --sidebar-w: 252px;
  --topbar-h: 58px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Boot splash */
.boot-splash {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.boot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  padding: 32px 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}
.boot-title { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.boot-sub { font-size: 0.9rem; color: var(--text-muted); }

/* App Shell Layout */
.app-shell {
  display: grid;
  min-height: 100dvh;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-columns: 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 8px;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.desktop-sidebar {
  display: none;
}

.main-content {
  padding: 16px 12px 48px;
  max-width: 1220px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
}
@media (max-width: 479px) {
  .topbar .brand-name {
    display: none;
  }
}

@media (min-width: 960px) {
  .app-shell {
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
  }
  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    grid-row: 1 / -1;
    grid-column: 1;
    position: sticky;
    top: 0;
    height: 100dvh;
    background: var(--surface);
    border-right: 1px solid var(--border-light);
    padding: 16px 12px;
    overflow-y: auto;
  }
  .topbar {
    grid-column: 2;
    padding: 0 24px;
  }
  .mobile-menu-btn {
    display: none !important;
  }
  .topbar .brand-row {
    display: none;
  }
  .main-content {
    grid-column: 2;
    padding: 24px 28px 56px;
  }
}

/* Navigation Links */
.nav-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  min-height: 42px;
}
.nav-btn:hover { background: var(--surface-alt); }
.nav-btn[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--primary);
  font-weight: 600;
}
.nav-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-chip {
  padding: 8px 10px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
}
.user-chip-name { font-weight: 600; color: var(--text); }
.user-chip-role { color: var(--text-muted); font-size: 0.78rem; }

/* Language Switcher */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-alt);
}
.lang-btn {
  border: 0;
  background: transparent;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  min-height: 32px;
}
.lang-btn[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
}

/* Mobile Navigation Drawer (modern-web-guidance: dialog + scroll-snap + scroll-driven backdrop) */
.Drawer {
  --drawer-width: min(20em, 80dvw, 100dvw - 24px);
  --drawer-backdrop: 0;
  inset: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  overflow: visible;
}
.Drawer:modal {
  overscroll-behavior: contain;
}
.Drawer::backdrop {
  background: #000;
  opacity: calc(var(--drawer-backdrop) / 2);
  overflow: hidden;
  overscroll-behavior: contain;
}
.Drawer-scroller {
  position: relative;
  display: grid;
  grid-template-columns: var(--drawer-width) 100%;
  overflow-x: scroll;
  overscroll-behavior: none;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
@media (prefers-reduced-motion: no-preference) {
  .Drawer-scroller {
    scroll-behavior: smooth;
  }
}
.Drawer-scroller::after {
  content: "";
  scroll-snap-align: end;
  scroll-initial-target: nearest;
}
.Drawer-sheet {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100svh;
  background: var(--surface);
  color: var(--text);
  overflow-y: auto;
  scroll-snap-align: start;
  scrollbar-width: none;
  padding: 14px 12px;
  box-shadow: var(--shadow-md);
}
.Drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}
.Drawer-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

@supports (animation-timeline: scroll()) {
  .Drawer {
    timeline-scope: --drawer-fade;
    animation: fade-drawer-backdrop linear both;
    animation-timeline: --drawer-fade;
  }
  .Drawer-scroller {
    scroll-timeline: --drawer-fade x;
  }
  @property --drawer-backdrop {
    syntax: '<number>';
    inherits: true;
    initial-value: 0;
  }
  @keyframes fade-drawer-backdrop {
    0% { --drawer-backdrop: 1; }
    100% { --drawer-backdrop: 0; }
  }
}

/* Native Modal Dialogs (modern-web-guidance: dialog) */
.fd-dialog {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0;
  width: min(760px, calc(100dvw - 24px));
  max-height: calc(100dvh - 32px);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
}
.fd-dialog--sm {
  width: min(440px, calc(100dvw - 24px));
}
.fd-dialog:modal {
  overscroll-behavior: contain;
}
.fd-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
  overflow: hidden;
  overscroll-behavior: contain;
}
.fd-dialog[open] {
  display: flex;
  flex-direction: column;
}
.fd-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 34px);
}
.fd-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
}
.fd-dialog-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}
.fd-dialog-body {
  padding: 16px 18px;
  overflow-y: auto;
}
.fd-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border-light);
}
.confirm-msg { margin: 0; color: var(--text); }

/* Toast Notifications (modern-web-guidance: persistent-toast-notifications) */
.toast-region[popover] {
  position: fixed;
  inset: auto 16px 16px auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  pointer-events: none;
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: calc(100dvw - 32px);
}
.toast-region[popover]:is(:popover-open, .\:popover-open) {
  display: flex;
}
.toast-item {
  pointer-events: auto;
  padding: 10px 12px;
  min-width: min(340px, calc(100dvw - 32px));
  max-width: 440px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #0f172a;
  color: #f8fafc;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
  transition-behavior: allow-discrete;
}
@starting-style {
  .toast-item {
    opacity: 0;
    transform: translateY(8px);
  }
}
.toast-item.is-closing {
  opacity: 0;
  transform: translateY(8px);
}
.toast-item--success { border-left: 4px solid #22c55e; }
.toast-item--error { border-left: 4px solid #ef4444; }
.toast-item--info { border-left: 4px solid #38bdf8; }
.toast-close {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 6px;
  border-radius: 4px;
}
.toast-close:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
@media (prefers-reduced-motion: reduce) {
  .toast-item[popover] { transition: none; transform: none; }
}

/* Cards, Grids, Buttons */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.page-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 14px; }
.card-title {
  margin: 0 0 12px;
  font-size: 1.02rem;
  font-weight: 700;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.kpi-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.kpi-value { font-size: 1.38rem; font-weight: 700; margin-top: 4px; color: var(--text); }
.kpi-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.quick-card-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.quick-card-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.quick-card-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}
.quick-card-title { font-weight: 700; font-size: 0.94rem; color: var(--text); }
.quick-card-desc { font-size: 0.78rem; color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn-sm { padding: 5px 10px; min-height: 32px; font-size: 0.8rem; }
.btn-icon { padding: 6px; min-width: 36px; min-height: 36px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #1d4ed8; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-alt); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #991b1b; }
.btn-success { background: var(--success); color: #fff; }
.btn[aria-disabled="true"] { opacity: 0.6; cursor: wait; }

/* Status & Type Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-draft { background: #e2e8f0; color: #334155; }
.badge-issued { background: #dbeafe; color: #1e40af; }
.badge-partial { background: var(--warning-soft); color: var(--warning); }
.badge-paid { background: var(--success-soft); color: var(--success); }
.badge-cancelled { background: var(--danger-soft); color: var(--danger); }
.badge-type { background: #f1f5f9; color: #0f172a; border: 1px solid var(--border-light); }

/* Forms & Validation (modern-web-guidance: required-field-feedback) */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .form-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .form-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .form-grid--4 { grid-template-columns: repeat(4, 1fr); }
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field--full { grid-column: 1 / -1; }
.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.field-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}
.input-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.input-row > input,
.input-row > select {
  flex: 1;
  min-width: 0;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 8px 10px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}
textarea { min-height: 68px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.error-msg {
  display: none;
  color: var(--danger);
  font-size: 0.78rem;
  margin-top: 2px;
}
:is(:user-invalid, .user-invalid-fallback) {
  border-color: var(--danger) !important;
  background-color: #fef2f2 !important;
}
:is(:user-invalid, .user-invalid-fallback) + .error-msg,
.field:has(:is(:user-invalid, .user-invalid-fallback)) > .error-msg {
  display: block;
}

/* Tabs (modern-web-guidance: tabs) */
.tablist {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
  gap: 4px;
}
.tablist::-webkit-scrollbar { display: none; }
.tab-btn {
  position: relative;
  flex: none;
  border: 0;
  background: transparent;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.tab-btn[aria-selected="true"] {
  color: var(--primary);
}
.tab-btn[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  border-block-end: 3px solid var(--primary);
}
.tabpanel-inner {
  padding-top: 4px;
}

/* Responsive Data Tables & Mobile Cards */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 2px solid var(--border-light);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  white-space: nowrap;
}
.data-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--surface-alt); }
.text-right { text-align: right; }

.doc-cards-mobile { display: flex; flex-direction: column; gap: 10px; }
.doc-table-desktop { display: none; }
.doc-actions-row { flex-wrap: wrap; gap: 4px; }
@media (min-width: 800px) {
  .doc-cards-mobile { display: none; }
  .doc-table-desktop { display: block; }
}
@media (min-width: 800px) and (max-width: 1220px) {
  .doc-table-desktop .data-table th,
  .doc-table-desktop .data-table td {
    padding: 7px 4px;
    font-size: 0.78rem;
  }
  .doc-table-desktop .data-table th {
    font-size: 0.7rem;
    letter-spacing: 0;
    white-space: normal;
  }
  .doc-table-desktop .data-table td {
    overflow-wrap: anywhere;
  }
  .doc-table-desktop .badge {
    padding: 2px 6px;
    font-size: 0.7rem;
  }
  .doc-actions-row {
    gap: 3px;
  }
  .doc-actions-row .btn-sm {
    padding: 3px 6px;
    min-height: 26px;
    font-size: 0.72rem;
  }
}
.doc-mobile-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-mobile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

/* Items Editor */
.item-row-card {
  border: 1px solid var(--border-light);
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
}
.item-row-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}
.totals-panel {
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.totals-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
}
.totals-grand {
  font-size: 1.1rem;
  font-weight: 700;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}

/* Auth / Setup Page */
.auth-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
}
.auth-card {
  width: min(600px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
}
.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Upload Thumbnails */
.img-preview-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  min-height: 58px;
}
.img-preview-thumb {
  max-height: 48px;
  max-width: 110px;
  object-fit: contain;
}
.qr-preview-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.filter-bar > * { flex: 1 1 150px; }
.code-snippet {
  display: block;
  padding: 10px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  word-break: break-all;
}
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}
.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}
.checkbox-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

/* Overdue & FOP Limit Indicators */
.badge-overdue {
  background: var(--danger-soft);
  color: var(--danger);
}
.row-overdue {
  background: #fff5f5;
}

/* Native Progress Bar (modern-web-guidance: progress) */
progress.limit-progress {
  appearance: none;
  border: 0 solid;
  overflow: clip;
  inline-size: 100%;
  block-size: 10px;
  border-radius: 1e5px;
  background: var(--border-light);
  --progress-bar-fill: var(--success);
}
progress.limit-progress.is-warning {
  --progress-bar-fill: var(--warning);
}
progress.limit-progress.is-danger {
  --progress-bar-fill: var(--danger);
}
progress.limit-progress::-webkit-progress-bar {
  background: transparent;
}
progress.limit-progress::-webkit-progress-value {
  background: var(--progress-bar-fill);
  border-radius: 1e5px;
  transition: inline-size 0.3s;
}
progress.limit-progress::-moz-progress-bar {
  background: var(--progress-bar-fill);
  border-radius: 1e5px;
  transition: inline-size 0.3s;
}

.fop-limit-row + .fop-limit-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.fop-limit-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

/* Accessible Copy Button (modern-web-guidance: copy-button) */
.copy {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.copy-button {
  min-inline-size: 28px;
  min-block-size: 28px;
}
.copy .tip {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--success);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.copy-button[data-copied] + .tip {
  opacity: 1;
}
.copy-button[data-failed] + .tip {
  opacity: 1;
  color: var(--danger);
}
@media (prefers-reduced-motion: reduce) {
  .copy .tip { transition: none; }
}

.share-box {
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 8px;
}
.scope-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.kpi-card--clickable {
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.kpi-card--clickable:hover {
  border-color: var(--danger);
}
