.login-shell {
  --star-x: 0;
  --star-y: 0;
  --card-rx: 0deg;
  --card-ry: 0deg;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  perspective: 1400px;
  background: #01030c;
}

.form-note {
  margin: -6px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.skeleton {
  background: var(--surface);
  animation: none;
}

select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.bar-track {
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
  background: #252b32;
}

.bar-track::-webkit-progress-bar {
  background: #252b32;
}

.bar-track::-webkit-progress-value {
  border-radius: 5px;
  background: var(--lime);
}

.bar-track.cost::-webkit-progress-value {
  background: #68717b;
}

.publication-header {
  align-items: center;
  gap: 28px;
}

.publication-header > div {
  max-width: 720px;
}

.publication-header h2,
.stage-last-resort h2,
.validation-card h3 {
  margin: 0;
}

.publication-header .muted {
  margin: 8px 0 0;
  line-height: 1.55;
}

/* Lead pipeline: customer is the scanning anchor; OP ID remains reference text. */
.lead-identity {
  min-width: 230px;
}

.lead-customer,
.lead-opportunity,
.lead-address {
  display: block;
}

.lead-customer {
  color: var(--text);
  font-size: 15px;
  font-weight: 780;
  line-height: 1.3;
}

.lead-opportunity {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.lead-address {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

/* Financial jobs: customer is the scanning anchor; Job ID stays visible as reference. */
.job-identity {
  min-width: 230px;
}

.job-customer,
.job-reference {
  display: block;
}

.job-customer {
  color: var(--text);
  font-size: 15px;
  font-weight: 780;
  line-height: 1.3;
}

.job-reference {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.check-now-button {
  min-width: 132px;
  min-height: 106px;
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border: 1px solid #6ebd2b;
  border-radius: 10px;
  background: #55a630;
  color: #071006;
  font-weight: 800;
  box-shadow: 0 10px 26px #0005;
}

.check-now-button:hover {
  border-color: var(--lime);
  background: #70c83b;
}

.check-now-button:disabled {
  cursor: wait;
  opacity: .76;
}

.check-now-button svg {
  width: 42px;
  height: 42px;
  padding: 7px;
  border-radius: 50%;
  background: #10220b;
  stroke: #b9f574;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.check-now-button span {
  display: block;
  line-height: 1.1;
}

.publication-table-wrap {
  overflow-x: auto;
}

/* Wide information stays inside the page and remains reachable at every width. */
.workspace,
.content,
.panel,
.table-scroll,
.publication-table-wrap {
  min-width: 0;
  max-width: 100%;
}

.table-scroll,
.publication-table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.table-scroll:focus-visible,
.publication-table-wrap:focus-visible {
  outline:2px solid var(--cyan);
  outline-offset:-2px;
}

.table-scroll table,
.publication-table-wrap table {
  width: max-content;
  min-width: 100%;
}

.table-scroll th,
.table-scroll td,
.publication-table-wrap th,
.publication-table-wrap td {
  white-space: nowrap;
}

.table-scroll .job-identity,
.table-scroll .lead-identity {
  white-space: normal;
}

.job-report-button,
.actions button {
  white-space: nowrap;
}

.panel-header {
  min-width: 0;
  flex-wrap: wrap;
  gap: 14px 20px;
}

.panel-header > div,
.actions {
  min-width: 0;
}

.actions {
  flex-wrap: wrap;
}

.panel-header h2,
.panel-header p,
.portal-section,
.banner,
.status-strip {
  overflow-wrap: anywhere;
}

@media (max-width:620px) {
  .panel-header,
  .panel-header .actions {
    align-items: stretch;
    flex-direction: column;
  }
  .panel-header .actions button,
  .panel-header > .primary,
  .panel-header > .quiet {
    width: 100%;
  }
  th,
  td {
    padding-inline: 12px;
  }
}

/* Lightweight red-neon sign-in experience */
.login-shell {
  min-height:100svh;
  isolation:isolate;
  display:grid;
  place-items:center;
  overflow:auto;
  padding:32px 20px;
  background:#020204;
}
.neon-stage {
  position:fixed;
  inset:0;
  z-index:-2;
  background:#020204 url('/kastern-login-neon.webp') center/cover no-repeat;
  pointer-events:none;
}
.neon-stage::after {
  content:'';
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.12);
}
.login-shell .login-card {
  width:min(470px,calc(100vw - 32px));
  margin:0;
  padding:32px 34px 30px;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  backdrop-filter:none;
  text-shadow:0 2px 12px #000;
}
.login-shell .login-card::before,.login-shell .login-card::after { display:none; }
.login-shell .login-watermark { opacity:.13; width:58%; left:21%; top:14%; filter:drop-shadow(0 0 18px rgba(255,29,29,.28)); }
.login-shell .brand-mark {
  border-color:rgba(255,97,52,.78);
  background:rgba(4,3,12,.72);
  color:#fff;
  box-shadow:0 0 20px rgba(255,38,18,.35);
}
.login-shell .eyebrow { color:#ffad8d; }
.login-shell h1 { color:#fff; text-shadow:0 0 18px rgba(255,50,30,.48),0 2px 10px #000; }
.login-shell .muted,.login-shell .form-note,.login-shell .security-note { color:#d7d3df; }
.login-shell label { color:#fff; }
.login-shell input {
  border:1px solid rgba(255,75,54,.68);
  background:rgba(4,4,14,.8);
  color:#fff;
  box-shadow:inset 0 0 18px rgba(66,22,110,.22),0 0 12px rgba(255,34,28,.1);
}
.login-shell input:focus { border-color:#ffb13b; box-shadow:0 0 0 3px rgba(255,54,27,.22),0 0 20px rgba(255,40,20,.24); }
.login-shell .primary {
  border-color:#ff6a38;
  background:rgba(190,30,21,.9);
  color:#fff;
  box-shadow:0 0 20px rgba(255,36,20,.32);
}
.login-shell .primary:hover,.login-shell .primary:focus-visible { background:#e33b20; }
.login-shell .error { color:#ffb5ac; background:rgba(54,0,0,.54); border-radius:8px; }
@media (max-width:620px) {
  .neon-stage { background-image:url('/kastern-login-neon-mobile.webp'); background-position:center; }
  .login-shell { align-items:start; padding-top:22svh; }
  .login-shell .login-card { padding:20px 12px 26px; }
}
@media (prefers-reduced-motion:reduce) {
  .login-shell * { scroll-behavior:auto!important; animation:none!important; transition:none!important; }
}

/* Business workflow tools */
.tool-page { display:grid; gap:22px; }
.tool-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:start; }
.workflow-form { padding:22px; display:grid; gap:15px; }
.workflow-form .panel-header { margin:-2px 0 2px; padding:0 0 14px; }
.workflow-form label { display:grid; gap:7px; color:#c8d1e4; font-weight:700; }
.workflow-form input,.workflow-form select,.workflow-form textarea,.review-controls input,.review-controls select,.document-line input {
  width:100%; min-width:0; border:1px solid rgba(105,154,205,.38); border-radius:9px; background:#0a1121; color:#f6f8ff; padding:11px 12px;
}
.workflow-form input:focus,.workflow-form select:focus,.workflow-form textarea:focus,.review-controls input:focus,.review-controls select:focus,.document-line input:focus { outline:2px solid #37d5e7; outline-offset:1px; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; }
.check-row { grid-template-columns:auto 1fr!important; align-items:center; }
.check-row input { width:auto; }
.file-drop { border:1px dashed rgba(77,220,222,.45); border-radius:10px; padding:14px; background:rgba(5,14,30,.55); }
.file-drop small,.form-status { color:#a9b5cb; font-weight:500; }
.form-status:empty { display:none; }
.selection-confirmation { display:grid; gap:4px; border-left:3px solid #42e2c6; padding:10px 13px; background:rgba(25,67,73,.28); }
.selection-confirmation span { color:#aebbd0; }
.form-actions,.attachment-row,.review-controls { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.receipt-list,.document-history { display:grid; gap:12px; padding:18px; }
.receipt-card,.document-history article { border:1px solid rgba(99,145,192,.25); border-radius:11px; padding:15px; background:rgba(8,15,31,.66); }
.receipt-card header,.document-history article { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; }
.receipt-card header>div,.document-history article>div { display:grid; gap:4px; }
.receipt-card header span,.document-history article span,.receipt-card small,.document-history article small { color:#aab6ca; }
.status-pill { color:#6df2cf; font-size:12px; text-transform:uppercase; letter-spacing:.06em; }
.review-controls { border-top:1px solid rgba(99,145,192,.2); margin-top:13px; padding-top:13px; }
.review-controls select { flex:0 1 190px; }.review-controls input { flex:1 1 220px; }
.review-note { color:#d8c9ff; }
.line-editor { display:grid; gap:10px; border:1px solid rgba(99,145,192,.25); border-radius:10px; padding:13px; }
.line-editor header { display:flex; align-items:center; justify-content:space-between; }
.document-line { display:grid; grid-template-columns:minmax(160px,1fr) 100px 120px auto; gap:8px; align-items:center; }
.workflow-steps { margin:0; padding-left:24px; display:grid; gap:14px; color:#d1d8e8; line-height:1.5; }
.offer-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-top:18px; }
.offer-card { display:grid; gap:11px; border:1px solid rgba(86,202,216,.3); border-radius:13px; padding:16px; background:#091225; }
.offer-card header { display:flex; justify-content:space-between; gap:10px; }.offer-card h3 { margin:0; color:#72edda; }.offer-card h3 small { font-size:12px; color:#aab6ca; }
.offer-card dl { display:grid; gap:7px; margin:0; }.offer-card dl div { display:flex; justify-content:space-between; gap:12px; border-bottom:1px solid rgba(99,145,192,.15); padding-bottom:6px; }.offer-card dt { color:#9aa8bf; }.offer-card dd { margin:0; text-align:right; }.offer-card>a { color:#6ad8ff; }
.workflow-toast { position:fixed; right:24px; top:92px; z-index:120; max-width:320px; padding:13px 17px; border:1px solid #41e1c4; border-radius:10px; background:#071a22; color:#eafffb; box-shadow:0 16px 40px rgba(0,0,0,.4); opacity:0; transform:translateY(-12px); pointer-events:none; transition:.18s ease; }
.workflow-toast.visible { opacity:1; transform:translateY(0); }
@media(max-width:1180px){.offer-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:820px){.tool-grid,.form-grid{grid-template-columns:1fr}.document-line{grid-template-columns:1fr 1fr}.document-line .line-description{grid-column:1/-1}.offer-grid{grid-template-columns:1fr}.receipt-card header,.document-history article{align-items:flex-start;flex-direction:column}}
@media print {
  .sidebar,.topbar,.chat-toggle,.chat-panel,.announcement-panel { display:none!important; }
  .workspace { margin:0!important; }.content { padding:0!important; }
}

@media (max-width:1500px) and (min-width:821px) {
  .content {
    padding-right:24px;
    padding-left:24px;
  }
}

.validation-results {
  scroll-margin-top: 110px;
}

.weekly-staffing {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 0 0 22px;
  padding: 14px 18px;
  border: 1px solid rgba(107,224,255,.22);
  border-radius: 14px;
  background: rgba(12,25,47,.72);
}
.weekly-staffing strong { color: #8dffd2; }
.weekly-staffing span { color: #e8f3ff; font-weight: 700; }
.weekly-staffing small { color: #9eabc0; flex: 1 1 340px; }

.validation-list {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.validation-card {
  padding: 18px;
  border: 1px solid #604b1b;
  border-left: 4px solid var(--warning);
  border-radius: 9px;
  background: #18170f;
}

.validation-card.critical {
  border-color: #632b2b;
  border-left-color: var(--critical);
  background: #1d1313;
}

.validation-card-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.validation-card h3 {
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.validation-card-heading p,
.validation-location {
  margin: 7px 0 0;
  color: #c9d1d9;
  font-size: 13px;
  line-height: 1.55;
}

.validation-location {
  margin-top: 15px;
  padding: 10px 12px;
  border: 1px solid #3b4149;
  border-radius: 7px;
  background: #11161c;
}

.validation-help,
.technical-details {
  margin-top: 12px;
  border-top: 1px solid #353b43;
  padding-top: 12px;
}

.validation-help summary,
.technical-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--lime);
  font-size: 13px;
  font-weight: 750;
}

.validation-help summary:hover,
.technical-details summary:hover {
  text-decoration: underline;
}

.validation-help ol {
  margin: 13px 0 2px 22px;
  padding: 0;
  color: #c9d1d9;
  font-size: 13px;
  line-height: 1.6;
}

.validation-help li + li {
  margin-top: 5px;
}

.technical-details summary {
  color: var(--muted);
  font-weight: 650;
}

.technical-details dl {
  display: grid;
  gap: 8px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.technical-details dl div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
}

.technical-details dt {
  color: #aab3bd;
  font-weight: 700;
}

.technical-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.technical-details code {
  color: #c9d1d9;
}

.stage-last-resort {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 42px;
  padding: 20px 22px;
  border: 1px solid #8a4c08;
  border-radius: 9px;
  background: #241608;
}

.stage-last-resort > div {
  max-width: 820px;
}

.stage-last-resort .section-label {
  color: #ffb454;
}

.stage-last-resort h2 {
  font-size: 17px;
}

.stage-last-resort p:last-child {
  margin: 8px 0 0;
  color: #d8c6b1;
  font-size: 13px;
  line-height: 1.55;
}

.stage-button {
  min-width: 188px;
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 18px;
  border: 1px solid #f0a13b;
  border-radius: 9px;
  background: #d97706;
  color: #1a0e02;
  font-weight: 800;
}

.stage-button:hover {
  background: #f59e0b;
}

.stage-warning-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

@media (max-width: 1100px) {
  .publication-header,
  .stage-last-resort {
    align-items: stretch;
    flex-direction: column;
  }

  .check-now-button,
  .stage-button {
    width: 100%;
  }

  .validation-card-heading {
    grid-template-columns: 1fr;
  }

  .technical-details dl div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

.icon-button {
  font-size: 12px;
  font-weight: 700;
}

.menu-close {
  display: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 820px) {
  .menu-close {
    display: block;
    align-self: flex-end;
    margin: -6px 4px 8px;
  }
}

.critical-banner {
  border-color: #632b2b;
  background: #251212;
  color: #ff7b72;
}

.owner-status .sync-workbooks {
  margin-left: auto;
  padding: 6px 11px;
  border-color: rgba(78, 224, 255, .34);
  color: #b7efff;
}

.workbook-sync-status {
  display: grid;
  grid-template-columns: minmax(230px, .75fr) minmax(300px, 1.25fr);
  gap: 18px;
  margin-top: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(78, 224, 255, .18);
  border-radius: 10px;
  background: rgba(7, 19, 35, .58);
}

.workbook-sync-status > div { display: grid; gap: 5px; }
.workbook-sync-status span { color: var(--muted); font-size: 12px; }
.workbook-sync-status b,
.workbook-sync-status strong { color: #d9edf8; }
.workbook-sync-status.sync-error { border-color: rgba(248, 81, 73, .5); }

@media (max-width: 700px) {
  .owner-status .sync-workbooks { width: 100%; margin-left: 0; }
  .workbook-sync-status { grid-template-columns: 1fr; }
}

.announcement-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.announcement-toggle { position:relative; margin-left:auto; min-width:48px; min-height:44px; border:1px solid rgba(102,222,255,.28); border-radius:12px; background:rgba(13,29,48,.76); color:#dff8ff; }
.announcement-toggle:hover { border-color:var(--cyan); background:rgba(31,76,102,.62); }
.announcement-bell { font-size:20px; line-height:1; }
.announcement-toggle b { position:absolute; top:-7px; right:-7px; display:grid; place-items:center; min-width:23px; height:23px; padding:0 6px; border-radius:999px; background:#ff4f9b; color:#fff; font-size:11px; box-shadow:0 0 16px rgba(255,79,155,.5); }
.announcement-toggle b.all-read { background:#405064; box-shadow:none; }
.topbar .health { margin-left:0; }
.announcement-panel { position:fixed; z-index:120; top:91px; right:0; bottom:0; width:min(420px,100vw); border-left:1px solid rgba(102,222,255,.25); background:linear-gradient(165deg,rgba(8,18,35,.98),rgba(18,12,37,.98)); box-shadow:-22px 0 60px rgba(0,0,0,.48); overflow:auto; }
.announcement-panel>header { position:sticky; z-index:2; top:0; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:20px 22px; border-bottom:1px solid rgba(137,184,231,.18); background:rgba(7,14,29,.94); backdrop-filter:blur(14px); }
.announcement-panel h2 { margin:3px 0 0; font-size:22px; }
.announcement-panel .icon-button { font-size:13px; border:1px solid var(--border); border-radius:8px; padding:8px 10px; }
.announcement-panel-content { padding:16px; }
.announcement-list { display:grid; gap:9px; }
.announcement-summary { display:flex; align-items:center; gap:9px; padding:7px; border:1px solid rgba(137,184,231,.18); border-radius:11px; background:rgba(4,10,27,.52); }
.announcement-summary.is-unread { border-color:rgba(84,232,255,.38); box-shadow:inset 3px 0 #50def2; }
.announcement-title { min-width:0; flex:1; display:grid; gap:5px; padding:9px; border:0; background:transparent; color:#f0f7ff; text-align:left; }
.announcement-title span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:700; }
.announcement-title small { color:var(--muted); }
.announcement-summary.is-read .announcement-title span { color:#aeb9c9; font-weight:600; }
.announcement-archive { flex:0 0 auto; padding:7px 9px; font-size:11px; }
.announcement-empty { margin:0; padding:20px 8px; color:var(--muted); }
.announcement-compose { margin-top:16px; border-top:1px solid rgba(137,184,231,.17); padding-top:15px; }
.announcement-compose summary { cursor:pointer; color:#bdefff; font-weight:700; }
.announcement-form { display:grid; gap:11px; margin-top:13px; }
.announcement-form label { margin:0; }
.announcement-form textarea { resize:vertical; }
.announcement-actions { justify-content:flex-start; }
.announcement-actions [role="status"] { color:var(--muted); font-size:12px; }
.announcement-dialog { width:min(620px,calc(100vw - 32px)); padding:30px; border:1px solid rgba(102,222,255,.35); border-radius:17px; background:linear-gradient(145deg,#101b30,#130e26); color:var(--text); box-shadow:0 28px 100px #000d; }
.announcement-dialog::backdrop { background:rgba(1,4,12,.76); backdrop-filter:blur(5px); }
.announcement-dialog h2 { margin:7px 38px 14px 0; font-size:26px; }
.announcement-dialog-body { margin:0 0 18px; color:#dce9f7; line-height:1.65; white-space:pre-wrap; }
.announcement-dialog small { color:var(--muted); }
.announcement-dialog-close { position:absolute; top:17px; right:17px; width:34px; height:34px; border:1px solid var(--border); border-radius:9px; background:transparent; color:var(--text); font-size:24px; line-height:1; }
.announcement-dialog-actions { margin-top:24px; }
.announcement-dialog-actions .primary:disabled { border-color:#405064; background:#405064; color:#aeb9c9; cursor:default; }
@media(max-width:700px){.announcement-panel{top:91px}.announcement-dialog{padding:23px}.health{display:none}}

.owner-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.owner-kpi {
  min-height: 148px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}

.owner-kpi.primary-kpi {
  grid-column: span 2;
  border-left: 4px solid var(--lime);
}

.owner-kpi.secondary-kpi {
  min-height: 124px;
  background: #131820;
}

.owner-kpi strong {
  display: block;
  margin: 14px 0 9px;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.owner-kpi.secondary-kpi strong {
  font-size: clamp(24px, 2vw, 32px);
}

.owner-kpi small,
.explain-cta p {
  color: var(--muted);
}

.explain-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 18px;
  padding: 24px;
  border: 1px solid #43511f;
  border-radius: 9px;
  background: #17200e;
}

.explain-cta h2,
.explain-cta p {
  margin: 4px 0 0;
}

.explain-cta p {
  max-width: 760px;
  line-height: 1.55;
}

.source-snapshot .panel-header p {
  margin: 5px 0 0;
}

.report-picker {
  display: grid;
  grid-template-columns: minmax(260px, 520px) auto;
  align-items: end;
  gap: 14px;
  padding: 20px 22px 24px;
}

.report-picker label {
  margin: 0;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
}

.report-group {
  padding: 20px 22px;
  background: var(--surface);
}

.report-group h3 {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.report-group div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.report-group div:last-child {
  border-bottom: 0;
}

.report-group span {
  color: var(--muted);
}

.report-group strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.report-notes {
  padding: 22px;
}

.report-notes p {
  margin: 6px 0 18px;
  color: var(--muted);
}

.report-notes small {
  color: var(--muted);
}

@media (max-width: 1180px) {
  .content {
    padding-right: 24px;
    padding-left: 24px;
  }

  .owner-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-picker {
    grid-template-columns: 1fr;
  }

  .report-picker .primary {
    width: 100%;
  }

  .source-snapshot .panel-header {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .source-snapshot .panel-header .primary {
    width: 100%;
  }
}

@media (max-width: 820px) {
  .owner-kpi-grid {
    grid-template-columns: 1fr;
  }

  .owner-kpi.primary-kpi {
    grid-column: auto;
  }

  .explain-cta {
    align-items: stretch;
    flex-direction: column;
  }

  .report-picker,
  .report-grid {
    grid-template-columns: 1fr;
  }
}

/* Dimensional space interface */
:root {
  --bg: #050712;
  --nav: #050813;
  --surface: rgba(14, 21, 39, .82);
  --raised: rgba(22, 31, 54, .88);
  --border: rgba(137, 184, 231, .19);
  --text: #f2f7ff;
  --muted: #9baac0;
  --lime: #62f7bd;
  --lime-hover: #8dffd2;
  --positive: #48e6a3;
  --warning: #f8b84d;
  --critical: #ff5c83;
  --cyan: #42dcff;
  --aqua: #44f2d4;
  --violet: #9c76ff;
  --magenta: #ff5daf;
  --gold: #ffc968;
  --orange: #ff8d4d;
  --depth-1: 0 10px 30px rgba(0,0,0,.25);
  --depth-2: 0 18px 44px rgba(0,0,0,.36), inset 0 1px rgba(255,255,255,.06);
  --depth-3: 0 24px 60px rgba(0,0,0,.48), 0 0 28px rgba(66,220,255,.07), inset 0 1px rgba(255,255,255,.09);
  --depth-4: 0 32px 80px rgba(0,0,0,.58), 0 0 44px rgba(156,118,255,.12), inset 0 1px rgba(255,255,255,.11);
}

body {
  background:
    radial-gradient(circle at 82% 4%, rgba(26,105,146,.18), transparent 28%),
    radial-gradient(circle at 18% 92%, rgba(110,36,139,.14), transparent 34%),
    linear-gradient(145deg,#050712,#080b18 46%,#04060e);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 9px 13px;
  border-radius: 8px;
  background: #f5fbff;
  color: #06101d;
  font-weight: 800;
}
.skip-link:focus { transform: translateY(0); }

.space-scene,.cosmic-backdrop,.nebula,.stars,.orbit-scene {
  position: absolute;
  inset: -7%;
  pointer-events: none;
}
.space-scene { z-index: -2; overflow: hidden; transform-style: preserve-3d; }
.cosmic-backdrop {
  inset: -3%;
  background: #020510 url('/kastern-orbital-space.png') center/cover no-repeat;
  filter: saturate(1.08) contrast(1.04);
  transform: scale(1.05) translate3d(calc(var(--star-x) * -5px),calc(var(--star-y) * -4px),0);
  animation: cosmic-breathe 18s ease-in-out infinite alternate;
}
.cosmic-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 52%,transparent 0 24%,rgba(1,4,14,.05) 48%,rgba(0,2,9,.52) 100%);
}
.nebula {
  inset: -14%;
  opacity: .58;
  background:
    radial-gradient(ellipse at 88% 17%,rgba(0,197,255,.22),transparent 25%),
    radial-gradient(ellipse at 11% 72%,rgba(205,43,255,.18),transparent 28%),
    radial-gradient(ellipse at 48% 8%,rgba(255,145,41,.09),transparent 24%);
  filter: blur(24px);
  transform: translate3d(calc(var(--star-x) * -10px),calc(var(--star-y) * -8px),0) scale(1.04);
  animation: nebula-drift 22s ease-in-out infinite alternate;
}
.stars {
  inset: -12%;
  background-repeat: repeat;
  will-change: transform;
}
.stars-far {
  opacity: .48;
  background-image:
    radial-gradient(circle,#d8efff 0 1px,transparent 1.4px),
    radial-gradient(circle,#9bc8ff 0 .8px,transparent 1.2px);
  background-size: 97px 113px,151px 137px;
  background-position: 13px 27px,51px 73px;
  transform: translate3d(calc(var(--star-x) * -9px),calc(var(--star-y) * -7px),-40px);
  animation: stars-far-drift 48s linear infinite;
}
.stars-mid {
  opacity: .72;
  background-image:
    radial-gradient(circle,#fff 0 1.25px,rgba(109,214,255,.7) 1.5px,transparent 3px),
    radial-gradient(circle,#ffc982 0 1px,transparent 2.4px),
    radial-gradient(circle,#e5b6ff 0 1px,transparent 2.6px);
  background-size: 163px 149px,227px 191px,283px 239px;
  background-position: 31px 17px,91px 61px,149px 107px;
  transform: translate3d(calc(var(--star-x) * -24px),calc(var(--star-y) * -19px),35px);
  animation: stars-mid-drift 31s linear infinite;
}
.stars-near {
  inset: -18%;
  opacity: .8;
  background-image:
    radial-gradient(circle,#fff 0 1.6px,#78efff 2px,rgba(63,210,255,.25) 4px,transparent 8px),
    radial-gradient(circle,#ffd391 0 1.7px,rgba(255,150,60,.3) 4px,transparent 9px),
    radial-gradient(circle,#ffb6ed 0 1.4px,rgba(255,76,181,.28) 4px,transparent 8px);
  background-size: 337px 281px,421px 353px,503px 419px;
  background-position: 47px 89px,171px 33px,269px 177px;
  transform: translate3d(calc(var(--star-x) * -48px),calc(var(--star-y) * -38px),85px);
  animation: stars-near-drift 21s linear infinite;
}
.orbit-scene {
  inset: 50% auto auto 50%;
  width: min(74vw,820px);
  aspect-ratio: 1;
  transform: translate3d(calc(-50% + var(--star-x) * -15px),calc(-50% + var(--star-y) * -12px),20px);
  transform-style: preserve-3d;
  animation: orbit-float 11s ease-in-out infinite alternate;
}
.orbit-glow {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle,rgba(0,8,28,.16) 0 43%,rgba(42,213,255,.07) 55%,transparent 67%);
  box-shadow: inset 0 0 80px rgba(73,223,255,.11),0 0 90px rgba(165,99,255,.08);
}
.orbit-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(10,18,48,.38);
  font-size: clamp(180px,33vw,470px);
  font-weight: 950;
  letter-spacing: -.13em;
  text-indent: -.13em;
  text-shadow: -2px 0 rgba(66,220,255,.09),2px 0 rgba(255,93,175,.08),0 20px 80px rgba(0,0,0,.8);
  user-select: none;
}

.login-card {
  position: relative;
  z-index: 2;
  width: min(500px,calc(100vw - 36px));
  padding: 34px 38px 30px;
  border: 1px solid rgba(150,221,255,.34);
  border-radius: 24px;
  background:
    linear-gradient(145deg,rgba(24,41,69,.78),rgba(8,12,29,.86) 48%,rgba(35,16,53,.72)),
    rgba(6,10,24,.72);
  box-shadow:
    0 42px 100px rgba(0,0,0,.7),
    0 14px 28px rgba(0,0,0,.52),
    -18px -8px 60px rgba(66,220,255,.12),
    18px 9px 64px rgba(255,93,175,.1),
    inset 0 1px rgba(255,255,255,.17),
    inset 0 -18px 34px rgba(0,0,0,.28);
  backdrop-filter: blur(19px) saturate(1.28);
  transform: translateZ(80px) rotateX(var(--card-rx)) rotateY(var(--card-ry));
  transform-style: preserve-3d;
  transition: transform .18s ease-out,border-color .18s ease,box-shadow .18s ease;
}
.login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(125deg,rgba(255,206,103,.7),rgba(66,220,255,.6) 28%,transparent 54%,rgba(255,93,175,.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .66;
}
.login-card > * { position: relative; transform: translateZ(18px); }
.login-card .brand-mark {
  width: 58px;
  height: 58px;
  border-color: rgba(255,203,90,.62);
  border-radius: 16px;
  background: linear-gradient(145deg,rgba(21,75,71,.88),rgba(11,34,43,.94));
  color: #8dffd2;
  font-size: 20px;
  text-shadow: 0 0 15px rgba(98,247,189,.85);
  box-shadow: 0 12px 28px rgba(0,0,0,.42),0 0 26px rgba(255,184,64,.16),inset 0 1px rgba(255,255,255,.18);
}
.login-card .eyebrow {
  margin-top: 20px;
  color: #b7eaff;
  font-size: 10px;
  letter-spacing: .24em;
  text-shadow: 0 0 12px rgba(66,220,255,.5);
}
.login-card h1 {
  position: relative;
  color: #f7fbff;
  font-size: clamp(29px,3.5vw,38px);
  font-weight: 850;
  line-height: 1.02;
  letter-spacing: -.035em;
  text-shadow: -1.5px 0 rgba(64,228,255,.75),1.5px 0 rgba(255,115,78,.7),0 12px 32px rgba(0,0,0,.58);
  white-space: nowrap;
}
.login-card .muted { margin: 11px 0 22px; color: #aabbd0; font-size: 13px; }
.login-card label { color: #d9eaff; font-size: 12px; letter-spacing: .02em; }
.login-card input {
  min-height: 47px;
  border: 1px solid rgba(100,220,255,.34);
  border-radius: 12px;
  background: linear-gradient(105deg,rgba(20,91,120,.42),rgba(93,55,143,.3) 55%,rgba(185,51,144,.18));
  color: #fff;
  box-shadow: inset 0 1px 10px rgba(0,0,0,.38),inset 0 1px rgba(255,255,255,.1),0 8px 18px rgba(0,0,0,.18);
  caret-color: var(--aqua);
}
.login-card input:focus {
  border-color: #66e8ff;
  box-shadow: 0 0 0 3px rgba(66,220,255,.16),0 0 26px rgba(66,220,255,.17),inset 0 1px 12px rgba(0,0,0,.4);
}
.login-card .primary {
  min-height: 47px;
  border-color: rgba(126,255,229,.85);
  border-radius: 12px;
  background: linear-gradient(180deg,#75f7dc 0,#31d8e9 48%,#2087da 100%);
  color: #03131c;
  text-shadow: 0 1px rgba(255,255,255,.45);
  box-shadow: inset 0 1px rgba(255,255,255,.72),inset 0 -2px rgba(4,53,105,.48),0 9px 0 rgba(7,65,111,.34),0 18px 30px rgba(0,155,220,.24);
  transition: transform .16s ease,filter .16s ease,box-shadow .16s ease;
}
.login-card .primary:hover { transform: translateY(-3px); filter: brightness(1.08); box-shadow: inset 0 1px rgba(255,255,255,.75),inset 0 -2px rgba(4,53,105,.45),0 11px 0 rgba(7,65,111,.3),0 22px 38px rgba(0,177,231,.28); }
.login-card .primary:active { transform: translateY(4px); box-shadow: inset 0 1px rgba(255,255,255,.55),inset 0 -2px rgba(4,53,105,.4),0 3px 0 rgba(7,65,111,.36),0 8px 18px rgba(0,155,220,.2); }
.login-card .security-note { margin-top: 25px; color: #76869c; letter-spacing: .03em; }

.portal { background: radial-gradient(circle at 78% 2%,rgba(26,115,157,.12),transparent 32%),linear-gradient(135deg,#080b17,#060914 55%,#0b0715); }
.sidebar {
  border-right-color: rgba(72,203,255,.2);
  background: linear-gradient(180deg,rgba(4,9,20,.97),rgba(7,8,19,.96)),radial-gradient(circle at 100% 20%,rgba(117,70,214,.16),transparent 40%);
  box-shadow: inset -1px 0 rgba(255,255,255,.025),12px 0 38px rgba(0,0,0,.3),10px 0 42px rgba(62,186,255,.04);
}
.sidebar .brand-mark { border-color: rgba(255,199,87,.42); background: linear-gradient(145deg,#102b31,#11182b); color: var(--aqua); box-shadow: 0 0 22px rgba(68,242,212,.14),inset 0 1px rgba(255,255,255,.08); }
.nav-button { border-radius: 11px; transition: transform .16s ease,border-color .16s ease,background .16s ease,color .16s ease; }
.nav-button:hover { transform: translateX(3px); background: linear-gradient(90deg,rgba(41,167,207,.1),rgba(128,65,187,.08)); }
.nav-button.active { border-color: rgba(78,215,255,.27); background: linear-gradient(90deg,rgba(42,207,214,.16),rgba(112,65,186,.15) 65%,rgba(255,86,166,.08)); color: #aafde5; box-shadow: inset 3px 0 var(--cyan),0 8px 22px rgba(0,0,0,.2),0 0 24px rgba(104,81,218,.08); }
.account-card { border-color: rgba(120,184,228,.19); border-radius: 14px; background: linear-gradient(145deg,rgba(23,37,58,.78),rgba(12,17,31,.9)); box-shadow: var(--depth-2); }
.account-card .quiet { width: 100%; }
.account-card #account-open { margin-bottom: 8px; border-color: rgba(78,224,255,.25); color: #b7efff; }
.account-card #account-open:hover,
.account-card #account-open.active { border-color: var(--cyan); background: rgba(40,150,190,.16); color: #e7fbff; }
.topbar { border-bottom-color: rgba(87,204,255,.17); background: rgba(6,10,21,.74); backdrop-filter: blur(18px) saturate(1.25); box-shadow: 0 12px 32px rgba(0,0,0,.24),0 1px rgba(118,226,255,.05); }
.topbar h1 { color: #f5f9ff; text-shadow: 0 7px 24px rgba(0,0,0,.45); }
.health { padding: 8px 11px; border: 1px solid rgba(72,230,163,.18); border-radius: 999px; background: rgba(24,85,67,.12); color: #a4beaF; }
.health span { background: var(--positive); box-shadow: 0 0 0 4px rgba(72,230,163,.1),0 0 15px rgba(72,230,163,.55); }
.content { width: 100%; max-width: 1500px; }
.status-strip,.banner,.panel,.metric,.comparison,.owner-kpi,.explain-cta,.validation-card,.stage-last-resort {
  border-color: rgba(129,185,227,.2);
  border-radius: 15px;
  background: linear-gradient(145deg,rgba(20,30,51,.82),rgba(10,15,30,.88));
  box-shadow: var(--depth-2);
  backdrop-filter: blur(12px);
}
.panel,.comparison,.owner-kpi,.explain-cta { transition: transform .2s ease,border-color .2s ease,box-shadow .2s ease; }
@media (hover:hover) and (pointer:fine) {
  .owner-kpi:hover,.comparison:hover,.explain-cta:hover { transform: translateY(-5px); border-color: rgba(107,224,255,.34); box-shadow: var(--depth-3); }
  .panel:hover { border-color: rgba(118,198,235,.29); box-shadow: var(--depth-3); }
}
.panel-header { border-bottom-color: rgba(140,191,230,.15); background: linear-gradient(90deg,rgba(40,105,141,.07),rgba(117,64,153,.06)); }
.owner-kpi { position: relative; overflow: hidden; border-left: 1px solid rgba(129,185,227,.2); box-shadow: var(--depth-3); }
.owner-kpi::before { content: ''; position: absolute; inset: 0 auto auto 0; width: 100%; height: 3px; background: linear-gradient(90deg,var(--cyan),transparent 78%); box-shadow: 0 0 18px var(--cyan); }
.owner-kpi:nth-child(1)::before { background: linear-gradient(90deg,var(--positive),var(--aqua),transparent 82%); box-shadow: 0 0 18px var(--positive); }
.owner-kpi:nth-child(1) strong { color: #8dffd2; }
.owner-kpi:nth-child(2)::before { background: linear-gradient(90deg,var(--orange),var(--gold),transparent 82%); box-shadow: 0 0 18px var(--orange); }
.owner-kpi:nth-child(2) strong { color: #ffc47b; }
.owner-kpi:nth-child(3)::before { background: linear-gradient(90deg,var(--magenta),var(--violet),transparent 82%); box-shadow: 0 0 18px var(--magenta); }
.owner-kpi:nth-child(3) strong { color: #f7a0d8; }
.owner-kpi:nth-child(4)::before { background: linear-gradient(90deg,var(--cyan),#458aff,transparent 82%); box-shadow: 0 0 18px var(--cyan); }
.owner-kpi:nth-child(4) strong { color: #8aeaff; }
.owner-kpi:nth-child(5)::before { background: linear-gradient(90deg,var(--gold),#ff9748,transparent 82%); box-shadow: 0 0 18px var(--gold); }
.owner-kpi:nth-child(5) strong { color: #ffda8a; }
.owner-kpi:nth-child(6)::before { background: linear-gradient(90deg,var(--positive),var(--cyan),transparent 82%); box-shadow: 0 0 18px var(--positive); }
.owner-kpi:nth-child(6) strong,.owner-kpi:nth-child(7) strong { color: #8dffd2; }
.owner-kpi:nth-child(7)::before { background: linear-gradient(90deg,#64ff9d,var(--cyan),transparent 82%); box-shadow: 0 0 18px #64ff9d; }
.explain-cta { border-color: rgba(68,242,212,.24); background: linear-gradient(115deg,rgba(15,64,68,.36),rgba(15,22,42,.86) 48%,rgba(79,32,107,.2)); }
.primary { border-color: rgba(95,244,216,.8); background: linear-gradient(180deg,#73f0d0,#26c9d3); color: #031517; box-shadow: inset 0 1px rgba(255,255,255,.55),0 8px 20px rgba(0,183,197,.16); }
.primary:hover { background: linear-gradient(180deg,#92ffe1,#35e0e1); border-color: #a9ffe7; }
.quiet { border-color: rgba(142,186,222,.24); background: rgba(16,24,41,.55); }
.quiet:hover { border-color: rgba(88,216,255,.4); background: rgba(31,62,84,.48); }
select,input,textarea { border-color: rgba(131,187,225,.25); border-radius: 10px; background: rgba(5,10,21,.75); }
input:focus,textarea:focus,select:focus,button:focus-visible,a:focus-visible { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(66,220,255,.2),0 0 22px rgba(66,220,255,.11); outline: none; }
table { background: rgba(5,9,19,.24); }
th { color: #a8b8cd; background: rgba(15,26,44,.86); border-bottom-color: rgba(133,185,223,.19); }
td { border-bottom-color: rgba(121,163,199,.12); }
tbody tr { transition: background .15s ease,box-shadow .15s ease; }
tbody tr:hover { background: rgba(51,177,214,.07); box-shadow: inset 3px 0 rgba(66,220,255,.25); }
.badge { border-color: rgba(70,234,180,.34); background: rgba(25,111,85,.18); color: #8dffd2; }
.badge.warning { border-color: rgba(248,184,77,.35); background: rgba(141,83,19,.17); color: #ffd587; }
.badge.critical { border-color: rgba(255,92,131,.4); background: rgba(133,25,60,.17); color: #ff9cb6; }
.chat-toggle { border-color: rgba(75,229,208,.5); background: linear-gradient(135deg,rgba(15,72,75,.96),rgba(42,27,75,.96)); color: #b4fff0; box-shadow: var(--depth-4),0 0 26px rgba(66,220,255,.13); }
.chat-panel { border-color: rgba(107,205,240,.3); border-radius: 18px; background: linear-gradient(145deg,rgba(17,31,50,.94),rgba(10,13,30,.97)); box-shadow: var(--depth-4); backdrop-filter: blur(18px); }
.chat-panel header { border-bottom-color: rgba(125,191,230,.18); background: linear-gradient(90deg,rgba(23,128,157,.2),rgba(97,40,135,.2)); }
.message { border-color: rgba(141,181,216,.2); border-radius: 13px 13px 13px 4px; background: rgba(34,43,67,.78); box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.message.mine { border-color: rgba(72,230,163,.27); border-radius: 13px 13px 4px 13px; background: linear-gradient(135deg,rgba(23,104,92,.55),rgba(30,65,94,.65)); }
.bar-track,.bar-track::-webkit-progress-bar { background: rgba(110,148,181,.15); }
.bar-track::-webkit-progress-value { background: linear-gradient(90deg,var(--aqua),var(--cyan)); box-shadow: 0 0 14px rgba(66,220,255,.35); }
.bar-track.cost::-webkit-progress-value { background: linear-gradient(90deg,var(--orange),var(--gold)); }

/* Grouped operations navigation */
.sidebar nav { overflow: visible; }
.nav-group { position: relative; }
.nav-group-toggle { justify-content: space-between; }
.nav-group-arrow {
  margin-left: auto;
  color: #7fa5bb;
  font-size: 21px;
  line-height: 1;
  transition: transform .15s ease,color .15s ease;
}
.nav-group.active > .nav-group-toggle {
  border-color: rgba(78,215,255,.27);
  background: linear-gradient(90deg,rgba(42,207,214,.16),rgba(112,65,186,.15) 65%,rgba(255,86,166,.08));
  color: #aafde5;
  box-shadow: inset 3px 0 var(--cyan),0 8px 22px rgba(0,0,0,.2),0 0 24px rgba(104,81,218,.08);
}
.nav-submenu {
  position: absolute;
  top: -7px;
  left: calc(100% - 2px);
  z-index: 40;
  display: none;
  min-width: 248px;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(108,198,235,.3);
  border-radius: 13px;
  background: linear-gradient(145deg,rgba(13,27,44,.98),rgba(22,17,48,.98));
  box-shadow: 0 18px 45px rgba(0,0,0,.48),0 0 25px rgba(66,220,255,.08);
}
.nav-group:hover:not(.suppress-hover) > .nav-submenu,
.nav-group.open > .nav-submenu { display: grid; }
.nav-group:hover:not(.suppress-hover) .nav-group-arrow,
.nav-group.open .nav-group-arrow {
  color: var(--cyan);
  transform: rotate(90deg);
}
.nav-sub-button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #b9c8d8;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.nav-sub-button:hover,
.nav-sub-button.active {
  border-color: rgba(74,218,255,.25);
  background: linear-gradient(90deg,rgba(42,207,214,.14),rgba(112,65,186,.13));
  color: #b9ffec;
}
.nav-submenu .nav-group-toggle { display: flex; align-items: center; }
.nav-submenu .nav-group { position: relative; }
.nav-submenu .nav-submenu { top: -8px; left: calc(100% - 2px); }

.portal-section {
  max-width: 1180px;
  margin: 0 auto;
}
.portal-section-heading {
  margin: 0 0 20px;
  padding: 0 2px 18px;
  border-bottom: 1px solid rgba(118,198,235,.2);
}
.portal-section-heading h2 {
  margin: 0 0 7px;
  color: #fff;
  font-size: clamp(24px,3vw,34px);
}
.portal-section-heading p {
  margin: 0;
  color: #b8c8db;
  font-size: 16px;
}

.resource-links {
  margin:18px 0;
  padding:16px;
  border:1px solid rgba(89,220,255,.22);
  border-radius:14px;
  background:rgba(5,13,29,.5);
}
.resource-links > .section-label { margin-bottom:10px; }
.resource-links > div { display:flex; flex-wrap:wrap; gap:10px; }
.resource-link {
  display:inline-flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  min-height:42px;
  padding:9px 12px;
  border:1px solid rgba(78,224,255,.28);
  border-radius:10px;
  background:linear-gradient(90deg,rgba(42,207,214,.12),rgba(112,65,186,.12));
  color:#dffaff;
  text-decoration:none;
  font:inherit;
  font-weight:700;
  text-align:left;
  cursor:pointer;
}
.resource-link span { color:var(--cyan); font-size:11px; text-transform:uppercase; letter-spacing:.08em; }
.resource-link:hover { border-color:var(--cyan); background:linear-gradient(90deg,rgba(42,207,214,.2),rgba(112,65,186,.18)); }
@media (max-width:620px) {
  .resource-links > div { display:grid; }
  .resource-link { width:100%; }
}
.permit-guide {
  position: relative;
  margin: 22px 0;
  padding: clamp(16px,2.5vw,24px);
  border: 1px solid rgba(89,220,255,.22);
  border-radius: 16px;
  background: linear-gradient(145deg,rgba(7,20,39,.78),rgba(15,12,34,.74));
  box-shadow: 0 18px 44px rgba(0,0,0,.2);
}
.permit-guide-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
}
.permit-guide-heading h3 { margin: 4px 0 0; color: #fff; font-size: clamp(22px,3vw,30px); }
.permit-guide-heading > p { max-width: 420px; margin: 0; color: var(--muted); line-height: 1.5; }
.permit-guide-list { display: grid; gap: 12px; }
.permit-guide-step {
  overflow: hidden;
  border: 1px solid rgba(124,168,220,.22);
  border-radius: 13px;
  background: rgba(5,11,25,.66);
}
.permit-guide-step[open] { border-color: rgba(78,224,255,.42); }
.permit-guide-step summary {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 15px 50px 15px 17px;
  cursor: pointer;
  list-style: none;
  color: #edf8ff;
}
.permit-guide-step summary::-webkit-details-marker { display: none; }
.permit-guide-step summary::after {
  content: '›';
  position: absolute;
  top: 50%;
  right: 19px;
  color: var(--cyan);
  font-size: 27px;
  line-height: 1;
  transform: translateY(-50%) rotate(90deg);
  transition: transform .18s ease;
}
.permit-guide-step[open] summary::after { transform: translateY(-50%) rotate(-90deg); }
.permit-guide-step summary span { font-weight: 900; }
.permit-guide-step summary small { color: var(--muted); font-size: 14px; line-height: 1.45; }
.permit-guide-image-link {
  display: block;
  padding: 0 clamp(10px,2vw,18px) clamp(10px,2vw,18px);
  background: rgba(255,255,255,.02);
}
.permit-guide-image-link img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 1180px;
  margin: 0 auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(0,0,0,.3);
}
.permit-guide-image-link:focus-visible { outline: 2px solid var(--cyan); outline-offset: -4px; }
@media (max-width:720px) {
  .permit-guide-heading { display: grid; gap: 8px; }
  .permit-guide-step summary { padding-left: 13px; }
}
.section-documents {
  max-width: 1180px;
  margin: 24px auto 42px;
  padding: clamp(18px,2.6vw,28px);
  border: 1px solid rgba(89,220,255,.22);
  border-radius: 16px;
  background: linear-gradient(145deg,rgba(7,19,38,.82),rgba(18,14,38,.78));
  box-shadow: 0 18px 44px rgba(0,0,0,.22);
}
.section-documents-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.section-documents-heading h2 { margin: 4px 0 0; color: #fff; }
.section-document-upload {
  display: grid;
  grid-template-columns: minmax(190px,1fr) minmax(220px,1.4fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  padding: 15px;
  border: 1px solid rgba(112,176,222,.2);
  border-radius: 12px;
  background: rgba(4,11,25,.58);
}
.section-document-upload label { display: grid; gap: 7px; color: #cbd8e8; font-weight: 700; }
.section-document-upload select,
.section-document-upload input[type="file"] {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(105,181,224,.3);
  border-radius: 9px;
  background: rgba(9,20,38,.92);
  color: #eef8ff;
}
.section-document-upload input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: rgba(54,205,220,.18);
  color: #cffff5;
  cursor: pointer;
}
.section-document-upload > small { grid-column: 1 / -1; color: var(--muted); }
#document-upload-status { min-height: 20px; color: #8dffd2; }
.section-document-list { display: grid; gap: 9px; }
.section-document {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(107,165,211,.18);
  border-radius: 11px;
  background: rgba(9,17,32,.66);
}
.section-document-info { min-width: 0; display: grid; gap: 4px; }
.section-document strong { overflow-wrap: anywhere; color: #edf8ff; }
.section-document small,.document-empty { color: var(--muted); }
.document-empty { margin: 6px 0 0; }
.section-document-actions { position: relative; display: flex; align-items: center; gap: 8px; }
.document-manage { position: relative; }
.document-manage > summary { list-style: none; padding: 8px 11px; border: 1px solid var(--border); border-radius: 7px; color: var(--text); cursor: pointer; }
.document-manage > summary::-webkit-details-marker { display: none; }
.document-manage[open] > summary { border-color: var(--cyan); color: #cffff5; }
.document-manage-form { position: absolute; z-index: 40; top: calc(100% + 8px); right: 0; width: min(360px,calc(100vw - 48px)); display: grid; gap: 12px; padding: 16px; border: 1px solid rgba(94,215,244,.35); border-radius: 12px; background: linear-gradient(145deg,#101a2d,#130e25); box-shadow: 0 20px 55px rgba(0,0,0,.58); }
.document-manage-form label { margin: 0; }
.document-manage-form select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid rgba(105,181,224,.3); border-radius: 9px; background: #091426; color: #eef8ff; }
.document-manage-form > div { display: flex; justify-content: space-between; gap: 10px; }
.document-manage-form .danger { border-color: rgba(248,81,73,.45); color: #ff9b95; }
.document-manage-form .danger:hover { background: rgba(248,81,73,.12); }
.document-manage-status { min-height: 18px; color: #ffb4ad; font-size: 12px; }
@media (max-width:900px) {
  .section-document-upload { grid-template-columns: 1fr 1fr; }
  .section-document-upload .primary { width: max-content; }
}
@media (max-width:620px) {
  .section-document-upload { grid-template-columns: 1fr; }
  .section-document-upload > small { grid-column: auto; }
  .section-document { align-items: flex-start; }
  .section-document-actions { align-items: flex-end; flex-direction: column; }
  .document-manage-form { position: fixed; top: 50%; right: 16px; left: 16px; width: auto; transform: translateY(-50%); }
}
.portal-accounts .table-scroll { margin-top: 18px; }
.create-account-form {
  margin: 18px 0 8px;
  padding: 18px;
  border: 1px solid rgba(89,220,255,.25);
  border-radius: 14px;
  background: rgba(5,13,29,.62);
}
.create-account-heading,
.create-account-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.create-account-heading h3 { margin: 4px 0 0; color: #fff; }
.create-account-fields {
  display: grid;
  grid-template-columns: repeat(2,minmax(220px,1fr));
  gap: 12px;
  margin-top: 16px;
}
.create-account-fields label { margin: 0; }
.create-account-actions [role="status"] { color: #ffb4ad; }
@media (max-width:700px) {
  .create-account-fields { grid-template-columns: 1fr; }
}

@keyframes cosmic-breathe { from { filter:saturate(1.02) brightness(.9); } to { filter:saturate(1.16) brightness(1.03); } }
@keyframes nebula-drift { from { translate:-1% -1%; } to { translate:2% 1%; } }
@keyframes stars-far-drift { to { background-position:110px 140px,194px 171px; } }
@keyframes stars-mid-drift { to { background-position:231px 207px,321px 271px,449px 347px; } }
@keyframes stars-near-drift { to { background-position:437px 389px,571px 463px,669px 547px; } }
@keyframes orbit-float { from { margin-top:-5px; } to { margin-top:7px; } }

@media (max-width: 820px) {
  .login-shell { padding: 18px; }
  .cosmic-backdrop { background-position: 48% center; }
  .orbit-scene { width: min(132vw,720px); }
  .login-card { padding: 29px 24px 25px; border-radius: 20px; transform: translateZ(38px); }
  .login-card h1 { font-size: 30px; }
  .login-card h1 { white-space: normal; }
  .content { padding-top: 24px; }
  .sidebar { box-shadow: 20px 0 70px rgba(0,0,0,.72),10px 0 35px rgba(66,220,255,.08); }
  .sidebar nav { overflow-y: auto; overflow-x: hidden; padding-right: 2px; }
  .nav-submenu {
    position: static;
    min-width: 0;
    margin: 3px 0 5px 14px;
    border-radius: 10px;
    box-shadow: none;
  }
  .nav-submenu .nav-submenu { margin-left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .cosmic-backdrop,.nebula,.stars,.orbit-scene { animation: none !important; transform: none !important; }
  .orbit-scene { transform: translate(-50%,-50%) !important; }
  .login-card { transform: none !important; }
}

@media print {
  .sidebar,
  .topbar,
  .chat-toggle,
  .chat-panel,
  .report-control,
  .source-snapshot,
  .banner,
  #print-report {
    display: none !important;
  }

  body,
  .portal,
  .workspace,
  .content,
  .panel,
  .report-group {
    background: #fff !important;
    color: #111 !important;
  }

  .portal {
    display: block;
  }

  .content {
    max-width: none;
    padding: 0;
  }

  .report-sheet {
    border-color: #bbb;
  }

  .report-group,
  .report-group div {
    border-color: #ddd;
  }

  .muted,
  .report-group span,
  .report-notes p,
  .report-notes small {
    color: #444 !important;
  }
}


/* Login scene: the starfield only follows the pointer; the real galaxy bands rotate. */
.login-shell {
  padding: clamp(14px,2.4vw,30px);
  contain: layout paint;
}
.cosmic-backdrop {
  inset: -3%;
  background-image: url('/kastern-starfield-static.webp');
  background-position: center;
  background-size: cover;
  filter: none;
  transform: scale(1.015);
  animation: none;
}
.nebula,.stars { display:none; }

.pointer-stars {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  z-index:1;
  pointer-events:none;
  opacity:.72;
}

.orbit-scene {
  inset: 50% auto auto 50%;
  width: min(116vmin,1120px);
  aspect-ratio: 1;
  transform: translate(-50%,-50%);
  animation: none;
  overflow: visible;
  z-index:2;
}
.orbit-scene::before,
.orbit-scene::after {
  display: none;
}
.orbit-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transform-origin: 50% 50%;
  will-change: transform;
}
.orbit-blue {
  inset:1% -2% -1% 2%;
  opacity:.34;
  filter:saturate(.64) brightness(.62) contrast(.88);
  animation:orbit-blue-spin 68s linear infinite;
}
.orbit-gold {
  inset:-2% 2% 2% -2%;
  opacity:.23;
  filter:saturate(.55) brightness(.54) contrast(.82) blur(.25px);
  animation:orbit-gold-spin 57s linear infinite reverse;
}

.login-card {
  width: min(620px,calc(100vw - 42px));
  min-width: 0;
  aspect-ratio: auto;
  min-height: 0;
  padding: clamp(34px,5vmin,54px) clamp(40px,7vmin,78px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transform: none;
  overflow: visible;
}
.login-card::before {
  display:none;
}
.login-card > *:not(.login-watermark) { position:relative; z-index:2; transform:none; }
.login-watermark {
  position:absolute;
  z-index:0;
  width:68%;
  left:16%;
  top:12%;
  opacity:.105;
  filter: drop-shadow(0 0 18px rgba(103,204,255,.13));
  pointer-events:none;
  user-select:none;
}
.login-card form { width:100%; }
.login-card .brand-mark { width:52px; height:52px; border-radius:50%; }
.login-card .eyebrow { margin-top:14px; }
.login-card .muted { margin-bottom:15px; }
.login-card label { margin:12px 0; }
.login-card input { min-height:43px; }
.login-card .primary { min-height:43px; }
.login-card .security-note { margin-top:18px; }

@keyframes orbit-blue-spin {
  from { transform:rotate(0deg) translate(1.4%,-.8%) scaleX(1.055) scaleY(.91) skewX(-1.4deg); }
  to { transform:rotate(360deg) translate(1.4%,-.8%) scaleX(1.055) scaleY(.91) skewX(-1.4deg); }
}
@keyframes orbit-gold-spin {
  from { transform:rotate(0deg) translate(-1.8%,1.2%) scaleX(.92) scaleY(1.065) skewY(1.8deg); }
  to { transform:rotate(360deg) translate(-1.8%,1.2%) scaleX(.92) scaleY(1.065) skewY(1.8deg); }
}

@media (max-width:700px), (max-height:720px) {
  .login-card {
    width:min(560px,calc(100vw - 28px));
    padding:32px 28px;
  }
  .orbit-scene { width:min(126vmin,760px); }
  .login-card h1 { font-size:clamp(25px,7vw,31px); }
}
@media (prefers-reduced-motion:reduce) {
  .orbit-layer { animation:none !important; }
  .pointer-stars { display:none; }
}

/* Final red-neon login alignment and sign-in control treatment. */
.login-shell .login-watermark {
  left:50%;
  top:50%;
  width:min(68%,420px);
  transform:translate(-50%,-50%);
}
.login-shell .login-card h1 {
  text-align:center;
}
#login-form .primary {
  color:#f4c210;
  background:#630303;
  border-color:#f4de4e;
  text-shadow:0 1px 2px rgba(0,0,0,.7);
  box-shadow:inset 0 1px rgba(255,255,255,.08),inset 0 -2px rgba(42,0,0,.7),0 7px 0 rgba(50,0,0,.48),0 15px 28px rgba(99,3,3,.28);
}
#login-form .primary:hover,
#login-form .primary:focus-visible {
  color:#ffe25c;
  background:#7b0808;
  border-color:#fff083;
  filter:none;
  box-shadow:inset 0 1px rgba(255,255,255,.1),inset 0 -2px rgba(42,0,0,.7),0 9px 0 rgba(50,0,0,.44),0 19px 32px rgba(99,3,3,.34);
}
#login-form .primary:active {
  color:#f4c210;
  background:#520202;
  border-color:#f4de4e;
  box-shadow:inset 0 1px rgba(255,255,255,.06),inset 0 -2px rgba(42,0,0,.72),0 3px 0 rgba(50,0,0,.5),0 8px 18px rgba(99,3,3,.26);
}

/* Flyout menus must paint above the workspace and its sticky header. */
.portal { isolation: isolate; overflow: visible; }
.sidebar { z-index: 100; overflow: visible; }
.sidebar nav { position: relative; z-index: 110; overflow: visible; }
.workspace { position: relative; z-index: 1; }
.nav-group:hover,
.nav-group:focus-within,
.nav-group.open { z-index: 200; }
.nav-submenu { z-index: 300; }

/* Owner workflow pages use the full workspace when no administrator panel is present. */
.tool-grid.single-column { grid-template-columns:minmax(0,1fr); }
.tool-grid.single-column > .workflow-form { width:100%; max-width:none; }
.view-back { flex:0 0 auto; }
.receipt-type-options { display:flex; flex-wrap:wrap; gap:18px; }
.receipt-upload-grid { grid-template-columns:minmax(420px,.95fr) minmax(360px,1.05fr); }
.receipt-preview-panel { position:sticky; top:94px; min-height:520px; padding:22px; }
.receipt-preview { min-height:390px; display:grid; place-items:center; gap:14px; padding:18px; border:1px dashed rgba(103,198,235,.32); border-radius:13px; background:rgba(5,12,27,.45); color:#9facbf; text-align:center; }
.receipt-preview figure { width:100%; margin:0; display:grid; gap:10px; }
.receipt-preview img { display:block; width:100%; max-height:560px; object-fit:contain; border-radius:10px; background:#050811; }
.receipt-preview figcaption { overflow-wrap:anywhere; color:#bdcadc; }
.receipt-file-preview { width:min(100%,420px); display:grid; gap:7px; padding:22px; border:1px solid rgba(103,198,235,.24); border-radius:12px; background:rgba(12,25,45,.72); text-align:left; }
.travel-route-fields { margin-top:14px; display:grid; gap:11px; padding:15px; border:1px solid rgba(97,195,230,.22); border-radius:11px; background:rgba(6,15,31,.44); }
.travel-route-fields .quiet { justify-self:start; }
.supplier-directory-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:15px; }
.supplier-directory-card { display:grid; gap:13px; padding:18px; border:1px solid rgba(92,172,214,.25); border-radius:13px; background:linear-gradient(145deg,rgba(12,26,46,.84),rgba(19,17,43,.78)); }
.supplier-directory-card header > div { display:grid; gap:4px; }
.supplier-directory-card header span,.supplier-directory-card p { color:#aebbcf; }
.supplier-directory-card p { margin:0; line-height:1.5; }
.supplier-directory-card dl { margin:0; display:grid; gap:8px; }
.supplier-directory-card dl div { display:grid; grid-template-columns:105px minmax(0,1fr); gap:9px; }
.supplier-directory-card dt { color:#8393aa; font-size:12px; text-transform:uppercase; letter-spacing:.05em; }
.supplier-directory-card dd { margin:0; overflow-wrap:anywhere; color:#d7deeb; }
.supplier-directory-card a.quiet { text-decoration:none; }

@media (max-width:1050px) {
  .receipt-upload-grid { grid-template-columns:1fr; }
  .receipt-preview-panel { position:static; min-height:0; }
  .receipt-preview { min-height:240px; }
}

/* Desktop navigation can be hidden to give wide reports the full window. */
@media (min-width:821px) {
  .portal {
    grid-template-columns:260px minmax(0,1fr);
    transition:grid-template-columns .18s ease;
  }
  .topbar #menu-toggle {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    min-width:82px;
    min-height:38px;
    padding:8px 11px;
    border:1px solid rgba(105,206,246,.25);
    border-radius:10px;
    background:rgba(12,25,44,.72);
    color:#b7efff;
  }
  .portal.sidebar-collapsed { grid-template-columns:0 minmax(0,1fr); }
  .portal.sidebar-collapsed .sidebar {
    width:0;
    padding-inline:0;
    border:0;
    overflow:hidden;
    opacity:0;
    pointer-events:none;
  }
}

@media (max-width:820px) {
  .portal.sidebar-collapsed { display:block; }
  .topbar #menu-toggle { display:block; }
  .content { width:100%; }
  .sidebar nav {
    flex:1 1 auto;
    min-height:0;
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior:contain;
    padding-right:4px;
  }
}

/* Authenticated Google Calendar schedule */
.calendar-panel {
  padding: clamp(18px,2.4vw,30px);
  overflow: hidden;
}
.calendar-header {
  gap: 18px;
  align-items: flex-start;
}
.calendar-header .muted {
  max-width: 640px;
  margin: 6px 0 0;
}
.calendar-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 42px;
  text-decoration: none;
}
.calendar-frame {
  position: relative;
  width: 100%;
  min-height: 620px;
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid rgba(138,184,214,.2);
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08),0 20px 50px rgba(0,0,0,.2);
}
.calendar-frame iframe {
  display: block;
  width: 100%;
  height: 72vh;
  min-height: 620px;
  border: 0;
  background: #fff;
}
@media (max-width:700px) {
  .calendar-header { flex-direction: column; }
  .calendar-open { width: 100%; }
  .calendar-frame,
  .calendar-frame iframe { min-height: 560px; }
  .calendar-frame iframe { height: 70vh; }
}

/* KC Quick Estimate */
.quick-estimate { max-width:1180px; margin:0 auto; }
.estimate-intro { padding:8px 4px 20px; text-align:center; }
.estimate-intro h2 { margin:4px 0 8px; color:#fff; font-size:clamp(32px,4.7vw,58px); line-height:1; letter-spacing:.015em; text-shadow:3px 3px 0 rgba(255,71,129,.72),-2px -2px 0 rgba(67,225,255,.68),0 0 26px rgba(156,118,255,.24); }
.estimate-intro p:last-child { margin:0; color:var(--muted); }
.estimate-layout { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(300px,.8fr); gap:20px; align-items:start; }
.estimate-entry-card,.estimate-search-card,.estimate-loading,.estimate-result { border:1px solid rgba(105,206,246,.25); border-radius:22px; background:linear-gradient(145deg,rgba(20,25,58,.93),rgba(38,22,72,.88)); box-shadow:var(--depth-3); }
.estimate-entry-card,.estimate-search-card { padding:22px; }
.estimate-card-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:14px; }
.estimate-card-heading h3,.estimate-search-card h3,.estimate-loading h3,.estimate-result h3 { margin:3px 0 0; font-size:21px; }
.estimate-card-heading > span { padding:5px 9px; border:1px solid rgba(98,247,189,.25); border-radius:999px; color:var(--lime); font-size:11px; white-space:nowrap; }
.estimate-detail { margin-top:10px; border:1px solid rgba(135,177,221,.19); border-radius:14px; background:rgba(4,10,27,.47); overflow:hidden; }
.estimate-detail[open] { border-color:rgba(67,220,255,.42); box-shadow:0 0 22px rgba(66,220,255,.07); }
.estimate-detail summary,.estimate-used summary { align-items:center; justify-content:space-between; gap:16px; padding:15px 16px; cursor:pointer; }
.estimate-detail summary { display:list-item; list-style-position:inside; }
.estimate-detail summary > span { display:inline-grid; width:calc(100% - 30px); margin-left:7px; vertical-align:middle; }
.estimate-used summary { display:flex; list-style:none; }
.estimate-used summary::-webkit-details-marker { display:none; }
.estimate-detail summary span,.estimate-used summary span { display:grid; gap:3px; }
.estimate-detail summary small,.estimate-used summary small { color:var(--muted); font-size:11px; font-weight:500; }
.estimate-used summary b { color:var(--cyan); font-size:11px; letter-spacing:.08em; text-transform:uppercase; }
.estimate-detail-body { padding:3px 16px 17px; }
.estimate-detail-body label,.estimate-search-row label,.estimate-feedback label { display:grid; gap:7px; color:#d8e4f5; font-size:12px; font-weight:700; }
.estimate-detail-body input,.estimate-detail-body textarea,.estimate-search-row input,.estimate-feedback textarea { border-color:rgba(91,202,239,.31); border-radius:10px; background:rgba(3,9,25,.72); }
.estimate-mini-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.estimate-calculate { width:100%; margin-top:18px; padding:14px 18px; border:1px solid #7dfff2; border-radius:13px; background:linear-gradient(180deg,#57f5e8,#2bbcf1 55%,#2381d8); color:#04101d; font-size:16px; font-weight:850; box-shadow:0 10px 28px rgba(36,183,235,.22),inset 0 1px rgba(255,255,255,.72); }
.estimate-calculate:hover { filter:brightness(1.08); }
.estimate-calculate:disabled { cursor:wait; opacity:.72; }
.estimate-search-card { position:sticky; top:112px; }
.estimate-search-card > .muted { margin:8px 0 20px; line-height:1.45; }
.estimate-search-row { display:grid; grid-template-columns:1fr auto; gap:8px; align-items:end; margin-top:13px; }
.estimate-search-row .quiet { min-height:43px; }
.estimate-search-results { display:grid; gap:8px; margin-top:16px; }
.estimate-search-note { margin:0; padding:10px 2px; color:var(--muted); font-size:12px; }
.estimate-match { display:grid; gap:3px; width:100%; padding:11px 12px; border:1px solid rgba(137,184,231,.22); border-radius:11px; background:rgba(7,14,34,.75); color:var(--text); text-align:left; }
.estimate-match:hover { border-color:var(--cyan); background:rgba(21,57,83,.65); }
.estimate-match span,.estimate-match small { color:var(--muted); font-size:11px; }
.estimate-selected { display:grid; gap:3px; margin-top:18px; padding:13px; border:1px solid rgba(98,247,189,.33); border-radius:12px; background:rgba(16,96,77,.19); }
.estimate-selected span,.estimate-selected small { color:var(--muted); font-size:11px; }
#qe-output { scroll-margin-top:112px; }
.estimate-loading { margin-top:22px; padding:28px; text-align:center; }
.estimate-loading h3 { margin-bottom:20px; }
.estimate-progress { height:12px; overflow:hidden; border:1px solid rgba(86,220,255,.31); border-radius:999px; background:rgba(0,0,0,.28); }
.estimate-progress span { display:block; width:100%; height:100%; background:linear-gradient(90deg,var(--cyan),var(--violet),var(--magenta),var(--cyan)); background-size:240% 100%; animation:estimate-progress 1.2s linear infinite; }
.estimate-loading ul { display:flex; flex-wrap:wrap; justify-content:center; gap:8px 22px; margin:18px 0 0; padding:0; color:var(--muted); font-size:12px; list-style:none; }
@keyframes estimate-progress { to { background-position:240% 0; } }
.estimate-result { margin-top:22px; padding:clamp(22px,4vw,38px); }
.estimate-ready { text-align:center; }
.estimate-ready h3 { margin:6px 0; font-size:clamp(25px,3vw,36px); }
.estimate-ready > span { color:var(--muted); font-size:12px; }
.estimate-total { display:grid; justify-items:center; gap:4px; margin:26px auto 20px; padding:22px; max-width:650px; border:1px solid rgba(255,93,175,.32); border-radius:20px; background:linear-gradient(135deg,rgba(33,136,183,.28),rgba(93,41,143,.3)); }
.estimate-total > span { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.12em; }
.estimate-total strong { color:#fff; font-size:clamp(40px,6vw,68px); line-height:1.08; font-variant-numeric:tabular-nums; text-shadow:0 0 25px rgba(66,220,255,.22); }
.estimate-total small { color:#c7d4e8; }
.estimate-confidence { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:18px; max-width:760px; margin:0 auto; }
.estimate-confidence div { display:grid; gap:3px; min-width:165px; }
.estimate-confidence span { color:var(--muted); font-size:11px; }
.estimate-confidence progress { width:100%; accent-color:var(--aqua); }
.estimate-cost-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:25px; }
.estimate-cost-grid div { display:grid; gap:5px; padding:14px; border:1px solid rgba(137,184,231,.17); border-radius:12px; background:rgba(4,10,27,.45); }
.estimate-cost-grid span { color:var(--muted); font-size:11px; }
.estimate-cost-grid strong { font-variant-numeric:tabular-nums; }
.estimate-used { margin-top:24px; border:1px solid rgba(68,242,212,.28); border-radius:16px; background:rgba(6,16,35,.62); overflow:hidden; }
.estimate-used[open] summary { border-bottom:1px solid rgba(137,184,231,.16); }
.estimate-used-body { padding:18px; }
.estimate-used-body > ul { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:0; padding:0; list-style:none; }
.estimate-used-body > ul li { display:grid; gap:4px; padding:12px; border:1px solid rgba(137,184,231,.15); border-radius:11px; background:rgba(28,39,68,.45); }
.estimate-used-body li span { color:var(--muted); font-size:11px; }
.estimate-notes { margin-top:14px; padding:12px 14px; border-left:3px solid var(--warning); background:rgba(113,73,13,.14); }
.estimate-notes p { margin:4px 0; color:#e8d6b2; font-size:12px; }
.estimate-feedback { margin-top:20px; padding-top:18px; border-top:1px solid rgba(137,184,231,.16); }
.estimate-feedback h4 { margin:0 0 12px; font-size:17px; }
.estimate-feedback-actions { display:flex; flex-wrap:wrap; gap:9px; }
.estimate-feedback-actions .quiet { min-height:42px; }
#qe-feedback-form { display:grid; gap:10px; margin-top:14px; }
#qe-feedback-form.hidden { display:none; }
#qe-feedback-send { justify-self:start; }
.estimate-feedback-status { min-height:20px; margin:10px 0 0; color:var(--lime); font-size:12px; }
@media (max-width:900px) {
  .estimate-layout { grid-template-columns:1fr; }
  .estimate-search-card { position:static; }
}
@media (max-width:620px) {
  .estimate-entry-card,.estimate-search-card,.estimate-result { padding:16px; border-radius:17px; }
  .estimate-card-heading { align-items:stretch; flex-direction:column; }
  .estimate-card-heading > span { align-self:flex-start; }
  .estimate-mini-grid,.estimate-cost-grid,.estimate-used-body > ul { grid-template-columns:1fr; }
  .estimate-confidence { grid-template-columns:1fr; }
  .estimate-search-row { grid-template-columns:1fr; }
  .estimate-search-row .quiet { width:100%; }
}

/* Material quantity estimator and saved supplier-price library */
.estimate-detail-body select { width:100%; border:1px solid rgba(91,202,239,.31); border-radius:10px; background:rgba(3,9,25,.72); color:var(--text); }
.estimate-detail-body label small { color:var(--muted); font-weight:500; }
.measurement-options { margin-top:12px; }
.estimate-option-row { display:flex; flex-wrap:wrap; gap:12px 20px; margin:13px 0; }
.estimate-check { display:flex !important; grid-column:span 1; flex-direction:row; align-items:center; gap:9px !important; min-height:42px; padding:9px 11px; border:1px solid rgba(137,184,231,.17); border-radius:10px; background:rgba(7,14,34,.55); }
.estimate-check input { width:18px; height:18px; margin:0; }
.supplier-price-panel { margin-top:22px; border-top:1px solid rgba(137,184,231,.18); padding-top:16px; }
.supplier-price-panel summary { cursor:pointer; }
.supplier-price-panel summary span { display:grid; gap:3px; }
.supplier-price-panel summary small { color:var(--muted); font-size:11px; }
.supplier-price-body { display:grid; gap:10px; margin-top:14px; }
.supplier-price-row { display:grid; gap:8px; padding:11px; border:1px solid rgba(137,184,231,.16); border-radius:11px; background:rgba(4,10,27,.5); }
.supplier-price-row > div,.supplier-price-row > label { display:grid; gap:3px; }
.supplier-price-row label { color:var(--muted); font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; }
.supplier-price-row input { min-width:0; padding:8px; border:1px solid rgba(91,202,239,.26); border-radius:8px; background:rgba(3,9,25,.76); color:var(--text); font-size:12px; }
.supplier-price-row small { color:var(--muted); font-size:10px; }
#qe-save-prices { width:100%; margin-top:14px; }
.estimate-materials { margin-top:25px; padding:18px; border:1px solid rgba(67,220,255,.27); border-radius:16px; background:rgba(4,10,27,.45); }
.estimate-material-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:14px; }
.estimate-material-heading h4 { margin:4px 0 0; font-size:20px; }
.estimate-material-heading > span { color:var(--warning); font-size:11px; }
.estimate-materials table { min-width:850px; }
.estimate-materials td { vertical-align:top; }
.estimate-materials td small { display:block; margin-top:4px; color:var(--muted); font-size:10px; line-height:1.35; }
.material-quantity { display:flex; align-items:center; gap:7px; white-space:nowrap; }
.material-quantity input { width:92px; min-width:0; padding:7px; border:1px solid rgba(91,202,239,.32); border-radius:8px; background:rgba(3,9,25,.78); color:var(--text); }
.material-quantity span { color:var(--muted); font-size:10px; }
.price-needed { color:var(--warning); font-weight:750; }
#qe-update-quantities { margin-top:14px; }
@media (max-width:620px) {
  .estimate-materials { padding:13px; }
  .estimate-material-heading { flex-direction:column; }
}

/* Printable forms library */
.template-library {
  width:min(1180px,100%);
  margin:0 auto;
}
.template-library-label { margin:0 0 14px; }
.template-library-heading {
  margin-bottom:20px;
}
.template-library-heading h2 {
  margin:5px 0 7px;
  color:#fff;
  font-size:clamp(25px,3vw,36px);
}
.template-library-heading > p:last-child {
  max-width:720px;
  margin:0;
  color:var(--muted);
}
.template-cabinet-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}
.template-cabinet {
  position:relative;
  display:grid;
  align-content:start;
  gap:8px;
  min-width:0;
  padding:12px;
  overflow:hidden;
  border:1px solid rgba(80,210,255,.25);
  border-radius:15px;
  background:linear-gradient(155deg,rgba(18,61,98,.68),rgba(6,18,50,.94));
  color:var(--text);
  text-align:left;
  cursor:pointer;
  transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;
}
.template-cabinet:hover,
.template-cabinet:focus-visible {
  transform:translateY(-3px);
  border-color:rgba(65,238,223,.78);
  box-shadow:0 13px 30px rgba(0,0,0,.28),0 0 22px rgba(65,238,223,.1);
}
.template-cabinet.active {
  border-color:var(--aqua);
  box-shadow:0 0 0 2px rgba(65,238,223,.17),0 14px 30px rgba(0,0,0,.3);
}
.template-cabinet-label {
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:50px;
  padding:8px 6px;
  border:1px solid rgba(107,226,255,.48);
  border-radius:9px;
  background:rgba(3,27,69,.84);
  color:#effcff;
  font-weight:850;
  line-height:1.15;
  text-align:center;
  text-transform:uppercase;
  letter-spacing:.035em;
}
.template-cabinet img {
  width:100%;
  aspect-ratio:1 / .94;
  object-fit:cover;
  object-position:center;
  border-radius:7px;
  filter:saturate(.88) brightness(.84);
}
.template-cabinet small {
  color:#b8c7da;
  font-size:11px;
  line-height:1.4;
}
.template-library-stage {
  margin-top:24px;
  scroll-margin-top:110px;
  border:1px solid rgba(121,174,223,.24);
  border-radius:18px;
  background:rgba(6,14,34,.76);
  box-shadow:0 18px 45px rgba(0,0,0,.22);
}
.template-library-stage:empty { display:none; }
.template-library-prompt {
  margin:0;
  padding:25px;
  color:var(--muted);
  text-align:center;
}
.template-drawer-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:21px 22px 17px;
  border-bottom:1px solid rgba(121,174,223,.18);
}
.template-drawer-heading h3 {
  margin:4px 0 0;
  color:#fff;
  font-size:22px;
}
.template-drawer-heading > span {
  flex:0 0 auto;
  color:var(--aqua);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.template-drawer-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:11px;
  padding:20px 22px 22px;
}
.template-drawer {
  display:grid;
  gap:7px;
  min-height:82px;
  padding:15px 16px;
  border:1px solid rgba(101,178,232,.3);
  border-radius:11px;
  background:linear-gradient(145deg,rgba(17,69,122,.72),rgba(7,29,74,.94));
  color:#f3fbff;
  text-align:left;
  cursor:pointer;
}
.template-drawer:hover,
.template-drawer:focus-visible,
.template-drawer.active {
  border-color:var(--aqua);
  background:linear-gradient(145deg,rgba(20,91,139,.82),rgba(10,42,91,.97));
}
.template-drawer span {
  font-weight:800;
  line-height:1.25;
}
.template-drawer small {
  color:#9fd9ee;
}
.template-master-files {
  margin:0 22px 22px;
  border-color:rgba(69,235,211,.24);
  background:rgba(3,10,25,.62);
}
.template-master-files .section-documents-heading p:not(.section-label) {
  margin:7px 0 0;
  color:var(--muted);
}
@media (max-width:980px) {
  .template-cabinet-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .template-drawer-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:620px) {
  .template-cabinet-grid,.template-drawer-grid { grid-template-columns:1fr; }
  .template-drawer-heading { align-items:flex-start; flex-direction:column; }
  .template-master-files { margin:0 12px 12px; }
  .template-drawer-grid { padding:14px 12px 16px; }
}

.template-form-start {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:22px;
  margin:20px 22px 0;
  padding:18px 20px;
  border:1px solid rgba(93,218,190,.34);
  border-radius:13px;
  background:#0b1828;
}
.template-form-start h3 { margin:4px 0 7px; color:#fff; font-size:21px; }
.template-form-start p:last-child { max-width:720px; margin:0; color:var(--muted); line-height:1.45; }
.template-form-start .primary { flex:0 0 auto; }
.kc-form-workspace { display:grid; gap:18px; padding-bottom:34px; }
.kc-form-toolbar {
  position:sticky;
  top:92px;
  z-index:4;
  display:flex;
  flex-wrap:wrap;
  align-items:end;
  gap:12px;
  padding:15px;
  border:1px solid rgba(109,168,208,.3);
  border-radius:13px;
  background:#071323f2;
  box-shadow:0 12px 34px rgba(0,0,0,.3);
}
.kc-form-toolbar label { min-width:190px; margin:0; }
.kc-form-destination,.kc-form-actions { display:flex; flex-wrap:wrap; align-items:end; gap:10px; }
.kc-form-actions { margin-left:auto; }
.kc-form-toolbar .form-status { flex:1 0 100%; min-height:18px; margin:0; color:#8dffd2; }
.kc-form-paper {
  width:min(850px,100%);
  min-height:1100px;
  margin:0 auto;
  padding:34px 38px 46px;
  border:0;
  border-radius:2px;
  background:#a9afc1 url('/kc-form-paper.webp') center top/cover no-repeat;
  color:#070a0f;
  box-shadow:0 25px 70px rgba(0,0,0,.52);
}
.kc-form-brand {
  min-height:108px;
  padding:14px 9px;
}
.kc-form-brand p {
  margin:0 0 3px;
  font:800 12px/1.1 'Arial Black',Arial,sans-serif;
  letter-spacing:.055em;
}
.kc-form-brand h2 {
  max-width:570px;
  margin:0;
  color:#05070a;
  font:900 clamp(22px,3.2vw,31px)/1.02 'Arial Black',Arial,sans-serif;
  letter-spacing:-.025em;
  text-transform:uppercase;
}
.kc-form-fields {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px 17px;
  padding:19px 30px 10px;
}
.kc-form-field { min-width:0; margin:0; color:#070a0f; }
.kc-form-field.wide { grid-column:1/-1; }
.kc-form-field > span {
  display:block;
  min-height:22px;
  font:800 10px/1.15 'Arial Black',Arial,sans-serif;
  letter-spacing:.015em;
  text-transform:uppercase;
}
.kc-form-field input,.kc-form-field textarea {
  border:1px solid #cbd1d8;
  border-radius:1px;
  background:#fffffff2;
  color:#11151b;
  box-shadow:none;
}
.kc-form-field input { min-height:42px; }
.kc-form-field textarea { min-height:78px; resize:vertical; }
.kc-form-field input:focus,.kc-form-field textarea:focus { border-color:#4abf9d; box-shadow:0 0 0 3px rgba(74,191,157,.22); }
.kc-form-paper footer { margin:18px 30px 0; padding-top:9px; border-top:1px solid rgba(44,59,66,.45); color:#303b46; font-size:10px; }
.completed-form-history { width:min(960px,100%); margin:0 auto; }
.completed-form-panel { margin-top:0; }
@media(max-width:780px){
  .template-form-start { align-items:stretch; flex-direction:column; margin:14px 12px 0; }
  .template-form-start .primary { width:100%; }
  .kc-form-toolbar { position:static; align-items:stretch; }
  .kc-form-destination,.kc-form-actions { width:100%; }
  .kc-form-actions { margin-left:0; }
  .kc-form-actions button { flex:1 1 180px; }
  .kc-form-paper { min-height:auto; padding:24px 16px 34px; }
  .kc-form-brand { min-height:95px; padding:12px 8px; }
  .kc-form-fields { grid-template-columns:1fr; padding:14px 12px; }
  .kc-form-field.wide { grid-column:auto; }
  .kc-form-paper footer { margin:14px 12px 0; }
}
@media print {
  body.printing-kc-form { background:#fff!important; }
  body.printing-kc-form > * { visibility:hidden!important; }
  body.printing-kc-form .kc-form-paper,body.printing-kc-form .kc-form-paper * { visibility:visible!important; }
  body.printing-kc-form .kc-form-paper { position:absolute; inset:0; width:8.5in; min-height:11in; margin:0; padding:.34in .38in .42in; box-shadow:none; }
  body.printing-kc-form .kc-form-fields { grid-template-columns:repeat(2,minmax(0,1fr)); gap:.11in .14in; padding:.18in .3in .1in; }
  body.printing-kc-form .kc-form-field.wide { grid-column:1/-1; }
  body.printing-kc-form .kc-form-field input,body.printing-kc-form .kc-form-field textarea { color:#070a0f!important; background:#fffffff2!important; print-color-adjust:exact; -webkit-print-color-adjust:exact; }
}
