:root {
  color-scheme: light;
  --bg: #eef3f8;
  --bg-2: #dde7f0;
  --surface: #ffffff;
  --surface-2: #f6f9fc;
  --surface-3: #eaf1f7;
  --ink: #17202e;
  --text: #17202e;
  --muted: #647187;
  --soft: #8794a8;
  --border: #d6e0ea;
  --border-strong: #b8c7d8;
  --primary: #0c75b8;
  --primary-2: #13a7a5;
  --accent: #d94f45;
  --accent-2: #f4b942;
  --success: #21895f;
  --warning: #b86c11;
  --danger: #c93d3a;
  --nav: #101927;
  --nav-2: #172436;
  --shadow: 0 18px 55px rgba(18, 32, 50, 0.13);
  --shadow-soft: 0 10px 30px rgba(18, 32, 50, 0.08);
  --radius: 8px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d141d;
  --bg-2: #111d2a;
  --surface: #151f2b;
  --surface-2: #1b2837;
  --surface-3: #223246;
  --ink: #f3f7fb;
  --text: #f3f7fb;
  --muted: #9bacbf;
  --soft: #7f91a6;
  --border: #2d4056;
  --border-strong: #486078;
  --primary: #4eb3f2;
  --primary-2: #37d0c3;
  --accent: #ff746a;
  --accent-2: #ffd15a;
  --success: #52c991;
  --warning: #f2b851;
  --danger: #ff736c;
  --nav: #090f17;
  --nav-2: #111b28;
  --shadow: 0 20px 65px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 12px 38px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--bg) 92%, var(--primary) 8%), var(--bg) 42%, var(--bg-2));
  color: var(--text);
}

body {
  overflow-x: hidden;
  overflow-y: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  min-height: 100vh;
}

.layout {
  min-height: 100vh;
  display: block;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, auto) 1fr auto;
  gap: 12px 16px;
  align-items: center;
  min-height: 78px;
  padding: 12px clamp(16px, 3vw, 34px);
  color: #f8fbff;
  background:
    linear-gradient(90deg, rgba(19, 167, 165, 0.18), transparent 28%),
    linear-gradient(135deg, var(--nav), var(--nav-2));
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 12px 34px rgba(7, 14, 24, 0.22);
}

.brand {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #06121d;
  background: linear-gradient(135deg, #f4b942, #35d1c4);
  border-radius: var(--radius);
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: inset 0 -3px 0 rgba(6, 18, 29, 0.18);
}

.brand-title {
  font-size: 18px;
  line-height: 1.1;
  font-weight: 850;
}

.brand-subtitle {
  margin-top: 3px;
  color: rgba(248, 251, 255, 0.7);
  font-size: 13px;
  line-height: 1.2;
}

.nav-list {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-list::-webkit-scrollbar {
  display: none;
}

.nav-button {
  flex: 0 0 auto;
  min-height: 44px;
  display: grid;
  grid-template-columns: 28px minmax(78px, auto);
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  min-width: 122px;
  padding: 8px 11px;
  color: rgba(248, 251, 255, 0.72);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.nav-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  opacity: 0;
  transform: translateX(-55%);
  transition: opacity 0.18s ease, transform 0.42s ease;
}

.nav-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.nav-button:hover::after {
  opacity: 1;
  transform: translateX(55%);
}

.nav-button.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(12, 117, 184, 0.65), rgba(19, 167, 165, 0.34));
  border-color: rgba(78, 179, 242, 0.55);
  box-shadow: inset 0 -2px 0 rgba(244, 185, 66, 0.8);
}

.nav-icon {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #0c1723;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
}

.nav-index {
  color: rgba(248, 251, 255, 0.5);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.nav-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.15;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  color: #0c1723;
  background: var(--accent-2);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 900;
}

.user-chip {
  max-width: 190px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  color: rgba(248, 251, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  min-width: 0;
  min-height: calc(100vh - 78px);
  display: block;
}

.topbar {
  padding: 18px clamp(16px, 3vw, 34px) 0;
}

.topbar-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  max-width: 1480px;
  margin: 0 auto;
  padding: 4px 0 18px;
  border-bottom: 1px solid var(--border);
}

.tool-heading {
  min-width: 0;
}

.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.crumb span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 8px;
  background: color-mix(in srgb, var(--primary) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: 999px;
}

.crumb span:first-child {
  color: var(--primary);
}

.top-title {
  margin: 9px 0 0;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: 0;
}

.top-subtitle {
  max-width: 780px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.command-deck {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
}

.deck-cell {
  min-width: 126px;
  min-height: 58px;
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.deck-cell strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.page {
  min-width: 0;
  overflow: visible;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  padding: 22px clamp(16px, 3vw, 34px) 72px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-row,
.split,
.triple,
.quad {
  display: grid;
  gap: 14px;
}

.split {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  align-items: start;
}

.triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quad {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.metric,
.tool-panel,
.development-panel {
  background: color-mix(in srgb, var(--surface) 94%, var(--primary) 6%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.panel:hover,
.metric:hover,
.development-panel:hover {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.panel {
  padding: 18px;
}

.panel.compact {
  padding: 14px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.panel-note,
.muted,
.small {
  color: var(--muted);
}

.panel-note {
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 1.45;
}

.eyebrow,
.mini-label,
.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.metrics-band {
  align-self: stretch;
}

.metric {
  min-height: 116px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  position: relative;
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2), var(--accent-2));
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.metric-spark {
  width: 28px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.metric-value {
  margin-top: 12px;
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
}

.metric-detail {
  margin-top: 6px;
  min-height: 34px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.tool-panel {
  padding: 14px;
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 780;
  text-decoration: none;
  overflow: hidden;
  position: relative;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  opacity: 0;
  transform: translateX(-55%);
  transition: opacity 0.16s ease, transform 0.36s ease;
}

.btn:hover {
  border-color: color-mix(in srgb, var(--primary) 58%, var(--border));
  transform: translateY(-1px);
}

.btn:hover::after {
  opacity: 1;
  transform: translateX(55%);
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #0b679f);
  border-color: color-mix(in srgb, var(--primary) 76%, var(--border));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 24%, transparent);
}

:root[data-theme="dark"] .btn.primary {
  color: #07111b;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.btn.success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.btn.danger {
  background: transparent;
  border-color: color-mix(in srgb, var(--danger) 52%, var(--border));
  color: var(--danger);
}

.btn.ghost {
  color: inherit;
  background: transparent;
}

.site-header .btn.ghost {
  color: #f8fbff;
  border-color: rgba(255, 255, 255, 0.14);
}

.site-header .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.09);
}

.btn.small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.input,
.select,
.textarea {
  width: 100%;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 12px;
  outline: none;
}

.textarea {
  min-height: 106px;
  resize: vertical;
  line-height: 1.45;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field {
  min-width: 0;
}

.field-label {
  display: block;
  margin: 0 0 7px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.segment {
  min-height: 38px;
  padding: 8px 14px;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.segment.active {
  color: #fff;
  background: var(--primary);
}

:root[data-theme="dark"] .segment.active {
  color: #06121d;
  background: var(--primary-2);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-2) 64%, transparent);
}

tbody tr:hover td {
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

td .input,
td .select {
  padding: 8px 9px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.status.ok {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 45%, var(--border));
}

.status.warn {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 50%, var(--border));
}

.status.bad {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 50%, var(--border));
}

.task-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.task-row + .task-row {
  margin-top: 8px;
}

.task-number {
  display: grid;
  place-items: center;
  min-height: 34px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border-radius: 7px;
  font-weight: 850;
}

.task-title {
  font-weight: 850;
}

.task-note {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.switch {
  position: relative;
  width: 48px;
  height: 28px;
  appearance: none;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 999px;
  transition: transform 0.16s ease;
}

.switch:checked {
  background: var(--primary);
}

.switch:checked::after {
  transform: translateX(20px);
}

.route-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.route-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.route-step.on {
  color: var(--text);
  border-color: var(--primary);
}

.log {
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  padding: 12px;
  color: #dbe7f3;
  background: #07101d;
  border: 1px solid #1e293b;
  border-radius: var(--radius);
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.hidden {
  display: none !important;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 8, 18, 0.72);
}

.dialog {
  width: min(780px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dialog-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.dialog-body {
  padding: 18px 20px;
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: grid;
  gap: 8px;
  max-width: 380px;
}

.toast {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toast strong {
  display: block;
  margin-bottom: 4px;
}

.toast.ok {
  border-color: color-mix(in srgb, var(--success) 58%, var(--border));
}

.toast.warn {
  border-color: color-mix(in srgb, var(--warning) 58%, var(--border));
}

.toast.bad {
  border-color: color-mix(in srgb, var(--danger) 58%, var(--border));
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 86%, var(--primary) 14%);
}

.print-area {
  display: none;
}

.drop-zone {
  display: block;
  min-height: 94px;
  border: 1px dashed color-mix(in srgb, var(--primary) 50%, var(--border));
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, transparent), transparent 62%),
    var(--surface-2);
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.drop-zone::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2), var(--accent-2));
  opacity: 0.7;
}

.drop-zone:hover,
.drop-zone:focus-within {
  border-color: var(--primary);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 13%, transparent), transparent 66%),
    var(--surface);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--primary) 14%, transparent);
  transform: translateY(-1px);
}

.drop-zone input {
  width: 100%;
  margin-top: 10px;
}

.upload-zone {
  cursor: pointer;
  min-height: 112px;
}

.upload-zone .file-input {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  border: 0;
  cursor: pointer;
}

.upload-control {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: 13px;
  padding: 9px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 92%, var(--primary) 8%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.upload-button {
  flex: 0 0 auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-radius: 6px;
  box-shadow: 0 8px 16px color-mix(in srgb, var(--primary) 20%, transparent);
  font-weight: 850;
  transition: filter 0.16s ease, transform 0.16s ease;
}

.upload-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-zone:hover .upload-button,
.upload-zone:focus-within .upload-button {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

:root[data-theme="dark"] .upload-button {
  color: #07111b;
}

input[type="file"] {
  display: block;
  max-width: 100%;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 7px;
}

input[type="file"]::file-selector-button {
  min-height: 36px;
  margin: 0 12px 0 0;
  padding: 8px 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 850;
  transition: filter 0.16s ease, transform 0.16s ease;
}

input[type="file"]::-webkit-file-upload-button {
  min-height: 36px;
  margin: 0 12px 0 0;
  padding: 8px 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 850;
  transition: filter 0.16s ease, transform 0.16s ease;
}

input[type="file"]:hover::file-selector-button,
input[type="file"]:focus::file-selector-button,
input[type="file"]:hover::-webkit-file-upload-button,
input[type="file"]:focus::-webkit-file-upload-button {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

:root[data-theme="dark"] input[type="file"]::file-selector-button,
:root[data-theme="dark"] input[type="file"]::-webkit-file-upload-button {
  color: #07111b;
}

.subtle-line {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.development-panel {
  max-width: 720px;
  margin: clamp(34px, 9vh, 96px) auto 0;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 22px;
}

.development-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  color: #0c1723;
  background: linear-gradient(135deg, var(--accent-2), var(--primary-2));
  border-radius: var(--radius);
  font-weight: 950;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--primary) 24%, transparent), transparent 32%),
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--primary-2) 20%, transparent), transparent 28%),
    linear-gradient(135deg, var(--nav), var(--bg));
}

.auth-card {
  width: min(460px, 100%);
  padding: 24px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 94%, var(--primary) 6%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.auth-copy h1 {
  margin: 7px 0 0;
  font-size: 32px;
  line-height: 1.08;
}

.auth-form {
  display: grid;
  gap: 13px;
  margin-top: 20px;
}

.profile-form {
  display: grid;
  gap: 12px;
}

.profiles-layout {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
}

.access-panel {
  align-self: stretch;
  display: grid;
  align-content: center;
}

.profiles-table {
  min-width: 960px;
}

.compact-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--muted);
  font-weight: 780;
  white-space: nowrap;
}

.compact-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

@media (prefers-reduced-motion: no-preference) {
  .site-header {
    animation: header-in 0.32s ease both;
  }

  .topbar-inner,
  .page > * {
    animation: surface-in 0.34s ease both;
  }

  .page > *:nth-child(2) {
    animation-delay: 0.04s;
  }

  .page > *:nth-child(3) {
    animation-delay: 0.08s;
  }

  @keyframes header-in {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes surface-in {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 1500px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .nav-list {
    grid-column: 1 / -1;
    order: 3;
  }

  .topbar-inner,
  .split,
  .triple,
  .quad {
    grid-template-columns: 1fr;
  }

  .command-deck {
    justify-content: flex-start;
  }

  .metric {
    min-height: 96px;
  }
}

@media (min-width: 1181px) and (max-width: 1500px) {
  .nav-list {
    overflow-x: visible;
  }

  .nav-button {
    flex: 1 1 0;
    min-width: 0;
  }
}

@media (max-width: 1100px) {
  .field-grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .layout,
  .app-main {
    min-height: auto;
  }

  .site-header {
    position: sticky;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 11px 12px;
  }

  .brand {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .brand-title {
    font-size: 16px;
  }

  .brand-subtitle {
    font-size: 12px;
  }

  .header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .nav-button {
    min-width: 96px;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    justify-items: start;
  }

  .nav-icon {
    display: none;
  }

  .nav-index {
    font-size: 11px;
  }

  .nav-title {
    max-width: 88px;
    font-size: 13px;
  }

  .topbar {
    padding: 14px 14px 0;
  }

  .topbar-inner {
    gap: 14px;
    padding-bottom: 14px;
  }

  .top-title {
    font-size: 28px;
  }

  .page {
    overflow: visible;
    padding: 16px 14px 24px;
  }

  .field-grid,
  .field-grid.three,
  .field-grid.four {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 15px;
  }

  .button-row .btn,
  .button-row .select {
    width: 100%;
  }

  .segmented {
    width: 100%;
  }

  .segment {
    flex: 1 1 0;
    padding-left: 10px;
    padding-right: 10px;
  }

  .task-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .task-row .button-row,
  .task-row .switch {
    grid-column: 2;
  }

  .development-panel {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }
}

@media print {
  body {
    overflow: visible;
    background: #fff;
    color: #111;
  }

  .layout {
    display: block;
  }

  .site-header,
  .topbar,
  .button-row,
  .segmented,
  .no-print {
    display: none !important;
  }

  .page {
    overflow: visible;
    padding: 0;
  }

  .panel,
  .metric,
  .table-wrap {
    border-color: #ccc;
    box-shadow: none;
  }
}
