:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #e7eef2;
  background: #091118;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 78% 18%, rgb(30 199 202 / 10%), transparent 32rem),
    linear-gradient(145deg, #0c161e 0%, #071017 62%, #0b141a 100%);
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid #22333d;
  background: rgb(9 17 24 / 88%);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #f3b526;
  color: #f3b526;
  font-family: Georgia, serif;
  font-size: 23px;
}

.brand strong,
.brand small {
  display: block;
  letter-spacing: 0.14em;
}

.brand strong {
  color: #f4f7f8;
  font-family: Georgia, serif;
  font-size: 18px;
}

.brand small {
  margin-top: 3px;
  color: #83a0ae;
  font-size: 8px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #b7c9d0;
  font-size: 13px;
}

.header-actions a {
  color: #d8e3e7;
  font-weight: 700;
  text-decoration: none;
}

.header-actions a:hover {
  color: #f3b526;
}

.header-actions form {
  margin: 0;
}

.user-chip {
  padding: 6px 10px;
  border: 1px solid #2c4651;
  background: #10212a;
  color: #91acb8;
}

.page-shell {
  display: grid;
  min-height: calc(100vh - 72px);
  place-items: center;
  padding: 48px 24px;
}

.message-stack {
  position: fixed;
  z-index: 20;
  top: 86px;
  right: 24px;
  width: min(390px, calc(100vw - 32px));
}

.message {
  padding: 14px 16px;
  border: 1px solid #34765d;
  background: #153a2c;
  box-shadow: 0 14px 34px rgb(0 0 0 / 32%);
  color: #c8f1dd;
  font-size: 13px;
}

.hero-card,
.login-card {
  width: min(100%, 760px);
  padding: clamp(30px, 6vw, 64px);
  border: 1px solid #253943;
  background: rgb(13 25 33 / 94%);
  box-shadow: 0 30px 80px rgb(0 0 0 / 35%);
}

.login-card {
  width: min(100%, 480px);
}

.eyebrow {
  margin-bottom: 18px;
  color: #f3b526;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 {
  max-width: 680px;
  margin: 0;
  color: #f6f8f9;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 500;
  line-height: 1.08;
}

.login-card h1 {
  font-size: clamp(32px, 5vw, 42px);
}

.lead {
  max-width: 610px;
  margin: 20px 0 0;
  color: #9cb0ba;
  font-size: 16px;
  line-height: 1.65;
}

.session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 32px;
  padding: 16px 18px;
  border: 1px solid #28444c;
  background: #10242b;
  color: #bfd0d7;
  font-size: 14px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #57d49b;
  box-shadow: 0 0 10px rgb(87 212 155 / 65%);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.filter-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border: 1px solid #2b424d;
  background: #0a171e;
}

.filter-tab {
  min-height: 38px;
  padding: 10px 14px;
  color: #9eb1b9;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 18px;
  text-decoration: none;
}

.filter-tab:hover {
  background: #142832;
  color: #f4f7f8;
}

.filter-tab.is-active {
  background: #f3b526;
  color: #12100a;
}

.catalog-filter-form {
  display: grid;
  grid-template-columns: auto minmax(220px, 360px) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.catalog-filter-form label {
  color: #9eb1b9;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.catalog-filter-form select {
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #35515d;
  background: #0b1c24;
  color: #dce7ea;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  border-color: #f3b526;
  background: #f3b526;
  color: #12100a;
}

.button-primary:hover {
  border-color: #ffd36a;
  background: #ffd36a;
}

.button-secondary {
  border-color: #36505c;
  background: #152731;
  color: #d8e3e7;
}

.button-secondary:hover {
  border-color: #5e7c89;
  background: #1a303b;
}

.button-danger {
  border-color: #a8514b;
  background: #3d201f;
  color: #ffd3cf;
}

.button-danger:hover {
  border-color: #dd7770;
  background: #572a28;
}

.button-full {
  width: 100%;
  margin-top: 8px;
}

.text-button {
  padding: 0;
  border: 0;
  color: #f3b526;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

code {
  color: #f0c65d;
  font-family: "Cascadia Code", Consolas, monospace;
}

.form-alert {
  margin-top: 24px;
  padding: 13px 15px;
  border: 1px solid #7d413e;
  background: #321d1c;
  color: #f0b3ad;
  font-size: 13px;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}

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

.field label {
  color: #bfd0d7;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #354c57;
  border-radius: 0;
  outline: none;
  background: #09151c;
  color: #edf2f4;
  font: inherit;
}

.field input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  accent-color: #f3b526;
}

.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #354c57;
  border-radius: 0;
  outline: none;
  background: #09151c;
  color: #edf2f4;
  font: inherit;
}

.field select {
  min-height: 46px;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
}

.field select:focus,
.field textarea:focus {
  border-color: #f3b526;
  box-shadow: 0 0 0 2px rgb(243 181 38 / 14%);
}

.field input:focus {
  border-color: #f3b526;
  box-shadow: 0 0 0 2px rgb(243 181 38 / 14%);
}

.back-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 0 12px 0 9px;
  border: 1px solid #2c4651;
  background: rgb(16 33 42 / 72%);
  color: #d8e3e7;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.back-link:hover {
  border-color: #52717d;
  background: #152b35;
  color: #f3b526;
  transform: translateX(-2px);
}

.back-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.project-page {
  width: min(100%, 1320px);
  align-self: start;
}

.project-page-narrow {
  width: min(100%, 930px);
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 34px;
}

.page-heading h1 {
  font-size: clamp(38px, 5vw, 58px);
}

.page-heading-compact {
  margin: 16px 0 28px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
}

.project-card {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  padding: 26px;
  border: 1px solid #263d48;
  background: rgb(13 25 33 / 94%);
  box-shadow: 0 18px 50px rgb(0 0 0 / 20%);
}

.project-card:hover {
  border-color: #496773;
  transform: translateY(-1px);
}

.project-card-topline {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #7794a1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid #45626e;
  background: #172b35;
  color: #b9ccd4;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-in_progress {
  border-color: #3b7b69;
  background: #15342b;
  color: #aee4cd;
}

.status-completed {
  border-color: #536c94;
  background: #172a45;
  color: #bed0ec;
}

.status-paused {
  border-color: #826b34;
  background: #342b17;
  color: #edd89f;
}

.status-archived {
  opacity: 0.7;
}

.project-revision {
  color: #6f8b97;
}

.project-card h2,
.detail-panel h2 {
  margin: 18px 0 0;
  color: #f4f7f8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.2;
}

.project-card h2 a {
  text-decoration: none;
}

.project-card h2 a:hover {
  color: #f3c75b;
}

.project-description {
  min-height: 46px;
  margin: 12px 0 22px;
  color: #8ca5b0;
  font-size: 13px;
  line-height: 1.55;
}

.project-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: auto 0 22px;
  padding-top: 18px;
  border-top: 1px solid #263b45;
}

.project-card-meta div,
.detail-list div {
  min-width: 0;
}

.project-card-meta dt,
.detail-list dt {
  margin-bottom: 5px;
  color: #6c8894;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card-meta dd,
.detail-list dd {
  overflow-wrap: anywhere;
  margin: 0;
  color: #c9d7dc;
  font-size: 13px;
  line-height: 1.4;
}

.card-link {
  color: #f3b526;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.empty-state {
  display: grid;
  min-height: 430px;
  place-items: center;
  padding: 50px;
  border: 1px dashed #38515c;
  background: rgb(13 25 33 / 75%);
  text-align: center;
}

.empty-state h2 {
  margin: 16px 0 0;
  font-family: Georgia, serif;
  font-size: 32px;
  font-weight: 500;
}

.empty-state p {
  max-width: 600px;
  margin: 12px auto 24px;
  color: #8ca5b0;
  line-height: 1.65;
}

.empty-mark {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 1px solid #f3b526;
  color: #f3b526;
  font-family: Georgia, serif;
  font-size: 38px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 28px;
  color: #78939f;
  font-size: 13px;
}

.pagination a {
  color: #f3b526;
  font-weight: 700;
}

.project-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  padding: 30px;
  border: 1px solid #263d48;
  background: rgb(13 25 33 / 94%);
}

.field-wide {
  grid-column: 1 / -1;
}

.help-text,
.field-error {
  color: #78939f;
  font-size: 11px;
  line-height: 1.45;
}

.field-error {
  color: #f0aaa4;
}

.template-notes {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid #2a424c;
  background: #0b171e;
}

.template-notes div {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) 1fr;
  gap: 14px;
  color: #78939f;
  font-size: 12px;
  line-height: 1.45;
}

.template-notes strong {
  color: #bdcdd4;
}

.form-actions {
  display: flex;
  gap: 12px;
  padding-top: 10px;
}

.concept-guide-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid #3d5660;
  background:
    linear-gradient(110deg, rgb(243 181 38 / 10%), transparent 55%),
    #0d1b23;
}

.concept-guide-callout h2 {
  margin: 5px 0 6px;
  color: #edf3f4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
}

.concept-guide-callout p {
  max-width: 650px;
  margin: 0;
  color: #8ca5b0;
  font-size: 13px;
  line-height: 1.55;
}

.concept-guide-callout .button {
  flex: 0 0 auto;
}

.guided-concept-form {
  display: grid;
  gap: 18px;
}

.guided-step {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  border: 1px solid #263d48;
  background: rgb(13 25 33 / 94%);
}

.guided-step-number {
  display: grid;
  min-height: 100%;
  place-items: start center;
  padding-top: 26px;
  border-right: 1px solid #263d48;
  color: #f3b526;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
}

.guided-step-content {
  min-width: 0;
  padding: 26px;
}

.guided-step-heading {
  margin-bottom: 22px;
}

.guided-step-heading > span {
  color: #f3b526;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.guided-step-heading h2 {
  margin: 6px 0;
  color: #edf3f4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
}

.guided-step-heading p {
  max-width: 680px;
  margin: 0;
  color: #819ba6;
  font-size: 13px;
  line-height: 1.55;
}

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

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

.measurement-guide {
  display: grid;
  gap: 5px;
  margin: 20px 0;
  padding: 14px 16px;
  border-left: 3px solid #2ca9be;
  background: #0a171d;
}

.measurement-guide strong {
  color: #c6d7dc;
  font-size: 12px;
}

.measurement-guide span {
  color: #78939f;
  font-size: 11px;
  line-height: 1.5;
}

.guided-manual-unit {
  max-width: calc(50% - 10px);
}

.guided-form-actions {
  justify-content: flex-end;
  padding: 8px 0 0;
}

.project-detail-heading {
  align-items: center;
  margin-top: 16px;
}

.project-detail-heading h1 {
  margin-top: 12px;
}

.actions-tight {
  max-width: 680px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 20px;
  border: 1px solid #2b414b;
  background: #0d1a22;
}

.metric-card {
  display: grid;
  gap: 7px;
  min-height: 92px;
  place-items: center;
  align-content: center;
  border-right: 1px solid #2b414b;
}

.metric-card:last-child {
  border-right: 0;
}

.metric-card span {
  color: #75909c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-card strong {
  color: #f2c75f;
  font-family: Georgia, serif;
  font-size: 27px;
  font-weight: 500;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.detail-panel {
  padding: 26px;
  border: 1px solid #263d48;
  background: rgb(13 25 33 / 94%);
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.panel-kicker {
  color: #f3b526;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.detail-panel h2 {
  margin-top: 7px;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 26px;
  margin: 0;
}

.report-panel > p {
  color: #8ca5b0;
  font-size: 13px;
  line-height: 1.55;
}

.report-download-form {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.report-download-form > label {
  color: #a6bac2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.report-download-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.report-download-controls select {
  min-width: 0;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #35515d;
  background: #0b1c24;
  color: #dce7ea;
}

.report-download-form small {
  color: #78939e;
  font-size: 11px;
  line-height: 1.45;
}

.report-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.report-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid #35515d;
  background: #12252e;
  text-decoration: none;
}

.report-card:hover {
  border-color: #f3b526;
}

.report-card strong {
  color: #f1c45a;
  font-size: 14px;
}

.report-card span {
  color: #86a0ab;
  font-size: 12px;
  line-height: 1.5;
}

.estimate-panel {
  margin-top: 20px;
}

.panel-heading-total {
  align-items: center;
}

.grand-total {
  display: grid;
  gap: 5px;
  text-align: right;
}

.grand-total span {
  color: #708b97;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.grand-total strong {
  color: #f3b526;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 500;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #2b414b;
}

.table-actions {
  white-space: nowrap;
}

.table-actions a {
  display: inline-flex;
  padding: 5px 8px;
  border: 1px solid #35515d;
  color: #c7d8de;
  text-decoration: none;
}

.table-actions a + a {
  margin-left: 5px;
}

.table-actions a:hover {
  border-color: #f3b526;
  color: #f3b526;
}

.import-upload-form {
  display: grid;
  max-width: 760px;
  gap: 12px;
}

.import-upload-form > label {
  color: #e7edef;
  font-weight: 800;
}

.import-upload-form input[type="file"] {
  padding: 14px;
  border: 1px dashed #3d5965;
  background: #0a171e;
  color: #b8c8ce;
}

.import-upload-form small {
  color: #829ba5;
  line-height: 1.5;
}

.import-preview {
  margin-top: 22px;
}

.import-summary {
  color: #9eb1b9;
  font-size: 12px;
}

.import-summary strong {
  color: #f3b526;
}

.import-row-invalid,
.import-row-duplicate {
  background: rgb(126 42 38 / 18%);
}

.import-row-existing {
  background: rgb(168 110 11 / 15%);
}

.schedule-gantt {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid #28424d;
  background: #0d1b22;
}

.schedule-gantt-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.schedule-gantt-heading h2 {
  margin: 3px 0 0;
  font-size: clamp(22px, 3vw, 32px);
}

.schedule-gantt-heading > span {
  color: #a9bec7;
  font-size: 12px;
  font-weight: 750;
}

.schedule-gantt-scroll {
  overflow-x: auto;
  border: 1px solid #2a424c;
}

.gantt-chart {
  display: grid;
  min-width: 760px;
  grid-template-columns: minmax(180px, 240px) minmax(560px, 1fr);
  grid-template-rows: 34px repeat(var(--gantt-rows), 46px);
  background: #102129;
}

.gantt-corner,
.gantt-label {
  padding: 0 12px;
  border-right: 1px solid #304955;
  border-bottom: 1px solid #263e48;
}

.gantt-corner {
  display: flex;
  align-items: center;
  color: #8fa8b2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gantt-label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.gantt-label strong {
  overflow: hidden;
  color: #e8eef0;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-label span {
  color: #829ba5;
  font-size: 10px;
}

.gantt-timeline {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid #263e48;
}

.gantt-months span {
  position: absolute;
  inset-block: 0;
  display: flex;
  min-width: 46px;
  align-items: center;
  justify-content: center;
  border-left: 1px solid #35515d;
  color: #a9bec7;
  font-size: 10px;
  font-weight: 750;
}

.gantt-gridline {
  position: absolute;
  inset-block: 0;
  border-left: 1px solid rgb(82 111 123 / 34%);
}

.gantt-bar {
  position: absolute;
  top: 10px;
  display: flex;
  min-width: 5px;
  height: 26px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #ffc54a;
  background: linear-gradient(90deg, #d88d1f, #f0b333);
  color: #182026;
  box-shadow: 0 5px 14px rgb(0 0 0 / 22%);
}

.gantt-bar b {
  padding: 0 7px;
  font-size: 10px;
  white-space: nowrap;
}

.schedule-gantt-empty {
  margin-bottom: 24px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  color: #c6d4d9;
  font-size: 12px;
}

.data-table th {
  padding: 12px;
  border-bottom: 1px solid #3a515b;
  background: #10222b;
  color: #829ca7;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid #263b45;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.numeric {
  font-variant-numeric: tabular-nums;
  text-align: right !important;
  white-space: nowrap;
}

.price-notice {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #725c2e;
  background: #2b2518;
  color: #d7bd7c;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
}

.empty-inline {
  padding: 24px;
  border: 1px dashed #35505b;
  color: #819ba6;
  text-align: center;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding: 20px 24px;
  border: 1px solid #5e3533;
  background: #231817;
}

.danger-zone div {
  display: grid;
  gap: 5px;
}

.danger-zone strong {
  color: #edc1bd;
}

.danger-zone span {
  color: #9f7773;
  font-size: 12px;
}

.confirm-card {
  border-color: #623936;
}

@media (max-width: 620px) {
  .site-header {
    padding: 0 18px;
  }

  .header-actions > a,
  .user-chip {
    display: none;
  }

  .page-shell {
    padding: 24px 14px;
  }

  .session-card {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .session-card {
    flex-direction: column;
  }

  .actions,
  .button {
    width: 100%;
  }

  .filter-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .filter-tab {
    text-align: center;
  }

  .catalog-filter-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-heading,
  .project-detail-heading,
  .concept-guide-callout,
  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .project-form,
  .guided-fields,
  .guided-percentage-grid,
  .detail-layout,
  .report-actions {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .guided-step {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .guided-step-content {
    padding: 22px 18px;
  }

  .guided-manual-unit {
    max-width: none;
  }

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

  .metric-card:nth-child(3) {
    border-right: 0;
  }

  .metric-card:nth-child(-n + 3) {
    border-bottom: 1px solid #2b414b;
  }

  .actions-tight,
  .form-actions {
    flex-direction: column;
  }

  .detail-list,
  .project-card-meta {
    grid-template-columns: 1fr;
  }

  .panel-heading-total {
    align-items: flex-start;
    flex-direction: column;
  }

  .grand-total {
    text-align: left;
  }
}

.theme-toggle {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #2c4651;
  background: #10212a;
  color: #b7c9d0;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: #52717d;
  color: #f3b526;
}

.theme-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.theme-icon-moon,
[data-theme="light"] .theme-icon-sun {
  display: none;
}

[data-theme="light"] .theme-icon-moon {
  display: block;
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-shell > :not(.message-stack) {
  animation: page-enter 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: 140ms ease-out both fade-out;
}

::view-transition-new(root) {
  animation: 280ms cubic-bezier(0.22, 1, 0.36, 1) both page-enter;
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

[data-theme="light"] {
  color-scheme: light;
  background: #edf1f2;
}

[data-theme="light"] body {
  background:
    radial-gradient(circle at 78% 18%, rgb(35 157 166 / 10%), transparent 34rem),
    linear-gradient(145deg, #f7f8f6 0%, #edf1f2 62%, #f5f2ea 100%);
  color: #18252c;
}

[data-theme="light"] .site-header {
  border-color: #cbd6da;
  background: rgb(248 250 249 / 90%);
}

[data-theme="light"] .brand strong,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] .project-card h2 a {
  color: #132128;
}

[data-theme="light"] .brand small,
[data-theme="light"] .lead,
[data-theme="light"] .header-actions,
[data-theme="light"] .project-card p,
[data-theme="light"] .field-help,
[data-theme="light"] .detail-meta,
[data-theme="light"] .report-card p {
  color: #5c737d;
}

[data-theme="light"] .header-actions a,
[data-theme="light"] .text-button {
  color: #263b44;
}

[data-theme="light"] .theme-toggle,
[data-theme="light"] .user-chip,
[data-theme="light"] .back-link {
  border-color: #c2d0d5;
  background: #fff;
  color: #314a55;
}

[data-theme="light"] .hero-card,
[data-theme="light"] .login-card,
[data-theme="light"] .project-card,
[data-theme="light"] .detail-panel,
[data-theme="light"] .report-card,
[data-theme="light"] .form-card,
[data-theme="light"] .budget-panel,
[data-theme="light"] .guided-step,
[data-theme="light"] .danger-zone {
  border-color: #cbd6da;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 22px 60px rgb(37 55 63 / 12%);
}

[data-theme="light"] .session-card,
[data-theme="light"] .metric-grid,
[data-theme="light"] .project-card-meta,
[data-theme="light"] .report-note,
[data-theme="light"] .measurement-guide,
[data-theme="light"] .empty-inline {
  border-color: #cbd8dc;
  background: #f1f6f6;
  color: #37505a;
}

[data-theme="light"] .button-secondary {
  border-color: #aebfc6;
  background: #f5f8f8;
  color: #233941;
}

[data-theme="light"] .concept-guide-callout {
  border-color: #c4d2d6;
  background:
    linear-gradient(110deg, rgb(184 117 0 / 10%), transparent 55%),
    rgb(255 255 255 / 94%);
}

[data-theme="light"] .concept-guide-callout h2,
[data-theme="light"] .guided-step-heading h2 {
  color: #20343d;
}

[data-theme="light"] .concept-guide-callout p,
[data-theme="light"] .guided-step-heading p {
  color: #526d78;
}

[data-theme="light"] .guided-step-number {
  border-color: #cbd6da;
  color: #9a6300;
}

[data-theme="light"] .filter-tabs {
  border-color: #c3d0d5;
  background: #eef3f4;
}

[data-theme="light"] .filter-tab {
  color: #405b65;
}

[data-theme="light"] .filter-tab:hover {
  background: #dce6e9;
  color: #172b33;
}

[data-theme="light"] .filter-tab.is-active {
  background: #b87500;
  color: #ffffff;
}

[data-theme="light"] .catalog-filter-form label {
  color: #405b65;
}

[data-theme="light"] .catalog-filter-form select {
  border-color: #aebfc6;
  background: #fff;
  color: #17272e;
}

[data-theme="light"] .table-actions a {
  border-color: #b8c8ce;
  color: #29424c;
}

[data-theme="light"] .table-actions a:hover {
  border-color: #9a6300;
  color: #704700;
}

[data-theme="light"] .import-upload-form > label {
  color: #20343d;
}

[data-theme="light"] .import-upload-form input[type="file"] {
  border-color: #aebfc6;
  background: #f5f8f8;
  color: #29424c;
}

[data-theme="light"] .field input,
[data-theme="light"] .field textarea,
[data-theme="light"] .field select {
  border-color: #b9c9cf;
  background: #fff;
  color: #17272e;
}

[data-theme="light"] .field label {
  color: #405861;
}

[data-theme="light"] .budget-table th {
  background: #e7eeee;
  color: #506974;
}

[data-theme="light"] .budget-table td,
[data-theme="light"] .budget-table th,
[data-theme="light"] .metric-card {
  border-color: #cfdbde;
}

[data-theme="light"] .budget-table td,
[data-theme="light"] .detail-list dd,
[data-theme="light"] .project-card-meta dd {
  color: #263b44;
}

[data-theme="light"] .panel-kicker,
[data-theme="light"] .grand-total strong {
  color: #7a4b00;
}

[data-theme="light"] .grand-total span,
[data-theme="light"] .report-panel > p,
[data-theme="light"] .report-download-form small {
  color: #405d68;
}

[data-theme="light"] .report-download-form > label {
  color: #324d58;
}

[data-theme="light"] .report-download-controls select {
  border-color: #aebfc6;
  background: #fff;
  color: #17272e;
}

[data-theme="light"] .table-scroll {
  border-color: #bdcdd2;
}

[data-theme="light"] .schedule-gantt {
  border-color: #c4d2d6;
  background: #fff;
  box-shadow: 0 16px 40px rgb(37 55 63 / 9%);
}

[data-theme="light"] .schedule-gantt-heading > span {
  color: #526d78;
}

[data-theme="light"] .schedule-gantt-scroll {
  border-color: #bdcdd2;
}

[data-theme="light"] .gantt-chart {
  background: #f8faf9;
}

[data-theme="light"] .gantt-corner,
[data-theme="light"] .gantt-label,
[data-theme="light"] .gantt-timeline {
  border-color: #d3dee1;
}

[data-theme="light"] .gantt-corner,
[data-theme="light"] .gantt-label span,
[data-theme="light"] .gantt-months span {
  color: #506a74;
}

[data-theme="light"] .gantt-label strong {
  color: #1d3038;
}

[data-theme="light"] .gantt-months span {
  border-color: #cbd8dc;
}

[data-theme="light"] .data-table {
  color: #20343d;
}

[data-theme="light"] .data-table th {
  border-color: #bdcdd2;
  background: #e4ecee;
  color: #38545f;
}

[data-theme="light"] .data-table td {
  border-color: #d5e0e3;
}

[data-theme="light"] .data-table tbody tr:nth-child(even) {
  background: #f5f8f8;
}

[data-theme="light"] .data-table code {
  color: #674200;
}

[data-theme="light"] .danger-zone span {
  color: #506872;
}

[data-theme="light"] .danger-zone strong {
  color: #8b2f2a;
}

@media (max-width: 620px) {
  .report-download-controls {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1050px) {
  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
