/* Yachting Assistant — tokens and signature styles for every page.
   Parts: build from the kit's .fx-* classes + Tailwind; the .yd-* classes below are this brand's own pieces. */
:root {
  --fx-primary: #12305C;
  --fx-on-primary: #ffffff;
  --fx-bg: #F6F8FB;
  --fx-surface: #ffffff;
  --fx-text: #0B1B33;
  --fx-muted: #47586F;
  --fx-border: #D9E1EC;
  --fx-soft: #E6EEF8;
  --fx-radius: 16px;
  --fx-shadow: 0 24px 60px -32px rgba(11, 27, 51, 0.28);
  --fx-space: 1.1;
  --fx-head-weight: 600;
  --fx-border-w: 1px;
  --fx-font-head: "FynFox Young Serif", Georgia, serif;
  --fx-font-body: "FynFox DM Sans", system-ui, sans-serif;
  --yd-navy: #0B1B33;
  --yd-gold: #B8924A;
  --yd-gold-light: #DDBD7C;
  --yd-gold-deep: #7F6026;
  --yd-sea: #2B7CB3;
  --yd-soft: #E6EEF8;
}
.fx-ui [hidden] { display: none !important; }
body.fx-ui { font-size: 17px; line-height: 1.6; }
.fx-btn { border-radius: 999px; min-height: 46px; }
.fx-btn-sm { min-height: 40px; }
.fx-btn-lg { min-height: 54px; padding-left: 28px; padding-right: 28px; }

/* header + footer */
.yd-wordmark { font-family: var(--fx-font-head); font-size: 1.15rem; letter-spacing: -0.01em; color: var(--fx-text); }
.yd-mark { background: var(--yd-navy); color: var(--yd-gold-light); border-radius: 50%; display: inline-grid; place-items: center; }
.yd-header-actions { gap: 8px; align-items: center; }
.yd-footer { border-top: 1px solid var(--fx-border); padding-top: 64px; background: var(--fx-surface); }
.yd-footer-name { font-size: 1.5rem; margin: 0 0 8px; }
.yd-links { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.yd-links a { color: var(--fx-text); text-decoration: none; border-bottom: 1px solid transparent; }
.yd-links a:hover { border-bottom-color: var(--yd-gold); }
.yd-owner-link { color: var(--fx-muted) !important; font-size: 0.9rem; }
.yd-small { font-size: 0.85rem; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--fx-border); }

/* page: a faint light in two corners */
.yd-page {
  min-height: 70vh; outline: none;
  background:
    radial-gradient(640px 440px at 100% 0, rgba(43, 124, 179, 0.08), transparent 70%),
    radial-gradient(560px 440px at 0 100%, rgba(184, 146, 74, 0.08), transparent 70%);
}

/* type */
.yd-display { font-family: var(--fx-font-head); font-weight: var(--fx-head-weight); font-size: clamp(44px, 6vw, 88px); line-height: 1; letter-spacing: -0.025em; margin: 0; color: var(--fx-text); text-wrap: balance; }
.yd-display em { font-style: normal; color: var(--yd-sea); }
.yd-title { font-family: var(--fx-font-head); font-size: clamp(30px, 4vw, 52px); line-height: 1.08; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.yd-lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--fx-muted); max-width: 56ch; }
.yd-rule { display: block; width: 56px; height: 2px; background: var(--yd-gold); border: 0; margin: 20px 0; }
.yd-section { padding: clamp(72px, 10vw, 128px) 0; }
.yd-tint { background: var(--fx-surface); border-bottom: 1px solid var(--fx-border); }

/* dark navy parts: first screen and closing panel */
.yd-band { background: var(--yd-navy); color: #fff; --fx-text: #ffffff; --fx-muted: #C6D2E2; --fx-surface: #12284A; --fx-border: rgba(255,255,255,0.18); --fx-soft: rgba(255,255,255,0.08); --fx-primary: #DDBD7C; --fx-on-primary: #0B1B33; }
.yd-band .yd-title, .yd-band .yd-display, .yd-band h2, .yd-band h3 { color: #fff; }
.yd-band .yd-display em { color: var(--yd-gold-light); }
.yd-band .fx-eyebrow { color: var(--yd-gold-light); }
.yd-band a:not(.fx-btn) { color: #fff; }
.yd-band .fx-btn-secondary { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.5); }
.yd-band .fx-btn-secondary:hover { background: rgba(255,255,255,0.1); }

/* first screen: sea photo under a navy layer, words left, the example email right */
.yd-hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(56px, 8vw, 112px) 0 clamp(40px, 5vw, 64px); }
.yd-hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 75% 60%; z-index: -2; background: var(--yd-navy); }
.yd-hero-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(100deg, rgba(11,27,51,0.97) 0%, rgba(11,27,51,0.92) 45%, rgba(11,27,51,0.66) 100%); }
.yd-hero-inner { pointer-events: none; }
.yd-hero-inner > * > *, .yd-steps li { pointer-events: auto; }
.yd-hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.yd-stage { position: relative; }
.yd-stage::before { content: ""; position: absolute; width: 112%; aspect-ratio: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; border: 1px solid var(--yd-gold-light); opacity: 0.45; pointer-events: none; }
.yd-subject { position: relative; z-index: 1; text-align: left; --fx-surface: #ffffff; --fx-text: #0B1B33; --fx-muted: #47586F; --fx-border: #D9E1EC; background: var(--fx-surface); color: var(--fx-text); border-radius: 24px; padding: clamp(20px, 3vw, 32px); box-shadow: 0 40px 80px -30px rgba(0,0,0,0.6); }
.yd-subject .fx-eyebrow { color: var(--yd-gold-deep); }
.yd-subject .yd-result { font-size: 15.5px; }
.yd-subject-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--fx-border); }
.yd-pills { display: inline-flex; gap: 6px; }
.yd-pill { font-size: 0.78rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: #E6EEF8; color: #12305C; }
.yd-steps { list-style: none; margin: clamp(44px, 6vw, 80px) 0 0; padding: 24px 0 0; border-top: 1px solid rgba(255,255,255,0.2); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 32px; }
.yd-steps li { display: flex; gap: 12px; align-items: baseline; color: #fff; font-size: 0.98rem; line-height: 1.4; }
.yd-band .yd-num { color: var(--yd-gold-light); }

/* closing panel */
.yd-cta { position: relative; overflow: hidden; text-align: center; border-radius: 28px; padding: clamp(40px, 7vw, 88px) clamp(22px, 5vw, 64px); box-shadow: 0 30px 70px -36px rgba(11,27,51,0.6); }
.yd-cta::before { content: ""; position: absolute; width: 420px; aspect-ratio: 1; right: -140px; top: -180px; border-radius: 50%; border: 1px solid var(--yd-gold-light); opacity: 0.4; pointer-events: none; }
.yd-cta > * { position: relative; }

/* task cards (workspace), topic chips, template cards */
.yd-task { display: block; text-decoration: none; color: var(--fx-text); background: var(--fx-surface); border: 1px solid var(--fx-border); border-radius: 20px; padding: 24px; position: relative; }
.yd-task h3 { font-family: var(--fx-font-head); font-size: 1.25rem; margin: 0 0 6px; }
.yd-task p { margin: 0; color: var(--fx-muted); font-size: 0.95rem; }
.yd-task[aria-current="true"], .yd-task[aria-pressed="true"] { border-color: var(--fx-primary); box-shadow: inset 0 -3px 0 var(--yd-gold), var(--fx-shadow); }
.yd-icon { width: 46px; height: 46px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--fx-soft); color: var(--fx-primary); }
.yd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.yd-chip { font: inherit; font-size: 0.92rem; min-height: 44px; padding: 6px 18px; border-radius: 999px; border: 1px solid var(--fx-border); background: var(--fx-surface); color: var(--fx-text); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.yd-chip[aria-pressed="true"], .yd-chip[aria-current="page"] { background: var(--yd-navy); border-color: var(--yd-navy); color: #fff; }
.yd-chip[data-ex] { border-radius: 14px; text-align: left; line-height: 1.4; padding: 10px 14px; background: var(--fx-soft); border-color: transparent; }
.yd-num { font-family: var(--fx-font-head); color: var(--yd-gold-deep); font-size: 1.1rem; }

/* tool layout: form on the left, answer on the right */
.yd-split { display: grid; gap: 28px; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
.yd-tool { padding: clamp(40px, 6vw, 80px) 0 clamp(64px, 8vw, 104px); }
.fx-textarea.yd-tall { min-height: 220px; }

/* the answer (App.renderResult) and any saved text */
.yd-result { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; font-size: 16.5px; color: var(--fx-text); border-left: 2px solid var(--yd-gold); padding: 4px 0 4px 16px; margin: 0; }
.yd-result.yd-clip { max-height: 9.9em; overflow: hidden; }
.yd-actions { gap: 10px; flex-wrap: wrap; }
.yd-answer-wait { border: 1px dashed var(--fx-border); border-radius: 20px; padding: 32px; color: var(--fx-muted); background: var(--fx-surface); }

/* sign-in pages */
.yd-auth { max-width: 480px; margin: 0 auto; padding: clamp(48px, 8vw, 104px) 0; }

/* news cards: equal height, long words wrap, story button sits at the bottom */
#news-list .fx-card { display: flex; flex-direction: column; gap: 4px; height: 100%; }
#news-list .fx-card-head { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
#news-list .fx-card-head h2 { overflow-wrap: anywhere; font-size: 1.2rem; line-height: 1.25; flex: 1 1 200px; margin: 0; }
#news-list .fx-card p { overflow-wrap: anywhere; }
#news-list .fx-card .fx-btn { align-self: flex-start; margin-top: auto; }
#news-chips { row-gap: 10px; }
#news-search { border-radius: 999px; min-height: 50px; padding-left: 20px; padding-right: 20px; width: 100%; background: var(--fx-surface); border: 1px solid var(--fx-border); }
#news-search:focus { border-color: var(--fx-primary); outline: 2px solid var(--yd-gold-light); outline-offset: 2px; }
#news-list { min-height: 120px; }
@media (max-width: 640px) {
  #news-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  #news-chips .yd-chip { flex: 0 0 auto; white-space: nowrap; }
}
#news-brief .yd-out { min-width: 0; }
.fx-toast[data-tone="danger"] { border-left: 3px solid #B42318; }
.fx-toast[data-tone="success"] { border-left: 3px solid var(--yd-gold); }

@media (prefers-reduced-motion: no-preference) {
  .yd-task, .yd-chip, .yd-links a, .fx-btn, .fx-card { transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease; }
  .yd-task:hover { transform: translateY(-3px); border-color: var(--fx-primary); }
  .yd-chip:hover { border-color: var(--fx-primary); }
  .fx-btn:hover { transform: translateY(-1px); }
  .yd-tint .fx-card:hover, #topics .fx-card:hover { transform: translateY(-3px); }
}

@media (max-width: 900px) {
  .yd-split { grid-template-columns: 1fr; }
  .yd-hero-grid { grid-template-columns: 1fr; }
  .yd-hero-shade { background: linear-gradient(180deg, rgba(11,27,51,0.95) 0%, rgba(11,27,51,0.86) 100%); }
  .yd-stage::before { width: 100%; }
  .yd-steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .yd-wordmark { font-size: 1.02rem; }
  .yd-header-actions a[href="#/profile"] { display: none; }
  .yd-hero .yd-actions .fx-btn, .yd-cta .yd-actions .fx-btn { width: 100%; justify-content: center; }
  .yd-subject { border-radius: 20px; }
  #news-list .fx-grid { grid-template-columns: 1fr; }
  #news-brief .yd-split { gap: 20px; }
  .yd-subject .yd-result { font-size: 14.5px; }
}