:root {
  --red: #ed321d;
  --pink: #f385af;
  --teal: #55bca8;
  --teal-soft: #dff4ef;
  --ink: #071817;
  --muted: #697674;
  --line: #dbe4e2;
  --paper: #f4f6f6;
  --white: #ffffff;
  --arsenal-redwood: #851c25;
  --arsenal-sand: #f7c995;
  --arsenal-light-graphite: #cfc9c9;
  --arsenal-dark-sand: #d8a380;
  --arsenal-sepia: #9c5b4a;
  --arsenal-graphite: #111111;
  --arsenal-offwhite: #f8f6f3;
}

@font-face {
  font-family: "Helios Extended";
  src: url("/assets/arsenal-east/fonts/heliosext.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Helios Extended";
  src: url("/assets/arsenal-east/fonts/heliosext_bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 11px 14px;
  color: var(--white);
  background: var(--red);
  cursor: pointer;
  font-weight: 800;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.ghost {
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
}

button.compact {
  padding: 8px 10px;
  font-size: 12px;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  background: var(--white);
  color: var(--ink);
}

.project-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: #eef2f1;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-toggle-button {
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
}

.project-toggle-button.active {
  color: var(--white);
  background: var(--red);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 58fr) minmax(440px, 42fr);
  background: var(--arsenal-offwhite);
  color: var(--arsenal-graphite);
  font-family: "Helios Extended", Arial, sans-serif;
}

.login-brand-panel {
  position: relative;
  min-height: 100vh;
  padding: clamp(36px, 5vw, 74px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background: var(--arsenal-redwood);
  color: var(--arsenal-sand);
}

.login-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(63deg, transparent 42%, rgba(247, 201, 149, 0.72) 43% 52%, transparent 53%),
    linear-gradient(117deg, transparent 45%, rgba(156, 91, 74, 0.65) 46% 54%, transparent 55%);
  background-size: 76px 46px;
  background-position: 38px 26px;
  mask-image: linear-gradient(90deg, transparent 0 8%, #000 30%, #000 82%, transparent 100%);
}

.login-brand-panel::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 1px;
  height: 100%;
  background: rgba(247, 201, 149, 0.52);
}

.arsenal-wordmark,
.login-statement,
.login-projects {
  position: relative;
  z-index: 1;
}

.arsenal-wordmark {
  width: fit-content;
  display: grid;
  gap: 1px;
  color: var(--arsenal-sand);
  text-transform: none;
  letter-spacing: -0.02em;
  line-height: 0.9;
}

.arsenal-wordmark span {
  font-size: clamp(24px, 2.3vw, 38px);
  font-weight: 700;
}

.arsenal-wordmark small {
  justify-self: end;
  padding-right: 3px;
  font-size: clamp(6px, 0.55vw, 9px);
  font-weight: 700;
  letter-spacing: 0.38em;
}

.login-statement {
  align-self: center;
  max-width: 680px;
}

.login-kicker,
.login-eyebrow,
.login-secure,
.login-projects {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  line-height: 1.4;
}

.login-kicker {
  margin-bottom: 24px;
  color: rgba(247, 201, 149, 0.74);
}

.login-statement h1 {
  max-width: 640px;
  color: #ffffff;
  font-size: clamp(54px, 7vw, 104px);
  line-height: 0.98;
  font-weight: 700;
}

.login-projects {
  color: rgba(247, 201, 149, 0.72);
}

.login-panel {
  min-height: 100vh;
  padding: clamp(34px, 6vw, 92px);
  display: flex;
  align-items: center;
  background: var(--arsenal-offwhite);
}

.login-panel-inner {
  width: min(440px, 100%);
  margin: 0 auto;
}

.login-eyebrow {
  margin-bottom: 18px;
  color: var(--arsenal-sepia);
}

.login-panel h2 {
  max-width: 360px;
  color: var(--arsenal-redwood);
  font-size: clamp(34px, 3vw, 52px);
  line-height: 1.05;
  font-weight: 400;
}

.login-copy {
  max-width: 340px;
  margin: 16px 0 42px;
  color: var(--arsenal-sepia);
  font-size: 13px;
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 22px;
}

.login-form label {
  gap: 10px;
  color: var(--arsenal-sepia);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-family: "Helios Extended", Arial, sans-serif;
  font-size: 10px;
}

.login-form input {
  height: 48px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(17, 17, 17, 0.34);
  border-radius: 0;
  background: transparent;
  color: var(--arsenal-graphite);
  font-size: 15px;
}

.login-form input:focus {
  outline: none;
  border-bottom-color: var(--arsenal-redwood);
  box-shadow: 0 1px 0 var(--arsenal-redwood);
}

.login-form button {
  height: 52px;
  margin-top: 10px;
  color: var(--arsenal-redwood);
  background: var(--arsenal-sand);
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: "Helios Extended", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.login-form button:hover {
  background: var(--arsenal-dark-sand);
}

.login-secure {
  margin-top: 58px;
  padding-top: 20px;
  color: rgba(156, 91, 74, 0.82);
  border-top: 1px solid rgba(156, 91, 74, 0.22);
}

@media (max-width: 860px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: 46vh;
    padding: 34px;
  }

  .login-panel {
    min-height: 54vh;
    padding: 34px;
  }

  .login-statement h1 {
    font-size: clamp(34px, 10vw, 48px);
  }
}

@media (max-width: 430px) {
  .login-brand-panel,
  .login-panel {
    padding: 30px;
  }

  .login-statement h1 {
    font-size: 37px;
  }
}

.brand {
  color: var(--red);
  font-size: 50px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.brand.small {
  font-size: 28px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  font-size: 15px;
}

.stack {
  display: grid;
  gap: 15px;
  margin-top: 24px;
}

.error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.hint,
.meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.topbar {
  height: 72px;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.topbar > div {
  display: flex;
  align-items: center;
  gap: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: 340px minmax(420px, 0.82fr) minmax(520px, 1.5fr);
  gap: 16px;
  padding: 16px;
}

.setup-panel,
.payment-panel,
.preview-panel {
  min-width: 0;
  display: grid;
  gap: 16px;
  align-content: start;
}

.panel {
  min-width: 0;
  padding: 16px;
  display: grid;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

.summary dl div {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(0, 1.2fr);
  gap: 10px;
  align-items: baseline;
}

.summary dt {
  color: var(--muted);
}

.summary dd {
  min-width: 0;
  margin: 0;
  text-align: right;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.unit-picker {
  position: relative;
}

.select-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  color: var(--ink);
  background: var(--teal-soft);
  border: 1px solid #b7dfd6;
}

.select-button::after {
  content: "⌄";
  color: var(--muted);
}

.unit-dropdown {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 10px;
  display: grid;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(7, 24, 23, 0.15);
}

.unit-options {
  max-height: 360px;
  overflow: auto;
  display: grid;
  gap: 4px;
}

.unit-option {
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: center;
  padding: 8px;
  border-radius: 6px;
  color: var(--ink);
}

.unit-option:hover {
  background: #f5fbfa;
}

.unit-option input {
  width: auto;
}

.unit-option strong {
  display: block;
  color: var(--red);
}

.unit-option small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.selected-chips {
  min-height: 72px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.selected-chips.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.chip strong {
  color: var(--red);
}

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

.offer-mode-toggle {
  grid-template-columns: 1fr 1fr;
}

.special-offer-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #ead7c8;
  border-radius: 8px;
  background: #fff8f4;
}

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

.payment-controls button {
  grid-column: 1 / -1;
}

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

.download-button {
  grid-column: 1 / -1;
  display: block;
  border-radius: 6px;
  padding: 12px 14px;
  text-align: center;
  color: var(--ink);
  background: var(--teal-soft);
  border: 1px solid #b7dfd6;
  text-decoration: none;
  font-weight: 900;
}

.actions .error {
  grid-column: 1 / -1;
}

.saved-path {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.content-slides-panel {
  gap: 12px;
  align-content: start;
}

.content-slide-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.content-slide-presets button {
  padding: 8px 7px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 11px;
}

.content-slide-presets button:nth-last-child(2) {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
}

.content-slide-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.content-slide-builder > section {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.content-slide-builder > section > h3 {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
}

.content-slide-list,
.offer-structure {
  min-height: 520px;
  max-height: calc(100vh - 270px);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 2px;
}

.content-slide-group {
  display: grid;
  gap: 6px;
}

.content-slide-group h3 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.content-slide-card,
.offer-slide-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  color: var(--ink);
  background: #fbfcfc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.content-slide-card.selected {
  background: var(--teal-soft);
  border-color: #b7dfd6;
}

.content-slide-info,
.offer-slide-item > span:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.content-slide-info strong,
.offer-slide-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-slide-info small,
.offer-slide-item small {
  color: var(--muted);
  font-size: 11px;
}

.content-slide-actions {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.content-slide-actions button,
.content-slide-actions a {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.offer-section {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.offer-section.drag-over {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.offer-section-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
}

.offer-section-head span {
  color: var(--muted);
}

.offer-base {
  padding: 7px 8px;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}

.offer-section-slides {
  display: grid;
  gap: 6px;
}

.offer-section-empty {
  min-height: 42px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 6px;
  font-size: 11px;
  text-align: center;
}

.content-slide-actions button:disabled {
  opacity: 0.35;
}

.content-slide-empty {
  min-height: 76px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  text-align: center;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.central-tabs-panel {
  padding: 8px;
}

.table-panel .panel-heading {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.payment-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: #eef2f1;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tab-button {
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
  font-size: 12px;
}

.tab-button.active {
  color: var(--ink);
  background: var(--white);
}

.main-work-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: #eef2f1;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.main-work-tabs .tab-button {
  padding: 11px 12px;
  font-size: 13px;
}

.main-work-tabs .tab-button.active {
  color: var(--white);
  background: var(--red);
}

.payment-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.save-plan-button {
  color: var(--white);
  background: var(--red);
}

.save-plan-form {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.payment-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.check-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.check-card span,
.check-card small {
  color: var(--muted);
  font-size: 12px;
}

.check-card strong {
  font-size: 18px;
}

.check-card.under {
  border-color: #81d2c2;
  background: #eefbf8;
}

.check-card.over {
  border-color: var(--red);
  background: #fff0ed;
}

.check-card.exact {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.payment-table-wrap {
  max-height: calc(100vh - 120px);
  overflow: auto;
  scrollbar-gutter: stable;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #fbfcfc;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.payment-table input {
  min-width: 92px;
  padding: 8px 9px;
}

.payment-number {
  width: 42px;
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}

.payment-table th:first-child {
  width: 42px;
  text-align: center;
}

.payment-table th:last-child,
.payment-table td:last-child {
  width: 134px;
}

.empty-row td {
  height: 120px;
  color: var(--muted);
  text-align: center;
}

.remove-row {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: #eef2f1;
  font-size: 17px;
  line-height: 1;
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.apply-plan {
  padding: 7px 9px;
  font-size: 11px;
  color: var(--ink);
  background: var(--teal-soft);
  border: 1px solid #b7dfd6;
}

.saved-plan-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.delete-plan {
  padding: 7px 9px;
  font-size: 11px;
  color: var(--white);
  background: var(--red);
}

.copy-row {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--white);
  background: var(--teal-soft);
  border: 1px solid #b7dfd6;
  background: var(--red);
  font-size: 20px;
  line-height: 1;
}

.saved-plans-view {
  padding: 0 0 10px;
}

.saved-plans-table td strong {
  display: block;
}

.saved-plans-table td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.preview-card {
  min-height: calc(100vh - 104px);
  grid-template-rows: auto minmax(0, 1fr);
}

.preview-empty {
  min-height: 520px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  text-align: center;
}

.pdf-preview {
  width: 100%;
  height: calc(100vh - 176px);
  min-height: 560px;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f1;
}

.preview-loading {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.preview-page {
  display: grid;
  gap: 8px;
  margin: 0 auto 18px;
}

.preview-page-label {
  width: fit-content;
  padding: 5px 8px;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}

.preview-page canvas {
  max-width: 100%;
  height: auto;
  display: block;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 10px 25px rgba(7, 24, 23, 0.12);
}

a.meta {
  color: var(--red);
  text-decoration: none;
  font-weight: 800;
}

@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: 320px minmax(440px, 1fr);
  }

  .preview-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .topbar {
    height: auto;
    gap: 12px;
    align-items: flex-start;
  }

  .topbar > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .actions,
  .payment-controls,
  .save-plan-form,
  .content-slide-builder {
    grid-template-columns: 1fr;
  }

  .content-slide-presets {
    grid-template-columns: 1fr 1fr;
  }

  .content-slide-list,
  .offer-structure {
    min-height: 260px;
    max-height: 420px;
  }
}
