@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/InterVariable.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --muted-2: #98989d;
  --line: #d2d2d7;
  --brand: #000000;
  --brand-2: #0071e3;
  --accent: #5856d6;
  --violet: #af52de;
  --cta: #10b981;
  --danger: #b42318;
  --warning: #a15c07;
  --ok: #0f8b57;
  --morning: #eaf4ff;
  --evening: #f1efff;
  --night: #f5f5f7;
  --day: #ecfdf5;
  --off: #fbfbfd;
  --radius: 4px;
  --panel-radius: 16px;
  --pill-radius: 50px;
  --gradient: linear-gradient(135deg, #0071e3 0%, #5856d6 50%, #af52de 100%);
  --cta-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(180deg, #ffffff 0, #f5f5f7 360px, #f5f5f7 100%);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(14px, 3vw, 32px);
  background: rgba(0, 0, 0, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--gradient);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(0, 113, 227, 0.28);
}

.brand-mark-small {
  width: 32px;
  height: 32px;
  font-size: 11px;
  box-shadow: none;
}

.eyebrow {
  margin: 0 0 2px;
  color: #a1a1a6;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 800;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--pill-radius);
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 28px);
}

.control-panel,
.output-panel {
  min-width: 0;
}

.control-panel {
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  margin-bottom: 14px;
}

.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  min-width: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.tab-button.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field span,
.toggle-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field .field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

.field.hidden {
  display: none;
}

.field textarea {
  resize: vertical;
  line-height: 1.35;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.16);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.strategy-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(96px, 0.65fr);
}

.system-note {
  margin: -2px 0 12px;
  border-left: 3px solid var(--brand-2);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 10px 11px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.home-intro {
  margin-top: 0;
}

.home-actions {
  display: grid;
  gap: 9px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 13px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--cta);
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr 44px 44px;
  gap: 8px;
  align-items: center;
}

.primary-button,
.icon-button,
.icon-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  min-width: 0;
  border-radius: var(--pill-radius);
  border: 1px solid transparent;
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-button {
  background: var(--cta-gradient);
  color: #fff;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.24);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(16, 185, 129, 0.28);
}

.primary-button.wide {
  width: 100%;
}

.icon-button {
  background: #fff;
  border-color: var(--line);
  color: var(--brand);
  box-shadow: none;
}

.icon-button:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
}

.icon-text-button {
  width: 100%;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.icon-text-button:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
}

.output-panel {
  display: grid;
  gap: 12px;
  align-self: start;
  align-content: start;
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 78px;
  min-width: 0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.metric span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.help-dot {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.help-dot:hover,
.help-dot:focus-visible {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
  outline: none;
}

.warnings {
  display: grid;
  gap: 8px;
}

.warning-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--surface);
  padding: 11px 12px;
}

.warning-item strong {
  display: block;
  margin-bottom: 2px;
}

.warning-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.warning-item.warning {
  border-left-color: var(--warning);
}

.warning-item.danger {
  border-left-color: var(--danger);
}

.warning-item.ok {
  border-left-color: var(--ok);
}

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

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  background: var(--surface);
  padding: 6px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.table-wrap {
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow);
  max-height: calc(100vh - 250px);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

th,
td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  text-align: center;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  text-align: left;
  background: #fff;
  min-width: 154px;
  max-width: 220px;
}

th.sticky-col {
  z-index: 4;
  background: var(--surface-2);
}

.person-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shift-cell {
  min-width: 44px;
  font-weight: 800;
}

.shift-morning {
  background: var(--morning);
}

.shift-evening {
  background: var(--evening);
}

.shift-night {
  background: var(--night);
  color: var(--ink);
}

.shift-day {
  background: var(--day);
}

.shift-off {
  background: var(--off);
  color: var(--muted-2);
}

.weekend {
  box-shadow: inset 0 3px 0 rgba(0, 113, 227, 0.45);
}

.totals-cell {
  background: #fbfbfd;
  font-weight: 800;
}

.coverage-row td {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
}

.joker-row td {
  background: #ecfdf5;
  color: #0f5132;
  font-weight: 800;
}

.joker-row .joker-detail {
  text-align: left;
  white-space: normal;
  line-height: 1.35;
}

.quick-result {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.location-toolbar {
  margin-bottom: 12px;
}

.locations-editor {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.location-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
}

.location-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.location-head strong {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.location-head input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 9px;
  color: var(--ink);
}

.location-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field.compact {
  margin-bottom: 8px;
}

.mini-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--danger);
}

.mini-icon-button svg {
  width: 18px;
  height: 18px;
}

.project-note {
  width: 100%;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-2);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 11px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.project-note strong {
  color: var(--ink);
}

.project-advice {
  width: 100%;
  border: 1px solid #b7d9cc;
  border-left: 4px solid var(--ok);
  border-radius: var(--radius);
  background: #ecfdf5;
  padding: 11px 12px;
  color: #0f5132;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.project-advice strong {
  color: #064e3b;
}

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

.home-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.home-panel-head {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
}

.home-panel-head strong,
.home-card-head strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.home-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.42;
}

.home-list strong,
.home-small-note strong {
  color: var(--ink);
}

.home-small-note {
  margin: 10px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.table-wrap.home-output {
  max-height: none;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.home-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.home-calc-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand-2);
  border-radius: var(--panel-radius);
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
}

.home-calc-card.has-overtime {
  border-top-color: var(--warning);
}

.home-calc-card.no-overtime {
  border-top-color: var(--ok);
}

.home-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.home-staff-badge {
  flex: 0 0 auto;
  border-radius: var(--pill-radius);
  background: #ecfdf5;
  color: #0f5132;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.home-calc-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.42;
}

.home-formula {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.home-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 7px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.home-stat-row:last-child {
  padding-bottom: 0;
}

.home-stat-row strong {
  color: var(--ink);
  text-align: right;
}

.project-table {
  min-width: 1580px;
}

.alternatives-cell {
  width: 460px;
  min-width: 440px;
  max-width: 520px;
  text-align: left;
  white-space: normal;
  vertical-align: middle;
}

.strategy-cell {
  width: 230px;
  min-width: 220px;
  text-align: left;
  white-space: normal;
  vertical-align: middle;
}

.strategy-box {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 6px 7px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.25;
}

.strategy-box strong,
.strategy-box span {
  display: block;
}

.strategy-box strong {
  color: var(--ink);
}

.strategy-box.saving {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #0f5132;
}

.strategy-box.danger {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #9f1239;
}

.alternatives-box {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  overflow: visible;
}

.alternative-reco {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 6px 7px;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.alternative-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  width: 100%;
  min-width: 0;
  overflow: visible;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.alt-chip {
  flex: 1 1 126px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  width: auto;
  min-width: 0;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 6px;
  background: #fff;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.alt-chip:hover,
.alt-chip:focus-visible {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
  outline: none;
}

.alt-chip.best {
  border-color: var(--ok);
}

.alt-chip.saving,
.alt-chip.same-cost {
  background: #ecfdf5;
  color: #0f5132;
}

.alt-chip.extra-cost {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}

.alt-chip.invalid {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.alt-chip.lower {
  background: #fff8ed;
  color: #7a4b12;
}

.support-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: help;
}

.support-pill.has-support {
  background: #fff8ed;
  border-color: #fed7aa;
  color: #7a4b12;
}

.support-pill.no-support {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #0f5132;
}

.support-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
}

.support-inline {
  cursor: help;
  border-bottom: 1px dotted currentColor;
}

.support-inline:focus-visible {
  border-radius: 3px;
  outline: 2px solid rgba(0, 113, 227, 0.28);
  outline-offset: 2px;
}

.alt-chip-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.alt-chip-main strong,
.alt-chip-main em,
.alt-chip-cost {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alt-chip-main em {
  flex: 0 0 auto;
  font-style: normal;
  color: var(--ink);
}

.alt-chip-cost {
  display: block;
  color: inherit;
  font-size: 10.5px;
  line-height: 1.2;
}

.project-card-list {
  display: none;
}

.project-result-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand-2);
  border-radius: var(--panel-radius);
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
}

.project-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.project-card-head span,
.project-card-section > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-card-head strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
  font-weight: 800;
}

.project-card-head em {
  flex: 0 0 auto;
  border-radius: var(--pill-radius);
  background: #ecfdf5;
  color: #0f5132;
  padding: 6px 9px;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.project-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.project-card-metrics div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 8px;
}

.project-card-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.project-card-metrics strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.project-card-section {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
}

.floating-tooltip {
  position: fixed;
  z-index: 850;
  max-width: min(340px, calc(100vw - 24px));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: #000;
  color: #fff;
  padding: 10px 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  white-space: pre-line;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.floating-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.quick-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.quick-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quick-card strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
}

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

.quick-detail-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand-2);
  border-radius: var(--panel-radius);
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
}

.quick-detail-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-detail-card strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.quick-detail-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

[data-icon] svg {
  width: 18px;
  height: 18px;
  display: block;
}

.rights-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100% - 28px, 1680px);
  margin: 0 auto 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.rights-footer strong,
.rights-footer span {
  display: block;
}

.rights-footer strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.rights-footer span {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
}

.scroll-top {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--brand-2);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover,
.scroll-top:focus-visible {
  background: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  outline: none;
}

.scroll-top svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

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

  .table-wrap {
    max-height: none;
  }

  .home-grid,
  .home-calc-grid,
  .quick-output-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1500px) {
  .table-wrap.project-output {
    max-height: none;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .project-output .project-table {
    display: none;
  }

  .project-card-list {
    display: grid;
    gap: 12px;
  }

  .project-card-list .alternatives-box {
    max-height: none;
  }

  .project-card-list .alternative-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card-list .alt-chip {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .project-card-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 12px;
  }

  h1 {
    font-size: 28px;
  }

  .status-pill {
    white-space: normal;
  }

  .tab-button {
    gap: 5px;
    font-size: 12px;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 12px;
  }

  .field-grid,
  .summary-band,
  .home-grid,
  .home-calc-grid,
  .quick-output-grid {
    grid-template-columns: 1fr;
  }

  .control-panel {
    padding: 12px;
  }

  .button-grid {
    grid-template-columns: 1fr 44px 44px;
  }

  table {
    min-width: 820px;
  }

  .sticky-col {
    min-width: 132px;
  }

  .rights-footer {
    align-items: flex-start;
    padding: 14px;
  }

  .project-card-list .alternative-list,
  .project-card-metrics {
    grid-template-columns: 1fr;
  }

  .scroll-top {
    right: 1.5rem;
    bottom: 1.5rem;
    width: 44px;
    height: 44px;
  }
}

/* TCO blog calculator visual alignment */
html {
  scroll-behavior: smooth;
}

:root {
  --bg: #ffffff;
  --surface: rgba(0, 0, 0, 0.02);
  --surface-2: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --muted-2: #98989d;
  --line: rgba(0, 0, 0, 0.08);
  --nav-bg: rgba(255, 255, 255, 0.85);
  --row-alt: rgba(0, 0, 0, 0.02);
  --brand: #0071e3;
  --brand-2: #0071e3;
  --accent: #5856d6;
  --cta: #0071e3;
  --radius: 12px;
  --panel-radius: 20px;
  --gradient: linear-gradient(135deg, #0071e3 0%, #5856d6 100%);
  --cta-gradient: linear-gradient(135deg, #0071e3 0%, #5856d6 100%);
  --shadow: none;
  font-family: "DM Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --ink: #f5f5f7;
  --muted: #a1a1a6;
  --muted-2: #6e6e73;
  --line: rgba(255, 255, 255, 0.1);
  --nav-bg: rgba(0, 0, 0, 0.85);
  --row-alt: rgba(255, 255, 255, 0.015);
  --brand: #0a84ff;
  --brand-2: #0a84ff;
  --accent: #5e5ce6;
  --cta: #0a84ff;
  --gradient: linear-gradient(135deg, #0a84ff 0%, #5e5ce6 100%);
  --cta-gradient: linear-gradient(135deg, #0a84ff 0%, #5e5ce6 100%);
}

body {
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  width: min(100% - 24px, 840px);
  margin: 0 auto;
  padding: 62px 16px 40px;
}

.topbar {
  position: fixed;
  right: 0;
  left: 0;
  z-index: 1000;
  padding: 0.6rem 1.5rem;
  background: var(--nav-bg);
  border-bottom: 0.5px solid var(--line);
  color: var(--ink);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.topbar::after {
  display: none;
}

.back-link,
.nav-links a,
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.3s, border-color 0.3s, transform 0.3s;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand-2);
}

.back-link svg {
  fill: currentColor;
}

.back-link:hover,
.nav-links a:hover,
.footer-links a:hover {
  color: var(--brand-2);
}

.nav-right,
.nav-links,
.footer-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-links {
  gap: 1.25rem;
}

.theme-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--brand-2);
  cursor: pointer;
  transition: all 0.3s;
}

.theme-button:hover {
  transform: scale(1.15);
}

.theme-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: all 0.5s;
}

.theme-button:hover svg {
  transform: rotate(20deg);
}

.page-header {
  margin-bottom: 36px;
  text-align: center;
}

h1 {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0;
  background: linear-gradient(135deg, var(--ink), var(--muted));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: none;
  padding: 0;
}

.control-panel {
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 0;
  border: 0;
  background: transparent;
}

.tab-button {
  flex: 0 1 auto;
  min-height: 36px;
  border: 1.5px solid var(--line);
  border-radius: var(--pill-radius);
  background: var(--surface);
  color: var(--muted);
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 800;
  transition: all 0.3s;
}

.tab-button.active {
  border-color: var(--brand-2);
  background: var(--brand-2);
  color: #fff;
  box-shadow: none;
}

.field span,
.toggle-row span,
.project-card-head span,
.project-card-section > span,
.quick-detail-card span,
.home-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea,
.location-head input {
  min-height: 46px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 750;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.location-head input:focus {
  border-color: var(--brand-2);
  box-shadow: none;
}

.system-note,
.toggle-row,
.project-note,
.project-advice,
.warning-item,
.legend-chip,
.home-panel,
.home-formula,
.strategy-box,
.alternative-reco,
.alt-chip,
.quick-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.system-note {
  border-left: 0;
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.primary-button,
.icon-button,
.icon-text-button {
  border-radius: 16px;
  min-height: 48px;
  font-weight: 800;
  transition: all 0.3s;
}

.primary-button {
  background: var(--cta-gradient);
  box-shadow: 0 8px 32px rgba(10, 132, 255, 0.2);
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(10, 132, 255, 0.35);
}

.icon-button,
.icon-text-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

.summary-band,
.home-calc-grid,
.quick-output-grid {
  gap: 12px;
}

.metric,
.home-calc-card,
.quick-detail-card,
.project-result-card,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
  box-shadow: none;
}

.metric {
  min-height: 0;
  padding: 20px 16px;
  text-align: center;
}

.metric span {
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric strong {
  color: var(--brand-2);
  font-size: 22px;
  letter-spacing: 0;
}

.table-wrap {
  max-height: none;
}

table {
  font-size: 12px;
}

th {
  color: var(--brand-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  border-bottom: 2px solid rgba(10, 132, 255, 0.3);
}

td {
  color: var(--muted);
}

tbody tr:nth-child(even) td {
  background: var(--row-alt);
}

tbody td:first-child,
.sticky-col {
  color: var(--ink);
  font-weight: 700;
}

.location-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 12px;
}

.project-card-list {
  gap: 12px;
}

.project-result-card,
.home-calc-card,
.quick-detail-card {
  border-top: 1px solid var(--line);
  padding: 20px;
}

.project-card-head strong,
.home-panel-head strong,
.home-card-head strong,
.quick-detail-card strong {
  font-weight: 900;
  letter-spacing: 0;
}

.alt-chip.best,
.alt-chip.saving,
.alt-chip.same-cost,
.strategy-box.saving,
.project-advice {
  border-color: rgba(15, 139, 87, 0.22);
  background: rgba(15, 139, 87, 0.08);
}

.alt-chip.extra-cost,
.alt-chip.invalid,
.strategy-box.danger {
  border-color: rgba(180, 35, 24, 0.2);
  background: rgba(180, 35, 24, 0.08);
}

.floating-tooltip {
  z-index: 999;
  border: 0;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.9);
  padding: 8px 14px;
  box-shadow: none;
  font-weight: 700;
}

.rights-footer {
  display: block;
  width: 100%;
  margin: 4.5rem 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  box-shadow: none;
  padding: 2.85rem clamp(1rem, 4vw, 2rem) 2.65rem;
  text-align: center;
}

.rights-footer p {
  margin: 0;
  color: var(--muted-2);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.45;
}

.rights-footer span {
  margin: 0.45rem auto 0;
  max-width: 720px;
  color: var(--muted-2);
  font-size: 0.78rem;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem 0.7rem;
  margin-top: 1rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  background: #fff;
  padding: 0.58rem 1.1rem;
  color: var(--muted);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--brand-2);
  border-color: rgba(0, 113, 227, 0.28);
  transform: translateY(-1px);
  outline: none;
}

.footer-links svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.footer-links .social-link {
  border-color: transparent;
  color: #fff;
  box-shadow: 0 9px 20px rgba(0, 0, 0, 0.12);
}

.footer-links .social-link:hover,
.footer-links .social-link:focus-visible {
  color: #fff;
  border-color: transparent;
}

.footer-links .social-link-x {
  background: #000;
}

.footer-links .social-link-linkedin {
  background: #2f6fd4;
}

[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .location-head input {
  background: var(--surface-2);
  color: var(--ink);
}

[data-theme="dark"] .metric,
[data-theme="dark"] .home-calc-card,
[data-theme="dark"] .quick-detail-card,
[data-theme="dark"] .project-result-card,
[data-theme="dark"] .table-wrap,
[data-theme="dark"] .location-card,
[data-theme="dark"] .system-note,
[data-theme="dark"] .toggle-row,
[data-theme="dark"] .project-note,
[data-theme="dark"] .warning-item,
[data-theme="dark"] .legend-chip,
[data-theme="dark"] .home-panel,
[data-theme="dark"] .home-formula,
[data-theme="dark"] .strategy-box,
[data-theme="dark"] .alternative-reco,
[data-theme="dark"] .alt-chip,
[data-theme="dark"] .quick-card,
[data-theme="dark"] .personnel-manager,
[data-theme="dark"] .footer-links a,
[data-theme="dark"] .tab-button,
[data-theme="dark"] .icon-button,
[data-theme="dark"] .icon-text-button {
  background: var(--surface);
  border-color: var(--line);
}

[data-theme="dark"] .footer-links a:not(.social-link) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

[data-theme="dark"] .footer-links .social-link-x {
  background: #050505;
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}

[data-theme="dark"] .footer-links .social-link-linkedin {
  background: #0a66c2;
  color: #fff;
}

[data-theme="dark"] .calculation-guide {
  border-color: rgba(52, 211, 153, 0.26);
  border-left-color: #34d399;
  background: rgba(16, 185, 129, 0.12);
}

[data-theme="dark"] .calculation-guide strong {
  color: #6ee7b7;
}

[data-theme="dark"] th,
[data-theme="dark"] th.sticky-col {
  background: var(--surface-2);
}

[data-theme="dark"] .sticky-col,
[data-theme="dark"] .totals-cell {
  background: #050505;
}

[data-theme="dark"] .name-chip-list {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .name-chip button {
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .shift-night,
[data-theme="dark"] .shift-off {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .shift-morning {
  background: rgba(10, 132, 255, 0.14);
}

[data-theme="dark"] .shift-evening {
  background: rgba(94, 92, 230, 0.16);
}

[data-theme="dark"] .shift-day,
[data-theme="dark"] .joker-row td,
[data-theme="dark"] .alt-chip.best,
[data-theme="dark"] .alt-chip.saving,
[data-theme="dark"] .alt-chip.same-cost,
[data-theme="dark"] .strategy-box.saving,
[data-theme="dark"] .project-advice {
  background: rgba(15, 139, 87, 0.14);
}

[data-theme="dark"] .alt-chip.extra-cost,
[data-theme="dark"] .alt-chip.invalid,
[data-theme="dark"] .strategy-box.danger {
  background: rgba(180, 35, 24, 0.16);
}

.export-toolbar {
  display: flex;
  justify-content: center;
  margin: -8px 0 12px;
}

.export-toolbar .icon-text-button {
  width: min(100%, 360px);
  border-color: rgba(10, 132, 255, 0.18);
  background: rgba(10, 132, 255, 0.08);
  color: var(--brand-2);
}

.calculation-guide {
  margin: 0 0 22px;
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-left: 4px solid #10b981;
  border-radius: var(--radius);
  background: rgba(16, 185, 129, 0.09);
  padding: 13px 14px;
  color: var(--ink);
}

.calculation-guide strong {
  display: block;
  margin-bottom: 8px;
  color: #047857;
  font-size: 13px;
  font-weight: 850;
}

.calculation-guide ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.calculation-guide li {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.calculation-guide b {
  color: var(--ink);
  font-weight: 850;
}

.personnel-manager {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
  padding: 14px;
}

.name-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.name-actions .icon-text-button {
  min-height: 40px;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
}

.name-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 38px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.64);
  padding: 9px;
}

.name-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  border: 1px solid rgba(10, 132, 255, 0.18);
  border-radius: var(--pill-radius);
  background: rgba(10, 132, 255, 0.08);
  color: var(--ink);
  padding: 6px 8px 6px 11px;
  font-size: 13px;
  font-weight: 800;
}

.name-chip button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.name-empty,
.name-help {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.name-help {
  margin: 8px 0 0;
}

.name-store[hidden] {
  display: none;
}

.scroll-top {
  z-index: 999;
  background: var(--brand-2);
}

.scroll-top:hover,
.scroll-top:focus-visible {
  background: var(--accent);
}

@media (max-width: 768px) {
  main {
    width: 100%;
    padding: 60px 12px 30px;
  }

  .nav-links {
    display: none;
  }

  .topbar {
    padding: 0.5rem 0.75rem;
  }

  .tab-button {
    padding: 8px 14px;
  }

  .name-actions {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }
}

@media (max-width: 560px) {
  .topbar {
    flex-direction: row;
    align-items: center;
  }

  .status-pill {
    white-space: nowrap;
  }

  .tabs {
    grid-template-columns: none;
  }

  .field-grid,
  .summary-band,
  .home-grid,
  .home-calc-grid,
  .quick-output-grid,
  .project-card-metrics {
    grid-template-columns: 1fr;
  }

  .rights-footer {
    margin-top: 3rem;
    padding: 2.25rem 0.85rem 2rem;
  }

  .rights-footer p {
    font-size: 0.78rem;
  }

  .footer-links {
    gap: 0.5rem;
  }

  .footer-links a {
    min-height: 42px;
    padding: 0.55rem 0.9rem;
    font-size: 0.8rem;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .control-panel,
  .warnings,
  .legend {
    display: none;
  }

  .workspace {
    display: block;
    padding: 0;
  }

  .summary-band {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 10px;
  }

  .table-wrap {
    max-height: none;
    overflow: visible;
    box-shadow: none;
  }

  table {
    min-width: 0;
    font-size: 10px;
  }

  th,
  td {
    padding: 4px;
  }

  .rights-footer {
    margin-top: 12px;
    box-shadow: none;
  }
}
