:root {
  --paper: #efe5d2;
  --paper-strong: #e2d4bd;
  --paper-edge: #f8f0de;
  --ink: #261d17;
  --ink-soft: #625141;
  --orange: #c95b21;
  --orange-deep: #8f3817;
  --cyan: #2b7381;
  --red-pencil: #9e2f21;
  --shadow: 0 24px 50px rgba(48, 33, 20, 0.14);
  --panel-shadow: 0 18px 34px rgba(48, 33, 20, 0.08);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Franklin Gothic Medium", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(201, 91, 33, 0.14), transparent 28%),
    radial-gradient(circle at bottom right, rgba(43, 115, 129, 0.12), transparent 30%),
    linear-gradient(180deg, #f6efdf 0%, #ebdfca 100%);
  overflow-x: hidden;
}

.paper-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 29, 23, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.35;
  mix-blend-mode: multiply;
}

.deckbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  background: rgba(245, 236, 220, 0.84);
  border-bottom: 1px solid rgba(38, 29, 23, 0.12);
  backdrop-filter: blur(18px);
}

.deckbar__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.deckbar__logo {
  width: auto;
  height: 42px;
}

.deckbar__title {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.deckbar__eyebrow,
.panel__eyebrow,
.kicker,
.status-label,
.pack-card__label,
.quick-stat__label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.69rem;
}

.deckbar__title strong,
h1,
h2,
h3 {
  font-family: Rockwell, "Book Antiqua", Georgia, serif;
  letter-spacing: -0.02em;
}

.deckbar__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 10px;
}

.utility-chip,
.small-button {
  border: 1px solid rgba(38, 29, 23, 0.14);
  border-radius: 999px;
  padding: 11px 16px;
  font: inherit;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 18px rgba(48, 33, 20, 0.05);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.utility-chip:hover,
.small-button:hover,
.utility-chip:focus-visible,
.small-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(48, 33, 20, 0.12);
  outline: none;
}

.utility-chip--coffee,
.small-button--file {
  background: rgba(201, 91, 33, 0.12);
  border-color: rgba(201, 91, 33, 0.28);
}

.small-button--danger {
  background: rgba(158, 47, 33, 0.12);
  border-color: rgba(158, 47, 33, 0.28);
}

.account-menu {
  position: relative;
}

.account-menu > summary {
  list-style: none;
}

.account-menu > summary::-webkit-details-marker {
  display: none;
}

.account-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(320px, calc(100vw - 24px));
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(38, 29, 23, 0.12);
  background: rgba(250, 244, 232, 0.98);
  box-shadow: 0 18px 34px rgba(48, 33, 20, 0.12);
}

.account-menu__panel p {
  margin: 0 0 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 44px;
}

.band,
.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(248, 240, 222, 0.96) 0%, rgba(240, 230, 212, 0.96) 100%);
  border: 1px solid rgba(38, 29, 23, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.band::before,
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.intro {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  padding: 28px 30px 24px;
  margin-bottom: 22px;
}

.intro h1 {
  margin: 6px 0 0;
  max-width: 780px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 0.98;
}

.kicker {
  margin: 0;
  color: var(--cyan);
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  max-width: 520px;
}

.status-chip {
  min-width: 150px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px dashed rgba(38, 29, 23, 0.16);
  background: rgba(255, 255, 255, 0.58);
}

.status-chip strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}

.workspace {
  display: grid;
  grid-template-columns: 1.08fr 1.24fr 0.92fr;
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 24px;
  min-height: 320px;
  box-shadow: var(--panel-shadow);
  animation: panel-rise 420ms ease both;
}

.panel--stage {
  animation-delay: 80ms;
}

.panel--pack {
  animation-delay: 150ms;
}

@keyframes panel-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel__head,
.inspector__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.panel__head h2,
.inspector__head h3 {
  margin: 4px 0 0;
  font-size: 1.65rem;
}

.meta-grid,
.field-grid {
  display: grid;
  gap: 12px;
}

.meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

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

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

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

.field span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(38, 29, 23, 0.13);
  border-radius: 18px;
  padding: 12px 14px;
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

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

.field input[readonly] {
  background: rgba(43, 115, 129, 0.08);
  color: var(--cyan);
}

.plane-list,
.preset-strip,
.waste-presets,
.pack-cards,
.quick-stats,
.footnote-grid,
.notes-grid {
  display: grid;
  gap: 12px;
}

.preset-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px 0;
}

.preset-card {
  border: 1px solid rgba(38, 29, 23, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.56);
  padding: 14px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease;
}

.preset-card:hover,
.preset-card:focus-visible {
  border-color: rgba(201, 91, 33, 0.4);
  transform: translateY(-1px);
  outline: none;
}

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

.plane-row__button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  text-align: left;
  border: 1px solid rgba(38, 29, 23, 0.12);
  border-radius: 22px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.54);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.plane-row__button:hover,
.plane-row__button:focus-visible,
.plane-row.is-active .plane-row__button {
  transform: translateX(2px);
  border-color: rgba(43, 115, 129, 0.45);
  background: rgba(43, 115, 129, 0.08);
  outline: none;
}

.plane-row__label,
.plane-row__meta {
  margin: 0;
}

.plane-row__label {
  font-family: Rockwell, "Book Antiqua", Georgia, serif;
  font-size: 1.08rem;
}

.plane-row__meta {
  margin-top: 4px;
  color: var(--ink-soft);
}

.plane-row__metrics {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.mono-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(38, 29, 23, 0.08);
  border: 1px solid rgba(38, 29, 23, 0.12);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.84rem;
}

.mono-chip--accent {
  color: var(--orange-deep);
  background: rgba(201, 91, 33, 0.12);
  border-color: rgba(201, 91, 33, 0.28);
}

.inspector {
  margin-top: 18px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(250, 244, 232, 0.92), rgba(238, 230, 214, 0.92));
  border: 1px solid rgba(38, 29, 23, 0.1);
}

.inspector__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-button {
  border: 1px solid rgba(38, 29, 23, 0.12);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.tab-button.is-active {
  background: rgba(201, 91, 33, 0.12);
  border-color: rgba(201, 91, 33, 0.24);
}

.tab-panel {
  display: none;
  margin-top: 18px;
}

.tab-panel.is-active {
  display: block;
}

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

.quick-stat,
.footnote-card,
.note-panel,
.pack-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(38, 29, 23, 0.1);
  background: rgba(255, 255, 255, 0.58);
}

.quick-stat strong,
.pack-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.55rem, 2vw, 2.3rem);
  font-family: Rockwell, "Book Antiqua", Georgia, serif;
}

.sketchboard {
  margin-top: 14px;
  padding: 18px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(43, 115, 129, 0.08), rgba(43, 115, 129, 0.02)),
    rgba(247, 241, 228, 0.94);
  border: 1px solid rgba(43, 115, 129, 0.18);
}

.sketchboard__label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--cyan);
}

#roofSketch {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  background:
    linear-gradient(rgba(43, 115, 129, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 115, 129, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
}

.footnote-grid,
.notes-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.footnote-card h3,
.note-panel h3,
.export-panel h3,
.pitch-guide h3 {
  margin: 0 0 8px;
  font-size: 1.18rem;
}

.footnote-card p,
.pack-card p,
.export-panel__copy,
.pitch-guide__intro p {
  margin: 0;
  line-height: 1.5;
  color: var(--ink-soft);
}

.pitch-guide__table {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pitch-guide__button {
  border: 1px solid rgba(38, 29, 23, 0.1);
  border-radius: 20px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.58);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.pitch-guide__button.is-match {
  border-color: rgba(201, 91, 33, 0.45);
  background: rgba(201, 91, 33, 0.1);
}

.pitch-guide__button strong {
  display: block;
  font-family: Rockwell, "Book Antiqua", Georgia, serif;
  font-size: 1.18rem;
}

.pitch-guide__button span {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
}

.note-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.55;
}

.waste-presets {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0;
}

.waste-preset {
  border: 1px dashed rgba(38, 29, 23, 0.12);
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.48);
  text-align: center;
  font: inherit;
  cursor: pointer;
}

.waste-preset.is-active {
  border-color: rgba(201, 91, 33, 0.45);
  background: rgba(201, 91, 33, 0.12);
}

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

.export-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(38, 29, 23, 0.1);
  background: rgba(255, 255, 255, 0.54);
}

.export-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

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

  .panel--stage {
    order: -1;
  }
}

@media (max-width: 960px) {
  .deckbar,
  .intro,
  .panel {
    padding-left: 18px;
    padding-right: 18px;
  }

  .intro {
    flex-direction: column;
    align-items: stretch;
  }

  .meta-grid,
  .field-grid,
  .quick-stats,
  .footnote-grid,
  .notes-grid,
  .pack-cards,
  .waste-presets,
  .preset-strip,
  .pitch-guide__table {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100%, calc(100% - 12px));
    padding-top: 14px;
  }

  .deckbar {
    padding: 14px 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .deckbar__brand {
    gap: 10px;
    width: 100%;
  }

  .deckbar__logo {
    height: 32px;
  }

  .deckbar__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .account-menu__panel {
    left: 0;
    right: auto;
  }

  .meta-grid,
  .field-grid,
  .quick-stats,
  .footnote-grid,
  .notes-grid,
  .pack-cards,
  .waste-presets,
  .preset-strip,
  .pitch-guide__table {
    grid-template-columns: 1fr;
  }

  .plane-row__button,
  .panel__head,
  .inspector__head {
    flex-direction: column;
    align-items: stretch;
  }

  .tab-strip {
    width: 100%;
  }

  .tab-button {
    flex: 1 1 0;
  }

  .status-chip {
    width: 100%;
  }
}
