:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #667085;
  --line: #d7dde7;
  --panel: #ffffff;
  --paper: #f5f7fb;
  --mint: #d9f8e8;
  --green: #19734a;
  --red: #b42318;
  --amber: #f2b84b;
  --blue: #2c65c8;
  --coral: #ed7b68;
  --shadow: 0 18px 56px rgba(30, 41, 59, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(217, 248, 232, 0.9), transparent 32rem),
    linear-gradient(135deg, #fbfcff 0%, #eef3f8 52%, #f8efe8 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  display: grid;
  gap: 1.1rem;
  min-height: 100vh;
  padding: clamp(1rem, 3vw, 2.25rem);
}

.topbar,
.lesson-panel,
.portfolio-panel,
.watchlist-panel,
.personalization-panel,
.company-panel,
.rules-panel,
.budget-panel,
.sec-guide-panel,
.sec-step-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(215, 221, 231, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.account-pill {
  min-width: min(17rem, 46vw);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  background: var(--paper);
}

.account-pill span {
  display: block;
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  font-weight: 850;
}

.account-pill small,
.quiet-copy,
#quote-status,
#watchlist-date {
  color: var(--muted);
  line-height: 1.5;
}

.hero-grid,
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(22rem, 0.9fr);
  gap: 1.1rem;
}

.content-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(21rem, 0.7fr);
}

.lesson-panel,
.portfolio-panel,
.watchlist-panel,
.personalization-panel,
.company-panel,
.rules-panel,
.budget-panel,
.sec-guide-panel,
.sec-step-card {
  padding: clamp(1.15rem, 2.5vw, 2rem);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tab-button {
  min-height: 2.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 1rem;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tab-button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 1.1rem;
}

.lesson-panel {
  min-height: 26rem;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-heading > span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.lesson-panel h2 {
  max-width: 12ch;
  margin-bottom: 1rem;
  font-size: clamp(2.4rem, 7vw, 5.2rem);
  line-height: 0.9;
}

.lesson-panel p {
  max-width: 58rem;
  color: #344054;
  font-size: 1.05rem;
  line-height: 1.75;
}

.lesson-actions,
.holding-form,
.company-search,
.budget-form,
.sec-guide-form {
  display: grid;
  gap: 0.7rem;
}

.lesson-actions {
  grid-template-columns: 2.85rem auto 2.85rem;
  align-items: center;
  justify-content: start;
  margin-top: 1.35rem;
}

.lesson-actions .primary-action {
  min-width: 8rem;
  width: auto;
}

.primary-action,
.ghost-action,
.icon-button,
.mail-link {
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-action,
.mail-link {
  min-height: 2.85rem;
  border-radius: 8px;
  padding: 0 1rem;
  background: var(--ink);
  color: white;
  font-weight: 800;
}

.mail-link {
  display: inline-flex;
  align-items: center;
}

.ghost-action {
  min-height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 0.85rem;
  background: var(--paper);
  color: var(--ink);
  font-weight: 750;
}

.icon-button {
  display: grid;
  width: 2.85rem;
  height: 2.85rem;
  place-items: center;
  border-radius: 50%;
  background: var(--mint);
  color: var(--green);
  font-size: 1.7rem;
  font-weight: 800;
}

.primary-action:hover,
.ghost-action:hover,
.icon-button:hover,
.mail-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(24, 33, 47, 0.14);
}

.holding-form {
  display: grid;
  grid-template-columns: 1fr 1.05fr 1fr 1fr auto;
  margin-bottom: 1rem;
}

.budget-form {
  grid-template-columns: minmax(12rem, 0.55fr) minmax(16rem, 0.8fr) auto;
  max-width: 58rem;
}

.company-search,
.sec-guide-form {
  grid-template-columns: minmax(14rem, 1fr) auto;
  max-width: 62rem;
}

.form-field {
  display: grid;
  gap: 0.35rem;
}

label {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 2.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 0;
  padding: 0 0.72rem;
  color: var(--ink);
  background: var(--paper);
}

.holding-list,
.stock-grid,
.rules-list,
.budget-results,
.budget-card-grid,
.sec-step-grid {
  display: grid;
  gap: 0.75rem;
}

.holding-card,
.stock-card,
.insight-box,
.budget-card,
.sec-step-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem;
  background: var(--paper);
}

.holding-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.holding-card strong,
.stock-card strong,
.budget-card strong,
.sec-step-card strong {
  display: block;
  font-size: 1.1rem;
}

.holding-card span,
.stock-card span,
.insight-box span,
.budget-card span,
.sec-step-card span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.holding-card button {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  background: white;
  color: var(--muted);
  cursor: pointer;
}

.gain {
  color: var(--green);
  font-weight: 800;
}

.loss {
  color: var(--red);
  font-weight: 800;
}

.stock-grid,
.sec-step-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.budget-results {
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

.budget-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.budget-category {
  display: grid;
  gap: 0.75rem;
}

.category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.55rem;
}

.category-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.category-heading span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.stock-card {
  display: grid;
  gap: 0.6rem;
  min-height: 14rem;
}

.budget-card,
.sec-step-card {
  display: grid;
  gap: 0.55rem;
}

.budget-card header {
  display: grid;
  gap: 0.35rem;
}

.budget-card em {
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

.stock-card:nth-child(2) {
  border-top: 4px solid var(--amber);
}

.stock-card:nth-child(3) {
  border-top: 4px solid var(--coral);
}

.stock-card:first-child {
  border-top: 4px solid var(--blue);
}

.stock-card a,
.insight-links a {
  color: var(--blue);
  font-weight: 800;
}

.company-search,
.personalization-form,
.budget-form,
.sec-guide-form {
  margin-bottom: 1rem;
}

.company-search input {
  margin-top: 0;
}

.personalization-form {
  display: grid;
  gap: 0.75rem;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem;
  color: var(--ink);
  background: var(--paper);
  resize: vertical;
}

.insight-box {
  min-height: 13rem;
}

.insight-box h3 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.insight-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.sec-report-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-top: 0.5rem;
}

.sec-report-links a,
.budget-card a,
.sec-step-card a {
  color: var(--blue);
  font-weight: 800;
}

.sec-report-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  background: var(--paper);
}

.sec-report-links span {
  flex-basis: 100%;
}

.rules-list label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  color: #344054;
  font-weight: 650;
  line-height: 1.35;
}

.rules-list input {
  width: 1rem;
  height: 1rem;
  min-height: 1rem;
  margin-top: 0.12rem;
  accent-color: var(--green);
}

@media (max-width: 980px) {
  .hero-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .stock-grid {
    grid-template-columns: 1fr;
  }

  .budget-results,
  .sec-step-grid {
    grid-template-columns: 1fr;
  }

  .budget-form,
  .company-search,
  .sec-guide-form {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-pill {
    width: 100%;
  }

  .holding-form {
    grid-template-columns: 1fr;
  }

  .lesson-actions {
    grid-template-columns: 2.85rem minmax(7.5rem, auto) 2.85rem;
    justify-content: start;
  }
}
