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

:root {
  --navy: #1e2d4a;
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --cream: #f8f5ef;
  --white: #ffffff;
  --gray-100: #f4f4f4;
  --gray-200: #e8e8e8;
  --gray-500: #888;
  --gray-700: #444;
  --green: #2d7a4f;
  --green-light: #e8f5ee;
  --red: #c0392b;
  --blue: #2563eb;
  --shadow: 0 2px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.14);
  --radius: 10px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--gray-700);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ── */
header {
  background: var(--navy);
  color: white;
  padding: 0;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.header-title h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.header-title p {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 2px;
}
.state-selector select {
  background: rgba(255,255,255,0.12);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.state-selector select option { background: var(--navy); }

/* ── Progress Bar ── */
.progress-bar {
  background: rgba(255,255,255,0.1);
  height: 4px;
}
.progress-fill {
  height: 100%;
  background: var(--gold);
  transition: width 0.4s ease;
}

/* ── Layout ── */
.app-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

/* ── Sidebar ── */
.sidebar {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: sticky;
  top: 20px;
}
.sidebar-header {
  background: var(--navy);
  color: white;
  padding: 14px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.step-list { padding: 8px 0; }
.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  font-size: 0.85rem;
  color: var(--gray-700);
}
.step-item:hover { background: var(--gray-100); }
.step-item.active {
  background: #eef3fb;
  border-left-color: var(--navy);
  color: var(--navy);
  font-weight: 600;
}
.step-item.completed { color: var(--green); }
.step-item.completed .step-num { background: var(--green); color: white; }
.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.15s;
}
.step-item.active .step-num { background: var(--navy); color: white; }
.step-label { flex: 1; line-height: 1.3; }
.sidebar-tools {
  border-top: 1px solid var(--gray-200);
  padding: 8px 0;
}
.tool-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--gray-700);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}
.tool-btn:hover { background: var(--gray-100); }
.tool-btn.active { background: #eef3fb; color: var(--navy); font-weight: 600; }
.tool-icon { font-size: 1.1rem; }

/* ── Main Content ── */
.main-content { min-width: 0; }

/* Intake Card */
.intake-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
}
.intake-card h2 {
  font-size: 1.2rem;
  color: var(--navy);
  margin-bottom: 16px;
}
.intake-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.intake-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gray-500);
  margin-bottom: 6px;
}
.intake-field input, .intake-field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}
.intake-field input:focus, .intake-field select:focus {
  border-color: var(--navy);
}
.intake-result {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}
.intake-result.small-estate {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid #b8e0ca;
}
.intake-result.full-probate {
  background: #fff3e0;
  color: #8B5E00;
  border: 1px solid #ffe0a0;
}

/* Step Card */
.step-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.step-card-header {
  background: var(--navy);
  color: white;
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.step-card-num {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
}
.step-card-title h2 {
  font-size: 1.3rem;
  font-weight: 700;
}
.step-card-title p {
  font-size: 0.88rem;
  opacity: 0.75;
  margin-top: 4px;
}

/* Tabs */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-100);
}
.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
  background: white;
  font-weight: 600;
}

/* Tab Panels */
.tab-panel { display: none; padding: 24px; }
.tab-panel.active { display: block; }

.tab-panel h4 {
  font-size: 1rem;
  color: var(--navy);
  margin: 20px 0 8px;
}
.tab-panel h4:first-child { margin-top: 0; }
.tab-panel p { margin-bottom: 12px; font-size: 0.92rem; }
.tab-panel ul, .tab-panel ol {
  margin: 0 0 12px 20px;
  font-size: 0.92rem;
}
.tab-panel li { margin-bottom: 4px; }
.tab-panel a { color: var(--blue); }
.tab-panel code {
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.tip {
  background: #fffbeb;
  border-left: 3px solid var(--gold);
  padding: 12px 14px;
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
  margin: 16px 0;
  color: #6b5000;
}

/* Checklist */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 0.12s;
  font-size: 0.9rem;
}
.checklist-item:hover { background: var(--gray-100); }
.checklist-item.done {
  background: var(--green-light);
  color: var(--green);
  text-decoration: line-through;
  opacity: 0.8;
}
.checklist-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-200);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: all 0.12s;
}
.checklist-item.done .checklist-checkbox {
  background: var(--green);
  border-color: var(--green);
}
.checklist-checkbox::after {
  content: '✓';
  color: white;
  font-size: 11px;
  display: none;
}
.checklist-item.done .checklist-checkbox::after { display: block; }

.checklist-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: var(--gray-500);
}
.checklist-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.checklist-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.3s;
}

/* Letters */
.letters-grid { display: flex; flex-direction: column; gap: 12px; }
.letter-card {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}
.letter-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--gray-100);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
  gap: 10px;
}
.letter-card-header:hover { background: var(--gray-200); }
.letter-toggle { color: var(--gray-500); font-size: 1rem; }
.letter-body {
  display: none;
  padding: 16px;
  box-sizing: border-box;
}
.letter-body.open { display: block; }
.letter-text {
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  white-space: pre-wrap;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 16px;
  color: var(--gray-700);
  width: 100%;
  box-sizing: border-box;
  min-height: 260px;
  resize: vertical;
  outline: none;
}
.letter-text:focus { border-color: var(--navy); }
.letter-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
}
.btn-primary { background: var(--navy); color: white; }
.btn-primary:hover { background: #162039; }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); filter: brightness(0.95); }
.btn-gold { background: var(--gold); color: var(--navy); font-weight: 600; }
.btn-gold:hover { background: var(--gold-light); }

.copy-toast {
  font-size: 0.78rem;
  color: var(--green);
  display: none;
  align-items: center;
  gap: 4px;
}
.copy-toast.show { display: flex; }

/* Navigation */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}
.step-counter { font-size: 0.82rem; color: var(--gray-500); }

/* Accounting Tool */
.accounting-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.accounting-header {
  background: var(--navy);
  color: white;
  padding: 20px 24px;
}
.accounting-header h2 { font-size: 1.3rem; }
.accounting-header p { font-size: 0.85rem; opacity: 0.7; margin-top: 4px; }
.accounting-body { padding: 24px; }

.accounting-section { margin-bottom: 28px; }
.accounting-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.accounting-section-title h3 {
  font-size: 1rem;
  color: var(--navy);
}

.acct-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.acct-table th {
  background: var(--gray-100);
  padding: 9px 12px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
}
.acct-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray-200);
}
.acct-table tr:hover td { background: var(--gray-100); }
.acct-table input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--gray-700);
  padding: 2px 0;
}
.acct-table input:focus { border-bottom: 1px solid var(--navy); }
.acct-table .del-btn {
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 4px;
  border-radius: 4px;
}
.acct-table .del-btn:hover { color: var(--red); background: #fef2f2; }
.add-row-btn {
  width: 100%;
  padding: 8px;
  background: none;
  border: 1px dashed var(--gray-200);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-top: 6px;
  transition: all 0.15s;
}
.add-row-btn:hover { border-color: var(--navy); color: var(--navy); background: var(--gray-100); }

.summary-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.summary-box {
  background: var(--gray-100);
  border-radius: 8px;
  padding: 14px 16px;
  text-align: center;
}
.summary-box .label { font-size: 0.75rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.4px; }
.summary-box .value { font-size: 1.4rem; font-weight: 700; color: var(--navy); margin-top: 4px; }
.summary-box.positive .value { color: var(--green); }
.summary-box.negative .value { color: var(--red); }

/* Resources panel */
.resources-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.resources-header {
  background: var(--navy);
  color: white;
  padding: 20px 24px;
}
.resources-body { padding: 24px; }
.resource-group { margin-bottom: 24px; }
.resource-group h3 {
  font-size: 0.95rem;
  color: var(--navy);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}
.resource-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--gray-100);
  margin-bottom: 6px;
  text-decoration: none;
  color: var(--gray-700);
  font-size: 0.88rem;
  transition: background 0.15s;
}
.resource-link:hover { background: var(--gray-200); }
.resource-link .icon { font-size: 1.1rem; }
.resource-link strong { color: var(--navy); display: block; font-size: 0.88rem; }
.resource-link span { font-size: 0.8rem; color: var(--gray-500); }
.phone-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--gray-100);
  margin-bottom: 6px;
  font-size: 0.88rem;
}
.phone-item strong { color: var(--navy); }
.phone-item span { color: var(--gray-500); font-family: monospace; }

/* ── Forms Guide ── */
.form-entry {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.form-title {
  background: var(--gray-100);
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.form-required {
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.form-optional {
  background: #e0f2fe;
  color: #075985;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.form-links {
  padding: 8px 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.82rem;
  color: var(--gray-500);
}
.form-dl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--navy);
  color: white;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.form-dl:hover { background: #162039; color: white; }
.form-note { font-size: 0.8rem; color: var(--gray-500); flex: 1; min-width: 180px; }
.form-fields { padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; }
.field-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 8px;
  font-size: 0.83rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--gray-200);
}
.field-row:last-child { border-bottom: none; }
.field-name { font-weight: 600; color: var(--navy); }
.field-inst { color: var(--gray-700); }

/* Responsive */
@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .sidebar { position: static; }
  .intake-grid { grid-template-columns: 1fr; }
  .summary-boxes { grid-template-columns: 1fr 1fr; }
  .header-inner { gap: 12px; }
}

/* Disclaimer */
.disclaimer {
  max-width: 1100px;
  margin: 0 auto 24px;
  padding: 0 24px;
  font-size: 0.78rem;
  color: var(--gray-500);
  text-align: center;
  line-height: 1.5;
}
