*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Primary = forest green (was cobalt). Accent = terracotta (was gold).
     Variable names kept for backward-compat across components. */
  --cobalt:       #2D6E4E;
  --cobalt-light: #3D8B65;
  --cobalt-pale:  #EAF2EC;
  --cobalt-mid:   #B8D4C2;
  --gold:         #C45C3A;
  --gold-light:   #D87654;
  --gold-pale:    #FBEDE6;
  --gold-mid:     #EFC2AF;
  --green:        #4A7A3A;
  --green-light:  #5E9449;
  --green-pale:   #EDF3E6;
  --green-mid:    #BDD3A8;
  --plum:         #6B4C8A;
  --plum-light:   #8866A8;
  --plum-pale:    #F0EBF5;
  --plum-mid:     #C7B5D8;
  --ink:          #1F2D1B;
  --mist:         #EEF2EB;
  --border:       #D9D3C4;
  --body-text:    #4A5240;
  --muted:        #8A8676;
  --white:        #FFFFFF;
}

html, body {
  height: 100%;
  font-family: 'DM Sans', sans-serif;
  color: var(--ink);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ============ APP SHELL ============ */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--cobalt) 0%, var(--cobalt-light) 50%, var(--gold) 100%);
  display: grid; place-items: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.brand-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(255,255,255,0.35), transparent 50%);
}

.brand-mark span {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  color: var(--white);
  position: relative;
  z-index: 1;
  font-style: italic;
}

.brand-logo {
  width: 44px; height: 44px;
  object-fit: contain;
  margin-right: 4px;
}

.brand-name {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  line-height: 1.15;
  color: var(--ink);
}

.brand-name em {
  color: var(--cobalt-light);
  font-style: italic;
  display: block;
  font-size: 13px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--body-text);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: var(--mist); color: var(--ink); }
.nav-item.active { background: var(--cobalt-pale); color: var(--cobalt); font-weight: 600; }
.nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.nav-item.active .nav-icon { opacity: 1; }

.nav-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  background: var(--mist);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 10px;
}
.nav-item.active .nav-count { background: var(--white); color: var(--cobalt); }

.sidebar-recent {
  margin-top: 8px;
}

.sidebar-recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--body-text);
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}
.sidebar-recent-item:hover { background: var(--mist); color: var(--ink); }
.sidebar-recent-item .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sidebar-recent-item .label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  width: 100%;
}
.user-chip:hover { background: var(--mist); }

.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gold-pale);
  color: var(--gold);
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
  border: 1px solid var(--gold-mid);
}

.user-chip-name { font-size: 13px; font-weight: 500; line-height: 1.2; }
.user-chip-mail { font-size: 11px; color: var(--muted); line-height: 1.2; margin-top: 2px; }

/* ============ MAIN COLUMN ============ */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--body-text);
  min-width: 0;
}
.crumbs .sep { color: var(--muted); }
.crumbs button { font-size: 13px; color: var(--body-text); }
.crumbs button:hover { color: var(--cobalt); }
.crumbs .current {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: var(--body-text);
}
.icon-btn:hover { background: var(--mist); color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 9px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.985); }

.tool-switcher { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 0; flex-wrap: wrap; }
.tool-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--white); border: 1px solid var(--border);
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  color: var(--ink); cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
}
.tool-pill:hover:not(:disabled) { border-color: var(--cobalt); background: #f9f7f2; }
.tool-pill.active { background: var(--cobalt); color: var(--white); border-color: var(--cobalt); cursor: default; }
.tool-pill.active .dot { background: var(--white) !important; }
.tool-pill-label { line-height: 1; }
.tool-pill-check { font-size: 11px; color: var(--green); font-weight: 700; }
.tool-pill.active .tool-pill-check { color: #c5f0d4; }
.tool-pill-dot-prog { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.btn-home-pill {
  display: inline-flex; align-items: center;
  padding: 7px 16px; border-radius: 999px;
  background: var(--cobalt); color: var(--white);
  border: none; font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn-home-pill:hover { background: #122d6a; }
.btn-home-pill:active { transform: scale(0.97); }
.btn-primary { background: var(--gold); color: var(--white); }
.btn-primary:hover { background: var(--gold-light); }

.btn-ghost { background: transparent; color: var(--body-text); }
.btn-ghost:hover { background: var(--mist); color: var(--ink); }

.btn-outline { background: var(--white); color: var(--ink); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--cobalt-mid); color: var(--cobalt); }

.btn-plum { background: var(--plum); color: var(--white); }
.btn-plum:hover { background: var(--plum-light); }

/* ============ PAGE ============ */
.page {
  padding: 36px 40px 80px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cobalt);
  margin-bottom: 12px;
}
.page-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
}

.page-title {
  font-family: 'Fraunces', serif;
  font-size: 38px;
  line-height: 1.13;
  color: var(--ink);
  margin-bottom: 8px;
}
.page-title em { color: var(--cobalt-light); font-style: italic; }

.page-sub {
  font-size: 15px;
  color: var(--body-text);
  font-weight: 300;
  line-height: 1.65;
  max-width: 580px;
}

/* ============ LIBRARY ============ */
.lib-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  flex: 1;
  min-width: 240px;
  max-width: 360px;
  transition: border-color 0.15s;
}
.search:focus-within { border-color: var(--cobalt-mid); }
.search input {
  border: none; outline: none; background: transparent;
  font-size: 14px; flex: 1;
}
.search input::placeholder { color: var(--muted); }

.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--body-text);
  transition: all 0.15s;
}
.chip:hover { border-color: var(--cobalt-mid); color: var(--cobalt); }
.chip.active { background: var(--cobalt); color: var(--white); border-color: var(--cobalt); }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.design-card {
  background: var(--white);
  border-radius: 16px;
  border: 1.5px solid var(--border);
  padding: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, border-color 0.2s;
  width: 100%;
}
.design-card-thumb {
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}
.design-card:hover {
  transform: translateY(-4px);
  border-color: var(--cobalt-mid);
  box-shadow: 0 18px 40px -12px rgba(27, 58, 140, 0.15);
}

.design-card-thumb {
  height: 110px;
  position: relative;
  background: linear-gradient(135deg, var(--cobalt-pale), var(--mist));
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.thumb-progress {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
}
.thumb-segment {
  flex: 1;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.92);
}
.thumb-segment + .thumb-segment { border-left: 1px solid rgba(255,255,255,0.25); }
.thumb-segment.empty { background: var(--mist); color: var(--muted); }
.thumb-segment.s1 { background: var(--cobalt); }
.thumb-segment.s2 { background: var(--gold); }
.thumb-segment.s3 { background: var(--green); }
.thumb-segment.empty::after {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(154,165,196,0.12) 6px, rgba(154,165,196,0.12) 7px);
}

.design-card-body {
  padding: 18px 20px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.design-card-title {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  color: var(--ink);
  line-height: 1.25;
  margin: 0;
}

.design-card-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  align-items: center;
  margin-top: 2px;
}
.design-card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }

.design-card-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.status-pill {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 12px;
}
.status-pill.draft { background: var(--mist); color: var(--body-text); }
.status-pill.progress { background: var(--gold-pale); color: #8A6A0A; }
.status-pill.complete { background: var(--green-pale); color: var(--green); }

.design-card-menu {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 7px;
  color: var(--muted);
}
.design-card-menu:hover { background: var(--mist); color: var(--ink); }

/* New design card */
.new-card {
  border: 2px dashed var(--cobalt-mid);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 32px;
  border-radius: 16px;
  color: var(--cobalt);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  min-height: 230px;
  transition: background 0.15s, border-color 0.15s, transform 0.2s;
}
.new-card:hover {
  background: var(--cobalt-pale);
  border-color: var(--cobalt);
  transform: translateY(-3px);
}
.new-card .plus {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--cobalt);
  color: var(--white);
  display: grid; place-items: center;
  font-size: 22px;
  font-weight: 400;
}

/* Empty state */
.empty {
  background: var(--white);
  border: 1.5px dashed var(--border);
  border-radius: 18px;
  padding: 64px 32px;
  text-align: center;
  max-width: 540px;
  margin: 32px auto;
}
.empty-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--cobalt-pale);
  color: var(--cobalt);
  display: grid; place-items: center;
  margin: 0 auto 18px;
}
.empty-title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  margin-bottom: 8px;
}
.empty-sub { font-size: 14px; color: var(--body-text); margin-bottom: 22px; line-height: 1.65; }

/* ============ WORKSPACE ============ */
.ws-head {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 28px 32px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.ws-head::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--cobalt), var(--gold), var(--green));
}

.ws-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.ws-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--cobalt-light);
  margin-bottom: 8px;
}

.ws-title {
  font-family: 'Fraunces', serif;
  font-size: 30px;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 6px;
}
.ws-title-input {
  font-family: 'Fraunces', serif;
  font-size: 30px;
  line-height: 1.15;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  border-bottom: 2px dashed transparent;
  width: 100%;
  padding: 0 0 2px;
}
.ws-title-input:focus { border-bottom-color: var(--cobalt-mid); }

.ws-meta {
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--body-text);
  margin-top: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.ws-meta-item { display: flex; align-items: center; gap: 6px; }
.ws-meta-item .lbl { color: var(--muted); }

.ws-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
}
.ws-progress-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--mist);
  overflow: hidden;
  display: flex;
}
.ws-progress-bar .seg { height: 100%; transition: flex-grow 0.3s; }
.ws-progress-bar .seg.s1 { background: var(--cobalt); }
.ws-progress-bar .seg.s2 { background: var(--gold); }
.ws-progress-bar .seg.s3 { background: var(--green); }
.ws-progress-label {
  font-size: 12px;
  color: var(--body-text);
  display: flex;
  justify-content: space-between;
}
.ws-progress-label strong { color: var(--ink); font-weight: 600; }

/* Phase cards (workspace) */
.phase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  position: relative;
  margin-bottom: 28px;
}

.phase-card {
  background: var(--white);
  border-radius: 18px;
  border: 1.5px solid var(--border);
  padding: 28px 26px 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  text-align: left;
  cursor: pointer;
  min-height: 280px;
}
.phase-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  border-radius: 18px 18px 0 0;
}
.phase-card.cobalt::before { background: linear-gradient(90deg, var(--cobalt), var(--cobalt-light)); }
.phase-card.gold::before   { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.phase-card.green::before  { background: linear-gradient(90deg, var(--green), var(--green-light)); }
.phase-card:hover { transform: translateY(-4px); }
.phase-card.cobalt:hover { border-color: var(--cobalt-mid); box-shadow: 0 18px 40px -12px rgba(27,58,140,0.15); }
.phase-card.gold:hover   { border-color: var(--gold-mid);   box-shadow: 0 18px 40px -12px rgba(196,154,34,0.15); }
.phase-card.green:hover  { border-color: var(--green-mid);  box-shadow: 0 18px 40px -12px rgba(45,122,79,0.15); }

.phase-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.phase-card.cobalt .phase-num { color: var(--cobalt-light); }
.phase-card.gold   .phase-num { color: var(--gold); }
.phase-card.green  .phase-num { color: var(--green-light); }

.phase-title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 6px;
}
.phase-sub {
  font-size: 13px;
  font-style: italic;
  color: var(--body-text);
  margin-bottom: 16px;
  line-height: 1.5;
}
.phase-desc {
  font-size: 13.5px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--body-text);
  flex: 1;
  margin-bottom: 18px;
}

.phase-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 12px;
  align-self: flex-start;
  margin-bottom: 14px;
}
.phase-status.not-started { background: var(--mist); color: var(--body-text); }
.phase-status.in-progress.cobalt { background: var(--cobalt-pale); color: var(--cobalt); }
.phase-status.complete.cobalt { background: var(--cobalt); color: var(--white); }
.phase-status.in-progress.gold { background: var(--gold-pale); color: #8A6A0A; }
.phase-status.complete.gold { background: var(--gold); color: var(--white); }
.phase-status.in-progress.green { background: var(--green-pale); color: var(--green); }
.phase-status.complete.green { background: var(--green); color: var(--white); }
.phase-status .check {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
.phase-status.complete.cobalt .check, .phase-status.complete.gold .check, .phase-status.complete.green .check {
  background: var(--white); opacity: 1;
}

.phase-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 10px;
  align-self: flex-start;
  color: var(--white);
  transition: gap 0.2s;
}
.phase-card.cobalt .phase-cta { background: var(--cobalt); }
.phase-card.gold   .phase-cta { background: var(--gold); }
.phase-card.green  .phase-cta { background: var(--green); }
.phase-card:hover .phase-cta { gap: 14px; }

/* Bloom's reference card */
.blooms-ref {
  background: var(--white);
  border-radius: 18px;
  border: 1.5px solid var(--plum-mid);
  padding: 26px 30px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.blooms-ref-text { flex: 1; min-width: 220px; }
.blooms-ref-eyebrow {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--plum-light); margin-bottom: 6px;
}
.blooms-ref-title {
  font-family: 'Fraunces', serif;
  font-size: 18px; color: var(--ink); margin-bottom: 4px;
}
.blooms-ref-desc { font-size: 13.5px; color: var(--body-text); line-height: 1.55; }

/* ============ TOOL VIEW ============ */
.tool-shell {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px - 64px);
  min-height: 600px;
}

.tool-bar {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--mist);
  gap: 14px;
}
.tool-bar-title {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tool-bar-title .dot { width: 9px; height: 9px; border-radius: 50%; }
.tool-bar-title .dot.cobalt { background: var(--cobalt); }
.tool-bar-title .dot.gold { background: var(--gold); }
.tool-bar-title .dot.green { background: var(--green); }
.tool-bar-title .dot.plum { background: var(--plum); }

.tool-bar-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.tool-iframe {
  flex: 1;
  border: none;
  width: 100%;
  background: var(--white);
}

/* ============ MODAL ============ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 30, 74, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: fadeIn 0.18s ease;
}

.modal {
  background: var(--white);
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  padding: 32px;
  box-shadow: 0 32px 80px -20px rgba(15, 30, 74, 0.4);
  animation: scaleIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-eyebrow {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--cobalt); margin-bottom: 8px;
}

.modal-title {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  margin-bottom: 6px;
  line-height: 1.2;
}
.modal-title em { color: var(--cobalt-light); font-style: italic; }

.modal-sub {
  font-size: 14px;
  color: var(--body-text);
  margin-bottom: 22px;
  line-height: 1.6;
}

.field { margin-bottom: 18px; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin-bottom: 7px;
}
.field-input, .field-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  background: var(--white);
  outline: none;
  transition: border-color 0.15s;
}
.field-input:focus, .field-textarea:focus { border-color: var(--cobalt); }
.field-textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
.field-help { font-size: 12px; color: var(--muted); margin-top: 5px; }

.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ============ MISC ============ */
.divider-thin { width: 48px; height: 3px; background: linear-gradient(90deg, var(--cobalt), var(--gold)); border-radius: 2px; margin: 12px 0 22px; }

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

@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; flex-direction: row; overflow-x: auto; align-items: center; padding: 12px 16px; }
  .brand { padding: 0; border: none; margin: 0 12px 0 0; }
  .nav-section-label, .sidebar-recent, .sidebar-foot { display: none; }
  .nav-item { white-space: nowrap; padding: 7px 12px; }
  .page { padding: 24px 18px 60px; }
}
