:root {
  font-synthesis: none;
  --desktop-rail-width: 58px;
  --surface: #0c0c0c;
  --raised: #151515;
  --corner: 9px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; background: var(--background); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.skip-link { position: fixed; top: -80px; left: 80px; z-index: 2100; border-radius: 6px; background: #171717; padding: 10px 15px; }
.skip-link:focus { top: 16px; }
.muted { color: var(--muted); }
.numeric { font-variant-numeric: tabular-nums; }
.small { font-size: 13px; }
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--desktop-rail-width); display: flex;
  flex-direction: column; align-items: center; gap: 12px; background: #000; z-index: 9;
}
.monogram { height: 55px; width: 42px; display: grid; place-items: center; }
.rail-button {
  position: relative; display: grid; place-items: center; min-height: 44px; width: 38px; border-radius: 7px;
  color: var(--muted); transition: color .18s, background .18s;
}
.rail-button:hover { color: #fff; background: #111; }
.rail-button[aria-current] { color: #fff; background: #171717; }
.rail-button[aria-current]::before { content: ""; position: absolute; left: -9px; width: 2px; height: 17px; background: #fff; border-radius: 1px; }
.rail-glyph { width: 17px; height: 17px; position: relative; display: block; border: 1.4px solid currentColor; border-radius: 3px; }
.glyph-assets { background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat, linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat; }
.glyph-companies { border-radius: 3px 3px 1px 1px; background: repeating-linear-gradient(to bottom, transparent 0 3px, currentColor 3px 4px) center 3px / 7px 8px no-repeat; }
.nav-label { position: absolute; height: 1px; width: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.shell { margin-inline-start: var(--desktop-rail-width); min-width: 0; min-height: 100svh; }
.topbar {
  min-height: 56px; padding: 0 26px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); gap: 12px;
}
.wordmark { font-size: 15px; font-weight: 650; letter-spacing: .045em; }
.topbar-end { display: flex; align-items: center; gap: 20px; }
.connection { margin: 0; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.dot { height: 6px; width: 6px; border-radius: 100%; background: var(--neutral); }
.connection[data-state="ok"] .dot { background: var(--green); }
.connection[data-state="error"] { color: var(--amber); }
.connection[data-state="error"] .dot { background: var(--amber); }
.settings-link { color: var(--muted); font-size: 14px; padding-block: 12px; }
.settings-link:hover, .settings-link[aria-current] { color: #fff; }
#main { width: min(100%, 1260px); padding: 25px 26px 52px; }
#main:focus { outline: none; }
.command-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 21px; }
.command-heading h1 { margin: 0; font-size: clamp(24px, 3vw, 33px); font-weight: 500; line-height: 1.15; letter-spacing: -.6px; overflow-wrap: anywhere; }
.caption { color: var(--muted); margin: 7px 0 0; font-size: 14px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.button {
  display: inline-flex; align-items: center; justify-content: center; border: 1px solid #303030; border-radius: 7px;
  min-height: 40px; padding: 7px 13px; background: #101010; color: var(--text); font-size: 14px; font-weight: 550; white-space: nowrap;
}
.button:hover { background: #1b1b1b; border-color: #494949; }
.button.primary { color: #04150d; background: var(--green); border-color: var(--green); }
.button.primary:hover { background: #52ffa9; }
.notice { padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--corner); margin: 0 0 16px; background: var(--surface); }
.notice[data-tone="error"], .notice.demo { color: #f2d781; border-color: #483c1d; }
.object-toolbar { display: flex; flex-wrap: wrap; gap: 12px 19px; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.segmented { display: inline-flex; flex-wrap: wrap; align-items: stretch; gap: 3px; border: 1px solid var(--line); padding: 3px; border-radius: var(--corner); }
.segmented a { padding: 7px 11px; border-radius: 5px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.segmented a:hover { background: var(--surface); color: #fff; }
.segmented a[aria-current] { background: #1a1a1a; color: #fff; }
.segment-count { margin-inline-start: 6px; color: var(--muted); font-size: 12px; }
.summary-line { display: flex; align-items: stretch; flex-wrap: wrap; gap: 13px 28px; padding-block: 18px; border-bottom: 1px solid var(--line); }
.summary-cell { display: grid; gap: 4px; min-width: 100px; }
.summary-cell span { color: var(--muted); font-size: 13px; }
.summary-cell strong { font-size: 19px; font-weight: 550; line-height: 1.2; }
.filters { margin: 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.filters input { width: min(100%, 440px); min-width: 0; }
.filters select { max-width: 46%; }
input:not([type="checkbox"]), select, textarea {
  appearance: none; border: 1px solid #383838; border-radius: 7px; background: #0e0e0e; color: var(--text); min-height: 40px; padding: 8px 11px;
}
input::placeholder, textarea::placeholder { color: #9a9a9a; }
select {
  padding-inline-end: 27px; background-image: linear-gradient(45deg, transparent 50%, #aaa 50%), linear-gradient(135deg, #aaa 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 10px) 50%; background-repeat: no-repeat; background-size: 4px 4px;
}
.list-panel { border: 1px solid var(--line); border-radius: var(--corner); overflow: clip; }
.record-line {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.03fr) minmax(94px, .55fr) minmax(0, .85fr);
  align-items: center; gap: 17px; padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.record-line:last-child { border-bottom: 0; }
.record-line > * { min-width: 0; overflow-wrap: anywhere; }
.record-line:hover { background: #0e0e0e; }
.record-line:focus-visible { outline-offset: -3px; }
.list-header { background: #0e0e0e; font-size: 12px; color: var(--muted); }
.record-name { display: block; font-size: 15px; font-weight: 600; line-height: 1.25; }
.record-meta { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; }
.review-note { color: #dec477; }
.info-note { margin: 0 0 20px; font-size: 14px; }
.record-area { font-variant-numeric: tabular-nums; }
.record-line.company-line { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(90px, .65fr); }
.empty { padding: 26px 18px; border: 1px solid var(--line); border-radius: var(--corner); }
.empty h2 { font-size: 18px; font-weight: 550; margin: 0 0 7px; }
.empty p { margin: 0; color: var(--muted); max-width: 70ch; }
.empty .button { margin-top: 12px; }
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; color: var(--muted); gap: 7px; font-size: 14px; margin: 0 0 16px; }
.breadcrumb a:hover { color: #fff; }
.crumb-separator { color: var(--dim); }
.dossier { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(260px, 1fr); align-items: start; gap: 16px; }
.dossier > div { display: grid; gap: 16px; min-width: 0; }
.panel { padding: 16px; border: 1px solid var(--line); border-radius: var(--corner); background: var(--surface); min-width: 0; }
.panel h2 { margin: 0 0 11px; font-size: 17px; font-weight: 590; line-height: 1.35; }
.panel p { overflow-wrap: anywhere; }
.panel-block { margin: 0 0 16px; }
.fields { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.field-pair { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-block: 9px; border-top: 1px solid var(--line); }
.field-pair.wide { grid-column: 1 / -1; }
.field-pair dt { color: var(--muted); font-size: 13px; }
.field-pair dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.simple-list, .files, .photos { padding: 0; margin: 0; list-style: none; }
.simple-list li, .files li { padding-block: 10px; border-top: 1px solid var(--line); }
.simple-list a, .files a { overflow-wrap: anywhere; }
.simple-list a:hover, .files a:hover { text-decoration: underline; text-underline-offset: 4px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.photos a { display: block; }
.photos img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #141414; border-radius: 6px; }
.photos span { display: block; margin-top: 4px; overflow-wrap: anywhere; }
.upload { border-top: 1px solid var(--line); padding-top: 11px; }
.upload summary { cursor: pointer; font-size: 14px; }
.upload-form { display: grid; gap: 10px; margin-top: 11px; }
.upload-form label { display: grid; gap: 4px; color: var(--muted); font-size: 13px; min-width: 0; }
.upload-form input, .upload-form select { width: 100%; min-width: 0; }
.upload-form .button { justify-self: start; }
.inline-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.upload-message { margin: 0; font-size: 14px; }
.settings-panel { max-width: 780px; display: grid; gap: 12px; }
.settings-panel p { margin: 0; }
.locked .rail, .locked .settings-link { display: none; }
.locked .shell { margin-inline-start: 0; }
.signin { max-width: 390px; margin: min(10vh, 85px) auto 0; display: grid; gap: 16px; }
.signin h1 { margin: 0 0 12px; }
.signin label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.signin input { min-height: 44px; }
.signin-message { margin: 0; font-size: 14px; color: #dec477; }
.signin-message:empty { display: none; }
.reauth { width: min(440px, calc(100vw - 32px)); padding: 24px; }
.reauth .signin { margin: 0; }
.reauth::backdrop { background: #000e; }
.badge { display: inline-flex; align-items: center; border: 1px solid #343434; border-radius: 5px; color: var(--muted); font-size: 12px; padding: 3px 7px; }
.badge.accent { border-color: #174735; color: var(--green); }
.short-note { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.dialog { border: 1px solid #343434; background: #0b0b0b; color: var(--text); border-radius: 12px; }
.dialog::backdrop { background: #000b; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.form-section { margin: 0 0 18px; border: 0; padding: 0; }
.form-section legend { color: var(--text); padding: 0; }
.field { display: grid; gap: 5px; min-width: 0; }
@media (max-width: 860px) {
  .record-line { grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr) minmax(72px, .43fr); }
  .record-owner { display: none; }
  .dossier { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .shell { margin-inline-start: 0; }
  .rail { inset: auto 0 0; flex-direction: row; justify-content: center; width: 100%; padding: 5px 16px max(5px, env(safe-area-inset-bottom)); gap: 10px; border-top: 1px solid var(--line); }
  .rail .monogram { display: none; }
  .rail-button { width: min(164px, 46%); min-height: 48px; gap: 3px; align-content: center; }
  .rail-button[aria-current]::before { display: none; }
  .nav-label { position: static; clip: auto; width: auto; height: auto; font-size: 12px; }
  .topbar { padding: max(0px, env(safe-area-inset-top)) 16px 0; }
  .topbar-end { gap: 13px; }
  #main { padding: 19px 16px calc(83px + env(safe-area-inset-bottom)); }
  .command-heading { gap: 9px; margin-bottom: 16px; }
  .command-heading .button { padding-inline: 9px; min-height: 37px; font-size: 13px; }
  .object-toolbar { gap: 10px; padding-bottom: 12px; }
  .segmented a { padding: 6px 8px; font-size: 13px; }
  .summary-line { gap: 13px 18px; padding-block: 14px; }
  .summary-cell { min-width: 76px; }
  .filters { flex-wrap: wrap; }
  .filters input, .filters select { max-width: none; width: 100%; }
  .record-line { gap: 8px; padding: 13px 11px; grid-template-columns: minmax(0, 1fr) max-content; }
  .record-line.company-line { grid-template-columns: minmax(0, 1fr) minmax(0, .55fr); }
  .record-line .record-location { display: none; }
  .record-meta { font-size: 12px; }
  .header-actions { max-width: 54%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; } }
.pad-top, .map-region { margin-top: 16px; }
