:root {
  color-scheme: light;
  --bg: #f2f7fc;
  --surface: #ffffff;
  --surface-alt: #eaf2f9;
  --border: #c8d8e8;
  --text: #0f1e30;
  --muted: #4a6278;
  --accent: #3873b3;
  --accent-soft: #d9eaf6;
  --danger: #d6453b;
  --radius: 10px;
  --shadow: 0 24px 80px rgba(12, 36, 68, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
  background: linear-gradient(180deg, #deeaf7 0%, #f2f7fc 100%);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 2rem 4% 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
}

.topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  pointer-events: none;
}

.local-data-details {
  position: relative;
}

.local-data-details summary {
  list-style: none;
}

.local-data-details summary::-webkit-details-marker {
  display: none;
}

.local-data-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 400;
}

.local-data-btn:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0.4rem;
  min-width: 160px;
  z-index: 100;
}

.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 5px;
  padding: 0.6rem 0.85rem;
  color: var(--text);
  font-weight: 400;
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--surface-alt);
}

.eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.8rem;
  color: var(--accent);
}

h1,
h2,
h3,
h4 {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 2.8vw, 3rem);
}

.subtitle {
  margin: 0.5rem 0 0;
  color: var(--muted);
  max-width: 38rem;
}

.app-layout {
  display: block;
  width: 100%;
  padding: 2rem 3%;
  box-sizing: border-box;
}

.editor {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
}

.editor .panel {
  min-height: 72vh;
}

.section-group {
  margin-bottom: 1.75rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--muted);
}

label.wide {
  width: 100%;
}

label.full-width {
  width: 100%;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.95rem 1rem;
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(56, 115, 179, 0.18);
}

.button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 400;
  background: var(--surface-alt);
  color: var(--text);
  transition: background-color 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.button.primary {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
  border: none;
}

.button.primary:hover {
  filter: brightness(0.94);
}

.button.secondary {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
}

.button.secondary:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.button.tiny {
  padding: 0.2rem 0.6rem;
  font-size: 0.76rem;
}

.button.danger {
  background: none;
  border: none;
  color: var(--danger);
  opacity: 0.65;
}

.button.danger:hover {
  opacity: 1;
  background: #fff1f0;
}

.list-container {
  display: grid;
  gap: 1rem;
}

.entry-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  background: var(--surface-alt);
}

.entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.subsection {
  padding-top: 0.75rem;
  border-top: 1px solid rgba(21, 41, 88, 0.08);
}

.subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.bullet-row,
.skill-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.skills-list {
  display: grid;
  gap: 0.75rem;
}

.date-range {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.date-range > label {
  flex: 1;
  min-width: 9rem;
}

.mp-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.95rem 1rem;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.mp-trigger:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(56, 115, 179, 0.18);
}

.mp-trigger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.mp-trigger svg {
  flex-shrink: 0;
  color: var(--muted);
}

.mp-placeholder {
  color: var(--muted);
}

#mp-popup {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.6rem;
  width: 220px;
  z-index: 1000;
}

.mp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.mp-header button {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.1rem 0.5rem;
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
}

.mp-header button:hover:not(:disabled) {
  background: var(--surface-alt);
}

.mp-header button:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.mp-year {
  font-weight: 600;
  font-size: 0.95rem;
}

.mp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.2rem;
}

.mp-month {
  background: none;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}

.mp-month:hover:not(:disabled) {
  background: var(--surface-alt);
}

.mp-month:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.mp-month.mp-selected {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.present-label {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.95rem;
  white-space: nowrap;
  flex: 0;
}

.present-label input[type="checkbox"] {
  width: auto;
  padding: 0;
  border: none;
  box-shadow: none;
  accent-color: var(--accent);
}

.tabs-row {
  display: flex;
  align-items: flex-end;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
}

.tab-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.6rem 0 1.25rem;
}

.page-tabs {
  display: flex;
  gap: 0.25rem;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.6rem 1.25rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 0;
  transition: color 120ms ease, border-color 120ms ease;
}

.tab-btn:hover {
  color: var(--accent);
  transform: none;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hidden {
  display: none;
}

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

  .contact-list {
    grid-template-columns: 1fr;
  }
}

.home-link {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  white-space: nowrap;
}

.home-link:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.hero {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 4%;
  text-align: center;
}

.hero-inner {
  max-width: 760px;
  width: 100%;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 540px;
  margin: 0 auto 3rem;
  line-height: 1.65;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 0 0 2.75rem;
  padding: 0;
  list-style: none;
  text-align: left;
}

.step-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.step-num {
  position: absolute;
  top: -0.75rem;
  left: 1.25rem;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--text);
  color: var(--bg, #fff);
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 600;
}

.step-icon {
  display: block;
  height: 150px;
  width: auto;
  margin: 0 auto 1rem;
}

.step-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.step-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

.hero-cta {
  padding: 0.9rem 2.5rem;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block;
}

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

@media print {
  body {
    background: white;
    color: #111;
  }
}

/* Export dialog: template + color selection */
#export-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  max-width: 640px;
  width: calc(100vw - 2rem);
}

#export-dialog::backdrop {
  background: rgba(12, 36, 68, 0.45);
}

#export-dialog h3 {
  margin: 0 0 0.75rem;
}

#export-dialog h3 + .color-choices,
.template-choices {
  margin-bottom: 1.25rem;
}

.template-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.template-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text);
}

.template-card img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.template-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.color-choices {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.color-swatch {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 2px solid transparent;
  outline: 2px solid var(--border);
  outline-offset: 2px;
  cursor: pointer;
}

.color-swatch.selected {
  outline-color: var(--accent);
  outline-width: 3px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

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

.paywall-note {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: right;
}

#pay-step h3 {
  margin-bottom: 0.5rem;
}

.pay-pitch {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  max-width: 32rem;
}
