:root {
  color: #1d2522;
  background: #eef2ef;
  font-family:
    Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial,
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  background: #eef2ef;
  overflow-x: hidden;
}

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

button {
  border: 1px solid #c9d4ce;
  background: #ffffff;
  color: #1f342c;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 650;
}

button:hover {
  border-color: #37745d;
  color: #0c5a3f;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #182823;
  color: #f5fbf7;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: #0d6264;
}

.brand-block h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.brand-block p {
  margin: 3px 0 0;
  color: #bcd1c8;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.legal-footnote {
  margin-top: auto;
  padding: 12px 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #bcd1c8;
  display: grid;
  gap: 5px;
  font-size: 11px;
  line-height: 1.35;
}

.legal-footnote strong {
  color: #f5fbf7;
  font-size: 12px;
}

.nav-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  text-align: left;
  min-height: 38px;
  background: transparent;
  border: 1px solid transparent;
  color: #d8e6df;
  padding: 0 8px;
}

.nav-item.active {
  background: #ffffff;
  color: #12382a;
  border-color: #ffffff;
}

.material-symbol {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.nav-item.active .material-symbol {
  background: #e4efe9;
}

.workspace {
  padding: 22px;
  overflow: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #67756f;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.topbar-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button-row.compact button {
  min-height: 30px;
}

.primary-button {
  background: #0f7a54;
  border-color: #0f7a54;
  color: white;
}

.ghost-button {
  background: transparent;
}

.save-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: #dfe9e3;
  color: #31453c;
  font-size: 12px;
  font-weight: 750;
}

.save-chip.saving {
  background: #fff0c2;
}

.status-strip {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #d2ddd7;
  background: #ffffff;
  border-radius: 8px;
  color: #42544d;
  margin-bottom: 16px;
}

.view-stack {
  display: grid;
  gap: 16px;
}

.metric-grid,
.project-summary,
.release-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.release-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.metric-card,
.panel,
.layer-card,
.copy-block {
  background: #ffffff;
  border: 1px solid #d2ddd7;
  border-radius: 8px;
}

.metric-card {
  padding: 14px;
}

.metric-card span,
.copy-block span {
  color: #6c7b75;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin: 6px 0;
  font-size: 24px;
  line-height: 1;
}

.metric-card p,
.layer-card p,
.timeline-row p {
  margin: 0;
  color: #66766f;
  font-size: 13px;
}

.split-grid,
.builder-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.4fr);
  gap: 16px;
  align-items: start;
}

.panel {
  padding: 14px;
}

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

.panel-header h3 {
  margin: 0;
  font-size: 17px;
}

.timeline-list,
.product-profit-list {
  display: grid;
  gap: 8px;
}

.timeline-row,
.profit-row {
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e2ebe6;
  border-radius: 6px;
  background: #fbfdfb;
}

.timeline-row {
  grid-template-columns: 12px 1fr auto;
}

.profit-row {
  grid-template-columns: 1fr auto;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #b4c3bb;
}

.status-dot.in-production,
.status-dot.approved {
  background: #0f7a54;
}

.status-dot.proofing {
  background: #c58519;
}

.status-dot.quoted {
  background: #607380;
}

.prompt-box {
  width: 100%;
  min-height: 430px;
  resize: vertical;
  border: 1px solid #ccd8d1;
  border-radius: 8px;
  padding: 12px;
  color: #1d2522;
  background: #fbfdfb;
  line-height: 1.45;
}

.tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0;
  border-bottom: 1px solid #dce6e0;
}

.deal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
  border-bottom: 1px solid #dce6e0;
}

.tab {
  border: 0;
  border-radius: 0;
  background: transparent;
  border-bottom: 3px solid transparent;
}

.tab.active {
  color: #0f7a54;
  border-bottom-color: #0f7a54;
}

.output-block {
  white-space: pre-wrap;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #182823;
  color: #ecf6f0;
  min-height: 260px;
  overflow: auto;
}

.svg-preview-wrap {
  background: #1c2521;
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
}

.svg-preview {
  width: 100%;
  min-height: 260px;
  display: grid;
  place-items: center;
}

.svg-preview svg {
  width: 100%;
  height: auto;
  max-height: 360px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #dce6e0;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #edf2ef;
  font-size: 13px;
  vertical-align: middle;
}

th {
  background: #f4f8f5;
  color: #53645d;
  font-size: 11px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.empty-table-cell {
  color: #66766f;
  text-align: center;
  padding: 24px 12px;
}

.warning-box,
.empty-state {
  border: 1px solid #e7cf95;
  background: #fff8e6;
  color: #614514;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.empty-state {
  border-color: #d3ded7;
  background: #f6faf7;
  color: #53645d;
}

.layer-grid,
.copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.deal-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.layer-card,
.copy-block,
.deal-card {
  padding: 12px;
}

.deal-card {
  background: #ffffff;
  border: 1px solid #d2ddd7;
  border-radius: 8px;
  display: grid;
  gap: 10px;
}

.deal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.deal-card-header strong {
  line-height: 1.25;
}

.deal-card-header span {
  color: #0f7a54;
  font-weight: 850;
  white-space: nowrap;
}

.deal-card p {
  margin: 0;
  color: #53645d;
  font-size: 13px;
  line-height: 1.45;
}

.freshness-note {
  color: #6c7b75;
  font-size: 11px;
  line-height: 1.35;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e4efe9;
  color: #1f4d3c;
  font-size: 11px;
  font-weight: 800;
}

.badge.warning {
  background: #fff0c2;
  color: #6a4811;
}

.layer-card strong {
  display: block;
  margin-bottom: 6px;
}

.layer-card span {
  display: block;
  margin-top: 8px;
  color: #0f7a54;
  font-weight: 800;
}

.copy-block p {
  margin: 8px 0 0;
  line-height: 1.45;
}

.disclaimer-text,
.legal-copy {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .metric-grid,
  .project-summary,
  .deal-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-grid,
  .builder-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  button {
    min-height: 38px;
  }

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    gap: 10px;
    padding: calc(12px + env(safe-area-inset-top)) 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }

  .brand-block {
    gap: 10px;
    padding: 0;
    border-bottom: 0;
  }

  .brand-mark {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
  }

  .brand-block h1 {
    font-size: 19px;
  }

  .brand-block p {
    font-size: 11px;
    line-height: 1.25;
  }

  .nav-list {
    display: flex;
    gap: 8px;
    margin: 0 -12px;
    padding: 0 12px 2px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    grid-template-columns: 24px auto;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .nav-item.active {
    background: #ffffff;
  }

  .material-symbol {
    width: 22px;
    height: 22px;
  }

  .legal-footnote {
    display: none;
  }

  .workspace {
    padding: 14px;
    overflow: visible;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .topbar h2 {
    font-size: 24px;
  }

  .topbar-actions,
  .button-row {
    width: 100%;
    flex-wrap: wrap;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  .topbar-actions .ghost-button,
  .button-row button,
  .panel-header button {
    flex: 1 1 auto;
    min-width: 0;
  }

  .save-chip {
    min-height: 34px;
  }

  .status-strip {
    min-height: 42px;
    line-height: 1.35;
  }

  .metric-grid,
  .project-summary,
  .release-grid,
  .layer-grid,
  .copy-grid,
  .deal-card-grid {
    grid-template-columns: 1fr;
  }

  .panel-header,
  .deal-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .prompt-box {
    min-height: 260px;
  }

  .output-block {
    min-height: 220px;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    flex: 0 0 auto;
  }

  table {
    min-width: 640px;
  }
}

@media (max-width: 420px) {
  .sidebar {
    padding-right: 10px;
    padding-left: 10px;
  }

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

  .brand-block h1 {
    font-size: 18px;
  }

  .workspace {
    padding: 12px;
  }

  .topbar h2 {
    font-size: 23px;
  }

  .metric-card strong {
    font-size: 22px;
  }
}
