:root {
  color-scheme: light;
  --navy: #071321;
  --navy-2: #0d233d;
  --blue: #1457b8;
  --blue-bright: #0868ed;
  --blue-dark: #0f3f84;
  --green: #2dd87a;
  --green-dark: #128044;
  --ink: #14213d;
  --muted: #586174;
  --line: #d9e1ee;
  --soft: #eef5ff;
  --paper: #ffffff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--navy);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid #70a9ff; outline-offset: 3px; }

.skip-link {
  background: white;
  color: var(--blue);
  left: 1rem;
  padding: 0.6rem 0.9rem;
  position: absolute;
  text-decoration: none;
  top: -5rem;
  z-index: 20;
}

.skip-link:focus { top: 1rem; }

.tool-header {
  background: rgba(4, 17, 32, 0.97);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: white;
}

.tool-nav {
  align-items: center;
  display: flex;
  gap: 1.2rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1120px;
  padding: 0.95rem 1.25rem;
}

.tool-brand {
  align-items: center;
  display: inline-flex;
  font-size: 1.1rem;
  font-weight: 800;
  gap: 0.68rem;
  text-decoration: none;
}

.tool-brand img { border-radius: 10px; height: 38px; transform: rotate(-8deg); width: 38px; }
.tool-links { align-items: center; display: flex; gap: 1.25rem; }
.tool-links a { align-items: center; border-bottom: 2px solid transparent; display: inline-flex; font-size: 0.94rem; font-weight: 750; min-height: 44px; text-decoration: none; }
.tool-links a:hover, .tool-links a:focus-visible, .tool-links a[aria-current="page"] { border-bottom-color: var(--green); color: var(--green); }

.planner-hero {
  background:
    radial-gradient(ellipse 45% 34% at 10% 0%, rgba(20, 87, 184, 0.34), transparent),
    radial-gradient(ellipse 45% 40% at 95% 5%, rgba(45, 216, 122, 0.12), transparent),
    linear-gradient(160deg, var(--navy), var(--navy-2));
  color: white;
  min-height: calc(100vh - 70px);
  padding: clamp(2.2rem, 5vw, 4.2rem) clamp(1rem, 3vw, 2.2rem) clamp(3.5rem, 7vw, 6rem);
}

.planner-heading { margin: 0 auto 2rem; max-width: 820px; text-align: center; }
.eyebrow { color: var(--green); font-size: 0.84rem; font-weight: 900; letter-spacing: 0.12em; margin: 0 0 0.8rem; text-transform: uppercase; }
.planner-heading h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); letter-spacing: -0.05em; line-height: 1; margin: 0; text-wrap: balance; }
.planner-heading > p:last-child { color: rgba(255,255,255,.72); font-size: clamp(1.05rem, 2vw, 1.32rem); margin: 1rem 0 0; }

.planner-shell {
  background: var(--paper);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(330px, .8fr) minmax(500px, 1.2fr);
  margin: 0 auto;
  max-width: 1160px;
  overflow: hidden;
}

.planner-form, .plan-result { padding: clamp(1.45rem, 3vw, 2.2rem); }
.planner-form { border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 1.25rem; }
.planner-form fieldset { border: 0; margin: 0; padding: 0; }
.planner-form legend, .field > span { display: block; font-weight: 850; margin-bottom: .6rem; }
.plan-choices { display: grid; gap: .65rem; }

.plan-choice { position: relative; }
.plan-choice input { opacity: 0; pointer-events: none; position: absolute; }
.plan-choice label {
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  display: block;
  padding: .9rem 1rem;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.plan-choice label:hover { border-color: #75a3df; transform: translateY(-1px); }
.plan-choice input:checked + label { background: var(--soft); border-color: var(--blue); box-shadow: inset 4px 0 0 var(--blue); }
.plan-choice strong { display: block; font-size: .98rem; }
.plan-choice small { color: var(--muted); display: block; line-height: 1.35; margin-top: .25rem; }

.field input {
  background: white;
  border: 1px solid #b8c4d6;
  border-radius: 9px;
  color: var(--ink);
  min-height: 48px;
  padding: .72rem .8rem;
  width: 100%;
}
.field small, .field-help { color: var(--muted); display: block; font-size: .78rem; line-height: 1.4; margin: .4rem 0 0; }

.generate-button, .dealbuddy-button {
  background: linear-gradient(135deg, #0b55cd, #0873ee);
  border: 0;
  border-radius: 9px;
  color: white;
  font-weight: 850;
  min-height: 52px;
  padding: .8rem 1.2rem;
}
.generate-button:hover, .dealbuddy-button:hover { background: var(--blue-dark); }

.plan-result { background: linear-gradient(160deg, #fbfdff, #f2f7ff); min-height: 620px; }
.empty-result { align-items: center; display: flex; flex-direction: column; height: 100%; justify-content: center; min-height: 480px; text-align: center; }
.empty-icon { align-items: center; background: #dff8e9; border: 1px solid #a9e9c6; border-radius: 50%; color: var(--green-dark); display: flex; font-size: 2rem; font-weight: 900; height: 70px; justify-content: center; width: 70px; }
.empty-result h2 { margin: 1rem 0 .45rem; }
.empty-result p { color: var(--muted); margin: 0; max-width: 390px; }

.result-heading { align-items: flex-end; display: flex; gap: 1rem; justify-content: space-between; }
.result-eyebrow { color: var(--blue); font-size: .79rem; font-weight: 900; letter-spacing: .08em; margin: 0 0 .3rem; text-transform: uppercase; }
.result-heading h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); letter-spacing: -.025em; margin: 0; }
.touch-count { background: #dff8e9; border-radius: 999px; color: var(--green-dark); flex: 0 0 auto; font-size: .8rem; font-weight: 900; padding: .45rem .7rem; }

.timeline { list-style: none; margin: 1.3rem 0; padding: 0; }
.timeline-item { display: grid; gap: .85rem; grid-template-columns: 64px 1fr; min-height: 78px; position: relative; }
.timeline-item:not(:last-child)::before { background: #bfd0e7; content: ""; height: calc(100% - 8px); left: 31px; position: absolute; top: 33px; width: 2px; }
.day-badge { align-items: center; background: var(--blue); border: 4px solid #edf4ff; border-radius: 50%; color: white; display: flex; font-size: .72rem; font-weight: 900; height: 62px; justify-content: center; position: relative; text-align: center; width: 62px; z-index: 1; }
.touch-card { background: white; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .65rem; padding: .8rem .9rem; }
.touch-channel { color: var(--blue); font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.touch-card strong { display: block; margin: .2rem 0; }
.touch-card p { color: var(--muted); font-size: .86rem; line-height: 1.4; margin: 0; }

.import-card { align-items: center; background: var(--navy); border-radius: 12px; color: white; display: flex; gap: 1rem; justify-content: space-between; padding: 1rem; }
.import-label { font-size: .83rem; font-weight: 800; margin: 0 0 .25rem; }
.import-code { color: var(--green); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 900; letter-spacing: .04em; margin: 0; }
.copy-button { background: transparent; border: 0; color: rgba(255,255,255,.72); font-size: .78rem; margin-top: .35rem; padding: 0; text-decoration: underline; }
.dealbuddy-button { flex: 0 0 auto; }
.app-fallback { background: white; border: 1px solid var(--line); border-radius: 10px; margin-top: .7rem; padding: .8rem; }
.app-fallback p { color: var(--muted); font-size: .84rem; margin: 0 0 .55rem; }
.app-fallback div { display: flex; gap: .6rem; }
.app-fallback a { color: var(--blue); font-weight: 800; }
.consent-note { color: var(--muted); font-size: .75rem; line-height: 1.45; margin: .8rem 0 0; }

.tool-footer { align-items: center; background: var(--navy); border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.72); display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; justify-content: center; padding: 1.6rem 1rem; text-align: center; }
.tool-footer > a { color: white; font-weight: 900; text-decoration: none; }
.tool-footer nav { display: flex; gap: 1rem; }

@media (max-width: 850px) {
  .planner-shell { grid-template-columns: 1fr; }
  .planner-form { border-bottom: 1px solid var(--line); border-right: 0; }
  .plan-result { min-height: 0; }
  .empty-result { min-height: 260px; }
}

@media (max-width: 560px) {
  .tool-nav { display: grid; gap: .35rem; grid-template-columns: 1fr; padding: .72rem .9rem; }
  .tool-brand span { display: inline; font-size: .92rem; }
  .tool-links { gap: 1rem; overflow-x: auto; }
  .tool-links a { font-size: .79rem; }
  .tool-links .header-cta { display: none; }
  .planner-hero { padding: 2.1rem .75rem 3rem; }
  .planner-heading { margin-bottom: 1.35rem; }
  .planner-heading h1 { font-size: 2.65rem; }
  .planner-shell { border-radius: 13px; }
  .planner-form, .plan-result { padding: 1.15rem; }
  .result-heading { align-items: flex-start; flex-direction: column; }
  .timeline-item { gap: .65rem; grid-template-columns: 52px 1fr; }
  .timeline-item:not(:last-child)::before { left: 25px; }
  .day-badge { border-width: 3px; height: 50px; width: 50px; }
  .import-card { align-items: stretch; flex-direction: column; }
  .dealbuddy-button { width: 100%; }
}
