:root {
  --ink: #073f59;
  --ink-2: #0a5c76;
  --sea: #1597a8;
  --sea-light: #62cdd2;
  --foam: #f2fbf8;
  --sand: #f4dfad;
  --sand-dark: #cfaa60;
  --coral: #f39b59;
  --green: #5ebc86;
  --paper: #fffdf5;
  --muted: #5d7480;
  --danger: #b84c4c;
  --shadow: 0 18px 50px rgba(6, 63, 88, .15);
  --radius: 24px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(98,205,210,.22), transparent 30%),
    radial-gradient(circle at 90% 0%, rgba(244,223,173,.36), transparent 30%),
    linear-gradient(180deg, #f8f5e9, #eef9f7 55%, #e3f5f4);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.sea-noise {
  position: fixed; inset: 0; pointer-events: none; opacity: .18; z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}
.topbar {
  position: sticky; top: 0; z-index: 20; min-height: 74px; padding: 10px clamp(16px, 4vw, 56px);
  display: flex; align-items: center; gap: 24px;
  background: rgba(255,253,245,.86); backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(7,63,89,.1);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: max-content; }
.brand img { width: 50px; height: 50px; object-fit: contain; }
.brand span { display: grid; line-height: 1.05; }
.brand strong { letter-spacing: .16em; }
.brand small { font-size: 11px; color: var(--muted); margin-top: 4px; }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav button { border: 0; background: transparent; color: var(--ink); padding: 10px 14px; border-radius: 999px; font-weight: 700; }
.nav button:hover, .nav button.active { background: rgba(21,151,168,.13); color: var(--ink-2); }
.user-area { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav:not(.hidden) + .user-area { margin-left: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: white; display: grid; place-items: center; font-weight: 800; }
.user-copy { display: grid; font-size: 12px; line-height: 1.25; }
.user-copy strong { font-size: 14px; }
.link-button, .ghost-button, .primary-button, .secondary-button, .danger-button {
  border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 800; transition: .2s ease;
}
.primary-button { color: white; background: linear-gradient(135deg, var(--ink-2), var(--sea)); box-shadow: 0 10px 24px rgba(21,151,168,.25); }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(21,151,168,.3); }
.secondary-button { color: var(--ink); background: var(--sand); }
.ghost-button, .link-button { color: var(--ink); background: rgba(7,63,89,.07); }
.danger-button { background: #f7d8d8; color: var(--danger); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
#app { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 72px; }
.loading-screen { min-height: 60vh; display: grid; place-content: center; text-align: center; color: var(--muted); }
.compass-loader { font-size: 54px; animation: spin 2s linear infinite; color: var(--sea); }
@keyframes spin { to { transform: rotate(360deg); } }

.hero {
  min-height: 620px; position: relative; overflow: hidden; border-radius: 40px;
  display: grid; grid-template-columns: 1.05fr .95fr; align-items: center;
  background: linear-gradient(135deg, rgba(255,253,245,.96), rgba(224,247,244,.93));
  border: 1px solid rgba(7,63,89,.1); box-shadow: var(--shadow); padding: clamp(28px, 5vw, 72px);
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 500px; height: 500px; right: -180px; top: -230px; background: rgba(98,205,210,.3); }
.hero::after { width: 300px; height: 300px; left: -150px; bottom: -160px; background: rgba(244,223,173,.55); }
.hero-copy { position: relative; z-index: 2; }
.eyebrow { color: var(--sea); text-transform: uppercase; letter-spacing: .18em; font-size: 12px; font-weight: 900; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; margin: 0; line-height: 1.04; }
h1 { font-size: clamp(50px, 7vw, 94px); max-width: 720px; letter-spacing: -.045em; }
h2 { font-size: clamp(34px, 5vw, 58px); letter-spacing: -.03em; }
h3 { font-size: 25px; }
.hero p { max-width: 620px; font-size: clamp(17px, 2vw, 21px); line-height: 1.65; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-art { position: relative; min-height: 480px; z-index: 2; }
.hero-art .captain-main { position: absolute; right: -3%; bottom: -9%; width: min(520px, 115%); filter: drop-shadow(0 30px 28px rgba(7,63,89,.22)); mix-blend-mode: multiply; }
.hero-art .map-card { position: absolute; left: 0; top: 7%; width: 190px; padding: 20px; transform: rotate(-5deg); background: rgba(255,253,245,.92); border: 1px solid rgba(7,63,89,.13); border-radius: 22px; box-shadow: var(--shadow); }
.hero-art .map-card strong { display: block; font-family: Georgia,serif; font-size: 20px; }
.hero-art .map-card span { font-size: 13px; color: var(--muted); }
.route-dots { margin: 16px 0 8px; display: flex; gap: 7px; }
.route-dots i { display: block; width: 13px; height: 13px; border-radius: 50%; background: var(--sand-dark); }
.route-dots i:nth-child(2) { background: var(--sea); }
.route-dots i:nth-child(3) { background: var(--coral); }

.login-panel { display: grid; grid-template-columns: 1.25fr .75fr; gap: 24px; margin-top: 24px; }
.paper-card, .card {
  background: rgba(255,253,245,.93); border: 1px solid rgba(7,63,89,.11); border-radius: var(--radius); box-shadow: var(--shadow);
}
.paper-card { padding: clamp(24px, 4vw, 44px); }
.login-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 24px; }
.login-option { text-align: left; padding: 18px; border: 1px solid rgba(7,63,89,.12); border-radius: 18px; background: white; color: var(--ink); }
.login-option:hover { border-color: var(--sea); transform: translateY(-2px); }
.login-option strong, .login-option span { display: block; }
.login-option span { font-size: 12px; color: var(--muted); margin-top: 5px; }
.policy-card { padding: 28px; color: white; background: linear-gradient(145deg,var(--ink),#0b6680); border-radius: var(--radius); box-shadow: var(--shadow); }
.policy-card ul { padding-left: 20px; line-height: 1.7; color: rgba(255,255,255,.8); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 8px 0 28px; }
.page-head p { max-width: 670px; color: var(--muted); line-height: 1.55; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.card { padding: 24px; }
.stat { display: grid; gap: 8px; }
.stat strong { font-family: Georgia,serif; font-size: 40px; }
.stat span { color: var(--muted); }

.diagnostic-shell { display: grid; grid-template-columns: 280px 1fr; gap: 24px; }
.diagnostic-guide { position: sticky; top: 100px; align-self: start; overflow: hidden; }
.diagnostic-guide img { width: 100%; display: block; mix-blend-mode: multiply; }
.diagnostic-guide .guide-copy { padding: 20px 24px 26px; }
.diagnostic-progress { height: 9px; background: rgba(7,63,89,.1); border-radius: 999px; overflow: hidden; margin: 14px 0 30px; }
.diagnostic-progress i { display: block; height: 100%; background: linear-gradient(90deg,var(--sea),var(--green)); transition: width .3s ease; }
.question-card { padding: clamp(24px, 5vw, 52px); }
.question-number { font-size: 13px; font-weight: 900; color: var(--sea); text-transform: uppercase; letter-spacing: .15em; }
.question-card h3 { margin: 12px 0 25px; font-size: clamp(26px,4vw,42px); }
.option-list { display: grid; gap: 12px; }
.option { display: flex; align-items: flex-start; gap: 14px; text-align: left; padding: 17px 18px; border-radius: 16px; border: 1px solid rgba(7,63,89,.13); background: white; color: var(--ink); }
.option:hover, .option.selected { border-color: var(--sea); background: rgba(98,205,210,.12); }
.option .radio { flex: 0 0 22px; width: 22px; height: 22px; border: 2px solid var(--sea); border-radius: 50%; display: grid; place-items: center; }
.option.selected .radio::after { content:""; width: 10px; height: 10px; border-radius: 50%; background: var(--sea); }
.question-actions { margin-top: 28px; display: flex; justify-content: space-between; gap: 12px; }

.result-card { padding: clamp(28px,5vw,64px); position: relative; overflow: hidden; }
.result-card::after { content:"⚓"; position:absolute; right: 24px; bottom: -25px; font-size: 150px; opacity: .05; }
.result-kicker { color: var(--sea); font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.result-score { display: inline-flex; align-items: baseline; gap: 5px; margin: 20px 0; }
.result-score strong { font-family: Georgia,serif; font-size: 62px; }
.result-body { white-space: pre-line; color: var(--muted); line-height: 1.7; max-width: 780px; }
.recommendation-box { margin-top: 28px; padding: 22px; background: rgba(244,223,173,.42); border-left: 5px solid var(--sand-dark); border-radius: 8px 18px 18px 8px; }

.journey-layout { display: grid; grid-template-columns: 1fr 340px; gap: 26px; }
.map-panel { position: relative; padding: clamp(22px,4vw,42px); min-height: 740px; overflow: hidden; }
.map-panel::before { content:""; position:absolute; inset:0; opacity:.35; background-image: radial-gradient(rgba(7,63,89,.28) 1px, transparent 1px); background-size: 24px 24px; }
.map-header { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.progress-ring { --p: 0deg; width: 92px; height: 92px; border-radius:50%; background: conic-gradient(var(--sea) var(--p), rgba(7,63,89,.1) 0); display:grid; place-items:center; flex:0 0 auto; }
.progress-ring::before { content:""; width:72px; height:72px; border-radius:50%; background:var(--paper); }
.progress-ring strong { position:absolute; font-size:16px; }
.phase-block { position: relative; z-index: 2; margin: 42px 0 20px; }
.phase-title { display: flex; align-items:center; gap:10px; margin-bottom: 18px; }
.phase-title::after { content:""; height:1px; flex:1; background:rgba(7,63,89,.16); }
.island-route { display: grid; grid-template-columns: repeat(5,minmax(90px,1fr)); gap: 26px 14px; align-items:center; position:relative; }
.island-route::before { content:""; position:absolute; left:6%; right:6%; top:50%; height:3px; border-top:3px dashed rgba(7,63,89,.18); z-index:0; }
.island-node { position:relative; z-index:2; min-height:118px; border:0; background:transparent; color:var(--ink); display:grid; justify-items:center; gap:7px; }
.island-node:nth-child(even) { transform: translateY(22px); }
.island-icon { width:68px; height:68px; border-radius:46% 54% 55% 45%; display:grid; place-items:center; font-size:31px; background:var(--sand); border:4px solid white; box-shadow:0 9px 24px rgba(7,63,89,.18); }
.island-node.revealed .island-icon, .island-node.in_progress .island-icon, .island-node.review .island-icon { background:var(--sea-light); }
.island-node.completed .island-icon { background:var(--green); color:white; }
.island-node.waived .island-icon { background:#b7c9cb; }
.island-node.hidden { filter: grayscale(1); opacity:.46; }
.island-label { font-size:11px; max-width:108px; line-height:1.2; font-weight:800; }
.island-status { font-size:10px; color:var(--muted); text-transform:uppercase; }

.captain-sidebar { display:grid; gap:18px; align-self:start; position:sticky; top:100px; }
.captain-card { overflow:hidden; text-align:center; }
.captain-card img { width:100%; max-height:275px; object-fit:cover; object-position:center 25%; display:block; mix-blend-mode:multiply; }
.captain-card .copy { padding:20px 22px 24px; }
.compass-card { padding:24px; color:white; background:linear-gradient(150deg,var(--ink),var(--ink-2)); border-radius:var(--radius); box-shadow:var(--shadow); }
.compass-card .message { line-height:1.6; color:rgba(255,255,255,.84); white-space:pre-line; }
.badge-list { display:flex; gap:8px; flex-wrap:wrap; margin-top:15px; }
.badge-pill { padding:7px 10px; border-radius:999px; background:rgba(244,223,173,.25); font-size:11px; }

.drawer-backdrop { position:fixed; inset:0; background:rgba(4,34,48,.45); backdrop-filter:blur(4px); z-index:39; }
.drawer { position:fixed; z-index:40; right:0; top:0; bottom:0; width:min(720px,96vw); background:var(--paper); box-shadow:-20px 0 60px rgba(4,34,48,.25); overflow:auto; padding:clamp(24px,5vw,52px); }
.drawer-close { position:sticky; top:0; float:right; width:42px; height:42px; border:0; border-radius:50%; background:rgba(7,63,89,.08); font-size:22px; z-index:3; }
.activity-meta { display:flex; flex-wrap:wrap; gap:8px; margin:15px 0 26px; }
.tag { padding:7px 10px; border-radius:999px; background:rgba(21,151,168,.12); font-size:11px; font-weight:800; text-transform:uppercase; }
.lesson-box { padding:18px; border-radius:18px; background:rgba(244,223,173,.32); margin:18px 0; line-height:1.6; }
.form-field { display:grid; gap:8px; margin:20px 0; }
.form-field label { font-weight:850; }
.form-field small { color:var(--muted); line-height:1.4; }
.form-field textarea, .form-field input, .form-field select { width:100%; border:1px solid rgba(7,63,89,.2); border-radius:14px; padding:14px 15px; background:white; color:var(--ink); outline:none; }
.form-field textarea { min-height:130px; resize:vertical; line-height:1.5; }
.form-field textarea:focus, .form-field input:focus { border-color:var(--sea); box-shadow:0 0 0 4px rgba(21,151,168,.1); }
.intervention { margin:28px 0; padding:22px; border-radius:20px; color:white; background:linear-gradient(145deg,var(--ink),var(--ink-2)); }
.intervention strong { color:var(--sand); }
.intervention p { line-height:1.65; }

.table-card { overflow:auto; }
table { width:100%; border-collapse:collapse; min-width:700px; }
th,td { text-align:left; padding:14px 12px; border-bottom:1px solid rgba(7,63,89,.09); }
th { font-size:11px; text-transform:uppercase; color:var(--muted); letter-spacing:.1em; }
.status { display:inline-flex; padding:6px 9px; border-radius:999px; font-size:11px; background:rgba(21,151,168,.12); }
.empty { min-height:340px; display:grid; place-items:center; text-align:center; padding:34px; }
.empty img { width:min(290px,80%); mix-blend-mode:multiply; }

.toasts { position:fixed; right:20px; bottom:20px; z-index:80; display:grid; gap:10px; width:min(360px,calc(100% - 40px)); }
.toast { padding:14px 16px; background:var(--ink); color:white; border-radius:14px; box-shadow:var(--shadow); display:grid; gap:4px; animation:rise .25s ease; }
.toast span { font-size:13px; color:rgba(255,255,255,.8); }
@keyframes rise { from { transform:translateY(10px); opacity:0; } }

@media (max-width: 960px) {
  .hero, .login-panel, .diagnostic-shell, .journey-layout { grid-template-columns:1fr; }
  .hero-art { min-height:390px; }
  .hero-art .captain-main { width:min(500px,95%); }
  .captain-sidebar { position:static; grid-template-columns:1fr 1fr; }
  .diagnostic-guide { position:static; display:grid; grid-template-columns:190px 1fr; }
  .diagnostic-guide img { height:100%; object-fit:cover; }
  .island-route { grid-template-columns:repeat(4,minmax(80px,1fr)); }
  .grid.three { grid-template-columns:1fr 1fr; }
}
@media (max-width: 680px) {
  .topbar { flex-wrap:wrap; gap:8px; }
  .brand small, .user-copy { display:none; }
  .nav { order:3; width:100%; overflow:auto; }
  .nav button { flex:1; white-space:nowrap; }
  #app { width:min(100% - 20px,1240px); padding-top:18px; }
  .hero { min-height:auto; padding:28px 22px; border-radius:28px; }
  .hero-art { min-height:310px; }
  .hero-art .map-card { width:150px; padding:14px; }
  .login-options, .grid.two, .grid.three, .captain-sidebar { grid-template-columns:1fr; }
  .diagnostic-guide { grid-template-columns:120px 1fr; }
  .island-route { grid-template-columns:repeat(3,minmax(70px,1fr)); gap:22px 8px; }
  .island-icon { width:58px; height:58px; }
  .page-head { align-items:flex-start; flex-direction:column; }
}

.notice { display:flex; gap:10px; align-items:center; justify-content:space-between; margin:0 0 18px; padding:14px 18px; border-radius:16px; background:rgba(232,163,39,.14); border:1px solid rgba(232,163,39,.28); }
.notice span { color:var(--muted); }
.entry-review { min-width:260px; display:grid; gap:7px; }
.entry-review > small { color:var(--muted); line-height:1.45; }
.entry-review details { font-size:12px; color:var(--muted); }
.entry-review ul { margin:7px 0 0; padding-left:18px; }
.row-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:3px; }
.compact-button { padding:7px 10px; font-size:12px; border-radius:10px; }
.muted { color:var(--muted); font-size:12px; }
