:root {
  --ink: #0b1f3f;
  --muted: #64748b;
  --paper: #f7fbff;
  --card: rgba(255, 255, 255, 0.92);
  --line: rgba(29, 78, 216, 0.14);
  --forest: #0b3a82;
  --forest-2: #08245c;
  --mint: #d8ecff;
  --sun: #7cc4ff;
  --coral: #2563eb;
  --blue: #1d4ed8;
  --shadow: 0 24px 70px rgba(15, 76, 160, 0.16);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", Verdana, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(59, 130, 246, 0.20), transparent 30rem),
    radial-gradient(circle at 92% 6%, rgba(125, 211, 252, 0.26), transparent 32rem),
    linear-gradient(135deg, #ffffff 0%, #f3f8ff 46%, #eaf4ff 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(37,99,235,0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(37,99,235,0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
code { background: rgba(37,99,235,0.08); border-radius: 6px; padding: 0.1rem 0.35rem; }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; position: relative; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}
.brand { display: inline-flex; gap: 12px; align-items: center; }
.brand-logo {
  display: block;
  width: 92px;
  max-height: 34px;
  object-fit: contain;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  color: #fff8ec;
  background: linear-gradient(145deg, #08245c, #1d4ed8 58%, #60a5fa);
  box-shadow: 0 12px 28px rgba(37,99,235,0.22);
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.35rem;
  font-weight: 800;
}
.brand strong { display: block; font-weight: 850; letter-spacing: -0.03em; }
.brand-name-text { font-size: 1.08rem; }
.brand-accent { color: #c8102e; }
.brand small { color: var(--muted); font-size: 0.78rem; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-actions a, .ghost-button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.44);
  color: var(--forest-2);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  cursor: pointer;
}
.nav-actions form { margin: 0; }

h1, h2, h3 { font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; letter-spacing: -0.045em; margin: 0; }
h1 { font-size: clamp(2.2rem, 6vw, 5.2rem); line-height: 0.95; }
h2 { font-size: clamp(1.55rem, 3vw, 2.35rem); }
h3 { font-size: 1.25rem; }
p { line-height: 1.65; }
.eyebrow { color: var(--coral); font-weight: 850; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; margin: 0 0 10px; }
.muted, .hint { color: var(--muted); font-size: 0.92rem; }

.login-layout {
  min-height: calc(100vh - 92px);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: center;
  padding: 28px 0 70px;
}
.hero-panel, .login-card, .panel {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hero-panel {
  min-height: 560px;
  border-radius: 38px;
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  position: relative;
}
.hero-panel::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -110px;
  top: -80px;
  border-radius: 40% 60% 55% 45%;
  background: linear-gradient(145deg, rgba(191,219,254,0.95), rgba(96,165,250,0.64));
  animation: blob 9s ease-in-out infinite alternate;
}
.hero-copy { max-width: 650px; font-size: 1.12rem; color: #475569; }
.hero-metrics { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-metrics span { border: 1px solid var(--line); border-radius: 999px; padding: 0.75rem 1rem; background: rgba(255,255,255,0.45); }
.login-card { border-radius: 32px; padding: 34px; }
.login-card label, .stack-form label { display: grid; gap: 8px; margin: 18px 0; font-weight: 750; }
input[type="text"], input[type="password"], input:not([type]), select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.72);
  padding: 0.95rem 1rem;
  outline: none;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--forest) 50%), linear-gradient(135deg, var(--forest) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
input:focus { border-color: var(--forest); box-shadow: 0 0 0 4px rgba(96,165,250,0.26); }
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  color: #fffaf0;
  background: linear-gradient(135deg, #08245c, #1d4ed8 52%, #60a5fa);
  padding: 0.95rem 1.25rem;
  box-shadow: 0 16px 34px rgba(37,99,235,0.24);
  cursor: pointer;
  font-weight: 850;
}
.primary-button:disabled { opacity: 0.55; cursor: wait; }
.alert { border-radius: 14px; padding: 0.85rem 1rem; margin: 14px 0; }
.alert.error, .job-status.error { color: #b42318; background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.25); }

.workspace-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 42px 0 24px;
}
.workspace-hero p { max-width: 760px; color: #475569; }
.status-orb {
  min-width: 180px;
  min-height: 180px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff8ee;
  background: radial-gradient(circle at 30% 20%, #93c5fd, #1d4ed8 48%, #08245c);
  box-shadow: var(--shadow);
}
.status-orb span { display: block; opacity: 0.78; }
.status-orb strong { display: block; font-size: 1.2rem; }
.grid { display: grid; gap: 24px; }
.two-columns { grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr); }
.admin-grid { grid-template-columns: 0.8fr 1.4fr; align-items: start; }
.span-two { min-width: 0; }
.panel { border-radius: 30px; padding: 26px; }
.panel-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 20px; }
.badge { border-radius: 999px; background: rgba(219,234,254,0.92); color: #1d4ed8; padding: 0.45rem 0.75rem; font-weight: 850; }
.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 2px dashed rgba(37,99,235,0.28);
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255,255,255,0.56), rgba(219,234,254,0.62));
  transition: 180ms ease;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragging { transform: translateY(-2px); border-color: var(--forest); background: rgba(219,234,254,0.82); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-content { text-align: center; padding: 24px; }
.file-icon { display: inline-grid; place-items: center; width: 76px; height: 76px; border-radius: 22px; background: linear-gradient(145deg, #08245c, #2563eb); color: #f8fbff; font-weight: 950; margin-bottom: 14px; transform: rotate(-4deg); }
.action-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.job-status { margin-top: 16px; border-radius: 18px; padding: 1rem; background: rgba(219,234,254,0.72); border: 1px solid rgba(37,99,235,0.12); }
.hidden { display: none; }
.feature-list { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 14px; }
.feature-list li { display: flex; align-items: center; gap: 10px; }
.feature-list span { width: 12px; height: 12px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 6px rgba(37,99,235,0.12); }
.mini-terminal {
  min-height: 160px;
  border-radius: 20px;
  padding: 18px;
  color: #dbeafe;
  background: #071b3d;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.84rem;
  overflow: auto;
  white-space: pre-wrap;
}
.history-panel { margin: 24px 0 70px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.status-pill { display: inline-flex; border-radius: 999px; padding: 0.3rem 0.65rem; font-weight: 850; font-size: 0.78rem; }
.status-completed { background: rgba(44, 139, 91, 0.15); color: #1d7047; }
.status-running { background: rgba(219, 234, 254, 0.95); color: #1e40af; }
.status-failed { background: rgba(239,68,68,0.12); color: #b42318; }
.status-draft { background: rgba(245, 158, 11, 0.16); color: #92400e; }
.status-active { background: rgba(44, 139, 91, 0.15); color: #1d7047; }
.status-archived { background: rgba(100, 116, 139, 0.16); color: #475569; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.job-import { display: grid; gap: 9px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); max-width: 600px; }
.job-import .row-actions:empty { display: none; }
.import-generate { color: var(--forest); font-weight: 750; }
.import-download { color: var(--forest); font-weight: 750; }
.import-generate:disabled { cursor: progress; opacity: 0.65; }
.conversion-summary { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 0.82rem; }
.conversion-summary span { white-space: nowrap; }
.conversion-summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.import-note { margin: 0; font-size: 0.82rem; line-height: 1.5; overflow-wrap: anywhere; color: var(--muted); }
.import-note.import-error { color: #b42318; }
.mini-terminal .job-import { border-color: currentColor; color: inherit; }
.mini-terminal .import-note, .mini-terminal .conversion-summary, .mini-terminal .conversion-summary strong { color: inherit; }
.mini-terminal .small-link { background: #fff; color: var(--forest); }
.mini-terminal pre { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .history-panel .panel-heading { align-items: flex-start; }
  .history-panel table, .history-panel tbody, .history-panel tr, .history-panel td { display: block; width: 100%; }
  .history-panel thead { display: none; }
  .history-panel tbody tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .history-panel tbody td { border: 0; padding: 5px 0; overflow-wrap: anywhere; }
  .history-panel td[data-label] { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 10px; }
  .history-panel td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 0.8rem; padding-top: 3px; }
  .history-panel .job-actions-cell { padding-top: 12px; }
  .history-panel .small-link { max-width: 100%; }
  .history-panel .job-import { max-width: 100%; }
}
.small-link, .danger-button {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42rem 0.68rem;
  background: rgba(255,255,255,0.56);
  cursor: pointer;
}
.danger-button { color: #b42318; border-color: rgba(239,68,68,0.32); }
.check-line { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px !important; }
.check-line input { width: auto; }
.error-panel { margin: 70px auto; max-width: 720px; }

.abacus-hero { align-items: center; }
.abacus-actions { justify-content: flex-end; }
.abacus-actions .primary-button { padding: 0.72rem 1rem; }
.abacus-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 70px; }
.abacus-sidebar { position: sticky; top: 18px; }
.abacus-list { display: grid; gap: 10px; }
.abacus-list-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 16px;
  background: rgba(255,255,255,0.54); color: var(--ink); cursor: pointer;
}
.abacus-list-item:hover, .abacus-list-item.selected { border-color: var(--forest); background: var(--mint); }
.abacus-list-item span:first-child { display: grid; gap: 3px; min-width: 0; }
.abacus-list-item strong, .abacus-list-item small { overflow: hidden; text-overflow: ellipsis; }
.abacus-editor { display: grid; gap: 18px; min-width: 0; }
.abacus-section { padding: 0; overflow: hidden; }
.abacus-section summary { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; cursor: pointer; font-size: 1.2rem; font-weight: 850; }
.abacus-section summary::marker { color: var(--forest); }
.abacus-section summary span { display: grid; gap: 4px; }
.abacus-section > .table-wrap, .abacus-section > .section-help, .abacus-section > .add-row, .abacus-section > .audit-log, .abacus-section > .form-grid, .abacus-section > h3 { margin-left: 26px; margin-right: 26px; }
.abacus-section > .table-wrap { margin-bottom: 16px; }
.abacus-section > .add-row { margin-bottom: 24px; }
.abacus-section > .form-grid { margin-bottom: 24px; }
.abacus-section > h3 { margin-top: 22px; margin-bottom: 12px; }
.section-help { color: var(--muted); margin-top: -4px; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid label { display: grid; gap: 7px; font-weight: 750; }
.wide-field { grid-column: 1 / -1; }
textarea { resize: vertical; }
.form-grid input, .form-grid textarea, .form-grid select {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,0.84);
  color: var(--ink); padding: 0.85rem 0.95rem; outline: none;
}
.compact-table th, .compact-table td { padding: 9px 7px; }
.compact-table input:not([type="checkbox"]), .compact-table select { min-width: 88px; padding: 0.58rem 0.62rem; }
.compact-table code { white-space: nowrap; }
.compact-table th small { display: block; text-transform: none; letter-spacing: normal; margin-top: 4px; }
.icon-button { border-radius: 10px; font-size: 1.1rem; padding: 0.35rem 0.6rem; }
.input-suffix { margin-left: -25px; color: var(--muted); pointer-events: none; }
.validation-summary { border-radius: 16px; background: rgba(245, 158, 11, 0.10); border: 1px solid rgba(245, 158, 11, 0.24); padding: 12px 16px; margin-bottom: 18px; }
.validation-summary ul { margin: 8px 0 0; padding-left: 20px; }
.validation-ok { color: #1d7047; margin: 0; }
.validation-error { color: #b42318; }
.validation-warning { color: #92400e; }
.audit-log { display: grid; gap: 8px; padding-bottom: 24px; color: var(--muted); }
.audit-log div { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.audit-log span { display: inline-block; min-width: 170px; }
.capability-fieldset { border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.capability-fieldset legend { font-weight: 850; padding: 0 6px; }
.capability-editor { display: grid; gap: 5px; min-width: 180px; }
.capability-editor .check-line { font-size: 0.78rem; white-space: nowrap; }
.capability-editor .small-link { justify-self: start; margin-top: 5px; }
.quote-start-grid { grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr); margin-bottom: 24px; }
.quote-list { display: grid; gap: 10px; }
.quote-list-item {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  border: 1px solid var(--line); border-radius: 16px; padding: 13px; text-align: left;
  background: rgba(255,255,255,0.58); color: var(--ink); cursor: pointer;
}
.quote-list-item:hover, .quote-list-item.selected { border-color: var(--forest); background: var(--mint); }
.quote-list-item > span { display: grid; gap: 4px; }
.quote-list-item > span:last-child { justify-items: end; }
.quote-editor { display: grid; gap: 24px; margin-bottom: 70px; }
.quote-models { display: grid; gap: 18px; }
.quote-model-card { border: 1px solid var(--line); border-radius: 22px; padding: 20px; background: rgba(255,255,255,0.54); }
.quote-model-heading, .model-review-footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.quote-model-heading h3 { margin-bottom: 4px; }
.model-evidence { color: var(--muted); margin: 12px 0; }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: 10px; }
.metric-grid label, .classification-grid label { display: grid; gap: 5px; font-weight: 750; }
.metric-grid small { color: var(--muted); font-weight: 500; }
.metric-grid input, .metric-grid select, .classification-grid input, .classification-grid select, .classification-grid textarea {
  min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 0.68rem 0.72rem;
  background: rgba(255,255,255,0.84); color: var(--ink);
}
.weighted-metrics { margin-top: 14px; border: 1px dashed var(--line); border-radius: 16px; padding: 12px 14px; }
.weighted-metrics summary { cursor: pointer; font-weight: 800; color: var(--forest); }
.weighted-metric-grid { margin-top: 12px; grid-template-columns: repeat(3, minmax(140px, 1fr)); }
.classification-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.model-review-footer { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; color: var(--muted); }
.model-review-footer .primary-button { padding: 0.65rem 0.85rem; }
.flat-cost-list { display: grid; gap: 14px; }
.flat-cost-card { border: 1px solid var(--line); border-radius: 18px; padding: 17px; background: rgba(255,255,255,0.48); }
.flat-cost-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.flat-cost-heading h3 { margin: 0 0 4px; }
.flat-cost-fields { margin-top: 14px; }
.flat-cost-cmr { align-self: end; padding-bottom: 13px; }
.flat-cost-card .action-row { margin-top: 14px; }
.automatic-method-calculations { display: grid; gap: 20px; margin-top: 18px; }
.automatic-method-result { border: 1px solid var(--line); border-radius: 20px; padding: 18px; background: rgba(255,255,255,0.48); }
.automatic-method-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; }
.automatic-method-heading h3 { margin: 0; }
.automatic-method-pending { color: var(--muted); }
.calculation-detail { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.calculation-detail > summary, .scenario-detail > summary { cursor: pointer; font-weight: 850; color: var(--forest); }
.calculation-detail > .section-help { margin-top: 10px; }
.scenario-details { display: grid; gap: 16px; }
.scenario-detail { border: 1px solid var(--line); border-radius: 16px; padding: 15px; background: rgba(255,255,255,0.46); }
.scenario-detail > summary { margin-bottom: 10px; }
.detail-group + .detail-group { margin-top: 18px; }
.detail-group h4 { margin-bottom: 8px; }
.detail-table td:nth-last-child(-n+3), .detail-table th:nth-last-child(-n+3) { text-align: right; white-space: nowrap; }
.scenario-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.scenario-cards article { display: grid; gap: 7px; border: 1px solid var(--line); border-radius: 20px; padding: 20px; background: var(--mint); }
.scenario-cards strong { font-size: 1.7rem; }
.comparison-card { display: flex; justify-content: space-between; gap: 18px; margin-top: 16px; padding: 18px; border-radius: 18px; background: #071b3d; color: #dbeafe; }
.comparison-table { width: 100%; border-collapse: collapse; }
.comparison-table th, .comparison-table td { border-bottom: 1px solid var(--line); padding: 13px 12px; text-align: left; }
.comparison-table thead th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.method-summary { display: flex; justify-content: space-between; gap: 16px; margin-top: 14px; padding: 13px 15px; border-radius: 14px; background: var(--mint); color: var(--ink); }

body.profile-kwsoft {
  --ink: #291016;
  --muted: #785b62;
  --paper: #fff8f8;
  --card: rgba(255, 255, 255, 0.94);
  --line: rgba(177, 0, 35, 0.17);
  --forest: #c8102e;
  --forest-2: #7d0019;
  --mint: #ffe1e6;
  --sun: #ff8798;
  --coral: #cf1234;
  --blue: #a90025;
  --shadow: 0 24px 70px rgba(130, 0, 27, 0.16);
  background:
    radial-gradient(circle at 10% 8%, rgba(220, 22, 59, 0.18), transparent 30rem),
    radial-gradient(circle at 93% 5%, rgba(255, 183, 193, 0.34), transparent 31rem),
    linear-gradient(135deg, #ffffff 0%, #fff8f8 48%, #ffecef 100%);
}
body.profile-kwsoft::before {
  background-image: linear-gradient(rgba(190,0,37,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(190,0,37,0.05) 1px, transparent 1px);
}
body.profile-kwsoft .brand-mark,
body.profile-kwsoft .file-icon,
body.profile-kwsoft .primary-button {
  background: linear-gradient(135deg, #790018, #c8102e 56%, #ef4964);
  box-shadow: 0 16px 34px rgba(177,0,35,0.24);
}
body.profile-kwsoft .status-orb {
  background: radial-gradient(circle at 30% 20%, #ff99a8, #c8102e 48%, #700016);
}
body.profile-kwsoft .dropzone {
  border-color: rgba(190, 0, 37, 0.28);
  background: linear-gradient(135deg, rgba(255,255,255,0.72), rgba(255,225,230,0.76));
}
body.profile-kwsoft .dropzone:hover,
body.profile-kwsoft .dropzone.dragging { background: rgba(255, 225, 230, 0.9); }
body.profile-kwsoft .badge,
body.profile-kwsoft .job-status { background: rgba(255,225,230,0.84); color: #97001f; }
body.profile-kwsoft .mini-terminal { background: #31000b; color: #ffe6ea; }
body.profile-kwsoft input:focus,
body.profile-kwsoft select:focus { border-color: #c8102e; box-shadow: 0 0 0 4px rgba(220,22,59,0.17); }

@keyframes blob {
  from { transform: rotate(0deg) scale(1); border-radius: 40% 60% 55% 45%; }
  to { transform: rotate(18deg) scale(1.08); border-radius: 60% 40% 44% 56%; }
}

@media (max-width: 860px) {
  .login-layout, .two-columns, .admin-grid, .quote-start-grid { grid-template-columns: 1fr; }
  .hero-panel { min-height: 420px; }
  .workspace-hero { display: block; }
  .status-orb { display: none; }
  .nav-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .topbar { align-items: flex-start; }
  .abacus-layout { grid-template-columns: 1fr; }
  .abacus-sidebar { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .metric-grid, .weighted-metric-grid { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
  .classification-grid, .scenario-cards { grid-template-columns: 1fr; }
  .model-review-footer, .comparison-card, .method-summary, .flat-cost-heading { align-items: flex-start; flex-direction: column; }
}

/* Local product mark: no external logo or font request from a customer space. */
body.profile-kwsoft .brand-mark { font-family: 'Avenir Next', 'Gill Sans', sans-serif; font-size: 18px; letter-spacing: -.06em; border-radius: 4px; }
body.profile-kwsoft { --cream: #fff0f3; }

/* Admin credential management follows the existing blue/white workspace. */
.ai-admin-panel { margin-bottom: 24px; }
.ai-admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.ai-admin-security { padding: 24px; border: 1px solid var(--line, #dbe6f4); border-radius: 20px; background: linear-gradient(135deg, #eef5ff, #fff); }
.ai-admin-security h3 { margin-top: 8px; }
.ai-admin-grid .check-line { display: flex; align-items: flex-start; gap: 10px; }
.ai-admin-grid .check-line input { width: auto; flex: none; margin-top: 4px; }
#aiCredentialMessage, #aiCredentialTestResult { overflow-wrap: anywhere; }
@media (max-width: 760px) { .ai-admin-grid { grid-template-columns: 1fr; } }

/* Language is a display preference, independent of account delivery profile. */
.ui-language{display:flex;align-items:center;gap:8px;font-size:12px;white-space:nowrap;color:var(--muted,#536477)}
.ui-language select{width:auto;min-width:104px;margin:0;padding:7px 10px;border:1px solid var(--line,#d9e2ec);border-radius:7px;background:#fff;color:#172a40;font:inherit}
.ui-language select:focus-visible{outline:3px solid var(--accent,#165bd5);outline-offset:2px}
.topbar{flex-wrap:wrap}
:root { --batch-border: #dce5f0; }
.batch-dialog { width: min(820px, calc(100vw - 32px)); max-height: 90vh; overflow: auto; padding: 24px; border: 1px solid var(--batch-border); border-radius: 16px; color: inherit; background: #fff; }
.batch-dialog::backdrop { background: rgba(15, 28, 48, .55); }
.batch-dialog input[type=search] { display: block; width: 100%; margin: 8px 0 12px; padding: 10px; }
.batch-toolbar { margin-bottom: 12px; }
.batch-model-list { max-height: 38vh; overflow: auto; border-block: 1px solid var(--batch-border); margin-bottom: 12px; }
.batch-model-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--batch-border); overflow-wrap: anywhere; }
.batch-model-row input { flex: 0 0 auto; margin-top: 5px; }
.batch-model-row small { display: block; color: #52647b; }
.batch-dialog .row-actions { flex-wrap: wrap; }
@media (max-width: 600px) { .batch-dialog { padding: 16px; } }

/* Target import assistance: independent of the source review workshop. */
.import-ai-workspace { max-width: 1280px; margin: 0 auto; }
.import-ai-header { display:flex; gap:24px; align-items:center; justify-content:space-between; }
.import-ai-columns { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; margin:24px 0; }
.import-ai-card { background:var(--surface, #fff); border:1px solid var(--border, #dce3ed); border-radius:18px; padding:24px; min-width:0; }
.import-ai-card h2 { font-size:1.25rem; margin:0 0 18px; }
.import-ai-card h2:not(:first-child) { margin-top:30px; }
.import-ai-card label:not(.import-ai-check) { display:block; margin:16px 0 6px; }
.import-ai-card input:not([type=checkbox]), .import-ai-card select { width:100%; max-width:100%; box-sizing:border-box; }
.import-ai-card fieldset { margin:20px 0; padding:12px; border:1px solid #dce3ed; border-radius:10px; }
.import-ai-check { display:flex; align-items:flex-start; gap:10px; margin:12px 0; }
.import-ai-check input { flex:none; width:auto; margin-top:4px; }
.import-ai-budgets { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.import-ai-notice { padding:16px 20px; background:#f1f5fa; border-radius:12px; }
.import-ai-run { border-top:1px solid #dce3ed; padding:16px 0; overflow-wrap:anywhere; }
.import-ai-run button { margin:4px 8px 0 0; }
.import-ai-table { overflow-x:auto; margin:20px 0; }
.import-ai-table td { white-space:normal; overflow-wrap:anywhere; vertical-align:top; }
.import-ai-workspace [hidden] { display:none !important; }
@media (max-width:760px) { .import-ai-columns { grid-template-columns:1fr; } .import-ai-header { align-items:flex-start; flex-direction:column; } .import-ai-card { padding:18px; } .import-ai-budgets { grid-template-columns:1fr; } }

.import-ai-card input[type=number] { border:1px solid #dce3ed; border-radius:10px; padding:10px 12px; font:inherit; }
.import-ai-card input[type=file] { padding:12px; border:1px dashed #c6cfdb; border-radius:10px; font:inherit; font-size:.9rem; }
