/* Stock Time Machine - Invest And Grow by Stephen Loke
   Large type, strong contrast and big touch targets for comfortable reading. */

:root {
  --brand: #14532d;
  --brand-2: #166534;
  --brand-tint: #ecf6ef;
  --gold: #f5c542;
  --ink: #1d1d1b;
  --ink-2: #44433f;
  --muted: #5f5e5a;
  --line: #d9d8d0;
  --page: #f6f6f2;
  --card: #ffffff;
  --up: #0f6a0f;
  --down: #b42318;
  --focus: #1d4ed8;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.55;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

a { color: var(--brand-2); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: #fff; padding: 8px 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header { background: var(--brand); color: #fff; border-top: 6px solid var(--gold); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 1.05rem; }
.brand .by { opacity: 0.85; font-weight: 400; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-mark rect { fill: #fff; }
.brand-mark path { stroke: var(--brand); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fullscreen-link { color: #fff; font-weight: 600; white-space: nowrap; }

.intro { padding: 28px 0 8px; }
h1 { font-size: 2.2rem; line-height: 1.15; margin: 0 0 8px; color: var(--brand); letter-spacing: -0.01em; }
h2 { font-size: 1.55rem; line-height: 1.25; margin: 0 0 10px; color: var(--brand); }
h3 { font-size: 1.25rem; margin: 0; }
h4 { font-size: 1.08rem; margin: 22px 0 8px; }
.lead { font-size: 1.15rem; color: var(--ink-2); margin: 0; max-width: 60ch; }

/* ---------- tabs ---------- */
.top-tabs, .sub-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 14px; }
.top-tabs [role="tab"], .sub-tabs [role="tab"] {
  font: inherit; font-weight: 600; cursor: pointer; min-height: 48px; padding: 8px 16px;
  border: 2px solid var(--brand); border-radius: 999px; background: #fff; color: var(--brand);
}
.top-tabs [role="tab"][aria-selected="true"], .sub-tabs [role="tab"][aria-selected="true"] { background: var(--brand); color: #fff; }
.sub-tabs [role="tab"] { font-size: 0.95rem; border-width: 1.5px; min-height: 44px; }

/* ---------- cards & form ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 0 0 18px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }

fieldset { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
legend { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.step { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 1rem; flex: none; }

label { font-weight: 600; display: block; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.92rem; }
p.hint { margin: 6px 0 0; }
.sublabel { margin: 14px 0 6px; font-weight: 600; }
.tip { margin: 10px 0 0; color: var(--ink-2); }

input[type="text"], input[type="email"], input[type="number"], input[type="date"], select {
  font: inherit; font-size: 1.05rem; color: var(--ink); background: #fff; width: 100%;
  min-height: 52px; padding: 10px 12px; border: 2px solid #8d8b84; border-radius: 10px;
}
input:focus, select:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.25); }
select { padding-right: 34px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { min-width: 0; }
.money { display: flex; align-items: center; border: 2px solid #8d8b84; border-radius: 10px; background: #fff; }
.money:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.25); }
.money span { padding-left: 12px; font-weight: 700; color: var(--ink-2); }
.money input { border: 0; box-shadow: none !important; padding-left: 6px; }
.money.small { display: inline-flex; width: 150px; }
.pct { display: inline-flex; align-items: center; gap: 6px; }
.pct input { width: 110px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  font: inherit; font-size: 0.95rem; font-weight: 700; cursor: pointer; min-height: 44px; padding: 6px 14px;
  border: 1.5px solid #8d8b84; border-radius: 999px; background: #fff; color: var(--ink);
}
.chip small { font-weight: 400; color: var(--muted); font-size: 0.82rem; margin-left: 4px; }
.chip:hover { border-color: var(--brand); background: var(--brand-tint); }
.linkish { font: inherit; background: none; border: 0; padding: 0; color: var(--brand-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600; }

.strategies { display: grid; gap: 10px; }
.strategy { display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; font-weight: 400; cursor: pointer; }
.strategy > label { font-weight: 400; margin: 0; cursor: pointer; }
.strategy, .strategy > label { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.strategy.has-settings { display: block; }
.strategy input[type="checkbox"], .toggle input { width: 26px; height: 26px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.strategy strong { display: block; font-size: 1.05rem; }
.strategy span { flex: 1; min-width: 200px; }
.strategy:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.settings { display: none; margin: 12px 0 2px 38px; gap: 6px 14px; grid-template-columns: max-content minmax(0, 360px); align-items: center; }
.settings label { margin: 0; font-weight: 600; font-size: 0.95rem; }
.settings .hint { grid-column: 1 / -1; width: 0; min-width: 100%; }
.has-settings:has(input[type="checkbox"]:checked) .settings { display: grid; }

.options { display: grid; gap: 10px; }
.toggle { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; font-size: 1rem;
  min-height: 48px; padding: 8px 18px; border-radius: 10px; border: 2px solid var(--brand); background: #fff; color: var(--brand);
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--brand-tint); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-big { width: 100%; font-size: 1.25rem; min-height: 60px; }
.btn:disabled { opacity: 0.6; cursor: progress; }

.alert { border-radius: 10px; padding: 12px 16px; margin-top: 14px; }
.alert p { margin: 4px 0; }
.alert-error { background: #fdecea; border: 2px solid var(--down); color: #6e1610; font-weight: 600; }

.status { min-height: 0; font-weight: 600; color: var(--brand); }
.status:not(:empty) { margin: 0 0 18px; padding: 14px 16px; background: var(--brand-tint); border-radius: 10px; }
.status.busy::before { content: ""; display: inline-block; width: 18px; height: 18px; margin-right: 10px; vertical-align: -3px; border: 3px solid var(--brand); border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .status.busy::before { animation: none; } }

/* ---------- share card ---------- */
.share-card { background: var(--brand); color: #fff; border: 0; border-top: 6px solid var(--gold); }
.share-eyebrow { margin: 0; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; font-weight: 700; color: var(--gold); }
.share-headline { font-size: 1.7rem; line-height: 1.25; font-weight: 800; margin: 6px 0 8px; }
.share-sub { margin: 0 0 16px; color: #e3f4e8; font-size: 1.05rem; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-card .btn { border-color: #fff; background: transparent; color: #fff; min-height: 44px; padding: 6px 14px; font-size: 0.95rem; }
.share-card .btn:hover { background: rgba(255, 255, 255, 0.15); }
.copied { margin: 10px 0 0; min-height: 1em; color: var(--gold); font-weight: 600; }
.copied:empty { display: none; }

.asof { margin: 0 0 12px; color: var(--ink-2); font-weight: 600; }
.asof:empty { display: none; }
.notes .note, .note { background: #fff8e6; border: 1.5px solid #e2b33c; border-radius: 10px; padding: 10px 14px; margin: 0 0 10px; color: #4a3500; }

/* ---------- panels ---------- */
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.ticker-switch, .view-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.view-switch { margin: 0 0 8px; align-items: center; }
.view-switch .lbl { font-weight: 600; margin-right: 4px; }
.pill { font: inherit; font-weight: 700; min-height: 40px; padding: 4px 14px; border-radius: 999px; border: 1.5px solid #8d8b84; background: #fff; color: var(--ink); cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.inline select { width: auto; }
.settings-row { display: flex; flex-wrap: wrap; gap: 14px 22px; margin: 0 0 14px; }
.settings-row > label { margin: 0; display: flex; flex-direction: column; gap: 6px; max-width: 100%; }
.settings-row select { width: auto; max-width: 100%; }
.explain { color: var(--ink-2); margin: 0 0 14px; max-width: 70ch; }
.chart-box { position: relative; height: 380px; margin: 4px 0 12px; }
.lessons { margin: 8px 0 14px; }
.lessons:empty { display: none; }
.lessons p { margin: 0 0 10px; padding: 12px 14px 12px 16px; border-left: 5px solid var(--gold); background: #fffbeb; border-radius: 0 10px 10px 0; }
.footnote { color: var(--muted); font-size: 0.9rem; margin: 10px 0 0; }
.muted { color: var(--muted); font-weight: 400; }
.up { color: var(--up); }
.down { color: var(--down); }

/* tables */
.table-wrap { overflow-x: auto; }
table.stats { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.97rem; }
.stats th, .stats td { padding: 10px 10px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: top; }
.stats th:first-child, .stats td:first-child { text-align: left; }
.stats thead th { font-size: 0.88rem; color: var(--ink-2); border-bottom: 2px solid var(--ink-2); white-space: nowrap; }
.stats tbody th { font-weight: 600; }
.stats tr.group th { text-align: left; background: #f1f1ec; font-size: 1.02rem; border-bottom: 1px solid var(--line); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 8px; vertical-align: -1px; }
.cell-note { display: block; font-weight: 400; font-size: 0.85rem; color: var(--muted); margin-left: 22px; }
.caption-bottom { caption-side: bottom; text-align: left; color: var(--muted); font-size: 0.88rem; padding-top: 6px; }

/* bars */
.bars { display: grid; gap: 14px; margin: 6px 0 16px; }
.bar-row { display: grid; grid-template-columns: 230px 1fr 230px; gap: 12px; align-items: center; }
.bar-label { font-weight: 600; }
.bar-track { background: #f0efea; border-radius: 6px; height: 30px; }
.bar { height: 100%; background: #2a78d6; border-radius: 0 6px 6px 0; }
.bar-alt { background: #eb6834; }
.bar-value { font-variant-numeric: tabular-nums; }

.events, .day-list { margin: 6px 0 0; padding-left: 1.4em; }
.events { list-style: none; padding: 0; }
.events li, .day-list li { margin: 4px 0; }
.ev { font-weight: 700; display: inline-block; min-width: 140px; }
.ev.sell { color: var(--down); }
.ev.buy { color: var(--up); }

details.more { margin: 8px 0 12px; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--brand-2); min-height: 44px; display: flex; align-items: center; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.tile { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fbfbf8; }
.tile-label { font-weight: 600; color: var(--ink-2); }
.tile-value { font-size: 1.9rem; font-weight: 800; line-height: 1.2; margin: 4px 0; }
.tile-value .per { font-size: 1rem; font-weight: 600; color: var(--ink-2); }
.tile-note { color: var(--muted); font-size: 0.92rem; }

.planner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin: 10px 0 6px; }

/* sign-up */
.signup { border: 2px solid var(--brand); background: var(--brand-tint); }
.signup-row { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 12px; align-items: end; }
.signup-row .btn { min-height: 52px; }
.signup-msg { margin: 10px 0 0; font-weight: 600; color: var(--brand); }
.signup-msg:empty { display: none; }

/* footer */
.disclaimer { font-size: 0.95rem; color: var(--ink-2); border-top: 1px solid var(--line); padding: 18px 0 32px; }
.disclaimer p { margin: 0 0 8px; }
.credits { color: var(--muted); font-size: 0.88rem; }

/* ---------- embedded in Wix ---------- */
.embedded .intro { padding-top: 18px; }
.embedded h1 { font-size: 1.9rem; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  html { font-size: 106.25%; }
  h1 { font-size: 1.8rem; }
  .card { padding: 16px; }
  .row, .signup-row { grid-template-columns: 1fr; }
  .settings { margin-left: 0; grid-template-columns: 1fr; }
  .chart-box { height: 300px; }
  .share-headline { font-size: 1.35rem; }
  .bar-row { grid-template-columns: 1fr; gap: 4px; }
  .brand .by { display: none; }

  /* tables become stacked cards */
  table.stats thead { display: none; }
  table.stats, .stats tbody, .stats tr, .stats th, .stats td { display: block; width: 100%; }
  .stats tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  .stats tr.group { border: 0; padding: 0; }
  .stats th, .stats td { border: 0; padding: 3px 0; text-align: right; }
  .stats td::before { content: attr(data-label); float: left; color: var(--muted); font-weight: 600; }
  .stats tbody th[data-label] { text-align: left; font-size: 1.05rem; padding-top: 8px; }
  .stats tr.group th { padding: 8px 10px; margin-top: 10px; border-radius: 8px; }
  .cell-note { margin-left: 22px; }
}

@media print {
  .site-header, .top-tabs, .sub-tabs, .share-buttons, .signup, form#bt-form { display: none !important; }
  [role="tabpanel"][hidden] { display: block !important; }
}

@media (forced-colors: active) {
  .swatch, .bar { forced-color-adjust: none; }
}
