:root {
  color-scheme: light;
  --forest: #174b3a;
  --forest-dark: #10362a;
  --mint: #dcece5;
  --paper: #fbfcf9;
  --ink: #18201d;
  --muted: #68736f;
  --line: #dce2de;
  --danger: #a63737;
  --success: #176b49;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); }
button, input, select { font: inherit; }
.hidden { display: none !important; }

.app-boot-loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  color: var(--forest);
  z-index: 9999;
}
.app-boot-loading svg { width: 32px; height: 32px; animation: ds-spin .85s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .app-boot-loading svg { animation-duration: 1.6s; }
}

.site-header {
  height: 84px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(24px, 6vw, 84px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--ds-canvas) 92%, transparent);
}
.brand { display: flex; align-items: center; color: var(--forest-dark); text-decoration: none; }
.brand-logo { display: block; width: auto; height: 56px; }
.menu-toggle { display: none; width: 42px; height: 42px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--ds-surface); cursor: pointer; }
.menu-toggle span { display: block; width: 100%; height: 2px; margin: 3px 0; border-radius: 2px; background: var(--forest-dark); }

main { min-height: calc(100vh - 84px); }

.site-footer { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--ds-canvas) 92%, transparent); }
.site-footer-inner {
  max-width: var(--ds-layout-max-width); margin: 0 auto; padding: 20px clamp(24px, 6vw, 84px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 13px; color: var(--muted);
}
.site-footer-brand { font-weight: 650; color: var(--forest-dark); }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer-links a { color: var(--muted); text-decoration: none; }
.site-footer-links a:hover, .site-footer-links a:focus-visible { color: var(--forest-dark); text-decoration: underline; }

.cookie-consent {
  position: fixed; left: 18px; right: 18px; bottom: 18px; z-index: 60;
  max-width: 640px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--ds-surface); box-shadow: 0 16px 42px rgba(16, 54, 42, .18);
}
.cookie-consent p { flex: 1 1 260px; margin: 0; font-size: 13.5px; color: var(--muted); }
.cookie-consent a { color: var(--forest); }
.cookie-consent .button { flex: none; }
.auth-layout { width: 100%; max-width: var(--ds-layout-max-width); margin: 0 auto; padding: clamp(48px, 9vh, 108px) var(--ds-layout-gutter); display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(48px, 9vw, 120px); align-items: center; }
#register-view.auth-layout, #verify-email-view.auth-layout, #forgot-password-view.auth-layout, #reset-password-view.auth-layout { grid-template-columns: 1fr; }
#register-view .auth-card, #verify-email-view .auth-card, #forgot-password-view .auth-card, #reset-password-view .auth-card { max-width: 480px; margin: 0 auto; width: 100%; }
.honeypot-field { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.intro h1, .page-heading h1 { margin: 8px 0 18px; letter-spacing: -.04em; line-height: 1.05; }
.intro h1 { max-width: 620px; font-size: clamp(46px, 6vw, 74px); }
.page-heading h1 { font-size: 44px; }
.eyebrow { margin: 0; color: var(--forest); font-size: 13px; font-weight: 760; letter-spacing: .13em; text-transform: uppercase; }
.lead { max-width: 560px; color: var(--muted); font-size: 19px; line-height: 1.65; }
.lead.small { font-size: 16px; margin: 0; }
.badge { padding: 8px 12px; border-radius: 999px; color: var(--forest-dark); background: var(--mint); font-size: 13px; font-weight: 650; }

.card { background: var(--ds-surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(19, 54, 42, .08); }
.auth-card { overflow: hidden; }
.contact-card { max-width: 560px; }
.auth-switch { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }
.form { display: grid; gap: 20px; padding: clamp(24px, 4vw, 40px); }
.form h2 { margin: 0 0 7px; font-size: 27px; letter-spacing: -.025em; }
.settings-section .form h2 { margin: 0 0 4px; font-size: 18px; letter-spacing: normal; }
.muted, .hint { margin: 0; color: var(--muted); line-height: 1.5; }
.hint { margin-top: -12px; font-size: 13px; }
label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 650; }
label > input, label > select, label > textarea, label > .password-field { margin-top: auto; }
.optional { color: var(--muted); font-weight: 450; }
input, select { width: 100%; height: 46px; padding: 0 13px; border: 1px solid #cbd4cf; border-radius: 9px; color: var(--ink); background: var(--ds-surface); outline: none; transition: border .15s, box-shadow .15s; }
textarea { width: 100%; padding: 10px 13px; border: 1px solid #cbd4cf; border-radius: 9px; color: var(--ink); background: var(--ds-surface); outline: none; font: inherit; transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(23, 75, 58, .12); }
input[readonly] { color: var(--muted); background: var(--ds-surface-subtle) !important; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 48px; }
.password-toggle {
  position: absolute; top: 50%; right: 5px; transform: translateY(-50%); width: 36px; height: 36px; padding: 8px;
  border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer;
}
.password-toggle:hover { color: var(--forest); background: var(--mint); }
.password-toggle:focus-visible { outline: 2px solid var(--forest); outline-offset: 1px; }
.password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle .password-hidden-icon { display: none; }
.password-toggle[aria-pressed="true"] .password-visible-icon { display: none; }
.password-toggle[aria-pressed="true"] .password-hidden-icon { display: block; }
.entry-mode-fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.entry-mode-fieldset legend { grid-column: 1 / -1; margin-bottom: 2px; font-size: 14px; font-weight: 650; }
.radio-card { display: flex; align-items: center; gap: 9px; min-height: 50px; padding: 9px 11px; border: 1px solid #cbd4cf; border-radius: 10px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--forest); background: var(--mint); box-shadow: 0 0 0 2px var(--ds-focus); }
.radio-card input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--forest); }
.radio-card span { display: grid; gap: 1px; }
.radio-card strong { font-size: 14px; }
.radio-card small { color: var(--muted); font-size: 12px; font-weight: 450; line-height: 1.4; }
.button { min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 700; }
.button:disabled { opacity: .65; cursor: wait; }
.button-primary { color: white; background: var(--forest); }
.button-primary:hover { background: var(--forest-dark); }
.button-secondary { color: var(--forest); border-color: #b8c9c1; background: transparent; }
.account-nav { display: flex; align-items: center; gap: 8px; }
.nav-link { padding: 10px 12px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 680; }
.nav-link.active { color: var(--forest-dark); background: var(--mint); }
.nav-icon-button { width: 40px; min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 9px; }
.nav-icon-button svg { display: block; width: 22px; height: 22px; }
.gear-icon { display: block; width: 23px; height: 23px; fill: currentColor; }
.user-menu { position: relative; }
.user-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ds-surface);
  box-shadow: 0 16px 42px rgba(16, 54, 42, .18);
  z-index: 40;
}
.user-menu-dropdown.is-open { display: grid; gap: 2px; }
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.user-menu-item:hover,
.user-menu-item.active { background: var(--mint); color: var(--forest-dark); }
.user-menu-item svg { width: 20px; height: 20px; flex: none; }
.user-menu-item .gear-icon { width: 20px; height: 20px; }
.message { margin: 0; padding: 11px 13px; border-radius: 8px; font-size: 14px; }
.error { color: var(--danger); background: var(--ds-danger-soft); }
.success { color: var(--success); background: var(--ds-success-soft); }
#login-error-block { display: grid; gap: 8px; justify-items: start; }
#login-error-block p { margin: 0; }

.workspace { width: 100%; max-width: var(--ds-layout-max-width); margin: 0 auto; padding: 64px var(--ds-layout-gutter); }
.admin-navigation { margin: 0 0 30px; padding: 0; border-color: var(--line); overflow: hidden; }
.admin-tabs { display: flex; flex-wrap: nowrap; margin: 0; padding: 0 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--ds-surface-subtle); overflow-x: auto; }
.admin-tabs .admin-tab, .admin-tabs .admin-catalogue-link { width: auto; min-height: 48px; margin: 0 2px -1px; padding: 12px 15px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; white-space: nowrap; }
.admin-tabs .admin-tab:hover, .admin-tabs .admin-catalogue-link:hover { color: var(--forest-dark); background: var(--mint); }
.admin-tabs .admin-tab.active { color: var(--forest-dark); border-bottom-color: var(--forest); background: var(--ds-surface); }
.admin-catalogue-link { margin-left: auto !important; color: var(--muted); }
.admin-breadcrumb { min-height: 48px; display: flex; align-items: center; padding: 10px 18px; background: var(--ds-surface); }
.admin-breadcrumb .breadcrumb { margin: 0; flex-wrap: wrap; }
.breadcrumb-link { padding: 0; border: 0; color: var(--forest); background: transparent; cursor: pointer; font: inherit; }
.breadcrumb-link:hover, .breadcrumb-link:focus-visible { color: var(--forest-dark); text-decoration: underline; }
.stand-import-additional-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.stand-import-additional-list .breadcrumb-link { text-align: left; }
.impersonation-banner { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 10px 20px; color: var(--ds-warning); background: var(--ds-warning-soft); border-bottom: 1px solid color-mix(in srgb, var(--ds-warning) 45%, transparent); font-size: 14px; font-weight: 650; }
.impersonation-banner .button { min-height: 36px; background: var(--ds-surface); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
#stand-create-view .page-heading { margin-bottom: 17px; }
.settings-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.settings-nav { display: grid; gap: 4px; align-content: start; position: sticky; top: 24px; }
.settings-nav-item {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.settings-nav-item:hover { background: var(--mint); }
.settings-nav-item.is-active { background: var(--forest); color: white; }
.settings-content { min-width: 0; }
.settings-section.hidden { display: none; }
#theme-preference-fieldset { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; grid-auto-flow: column; overflow-x: auto; }
  #theme-preference-fieldset { grid-template-columns: 1fr; }
}
.screen-block,
.profile-card,
.standalone-form-card,
.user-editor-form,
.priority-editor-form,
.help-card { width: 100%; max-width: none; }
.help-card { padding: 24px 26px; margin-bottom: 18px; }
.help-card h2 { margin: 0 0 8px; font-size: 18px; }
.help-card p { margin: 0; color: var(--muted); }
.help-card p + .help-changelog { margin-top: 14px; }
.help-changelog { margin: 0; padding-left: 20px; color: var(--muted); }
.help-changelog li { margin-bottom: 6px; }
.help-changelog li:last-child { margin-bottom: 0; }
.help-card .help-changelog + button { margin-top: 14px; }

.stand-row-clickable { cursor: pointer; }
.stand-row-clickable:focus-visible { outline: 2px solid var(--forest); outline-offset: -2px; }
.stand-summary-heading-row { align-items: flex-start; }
.stand-summary-content { display: grid; gap: 20px; }
.stand-summary-header-card,
.stand-summary-table-card { padding: 24px 26px; }
.stand-summary-header-card h2 { margin: 0 0 8px; font-size: 22px; }
.stand-summary-header-layout { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; }
.stand-summary-header-left { flex: 1; min-width: 0; }
.stand-summary-header-fields { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.85; }
.stand-summary-header-right { flex: none; text-align: right; white-space: nowrap; }
.stand-summary-market-price {
  display: inline-block;
  max-width: 230px;
  padding: 8px 12px;
  border: 1px solid var(--forest);
  border-radius: var(--ds-radius-sm);
  background: var(--mint);
  text-align: left;
  text-decoration: none;
  white-space: normal;
  transition: filter .12s ease;
}
.stand-summary-market-price:hover,
.stand-summary-market-price:focus-visible { filter: brightness(.97); }
.stand-summary-market-price-top { display: flex; align-items: flex-start; gap: 8px; }
.stand-summary-market-price-logo { display: block; height: 28px; width: auto; flex: none; margin-top: 2px; }
.stand-summary-market-price-headline { display: flex; flex-direction: column; flex: 1; align-items: flex-end; }
.stand-summary-market-price-heading { font-size: 13px; font-weight: 400; color: var(--forest); text-align: right; }
/* Dastojums brand package "teksta brūns" (PRASIBAS.md §9 29) -- no brand
   brown token exists in the design system yet, hardcoded here as a single-use accent. */
.stand-summary-market-price-value { font-size: 13px; font-weight: 600; color: #68512F; text-align: right; }
.stand-summary-market-price-fallback-text { font-size: 13px; font-weight: 600; color: var(--forest); text-align: left; }
.stand-summary-market-price-footnote { margin-top: 6px; font-size: 10.5px; line-height: 1.4; color: var(--muted); text-align: left; }
.stand-summary-market-price-fact { font-weight: 700; color: var(--forest); }
.stand-summary-market-price-note + .stand-summary-market-price-fact { margin-top: 6px; }
@media (max-width: 720px) {
  .stand-summary-header-layout { flex-direction: column; }
  .stand-summary-header-right { text-align: left; white-space: normal; }
}
.stand-summary-table-card h2 { margin: 0 0 14px; font-size: 17px; }
.stand-summary-table-card thead th { white-space: normal; overflow-wrap: normal; word-break: normal; min-width: 7ch; }
.stand-summary-totals-row { font-weight: 700; background: var(--mint); }
.stand-summary-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}
.stand-summary-group:last-child { margin-bottom: 0; }
.stand-summary-group .table-responsive { padding: 0 14px 12px; }
.stand-summary-group-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  background: var(--mint);
  color: var(--forest-dark);
  font-weight: 700;
}
.stand-summary-group-summary::-webkit-details-marker { display: none; }
.stand-summary-group-summary::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s ease;
}
.stand-summary-group[open] .stand-summary-group-summary::before { transform: rotate(45deg); }
.stand-summary-group-label { flex: 1; min-width: 0; }
.stand-summary-group-summary-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  color: var(--muted);
}
@media (hover: hover) {
  .stand-summary-group-summary:hover { background: var(--forest); color: white; }
  .stand-summary-group-summary:hover .stand-summary-group-summary-value { color: rgba(255, 255, 255, .85); }
}
@media (max-width: 720px) {
  .stand-summary-group-summary-value:not(:first-of-type) { display: none; }
  .stand-summary-group-summary {
    position: sticky;
    top: 0;
    z-index: 6;
  }
  .stand-summary-group[open] thead th {
    position: sticky;
    top: 42px;
    z-index: 5;
    background: var(--paper);
    box-shadow: 0 1px 0 var(--line);
  }
}
.stand-summary-diameter-group-header {
  cursor: pointer;
  background: var(--mint);
  color: var(--forest-dark);
  font-weight: 700;
}
.stand-summary-diameter-group-header td:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stand-summary-diameter-group-header td:first-child::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s ease;
}
.stand-summary-diameter-group-header[aria-expanded="true"] td:first-child::before { transform: rotate(45deg); }
/* The priorities panel's group header cell (§9 96) uses colspan across all
   columns instead of one real <td> per column like the diameter table above
   -- `display: flex` on that single spanned cell makes it size to its own
   content instead of the full colspanned width (the table layout algorithm
   no longer treats it as a table cell), which is why the group boxes were
   narrow with a stray line trailing off to the right. Cancel the flex here
   and give the chevron its spacing via margin instead of the (now moot)
   flex gap. */
.stand-summary-priorities-panel .stand-summary-diameter-group-header td:first-child {
  display: table-cell;
}
.stand-summary-priorities-panel .stand-summary-diameter-group-header td:first-child::before {
  display: inline-block;
  margin-right: 10px;
  vertical-align: middle;
}
.stand-summary-diameter-group:not(.is-open) tr:not(.stand-summary-diameter-group-header) { display: none; }
/* The priorities table (§9 96) has more, longer-named columns than the
   diameter table it borrows this class from -- with the default `auto`
   table layout the browser just grows the table wider instead of wrapping
   header text, which overflows .table-responsive and needs a horizontal
   scrollbar (reported as a stray line at the panel edge). `fixed` layout
   forces header text to wrap within its column instead; the Sortimenti
   column's own data values (short species+assortment names) stay unwrapped. */
.stand-summary-priorities-panel .stand-summary-diameter-table {
  table-layout: fixed;
  width: 100%;
}
.stand-summary-priorities-panel .stand-summary-diameter-table th {
  white-space: normal;
}
.stand-summary-priorities-panel .stand-summary-diameter-table td:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (hover: hover) {
  .stand-summary-diameter-group-header:hover { background: var(--forest); color: white; }
}
@media (max-width: 720px) {
  .stand-summary-diameter-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--paper);
    box-shadow: 0 1px 0 var(--line);
  }
}
.stand-summary-share-result { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.stand-summary-share-result input { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; }
.stand-summary-share-list { margin-top: 6px; display: grid; gap: 8px; }
.stand-summary-share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
}
.stand-summary-share-row strong { color: var(--ink); }
.text-button { margin: 0 0 24px; padding: 0; border: 0; color: var(--forest); background: transparent; cursor: pointer; font-weight: 700; }
.context-action { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.action-icon { font-size: 20px; line-height: 1; }
.dashboard-grid { display: grid; grid-template-columns: minmax(330px, 420px) minmax(360px, 1fr); gap: 34px; align-items: start; }
.create-card { box-shadow: 0 14px 42px rgba(19, 54, 42, .06); }
.section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 23px; }
.large-list-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 420px) minmax(180px, 1fr);
  align-items: center;
}
.stand-list-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.stand-list-title h1,
.stand-list-title h2 { white-space: nowrap; }
.stand-search { position: relative; width: 100%; }
.stand-search input { min-height: 40px; padding-right: 44px; }
.stand-search input::-webkit-search-cancel-button { display: none; }
.stand-search-clear {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 8px;
  transform: translateY(-50%);
  border: 0;
  border-radius: var(--ds-radius-sm);
  color: var(--ds-text-muted);
  background: transparent;
  cursor: pointer;
}
.stand-search-clear:hover,
.stand-search-clear:focus-visible {
  color: var(--ds-text);
  background: var(--ds-surface-subtle);
}
.stand-search-clear svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.large-list-toolbar > .add-priority-button { justify-self: end; }
.large-list-toolbar > .help-trigger-button { justify-self: end; }
.count { display: grid; place-items: center; min-width: 27px; height: 27px; padding: 0 8px; border-radius: 99px; color: var(--forest); background: var(--mint); font-size: 13px; font-weight: 750; }
.stand-table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--ds-surface); }
.stand-table { width: 100%; min-width: 0; margin: 0; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.stand-table th, .stand-table td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
.stand-table th { color: var(--muted); background: var(--ds-surface-subtle); font-size: 11px; font-weight: 700; line-height: 1.15; vertical-align: top; }
.stand-table th small { color: inherit; font-size: 9px; font-weight: 600; }
.stand-table tbody tr:last-child td { border-bottom: 0; }
.stand-table tbody tr:hover { background: var(--ds-surface-subtle); }
/* .stand-table-wrap always carries .long-table-scroll (sticky header relies on
   window-level scroll, so the wrapper's own overflow must stay visible) -- the
   wrapper's border-radius can't clip these corners, so the header/last-row
   cells round themselves to match. */
.stand-table thead th:first-child { border-top-left-radius: 13px; }
.stand-table thead th:last-child { border-top-right-radius: 13px; }
.stand-table tbody tr:last-child td:first-child { border-bottom-left-radius: 13px; }
.stand-table tbody tr:last-child td:last-child { border-bottom-right-radius: 13px; }
.stand-name-column { width: 39%; }
.stand-compartment-column { width: 14%; }
.stand-area-column { width: 10%; }
.stand-entry-column { width: 17%; }
.stand-count-column { width: 9%; }
.stand-actions-column { width: 180px; }
.stand-name-cell strong { display: block; color: var(--ink); }
.stand-mobile-number { display: none; margin-top: 3px; color: var(--muted); font-weight: 500; }
.stand-actions-cell { padding-inline: 5px !important; }
.stand-drop-card { margin-bottom: 24px; padding: 10px; }
.stand-quick-start-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stand-quick-start-cell { display: flex; }
.stand-quick-start-cell .stand-drop-zone { flex: 1; }
.stand-breadcrumb {
  min-height: 30px;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding: 0;
  background: transparent;
}
.stand-breadcrumb .breadcrumb { margin: 0; flex-wrap: wrap; }
.stand-form-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  align-items: start;
}
.stand-form-meta,
.stand-entry-mode-panel { min-width: 0; }
.stand-form-meta { display: grid; gap: 16px; }
.stand-location-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(7.5rem, max-content);
  gap: 14px;
  align-items: end;
}
.stand-area-field { width: 8rem; justify-self: end; }
.stand-area-field input {
  width: 100%;
  justify-self: end;
  font-variant-numeric: tabular-nums;
}
.stand-audit-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.stand-audit-panel > div {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
  background: var(--ds-surface-subtle);
}
.stand-audit-panel span { color: var(--ds-text-muted); font-size: 12px; font-weight: 700; }
.stand-audit-panel strong { font-size: 14px; }
.stand-header-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
  align-items: end;
}
.stand-people-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
  align-items: end;
}
.stand-notes-field { margin-top: 16px; }
.stand-notes-field textarea { resize: vertical; }
.stand-entry-mode-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}
.stand-entry-mode-panel .entry-mode-fieldset {
  grid-template-columns: 1fr;
  margin: 0;
}
.stand-entry-mode-panel .radio-card { min-height: 68px; }
.stand-drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  min-height: 108px;
  padding: 20px;
  border: 2px dashed var(--ds-border);
  border-radius: var(--ds-radius-md);
  color: var(--ds-brand);
  background: color-mix(in srgb, var(--ds-brand-soft) 34%, var(--ds-surface));
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.stand-drop-zone:hover,
.stand-drop-zone:focus-visible,
.stand-drop-zone.is-dragover {
  border-color: var(--ds-brand);
  background: var(--ds-brand-soft);
}
.stand-drop-zone.is-dragover { transform: translateY(-2px); }
.stand-drop-zone:disabled { opacity: .68; cursor: wait; }
.stand-drop-zone strong,
.stand-drop-zone small { display: block; }
.stand-drop-zone strong { margin-bottom: 3px; font-size: 18px; }
.stand-drop-zone small { color: var(--ds-text-muted); }
.stand-drop-icon {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  background: var(--ds-brand);
}
.stand-drop-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stand-drop-zone.is-busy .stand-drop-icon svg { display: none; }
.stand-drop-zone.is-busy .stand-drop-icon::after {
  content: "";
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2.2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: ds-spin .7s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .stand-drop-zone.is-busy .stand-drop-icon::after { animation-duration: 1.6s; }
}
.stand-import-status {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: var(--ds-radius-sm);
  color: var(--ds-brand);
  background: var(--ds-success-soft);
  font-weight: 700;
}
.stand-drop-card .message { margin: 8px 0 0; }
.stand-measurements-panel { margin-top: 24px; padding: 28px; box-shadow: var(--ds-shadow-card); }
.stand-inline-drop {
  margin-bottom: 18px;
  padding: 8px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
  background: var(--ds-surface-subtle);
}
.stand-drop-zone-compact { min-height: 78px; padding: 12px 16px; }
.stand-drop-zone-compact .stand-drop-icon {
  width: 36px;
  min-width: 36px;
  height: 36px;
}
.stand-drop-zone-compact strong { font-size: 15px; }
.stand-inline-drop .message { margin: 8px 0 0; }
.stand-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.stand-summary-item {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
  background: var(--ds-canvas);
}
.measurement-list-context { margin: 0 0 12px; }
.measurement-list-toolbar h1 { margin: 0; font-size: 23px; }
.measurement-filter-summary {
  display: block;
  margin-top: 5px;
  color: var(--ds-text-muted);
  font-size: 13px;
  white-space: nowrap;
}
.measurement-filter-summary strong { color: var(--ds-text); font-weight: 750; }
.measurement-search .stand-search-clear { top: 20px; }
.long-table-scroll {
  max-height: none;
  overflow: visible;
}
.stand-table-wrap.long-table-scroll,
.user-table-wrap.long-table-scroll,
.priority-table-wrap.long-table-scroll,
.table-responsive.long-table-scroll { overflow: visible; }
.long-table-scroll table > thead {
  position: static;
}
.long-table-scroll table > thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--ds-canvas);
  box-shadow: 0 1px 0 var(--ds-border);
}
.stand-measurement-list-card { padding: 0; overflow: visible; }
.stand-measurement-table { width: 100%; min-width: 0; margin: 0; table-layout: fixed; }
.stand-measurement-table th { vertical-align: top; white-space: normal !important; }
.measurement-sequence-column { width: 64px; }
.measurement-species-column { width: 23%; }
.measurement-diameter-column,
.measurement-height-column,
.measurement-volume-column,
.measurement-count-column { width: 9%; }
.measurement-quality-column,
.measurement-affected-quality-column { width: 17%; }
.measurement-affected-length-column { width: 13%; }
.measurement-actions-column { width: 140px; }
.stand-measurement-table:not(.is-file-measurements) .measurement-affected-length-column,
.stand-measurement-table:not(.is-file-measurements) .measurement-affected-quality-column,
.stand-measurement-table:not(.is-file-measurements) .stand-measurement-affected-length-cell,
.stand-measurement-table:not(.is-file-measurements) .stand-measurement-affected-quality-cell,
.stand-measurement-table.is-file-measurements .measurement-count-column,
.stand-measurement-table.is-file-measurements .stand-measurement-count-cell { display: none; }
.stand-measurement-table.is-file-measurements .measurement-quality-column,
.stand-measurement-table.is-file-measurements .stand-measurement-quality-cell,
.stand-measurement-table.is-diameter-classes .measurement-quality-column,
.stand-measurement-table.is-diameter-classes .stand-measurement-quality-cell { display: none; }
.stand-measurement-species-cell strong,
.stand-measurement-species-cell small { display: block; }
.stand-measurement-species-cell small { color: var(--ds-text-muted); }
.stand-measurement-quality-summary {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
}
.stand-measurement-table td { vertical-align: middle; }
.stand-measurement-table tr.is-editing,
.height-sample-table tr.is-editing { background: var(--ds-dirty-soft); }
.stand-measurement-table tr.is-editing td,
.height-sample-table tr.is-editing td { padding: 8px; }
.height-sample-table tr.is-editing .form-control,
.height-sample-table tr.is-editing .form-select {
  min-height: 38px;
  padding: 7px 8px;
  font-size: 13px;
  width: 100%;
}
.height-sample-table tr.is-editing .stand-measurement-actions-cell { text-align: right; }
.measurement-inline-editor {
  display: grid;
  grid-template-columns:
    48px minmax(140px, 1.5fr) minmax(130px, 1fr)
    repeat(3, minmax(82px, .65fr))
    88px;
  gap: 8px;
  align-items: center;
}
.measurement-inline-editor.is-diameter-class-add {
  grid-template-columns:
    minmax(140px, 1.5fr) minmax(160px, 1fr) minmax(110px, .8fr) minmax(90px, .5fr) 44px;
}
.measurement-inline-sequence { text-align: center; }
.measurement-inline-readonly {
  min-height: 38px;
  padding: 9px 8px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-sm);
  color: var(--ds-text-muted);
  background: var(--ds-canvas);
}
.measurement-inline-actions .user-actions { justify-content: flex-end; }
.stand-measurement-table tr.is-editing .form-control,
.stand-measurement-table tr.is-editing .form-select {
  min-height: 38px;
  padding: 7px 8px;
  font-size: 13px;
}
.stand-measurement-species-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.retained-tree-marker {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: none;
  color: #16834d;
}
.retained-tree-marker svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linejoin: round;
}
.stand-species-mapping-list { display: grid; gap: 12px; margin: 20px 0; }
.stand-species-mapping-row {
  display: grid;
  grid-template-columns: minmax(110px, .35fr) minmax(240px, 1fr);
  gap: 14px;
  align-items: end;
}
.stand-species-mapping-code {
  display: grid;
  gap: 3px;
  min-height: 46px;
  align-content: center;
  padding: 7px 11px;
  border-radius: var(--ds-radius-sm);
  color: var(--ds-brand);
  background: var(--ds-brand-soft);
}
.stand-species-mapping-code small { color: var(--ds-text-muted); }
.stand-quality-mapping-list {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}
.quality-mapping-row {
  display: grid;
  grid-template-columns: minmax(64px, .18fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-surface);
}
.quality-mapping-row.is-not_in_file {
  color: var(--ds-text-muted);
  background: var(--ds-surface-subtle);
}
.quality-mapping-row.is-missing-in-classifier {
  border-color: color-mix(in srgb, var(--ds-danger) 45%, transparent);
  background: var(--ds-danger-soft);
}
.quality-mapping-row .mapping-status {
  color: var(--ds-text-muted);
  font-weight: 700;
  white-space: nowrap;
}
.quality-mapping-row.is-missing-in-classifier .mapping-status {
  color: var(--ds-danger, #b42318);
}
.quality-mapping-create-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.classifier-code-status.has-mismatch,
.classifier-row-code-status {
  color: var(--ds-danger, #b42318);
  font-weight: 700;
}
.raw-record-dialog-card { overflow: visible; }
.raw-record-dialog-card .classifier-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.raw-record-content {
  margin: 18px 0 0;
  padding: 16px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
  color: var(--ds-text);
  background: var(--ds-surface-subtle, #f5f8f6);
  opacity: 1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 600 14px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.message.warning {
  color: var(--ds-warning);
  border-color: color-mix(in srgb, var(--ds-warning) 45%, transparent);
  background: var(--ds-warning-soft);
}
.classifier-set-dialog.tree-assortment-dialog { width: min(1180px, calc(100% - 32px)); }
.tree-assortment-dialog-card { width: 100%; }
.tree-assortment-content {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 16px;
}
.tree-assortment-chart {
  position: relative;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
  background: var(--ds-surface-subtle, #f8faf9);
}
.tree-assortment-chart svg { display: block; width: 100%; height: min(66vh, 650px); }
.tree-assortment-axis { stroke: var(--ds-border); stroke-width: 1; }
.tree-assortment-axis-label {
  fill: var(--ds-text-muted);
  font-size: 12px;
  text-anchor: end;
}
.tree-assortment-axis-title {
  fill: var(--ds-text-muted);
  font-size: 13px;
  font-weight: 700;
  text-anchor: middle;
}
.tree-assortment-segment {
  cursor: pointer;
  stroke: color-mix(in srgb, var(--ds-brand) 72%, #173f32);
  stroke-width: 1.2;
  transition: filter .12s ease, opacity .12s ease, stroke-width .12s ease;
}
.tree-assortment-segment:hover,
.tree-assortment-segment:focus,
.tree-assortment-segment.is-selected {
  filter: saturate(1.25) brightness(.96);
  stroke: var(--ds-focus, #e0a100);
  stroke-width: 4;
  outline: none;
}
.tree-assortment-segment.color-0,
.tree-assortment-color-marker.color-0 { fill: #6f2f24; background: #6f2f24; }
.tree-assortment-segment.color-1,
.tree-assortment-color-marker.color-1 { fill: #8f4334; background: #8f4334; }
.tree-assortment-segment.color-2,
.tree-assortment-color-marker.color-2 { fill: #a95b43; background: #a95b43; }
.tree-assortment-segment.color-3,
.tree-assortment-color-marker.color-3 { fill: #bf7355; background: #bf7355; }
.tree-assortment-segment.color-4,
.tree-assortment-color-marker.color-4 { fill: #d08e6d; background: #d08e6d; }
.tree-assortment-segment.color-5,
.tree-assortment-color-marker.color-5 { fill: #dfaa88; background: #dfaa88; }
.tree-assortment-segment.is-top_remainder,
.tree-assortment-color-marker.is-top_remainder { fill: #c8dfc4; background: #c8dfc4; }
.tree-assortment-segment.is-retained,
.tree-assortment-color-marker.is-retained { fill: #69a96f; background: #69a96f; }
.tree-assortment-overmeasure {
  fill: url(#tree-assortment-overmeasure-pattern);
  fill-opacity: .34;
  stroke: none;
  pointer-events: none;
}
.tree-assortment-overmeasure-line { stroke: var(--ds-text); stroke-width: 2; }
.tree-assortment-cut-line {
  stroke: var(--ds-text);
  stroke-width: 2.2;
  pointer-events: none;
}
.tree-assortment-details {
  position: sticky;
  top: 16px;
  min-width: 0;
  display: grid;
  gap: 14px;
}
.tree-assortment-values {
  display: grid;
  grid-template-columns: minmax(110px, .8fr) minmax(100px, 1fr);
  gap: 8px 12px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
  background: var(--ds-canvas);
}
.tree-assortment-values dt { color: var(--ds-text-muted); font-size: 12px; font-weight: 700; }
.tree-assortment-values dd { margin: 0; color: var(--ds-text); font-weight: 750; }
.tree-assortment-priorities { min-width: 0; width: 100%; }
.tree-assortment-priorities h3 { margin: 0 0 8px; font-size: 14px; }
.tree-assortment-priority-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
}
.tree-assortment-tooltip {
  position: absolute;
  z-index: 2;
  max-width: 240px;
  padding: 6px 9px;
  border: 1px solid rgb(255 255 255 / .14);
  border-radius: 7px;
  color: #fff;
  background: rgb(15 19 17 / .94);
  box-shadow: 0 4px 14px rgb(0 0 0 / .16);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  pointer-events: none;
}
.tree-assortment-priority-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: var(--ds-canvas);
  font-size: 12px;
}
.tree-assortment-priority-table th,
.tree-assortment-priority-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--ds-border);
  text-align: left;
  white-space: nowrap;
}
.tree-assortment-priority-table th { color: var(--ds-text-muted); font-weight: 750; }
.tree-assortment-priority-table th small {
  display: block;
  font-size: 10px;
  font-weight: 650;
}
.tree-assortment-priority-table .is-numeric { text-align: right; }
.tree-assortment-priority-table tbody tr:last-child td { border-bottom: 0; }
.tree-assortment-color-marker {
  display: block;
  width: 13px;
  height: 13px;
  border: 1px solid color-mix(in srgb, var(--ds-text) 30%, transparent);
  border-radius: 3px;
}
.stand-summary-item-wide { grid-column: span 2; }
.stand-summary-item dt {
  margin-bottom: 5px;
  color: var(--ds-text-muted);
  font-size: 12px;
  font-weight: 700;
}
.stand-summary-item dd {
  margin: 0;
  color: var(--ds-text);
  font-size: 17px;
  font-weight: 750;
  overflow-wrap: anywhere;
}
.stand-summary-basal-area { display: grid; gap: 2px; }
.stand-summary-primary-secondary { display: grid; gap: 2px; }
.stand-summary-basal-area small,
.stand-summary-primary-secondary small {
  color: var(--ds-text-muted);
  font-size: 13px;
  font-weight: 700;
}
.stand-measurements-panel .message { margin-bottom: 14px; }
.stand-measurements-panel .compact-empty { margin-top: 0; }
.stand-classifiers-panel { margin-top: 16px; overflow: hidden; box-shadow: var(--ds-shadow-card); }
.stand-height-curves-panel { margin-top: 16px; overflow: hidden; box-shadow: var(--ds-shadow-card); }
.stand-height-curves-panel[open] .stand-classifiers-summary > svg { transform: rotate(180deg); }
.stand-height-curves-content {
  display: grid;
  gap: 16px;
  padding: 20px 28px 28px;
  border-top: 1px solid var(--ds-border);
}
.height-curve-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
  background: var(--ds-surface-subtle, #f8faf9);
}
.height-curve-heading { display: grid; gap: 4px; margin-bottom: 12px; }
.height-curve-heading small { color: var(--ds-text-muted); }
.height-curve-chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-axis { stroke: var(--ds-border); stroke-width: 1; }
.chart-grid { stroke: var(--ds-border); stroke-width: .7; opacity: .55; }
.chart-label { fill: var(--ds-text-muted); font-size: 13px; font-weight: 700; }
.chart-label-end { text-anchor: end; }
.chart-tick { fill: var(--ds-text-muted); font-size: 11px; text-anchor: middle; }
.chart-tick-y { text-anchor: end; }
.chart-tick-count { text-anchor: start; fill: var(--ds-brand, #176b50); }
.chart-axis-title { text-anchor: middle; }
.height-curve-line { fill: none; stroke: var(--ds-brand, #176b50); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.height-curve-line.is-outside { stroke: var(--ds-danger, #c33b36); stroke-dasharray: 8 6; }
.height-sample-points circle { fill: white; stroke: var(--ds-brand, #176b50); stroke-width: 3; }
.diameter-bars rect { fill: var(--ds-brand-soft, #dcece5); fill-opacity: .38; stroke: var(--ds-brand, #176b50); stroke-opacity: .48; stroke-width: .7; }
.curve-value-target { fill: transparent; stroke: none; cursor: crosshair; }
.chart-value-target:focus { outline: none; stroke: var(--ds-focus, #e0a100); stroke-width: 3; }
.height-curve-value { display: block; min-height: 22px; margin-top: 5px; color: var(--ds-text-muted); font-size: 13px; font-weight: 650; }
.height-sample-details {
  margin-top: 12px;
  border-top: 1px solid var(--ds-border);
}
.height-sample-details > summary {
  padding: 13px 4px 8px;
  color: var(--ds-text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
}
.height-sample-details > summary:focus-visible {
  outline: 3px solid var(--ds-focus);
  outline-offset: 2px;
}
.height-sample-table-wrap { margin-top: 4px; overflow: visible; }
.height-sample-table { width: 100%; table-layout: fixed; }
.height-sample-table th { vertical-align: top; }
.height-sample-sequence-column { width: 60px; }
.height-sample-number-column { width: 120px; }
.height-sample-actions-column { width: 90px; }
.height-sample-table .stand-measurement-actions-cell { text-align: right; }
.is-calculated-value { color: var(--ds-brand, #176b50); font-weight: 700; }
#stand-measurement-editor-view { width: min(960px, calc(100% - 32px)); }
.stand-measurement-dialog-card { width: 100%; }
.stand-measurement-dialog-card .page-heading { margin-bottom: 18px; }
.stand-classifiers-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 28px;
  cursor: pointer;
  list-style: none;
}
.stand-classifiers-summary::-webkit-details-marker { display: none; }
.stand-classifiers-summary > span { display: grid; gap: 4px; }
.stand-classifiers-summary strong { font-size: 18px; }
.stand-classifiers-summary small { color: var(--ds-text-muted); font-size: 13px; }
.stand-classifiers-summary svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: transform .16s ease;
}
.stand-classifiers-panel[open] .stand-classifiers-summary > svg { transform: rotate(180deg); }
.stand-classifiers-summary:focus-visible { outline: 3px solid var(--ds-focus); outline-offset: -3px; }
/* "Labot" sits in the same row as the panel title (§9 96), grouped with the
   chevron rather than the chevron alone as .stand-classifiers-summary > svg
   assumes elsewhere -- the rotate-on-open rule needs its own, descendant-
   selector version since the svg is no longer a direct summary child here. */
/* Beats the pre-existing ".stand-classifiers-summary > span { display: grid }"
   rule (higher specificity via the parent class), which otherwise wins over
   a plain .stand-summary-priorities-actions selector and breaks this row's
   flex layout. */
.stand-classifiers-summary > .stand-summary-priorities-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.stand-summary-priorities-panel[open] .stand-summary-priorities-chevron { transform: rotate(180deg); }
.stand-classifiers-content { padding: 0 28px 28px; border-top: 1px solid var(--ds-border); }
.stand-classifier-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding-top: 20px;
}
.stand-template-choice-list { display: grid; gap: 10px; margin: 20px 0; }
.stand-template-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
  cursor: pointer;
}
.stand-template-choice:has(input:checked) {
  border-color: var(--ds-brand);
  background: var(--ds-brand-soft);
}
.stand-template-choice span { display: grid; gap: 3px; }
.stand-template-choice small { color: var(--ds-text-muted); }
.stand-classifier-overview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 16px;
}
.stand-classifier-mode .admin-tabs { display: none; }
.stand-classifier-mode .admin-navigation { margin-bottom: 30px; }
#recalculate-stand-button.is-required {
  color: var(--ds-warning);
  border-color: var(--ds-warning);
  background: var(--ds-warning-soft);
}
#recalculate-stand-button.is-required:hover,
#recalculate-stand-button.is-required:focus-visible {
  background: color-mix(in srgb, var(--ds-warning-soft) 60%, var(--ds-warning) 40%);
}
.stand-classifier-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 20px; }
.measurement-form-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.3fr) repeat(3, minmax(102px, .65fr)) minmax(160px, 1fr);
  gap: 14px;
  align-items: end;
}
.affected-segment-fieldset {
  margin: 22px 0 0;
  padding: 18px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
}
.affected-segment-fieldset legend {
  width: auto;
  margin: 0;
  padding: 0 6px;
  color: var(--ds-text);
  font-size: 14px;
  font-weight: 700;
}
.measurement-affected-form-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) repeat(2, minmax(130px, 1fr));
  gap: 14px;
  align-items: end;
}
.empty-state { padding: 52px 24px; border: 1px dashed #cbd5cf; border-radius: 14px; text-align: center; color: var(--muted); }
.empty-state h3 { margin: 13px 0 7px; color: var(--ink); font-size: 17px; }
.empty-state p { max-width: 360px; margin: 0 auto; line-height: 1.55; font-size: 14px; }
.empty-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--forest); background: var(--mint); font-size: 21px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field-grid.three-columns { grid-template-columns: repeat(3, 1fr); }
.field-grid.four-columns { grid-template-columns: repeat(4, 1fr); }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; padding-top: 4px; }
.species-create-row { display: flex; align-items: flex-end; gap: 20px; }
.species-create-row > .field-grid { flex: 1; min-width: 0; }
.species-create-row > .actions { flex: 0 0 auto; padding-top: 0; }
.admin-sections { display: grid; gap: 26px; }
.classifier-card { padding: 28px; box-shadow: 0 14px 42px rgba(19, 54, 42, .06); }
.classifier-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.classifier-heading h2 { margin: 0 0 6px; font-size: 24px; }
.stand-finalize-terms { margin: 10px 0 0; padding-left: 20px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.stand-finalize-terms li + li { margin-top: 4px; }
.inline-form { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 12px; align-items: end; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.inline-form .message { grid-column: 1 / -1; }
.compact-form { padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.bottom-entry-form { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); border-bottom: 0; }
.bottom-entry-form.card { padding: 28px; border: 1px solid var(--line); }
.bottom-entry-form h3 { margin: 0; }
.subsection-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-top: 38px; padding-top: 28px; border-top: 1px solid var(--line); }
.subsection-heading h3 { margin: 0 0 6px; font-size: 20px; }
.checkbox-field { display: flex; align-items: center; gap: 9px; min-height: 46px; }
.checkbox-field input { width: 18px; height: 18px; flex: none; accent-color: var(--forest); }
.stand-print-options-list { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 6px; }
.stand-print-options-list .checkbox-field {
  align-items: flex-start;
  min-height: 0;
  padding: 10px;
  border-radius: var(--ds-radius-sm, 8px);
  cursor: pointer;
}
.stand-print-options-list .checkbox-field:hover { background: var(--mint); }
.stand-print-options-list .checkbox-field input { margin-top: 2px; }
.stand-print-options-list .option-title { display: block; font-weight: 650; }
.stand-print-options-list .option-caption { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.classifier-list { display: grid; gap: 10px; margin-top: 20px; }
.classifier-row { display: grid; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--ds-surface-subtle); }
.classifier-row.species-row { grid-template-columns: 90px 110px minmax(180px, 1fr) auto; }
.species-row-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.stand-species-code-picker { position: relative; min-width: 0; }
.stand-species-code-picker > summary {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 34px 10px 12px;
  border: 1px solid #b7c5bf;
  border-radius: 8px;
  color: var(--forest);
  background: var(--ds-surface);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.stand-species-code-picker > summary::-webkit-details-marker { display: none; }
.stand-species-code-picker > summary::after {
  content: '';
  position: absolute;
  right: 13px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.stand-species-code-picker[open] > summary {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(31, 91, 67, .12);
}
.stand-species-code-picker[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.stand-species-code-picker > summary.is-empty { color: var(--muted); font-weight: 600; }
.stand-species-code-choices {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  left: 0;
  min-width: 100%;
  display: grid;
  gap: 2px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--ds-surface);
  box-shadow: 0 14px 34px rgba(19, 54, 42, .16);
}
.stand-species-code-choices label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 7px;
  cursor: pointer;
}
.stand-species-code-choices label:hover { background: var(--mint); }
.stand-species-code-choices input { width: 18px; height: 18px; accent-color: var(--forest); }
.stand-classifier-mode .classifier-row.species-row { grid-template-columns: minmax(105px, .32fr) minmax(190px, .78fr) minmax(190px, 1fr) auto; }
.stand-species-create-fields { align-items: end; }
/* Stand/user species rows link to a veidules (source) species and share one
   column grid with a header row above the list and the add-row below it --
   self-tagged (not ancestor-scoped like .stand-classifier-mode above) so it
   applies identically whether the row sits under a stand or a user's own
   classifier template. The last column is a fixed width, not auto: auto
   sizes to each row's own action-button count (3 in a read row, 1 in the
   add-row, 0 in the header), which reflowed the fr-based columns before it
   to a different width per row and threw off alignment between them. */
.classifier-row.species-row.species-row-linked,
.species-row-header,
.species-create-row.species-create-row-linked {
  grid-template-columns: minmax(105px, .32fr) minmax(190px, .78fr) minmax(190px, 1fr) 120px;
}
.species-row-header {
  display: grid;
  gap: 10px;
  padding: 4px 12px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.species-create-row.species-create-row-linked { display: grid; gap: 10px; align-items: end; padding: 0 12px; }
.species-create-row.species-create-row-linked .user-species-create-fields,
.species-create-row.species-create-row-linked .stand-species-create-fields { display: contents; }
.classifier-row.inactive { background: var(--ds-surface-subtle); }
.classifier-row.inactive input, .classifier-row.inactive .classifier-code { opacity: .65; }
.classifier-code { color: var(--forest); text-align: center; }
.classifier-details { display: grid; grid-template-columns: minmax(130px, .55fr) minmax(180px, 1fr); gap: 10px; }
.classifier-details label { font-size: 12px; }
.classifier-actions { display: flex; align-items: center; gap: 6px; }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 8px; border: 1px solid #b8c9c1; border-radius: 8px; color: var(--forest); background: var(--ds-surface); cursor: pointer; }
.icon-button:hover { background: var(--mint); }
.icon-button:disabled { opacity: .55; cursor: wait; }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.toggle-button.is-active { color: white; border-color: var(--success); background: var(--success); }
.state-toggle-button { width: 36px; min-width: 36px; gap: 0; padding: 8px; }
.state-toggle-button svg { flex: none; }
.status-field { display: grid; gap: 7px; align-content: end; color: var(--muted); font-size: 13px; font-weight: 650; }
.user-status-field { justify-items: start; }
.delete-button { color: var(--danger); border-color: #e2bcbc; }
.compact-empty { margin: 20px 0 0; padding: 24px; border: 1px dashed #cbd5cf; border-radius: 11px; color: var(--muted); text-align: center; }
.upcoming-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.upcoming-card { padding: 24px; border: 1px dashed var(--ds-border); border-radius: 14px; background: var(--ds-surface-subtle); }
.upcoming-card h3 { margin: 18px 0 8px; }
.upcoming-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.classifier-overview { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; }
.classifier-summary { min-height: 124px; display: grid; grid-template-columns: 46px 1fr auto; gap: 16px; align-items: center; padding: 22px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: var(--ds-surface); text-align: left; cursor: pointer; box-shadow: 0 10px 30px rgba(19, 54, 42, .05); }
.classifier-summary:hover:not(.planned) { border-color: #a9c1b6; transform: translateY(-1px); }
.classifier-summary > span:nth-child(2) { display: grid; gap: 5px; }
.classifier-summary strong { font-size: 18px; }
.classifier-summary small { color: var(--muted); font-size: 13px; }
.classifier-summary.planned { grid-template-columns: 46px 1fr; border-style: dashed; cursor: default; box-shadow: none; }
.summary-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--forest); background: var(--mint); font-weight: 800; }
.summary-arrow { color: var(--forest); font-size: 22px; }
.admin-section-intro { margin: 5px 0 0; }
.section-heading { justify-content: space-between; }
.heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.stand-height-curves-toolbar {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.stand-height-curves-filter-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}
.stand-height-curves-filter-wrap .form-select { max-width: 260px; }
.stand-height-curves-panel:not([open]) .stand-height-curves-toolbar { display: none; }
.height-curve-heading.has-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}
.height-curve-heading.has-toggle .height-curve-heading-text {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.height-curve-card-table-toggle { margin-left: auto; flex: none; }
/*
 * `applyDesignSystem()` (app.js) adds .btn/.btn-icon to every .icon-button at
 * runtime, and body[data-ui-theme="classifier"] is the app's normal, global
 * skin (not an opt-in admin-only mode) - so design-system.css's
 * `[data-ui-theme="classifier"] .icon-button` width/gap reset and its
 * `.skin-action-label` visually-hidden rule both apply here unconditionally,
 * at higher specificity than a single class selector. !important matches
 * this file's existing convention for overriding such a competing rule
 * (see .numeric-cell, .stand-actions-cell above).
 */
#stand-height-curves-mode-toggle,
.height-curve-card-table-toggle {
  display: inline-flex !important;
  align-items: center;
  width: auto !important;
  min-width: auto !important;
  padding: 0 14px 0 12px !important;
  gap: 8px !important;
}
#stand-height-curves-mode-toggle .skin-action-label,
.height-curve-card-table-toggle .skin-action-label {
  position: static !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: nowrap;
  border: 0;
  font-size: 13.5px;
  font-weight: 600;
}
/* Same "own treatment" exception as above (§9 96/97): "Labot" in the
   summary's embedded Sortimentu prioritātes panel needs a visible label on
   desktop too, not just the icon. */
#stand-summary-priorities-edit-button {
  display: inline-flex !important;
  align-items: center;
  width: auto !important;
  min-width: auto !important;
  padding: 0 14px 0 12px !important;
  gap: 8px !important;
}
#stand-summary-priorities-edit-button .skin-action-label {
  position: static !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: nowrap;
  border: 0;
  font-size: 13.5px;
  font-weight: 600;
}
/*
 * Same "own treatment" exception as above (PRASIBAS.md §9 41/42): the
 * Profils "Saglabāt" and Konts "Apstiprināt" save-status buttons need a
 * visible label on screen, but .save-status-button is deliberately excluded
 * from design-system.css's default form-actions/heading-actions label
 * treatment (its label already changes with state).
 */
#profile-save-button,
#password-change-trigger-button,
#save-classifier-set-button,
#save-stand-button,
#save-priority-button {
  display: inline-flex !important;
  align-items: center;
  width: auto !important;
  min-width: auto !important;
  padding: 0 14px 0 12px !important;
  gap: 8px !important;
}
#profile-save-button .skin-action-label,
#password-change-trigger-button .skin-action-label,
#save-classifier-set-button .skin-action-label,
#save-stand-button .skin-action-label,
#save-priority-button .skin-action-label {
  position: static !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: nowrap;
  border: 0;
  font-size: 13.5px;
  font-weight: 600;
}
.user-table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--ds-surface); }
.user-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.user-table th, .user-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
.user-table th { color: var(--muted); background: var(--ds-surface-subtle); font-size: 12px; font-weight: 700; white-space: nowrap; }
.user-table tbody tr:last-child td { border-bottom: 0; }
.user-table tbody tr:hover { background: var(--ds-surface-subtle); }
/* Same reasoning as .stand-table above: .user-table-wrap always carries
   .long-table-scroll, so the wrapper's border-radius never clips these
   corners -- round the header/last-row cells directly instead. */
.user-table thead th:first-child { border-top-left-radius: 13px; }
.user-table thead th:last-child { border-top-right-radius: 13px; }
.user-table tbody tr:last-child td:first-child { border-bottom-left-radius: 13px; }
.user-table tbody tr:last-child td:last-child { border-bottom-right-radius: 13px; }
.user-table tbody tr.inactive { color: var(--muted); background: var(--ds-surface-subtle); }
.user-name-cell { font-weight: 700; }
.user-email-link { display: block; margin-top: 3px; color: var(--forest); font-size: 12px; font-weight: 500; text-decoration: none; }
.user-email-link:hover { text-decoration: underline; }
.user-name-column { width: 24%; }
.user-organization-column { width: 15%; }
.user-role-column { width: 10%; }
.user-stands-column { width: 7%; }
.user-last-login-column { width: 19%; }
.user-last-login-cell { font-size: 12.5px; line-height: 1.4; }
.user-last-login-failed { display: block; color: var(--danger); font-weight: 600; }
.user-actions-column { width: 180px; }
.user-actions-cell { padding-inline: 6px !important; }
.numeric-cell { text-align: right !important; font-variant-numeric: tabular-nums; }
.user-actions { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }
.table-action { min-height: 34px; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
.compact-page-heading { margin: 18px 0; }
.compact-page-heading h2 { margin: 0; }
.user-editor-form { max-width: 860px; padding: 28px; }
.form-actions { gap: 10px; }
.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; }
.coefficient-panel { grid-column: 1 / -1; border: 1px solid var(--ds-border); border-radius: 9px; background: var(--ds-surface-subtle); }
.coefficient-panel > summary { padding: 11px 13px; color: var(--forest); cursor: pointer; font-size: 13px; font-weight: 700; }
.coefficient-row { display: grid; grid-template-columns: 110px repeat(7, minmax(76px, 1fr)); gap: 9px; align-items: end; padding: 12px; border-top: 1px solid #d5dfda; }
.coefficient-row.coefficient-b { grid-template-columns: 110px repeat(5, minmax(76px, 1fr)); }
.coefficient-row strong { align-self: center; font-size: 12px; }
.coefficient-row label, .coefficient-meta label { font-size: 11px; }
.coefficient-row input, .coefficient-meta input { height: 38px; }
.coefficient-meta { display: grid; grid-template-columns: minmax(150px, .7fr) 1fr 1.4fr; gap: 9px; padding: 12px; border-top: 1px solid #d5dfda; }
.assortment-table-heading { margin-top: 0; padding-top: 0; border-top: 0; }
.add-priority-button { width: 36px; min-width: 36px; height: 36px; padding: 0; }
.priority-editor-form { max-width: 1120px; padding: 24px; }
.assortment-primary-row { display: grid; grid-template-columns: 90px minmax(145px, .6fr) minmax(230px, 1.4fr) auto auto; gap: 14px; align-items: end; }
.assortment-primary-row .status-field { gap: 8px; font-size: 14px; }
.assortment-primary-row .state-toggle-button { height: 46px; }
.assortment-groups-row { display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: 14px; align-items: end; }
.priority-position-field { min-width: 0; }
.priority-species-field { position: relative; display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 650; }
.species-token-field { display: flex; flex-wrap: nowrap; align-items: center; gap: 5px; min-height: 46px; padding: 5px 8px; border: 1px solid #b7c5bf; border-radius: 8px; background: var(--ds-surface); cursor: text; }
.species-token-field:focus-within { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(31, 91, 67, .12); }
.species-token-field > span { display: contents; }
.species-token-field input { flex: 1 1 70px; min-width: 55px; height: 34px; padding: 4px; border: 0; outline: 0; background: transparent; }
.species-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 5px 8px; border: 1px solid #b8c9c1; border-radius: 7px; color: var(--forest); background: var(--mint); cursor: pointer; white-space: nowrap; }
.species-suggestions { position: absolute; z-index: 15; top: calc(100% + 4px); left: 0; right: 0; display: grid; gap: 3px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: var(--ds-surface); box-shadow: 0 14px 34px rgba(19, 54, 42, .16); }
.species-suggestion { min-height: 36px; padding: 7px 9px; border: 0; border-radius: 7px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.species-suggestion:hover, .species-suggestion.is-current { color: white; background: var(--forest); }
.assortment-dimension-row { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 10px; align-items: stretch; overflow-x: auto; padding-bottom: 4px; }
.priority-row { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--ds-surface-subtle); }
.priority-form.is-dirty { background: var(--ds-dirty-soft); }
.priority-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.priority-meta span { padding: 5px 8px; border-radius: 7px; background: var(--ds-surface-subtle); color: var(--ds-text-muted); font-size: 12px; }
.priority-table-wrap { margin-bottom: 24px; border: 1px solid var(--line); border-radius: var(--ds-radius-md); background: var(--ds-surface); overflow-x: auto; overflow-y: hidden; }
/* .priority-table-wrap always carries .long-table-scroll too (sticky header,
   same reasoning as .stand-table-wrap above, §9 36) -- overflow: visible
   there means the wrapper's own border-radius never clips this table's
   corners, so the header/last-row cells round themselves to match (§9 96). */
.priority-table thead tr:first-child th:first-child { border-top-left-radius: var(--ds-radius-md); }
.priority-table thead tr:first-child th:last-child { border-top-right-radius: var(--ds-radius-md); }
.priority-table tbody:last-of-type tr:last-child td:first-child { border-bottom-left-radius: var(--ds-radius-md); }
.priority-table tbody:last-of-type tr:last-child td:last-child { border-bottom-right-radius: var(--ds-radius-md); }
.priority-table { min-width: 760px; margin: 0; color: var(--ds-text); font-size: 13px; }
.priority-table > thead > tr > th { padding: 6px 7px; color: var(--ds-text-muted); background: var(--ds-canvas); font-size: 10px; font-weight: 700; line-height: 1.15; white-space: normal; vertical-align: top; }
.priority-table > thead > tr > th small { display: block; margin-top: 2px; color: inherit; font-size: 9px; font-weight: 600; white-space: nowrap; }
.priority-table > tbody > tr > td { padding: 5px 7px; vertical-align: middle; }
.priority-table .priority-group-row > th { padding: 0; border-top: 1px solid var(--line); background: var(--ds-brand-soft); }
.priority-table > tbody:first-of-type .priority-group-row > th { border-top: 0; }
.priority-group-toggle { display: flex; align-items: center; gap: 7px; width: 100%; padding: 7px 9px; border: 0; color: var(--ds-brand); background: transparent; text-align: left; cursor: pointer; }
.priority-group-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .16s ease; }
.priority-group-toggle span { margin-left: auto; color: var(--ds-text-muted); font-size: 11px; font-weight: 600; }
.priority-species-group.is-collapsed .priority-group-toggle svg { transform: rotate(-90deg); }
.priority-species-group.is-collapsed .priority-data-row { display: none; }
.priority-name-cell { font-weight: 700; }
.priority-name-column { min-width: 125px; }
.priority-quality-column { width: 78px; }
.priority-measure-column { width: 72px; }
.priority-overmeasure-column { width: 58px; }
.priority-length-column { width: 88px; }
.priority-handle-column { width: 40px; }
.priority-state-column { width: 48px; text-align: center; }
.priority-actions-column { width: 84px; }
.priority-drag-handle { cursor: grab; touch-action: none; }
.priority-drag-handle:active { cursor: grabbing; }
.priority-data-row.is-dragging { opacity: .58; background: var(--ds-dirty-soft); }
.priority-species-group.is-saving { opacity: .72; pointer-events: none; }
.priority-table .inactive { color: var(--ds-text-muted); background: color-mix(in srgb, var(--ds-canvas) 82%, var(--ds-border)); }

@media (max-width: 820px) {
  .auth-layout { grid-template-columns: 1fr; padding-top: 44px; gap: 36px; }
  .intro h1 { font-size: 46px; }
  .intro .lead { font-size: 17px; }
  .classifier-row.species-row { grid-template-columns: 80px 100px minmax(160px, 1fr) auto; }
  .stand-classifier-mode .classifier-row.species-row { grid-template-columns: minmax(96px, .35fr) minmax(170px, .8fr) minmax(160px, 1fr) auto; }
  .classifier-row.species-row.species-row-linked,
  .species-row-header,
  .species-create-row.species-create-row-linked { grid-template-columns: minmax(96px, .35fr) minmax(170px, .8fr) minmax(160px, 1fr) 120px; }
  .classifier-details { grid-column: 2 / -1; }
  .field-grid.four-columns { grid-template-columns: repeat(2, 1fr); }
  .coefficient-row, .coefficient-row.coefficient-b { grid-template-columns: repeat(4, 1fr); }
  .coefficient-row strong { grid-column: 1 / -1; }
  .assortment-primary-row { grid-template-columns: 90px minmax(145px, .7fr) 1.4fr auto auto; }
  .stand-form-top-grid { grid-template-columns: 1fr; }
  .tree-assortment-content { grid-template-columns: 1fr; }
  .tree-assortment-details { position: static; }
  .tree-assortment-priority-table .col-quality,
  .tree-assortment-priority-table .col-butt,
  .tree-assortment-priority-table .col-overmeasure { display: none; }
  .tree-assortment-priority-table { min-width: 0; }
}
@media (max-width: 560px) {
  #stand-height-curves-mode-toggle,
  .height-curve-card-table-toggle {
    width: 36px !important;
    min-width: 36px !important;
    padding: 8px !important;
    gap: 0 !important;
  }
  #stand-height-curves-mode-toggle .skin-action-label,
  .height-curve-card-table-toggle .skin-action-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap;
    border: 0;
  }
  :root { --ds-layout-gutter: 18px; }
  .site-header { position: relative; height: 76px; padding: 0 18px; z-index: 20; }
  .brand-logo { height: 48px; }
  main { min-height: calc(100vh - 76px); }
  .auth-layout, .workspace { padding-top: 32px; padding-bottom: 32px; }
  .intro h1 { font-size: 39px; }
  .field-grid, .field-grid.three-columns, .field-grid.four-columns, .coefficient-meta, .assortment-primary-row, .assortment-groups-row { grid-template-columns: 1fr; }
  .species-create-row { flex-direction: column; align-items: stretch; }
  .page-heading { align-items: flex-start; }
  .menu-toggle { display: block; }
  .account-nav { display: none; position: absolute; top: 63px; left: 12px; right: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--ds-surface); box-shadow: 0 16px 42px rgba(16, 54, 42, .18); }
  .account-nav.menu-open { display: grid; }
  .nav-link { width: 100%; padding: 12px; text-align: left; }
  .account-nav .nav-icon-button { width: 100%; min-width: 0; padding: 12px; justify-content: flex-start; gap: 10px; }
  .account-nav .nav-icon-button svg { width: 20px; height: 20px; }
  .account-nav .button { width: 100%; margin-top: 4px; }
  .user-menu-dropdown,
  .user-menu-dropdown.is-open { position: static; box-shadow: none; border: 0; padding: 0 0 0 14px; }
  .user-menu-dropdown { display: none; }
  .user-menu-dropdown.is-open { display: grid; }
  .admin-tabs { padding-inline: 6px; }
  .admin-tabs .admin-tab, .admin-tabs .admin-catalogue-link { min-height: 46px; padding-inline: 12px; }
  .context-action { width: 46px; min-width: 46px; height: 46px; padding: 0; justify-content: center; border-radius: 50%; }
  .context-action .action-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .context-action .action-icon { font-size: 25px; }
  .classifier-card { padding: 20px; }
  .inline-form, .upcoming-grid, .classifier-overview { grid-template-columns: 1fr; }
  .classifier-row.species-row { grid-template-columns: 64px 90px 1fr; }
  .stand-classifier-mode .classifier-row.species-row { grid-template-columns: 1fr; }
  .classifier-row.species-row.species-row-linked,
  .species-row-header,
  .species-create-row.species-create-row-linked { grid-template-columns: 1fr; }
  /* No column header to label the stacked fields at this width -- show each
     field's own label again instead of leaving stacked inputs unlabeled. */
  .species-row-header { display: none; }
  .species-create-row.species-create-row-linked label .visually-hidden {
    position: static; width: auto; height: auto; padding: 0; margin: 0; overflow: visible; clip: auto; white-space: normal;
  }
  .classifier-details { grid-column: 1 / -1; grid-template-columns: 1fr; }
  .classifier-row.species-row .classifier-actions { grid-column: 1 / -1; grid-row: auto; justify-content: flex-end; }
  .coefficient-row, .coefficient-row.coefficient-b { grid-template-columns: repeat(2, 1fr); }
  .priority-species-field { grid-column: auto; }
  .classifier-summary { min-height: 108px; }
  .impersonation-banner { align-items: stretch; flex-direction: column; }
  .section-heading { align-items: flex-start; }
  .large-list-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  .stand-list-title { grid-column: 1; }
  .measurement-list-toolbar .stand-list-title h1 { font-size: 21px; }
  .height-sample-sequence-column { width: 38px; }
  .height-sample-number-column { width: 62px; }
  .height-sample-actions-column { width: 74px; }
  .height-sample-table .user-actions { gap: 4px; }
  .height-sample-table th,
  .height-sample-table td { padding-inline: 5px; }
  .height-sample-table td:nth-child(2) { overflow-wrap: anywhere; }
  .large-list-toolbar > .add-priority-button { grid-column: 2; grid-row: 1; }
  .large-list-toolbar > .help-trigger-button { grid-column: 2; grid-row: 1; justify-self: end; }
  .stand-search { grid-column: 1 / -1; grid-row: 2; }
  .heading-actions { align-items: stretch; flex-direction: column-reverse; }
  .priority-table-wrap { overflow-x: hidden; }
  .priority-table { width: 100%; min-width: 0; table-layout: fixed; }
  .priority-table > thead > tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }
  .priority-table .priority-data-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px 82px;
    align-items: center;
    width: 100%;
  }
  .priority-table .priority-handle-column,
  .priority-table .priority-quality-column,
  .priority-table .priority-measure-column,
  .priority-table .priority-overmeasure-column,
  .priority-table .priority-length-column,
  .priority-table .priority-bark-column,
  .priority-table .priority-handle-cell,
  .priority-table .priority-quality-cell,
  .priority-table .priority-measure-cell,
  .priority-table .priority-length-cell,
  .priority-table .priority-bark-cell { display: none; }
  .priority-table .priority-name-column { width: auto; grid-column: 1 / -1; }
  .priority-table .priority-name-cell { min-width: 0; overflow-wrap: normal; word-break: normal; }
  .priority-table .priority-active-cell { grid-column: 2; }
  .priority-table .priority-action-cell { grid-column: 3; }
  .priority-table .priority-state-column,
  .priority-table .priority-actions-column { display: none; }
  .priority-table .priority-action-cell { padding-inline: 3px; }
  .priority-table .user-actions { gap: 4px; }
  .user-table .user-organization-column,
  .user-table .user-role-column,
  .user-table .user-stands-column,
  .user-table .user-last-login-column,
  .user-table .user-organization-cell,
  .user-table .user-role-cell,
  .user-table .user-stands-cell,
  .user-table .user-last-login-cell { display: none; }
  .user-table .user-name-column { width: auto; }
  .user-table .user-actions-column { width: 166px; }
  .user-table th, .user-table td { padding: 8px 7px; }
  .user-table .user-actions { gap: 4px; }
  .stand-table { width: 100%; min-width: 0; table-layout: fixed; }
  .stand-table .stand-compartment-column,
  .stand-table .stand-area-column,
  .stand-table .stand-entry-column,
  .stand-table .stand-count-column,
  .stand-table .stand-compartment-cell,
  .stand-table .stand-area-cell,
  .stand-table .stand-entry-cell,
  .stand-table .stand-count-cell { display: none; }
  .stand-table .stand-name-column { width: auto; }
  .stand-table .stand-actions-column { width: 166px; }
  .stand-table th, .stand-table td { padding: 8px 7px; }
  .stand-table .stand-mobile-number { display: block; }
  .stand-table .user-actions { gap: 4px; }
  .stand-quick-start-grid { grid-template-columns: 1fr; }
  .stand-drop-zone {
    justify-content: flex-start;
    min-height: 96px;
    padding: 16px;
  }
  .stand-drop-zone strong { font-size: 16px; }
  .entry-mode-fieldset { grid-template-columns: 1fr; }
  .stand-location-row { grid-template-columns: minmax(0, 1fr) 7rem; }
  .stand-area-field { width: 7rem; }
  .stand-header-fields,
  .stand-people-row,
  .stand-audit-panel { grid-template-columns: 1fr; }
  .radio-card small { display: none; }
  .stand-measurements-panel { padding: 20px; }
  .stand-summary-grid,
  .stand-classifier-grid,
  .stand-classifier-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stand-summary-item-wide { grid-column: 1 / -1; }
  .stand-summary-item { padding: 12px; }
  .stand-summary-item dd { font-size: 15px; }
  .stand-classifiers-summary { padding: 18px 20px; }
  .stand-classifiers-content { padding: 0 20px 20px; }
  .measurement-form-row,
  .measurement-affected-form-row { grid-template-columns: 1fr; }
  .stand-species-mapping-row { grid-template-columns: 1fr; gap: 7px; }
  .stand-measurement-list-card { border-radius: var(--ds-radius-md); }
  .stand-measurement-table,
  .stand-measurement-table thead,
  .stand-measurement-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .long-table-scroll .stand-measurement-table > thead {
    position: sticky;
    top: 0;
    z-index: 6;
    background: var(--ds-canvas);
    box-shadow: 0 1px 0 var(--ds-border);
  }
  .long-table-scroll .stand-measurement-table > thead > tr > th {
    position: static;
    top: auto;
    z-index: auto;
    box-shadow: none;
  }
  .stand-measurement-table thead tr,
  .stand-measurement-table tbody tr:not(.is-editing) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    align-items: center;
    width: 100%;
  }
  .stand-measurement-table tr.is-editing {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }
  .stand-measurement-table .measurement-sequence-column,
  .stand-measurement-table .measurement-diameter-column,
  .stand-measurement-table .measurement-height-column,
  .stand-measurement-table .measurement-volume-column,
  .stand-measurement-table .measurement-count-column,
  .stand-measurement-table .measurement-quality-column,
  .stand-measurement-table .measurement-affected-length-column,
  .stand-measurement-table .measurement-affected-quality-column,
  .stand-measurement-table .stand-measurement-sequence-cell,
  .stand-measurement-table .stand-measurement-diameter-cell,
  .stand-measurement-table .stand-measurement-height-cell,
  .stand-measurement-table .stand-measurement-volume-cell,
  .stand-measurement-table .stand-measurement-count-cell,
  .stand-measurement-table .stand-measurement-quality-cell,
  .stand-measurement-table .stand-measurement-affected-length-cell,
  .stand-measurement-table .stand-measurement-affected-quality-cell { display: none; }
  .stand-measurement-table .measurement-species-column { width: auto; }
  .stand-measurement-table thead .measurement-species-column { grid-column: 1 / -1; }
  .stand-measurement-table thead .measurement-actions-column { display: none; }
  .stand-measurement-table .measurement-actions-column { width: 132px; }
  .stand-measurement-table th,
  .stand-measurement-table td { padding: 8px 7px; }
  .stand-measurement-table .user-actions { gap: 4px; }
  .stand-measurement-table tr.is-editing td.measurement-inline-editor-cell {
    display: table-cell;
    width: auto;
    padding: 10px;
  }
  .measurement-inline-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .measurement-inline-sequence { display: none; }
  .measurement-inline-species,
  .measurement-inline-quality,
  .measurement-inline-actions { grid-column: 1 / -1; }
  .measurement-inline-field[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--ds-text-muted);
    font-size: 11px;
    font-weight: 700;
  }
}

.classifier-set-toolbar {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) auto;
  gap: 12px 16px;
  align-items: end;
  margin-bottom: 16px;
  padding: 16px;
}
.classifier-set-picker { display: grid; gap: 6px; }
.classifier-set-picker label { font-weight: 700; }
.classifier-set-picker select { max-width: 608px; }
.classifier-set-form-row {
  display: grid;
  gap: 14px;
  max-width: 640px;
}
.classifier-set-form-row .classifier-set-field-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.classifier-set-form-row .classifier-set-field-row > span:first-child {
  min-width: 190px;
  flex-shrink: 0;
}
.classifier-set-form-row .classifier-set-field-row input,
.classifier-set-form-row .classifier-set-field-row select,
.classifier-set-form-row .classifier-set-field-row textarea {
  flex: 1;
  min-width: 0;
}
.classifier-set-form-row .classifier-set-field-row textarea {
  font-weight: 400;
  resize: vertical;
}
.classifier-set-form-row .status-field.classifier-set-field-row { color: var(--muted); font-size: 13px; font-weight: 650; }
.aligned-form-row > label { display: grid; grid-template-rows: auto 46px; align-items: end; }
.classifier-set-dialog {
  width: min(720px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--ds-radius-lg, 16px);
  background: transparent;
}
.classifier-set-dialog::backdrop { background: rgba(18, 38, 31, .42); }
.classifier-set-dialog-card { margin: 0; padding: 24px; overflow: auto; }
.help-dialog-body { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.help-dialog-body p { margin: 0; color: var(--muted); font-size: 14px; }
.help-trigger-button { color: var(--forest); border-color: color-mix(in srgb, var(--forest) 35%, var(--line)); }
dialog .actions { flex-wrap: nowrap; overflow-x: auto; }
.system-classifier-set-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.system-classifier-set-table { width: 100%; margin: 0; }
.system-classifier-set-table th,
.system-classifier-set-table td { padding: 10px; vertical-align: middle; }
.system-classifier-set-table tbody tr { cursor: pointer; }
.system-classifier-set-table tbody tr:hover { background: var(--mint); }
.system-classifier-set-table input[type="radio"] { width: 18px; height: 18px; accent-color: var(--forest); }
.system-classifier-set-name { font-weight: 700; }
.quality-group-row {
  grid-template-columns: 32px minmax(80px, .25fr) minmax(192px, 1fr) auto minmax(0, auto) auto;
}
.summary-group-row {
  grid-template-columns: 32px minmax(80px, .25fr) minmax(192px, 1fr) auto minmax(0, auto) auto;
}
.quality-group-drag-handle { cursor: grab; touch-action: none; }
.quality-group-drag-handle:active { cursor: grabbing; }
.quality-group-row.is-dragging { opacity: .58; background: var(--ds-dirty-soft); }
.quality-group-row.is-missing-in-classifier {
  border-color: color-mix(in srgb, var(--ds-danger) 45%, transparent);
  background: var(--ds-danger-soft);
}
.quality-group-create-row {
  grid-template-columns: minmax(100px, .3fr) minmax(220px, 1fr) 36px 36px;
  align-items: end;
}
.quality-retained-field { justify-items: center; }
.damage-share-row {
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(90px, 140px) auto;
}
.damage-share-create-row {
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(90px, 140px) 36px;
  align-items: end;
}

@media (max-width: 640px) {
  .classifier-set-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px;
  }
  .classifier-set-picker select { width: 100%; }
  .classifier-set-form-row .classifier-set-field-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .classifier-set-form-row .classifier-set-field-row > span:first-child { min-width: 0; }
  .classifier-set-dialog { width: calc(100% - 20px); }
  .classifier-set-dialog-card { padding: 16px; }
  .stand-height-curves-content { padding: 14px; }
  .height-curve-card { padding: 12px; }
  .stand-measurement-dialog-card { width: calc(100vw - 20px); }
  .system-classifier-set-table th:nth-child(3),
  .system-classifier-set-table td:nth-child(3),
  .system-classifier-set-table th:nth-child(4),
  .system-classifier-set-table td:nth-child(4) { display: none; }
  .quality-group-row { grid-template-columns: 28px 64px minmax(0, 1fr) auto; }
  .quality-group-row .classifier-row-code-status {
    grid-column: 1 / -1;
  }
  .quality-group-row .classifier-actions {
    grid-column: 1 / -1;
    justify-self: end;
  }
  .summary-group-row { grid-template-columns: 28px 64px minmax(0, 1fr) auto; }
  .summary-group-row .classifier-row-code-status {
    grid-column: 1 / -1;
  }
  .summary-group-row .classifier-actions {
    grid-column: 1 / -1;
    justify-self: end;
  }
  .quality-group-create-row { grid-template-columns: minmax(0, 1fr) auto; }
  .quality-group-create-row > label { grid-column: 1 / -1; }
  .damage-share-row { grid-template-columns: 1fr; }
  .damage-share-row .classifier-actions { grid-column: 1 / -1; justify-self: end; }
  .damage-share-create-row { grid-template-columns: minmax(0, 1fr) auto; }
  .damage-share-create-row > label { grid-column: 1 / -1; }
  .quality-mapping-row {
    grid-template-columns: 54px minmax(0, 1fr);
  }
  .quality-mapping-row .mapping-status {
    grid-column: 2;
  }
}
