/*
 * OpenCap public UI — portrait-first, progressively enhanced for wider screens.
 * User-facing copy stays in HTML/locale files. Decorative artwork contains no text.
 * Internal/operator terminology must never be introduced here.
 */
:root {
  --ink: #152e39;
  --muted: #52666e;
  --paper: #f4f7f5;
  --card: #ffffff;
  --line: #d7e2df;
  --brand: #123f43;
  --mint: #d8ede3;
  --soft: #edf5ef;
  --accent: #a7d8c3;
  --focus: #086d9c;
  --warn-ink: #644d1d;
  --warn-bg: #faf2de;
  --warn-line: #e8d4a5;
  --danger: #85382f;
  --radius: 22px;
  --radius-small: 13px;
  --surface-raised: rgba(255, 255, 255, .92);
  --shadow-soft: 0 12px 32px rgba(24, 58, 52, .065);
  --shadow-float: 0 18px 46px rgba(20, 54, 50, .10);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  line-height: 1.6;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-padding-bottom: 92px; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, a, input, select { touch-action: manipulation; }
button, a, input, select, summary, [tabindex] { scroll-margin-block: 16px 104px; }
button, select, input[type="search"], input[type="date"], input[type="text"], input[type="number"] { min-height: 48px; }
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 650;
}
button:disabled { cursor: not-allowed; opacity: .58; }
button[aria-busy="true"] { cursor: progress; opacity: .72; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
button.primary, a.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
button.danger { background: var(--danger); color: #fff; }
button.ghost { background: transparent; }
button:active:not(:disabled) { background: #e2efe9; border-color: #9bbdb0; }
button.primary:active:not(:disabled) { background: #1d5150; border-color: #1d5150; }
button.compact { padding: 8px 12px; min-height: 48px; }
input, select {
  border: 1px solid #aebfbc;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  max-width: 100%;
}
input[type="checkbox"] { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--brand); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px rgba(133, 56, 47, .08); }

h1, h2, h3, p { margin: 0; }
h1 {
  text-wrap: balance;
  font-size: clamp(2rem, 4.8vw, 3.6rem);
  line-height: 1.18;
  letter-spacing: -.05em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
h2 { text-wrap: balance; font-size: clamp(1.4rem, 2.5vw, 2rem); line-height: 1.3; letter-spacing: -.03em; }
h3 { font-size: 1.15rem; letter-spacing: -.025em; }
p { overflow-wrap: anywhere; }
img { display: block; max-width: 100%; object-fit: contain; }

.muted { color: var(--muted); }
.small { font-size: .88rem; }
.eyebrow { font-size: .8rem; letter-spacing: .08em; font-weight: 750; color: #37635a; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.ui-icon { width: 22px; height: 22px; flex: 0 0 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip { position: fixed; top: -100px; left: 12px; background: #fff; padding: 12px; z-index: 100; }
.skip:focus { top: 12px; }
.topbar {
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: max(0px, env(safe-area-inset-top)) clamp(16px, 4vw, 52px) 0;
  background: rgba(255, 255, 255, .97);
}
.brand { min-height: 44px; display: flex; gap: 9px; align-items: center; font-size: 1.55rem; font-weight: 800; letter-spacing: -.05em; }
.header-tools select { font-size: .86rem; min-height: 48px; max-width: 122px; }

.layout { display: block; max-width: 1480px; margin: auto; }
.desktop-nav { display: none; }
main { min-width: 0; padding: 26px 18px 42px; max-width: 1160px; margin: 0 auto; outline: none; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 16px 20px 108px; }

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  z-index: 15;
}
.bottom-nav:empty { display: none; }
.nav-button { display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.bottom-nav .nav-button {
  border: 0;
  flex: 1;
  max-width: 200px;
  border-radius: 10px;
  font-size: .76rem;
  padding: 7px 8px;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 54px;
}
.bottom-nav .nav-button .ui-icon { width: 21px; height: 21px; }
.bottom-nav .nav-button[aria-current="page"] { background: var(--mint); color: var(--brand); }

.loading, .empty, .detail-placeholder {
  padding: 48px 22px;
  text-align: center;
  border: 1px dashed #b5c7c0;
  border-radius: var(--radius);
  color: var(--muted);
  background: #fff;
}
.status-panel {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
  padding: 24px;
  border: 1px solid #cddbd5;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}
.status-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--soft);
  color: var(--brand);
}
.status-icon .ui-icon { width: 22px; height: 22px; }
.status-copy { min-width: 0; display: grid; gap: 2px; }
.status-copy > strong { font-size: 1rem; }
.status-action { grid-column: 2; justify-self: start; display: inline-flex; align-items: center; gap: 7px; }
.status-panel[role="alert"] .status-icon { background: var(--warn-bg); color: var(--warn-ink); }
.loading::before {
  content: "";
  display: block;
  border: 3px solid #d5e8df;
  border-top-color: var(--brand);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero {
  display: grid;
  gap: 30px;
  padding: clamp(24px, 4vw, 46px);
  border-radius: 28px;
  background: #e4f0e9;
  border: 1px solid #d0e2d6;
  overflow: hidden;
}
.hero-copy { display: flex; flex-direction: column; gap: 21px; align-items: flex-start; min-width: 0; }
.hero-copy > p:not(.eyebrow) { color: #36594f; max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-actions button { min-height: 50px; padding: 13px 18px; display: inline-flex; align-items: center; gap: 8px; }
.hero-secondary { background: rgba(255, 255, 255, .68); border-color: #b7cec2; }
.hero-art { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-self: center; position: relative; min-width: 0; }
.art-panel { border: 1px solid #bad2c4; border-radius: 18px; padding: 20px; background: #fafffb; min-width: 0; box-shadow: 0 8px 20px rgba(49, 88, 69, .03); }
.art-panel:first-child { grid-column: 1 / -1; background: var(--brand); color: #fff; }
.art-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .87rem; font-weight: 650; }
.art-dots { display: flex; gap: 5px; margin-top: 24px; align-items: end; height: 42px; }
.art-dots i { display: block; flex: 1; background: var(--accent); border-radius: 3px; height: 38%; }
.art-dots i:nth-child(2) { height: 56%; }
.art-dots i:nth-child(3) { height: 48%; }
.art-dots i:nth-child(4) { height: 78%; }
.art-dots i:nth-child(5) { height: 96%; }
.art-line { height: 7px; background: #d6e7dd; margin-top: 10px; border-radius: 10px; }
.art-line.short { width: 60%; }
.art-check { width: 24px; height: 24px; }

.intro { margin: 34px 0 18px; display: grid; gap: 9px; }

.related-services { display: grid; gap: 10px; margin: 22px 0 4px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.66); }
.related-services h2 { font-size: .9rem; color: var(--muted); letter-spacing: 0; }
.related-grid { display: grid; gap: 10px; }
.related-grid .service-card { min-height: 64px; background: #fff; }
.related-grid .service-icon { width: 42px; height: 42px; }
.quick-starts { display: grid; gap: 12px; margin: 24px 0 10px; }
.quick-starts h2 { font-size: 1.2rem; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.quick-button { min-width: 0; min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 8px; font-size: .84rem; }
.quick-button span { min-width: 0; word-break: keep-all; overflow-wrap: break-word; text-wrap: balance; }
.service-sections { display: grid; gap: 28px; }
.service-section { display: grid; gap: 12px; }
.service-section-head { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.service-section-head h2 { font-size: 1.08rem; }
.service-section-mode { margin-left: 2px; }
.metrics.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.disclosure { border-top: 1px solid var(--line); padding-top: 4px; }
.disclosure summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-weight: 700; list-style: none; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: '+'; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); color: var(--brand); flex: 0 0 24px; }
.disclosure[open] summary::after { content: '−'; }
.disclosure-count { margin-left: auto; font-size: .78rem; font-weight: 650; color: var(--muted); }
.disclosure > :not(summary) { margin: 4px 0 12px; }
.service-grid { display: grid; gap: 10px; }
.service-card {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 13px;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  min-width: 0;
  transition: transform .15s, box-shadow .15s;
}
.service-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--soft); color: #365f52; }
.service-card-label { display: flex; min-width: 0; align-items: center; gap: 8px; flex-wrap: wrap; }
.service-card-label strong { font-size: 1rem; }
.service-arrow { color: #5d756d; }
.badge { font-size: .73rem; border-radius: 7px; background: #f7eaca; color: #64490b; padding: 3px 9px; display: inline-block; font-weight: 650; }

.page-head { display: grid; gap: 10px; margin: 10px 0 18px; }
.page-head h1 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.service-title-icon { width: 28px; height: 28px; flex: 0 0 28px; fill: none; stroke: var(--brand); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.back { width: max-content; display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; font-size: .83rem; margin-bottom: 8px; }

.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); border-radius: 14px; padding: 15px; font-size: .86rem; margin: 18px 0; }
.notice.info { background: #eaf2ef; color: #30544a; border-color: #c9dfd3; }
.category-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 16px 0 20px; padding: 2px; }
.category-button { width: 100%; min-height: 48px; min-width: 0; padding: 8px 12px; display: flex; align-items: center; justify-content: flex-start; gap: 8px; font-size: .86rem; text-align: left; }
.category-button span { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.category-button[aria-current="page"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.preparation-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0 20px; padding: 2px; }
.preparation-step { position: relative; width: 100%; min-width: 0; min-height: 52px; padding: 8px 10px; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: .82rem; text-align: center; }
.preparation-step span { min-width: 0; overflow-wrap: anywhere; }
.preparation-step[aria-current="page"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.preparation-step:disabled { opacity: .48; cursor: default; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 30px); min-width: 0; }
.panel + .panel { margin-top: 18px; }
.stack { display: grid; gap: 16px; }
.checklist { display: grid; gap: 8px; margin: 4px 0; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; min-height: 56px; }
.check-row:has(:checked) { background: var(--soft); border-color: #9ebfb0; }
.summary-number { font-size: 2.2rem; font-weight: 800; line-height: 1.1; letter-spacing: -.05em; }
.result-block { display: flex; justify-content: space-between; align-items: center; gap: 15px; flex-wrap: wrap; padding: 18px; background: #eaf3ee; border-radius: 16px; }

.readiness-copy { display: flex; align-items: center; gap: 10px; min-width: 0; }
.readiness-copy > div { display: grid; gap: 2px; min-width: 0; }
.readiness-copy > .ui-icon { color: #416a5d; }
.readiness-review { align-items: center; }
.readiness-review .readiness-copy { flex: 1 1 260px; }
.readiness-item { cursor: default; }
.readiness-item .ui-icon { width: 19px; height: 19px; flex-basis: 19px; color: #416a5d; }
.readiness-item[data-state="missing"] { background: #fff9ec; border-color: #e7d6ad; }
.readiness-item[data-state="missing"] .ui-icon { color: #8a6518; }
.readiness-summary { margin-bottom: 2px; }
.choice-grid { display: grid; gap: 10px; }
.choice-card { border: 1px solid var(--line); border-radius: 15px; padding: 16px; display: grid; gap: 8px; align-content: start; }
.choice-card > .ui-icon { color: #40695e; }

.project-context {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.project-context-copy { display: flex; align-items: center; gap: 10px; min-width: 0; }
.project-context-copy > div { display: grid; min-width: 0; }
.project-context-copy strong, .project-context-copy span { overflow-wrap: anywhere; }
.project-context .ui-icon { color: #40695e; }

.project-toolbar { display: grid; gap: 9px; margin: 0 0 12px; }
.project-filter-fields { display: grid; grid-template-columns: 1fr; gap: 9px; }
.project-toolbar input { width: 100%; min-width: 0; }
.project-filter-meta { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.project-result-status { display: flex; align-items: baseline; gap: 7px; color: var(--muted); font-size: .84rem; }
.project-result-status strong { color: var(--ink); font-size: 1rem; }
.project-filter-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.project-refresh[data-pending="true"] { background: var(--soft); border-color: #9ebfb0; }
.project-applied-filters { display: flex; gap: 7px; flex-wrap: wrap; min-width: 0; }
.filter-chip { min-height: 48px; max-width: 100%; padding: 7px 10px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: var(--soft); color: var(--ink); }
.filter-chip span { max-width: min(220px, 58vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip .ui-icon { width: 17px; height: 17px; flex-basis: 17px; }
.project-browser { display: grid; gap: 14px; min-width: 0; }
.project-list-pane, .project-detail-pane { min-width: 0; }
.project-grid { display: grid; gap: 12px; }
.project-card { display: grid; gap: 14px; }
.project-more { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.project-card.selected { border-color: #83aa99; box-shadow: 0 0 0 2px rgba(66, 111, 91, .08); }
.project-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.project-symbol { width: 44px; height: 44px; background: var(--soft); border-radius: 14px; display: grid; place-items: center; font-weight: 700; color: #416a5d; flex-shrink: 0; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.metric { border-top: 1px solid var(--line); padding-top: 12px; min-width: 0; }
.metric p { font-size: .79rem; color: var(--muted); }
.metric strong { display: block; font-size: 1.2rem; overflow-wrap: anywhere; }
.project-card button { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.project-detail { min-height: 100%; }
.project-detail-back { margin: 0; }
.compare-selection { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.78); }
.compare-selection-status { display: flex; align-items: baseline; gap: 7px; min-width: 0; color: var(--muted); font-size: .84rem; }
.compare-selection-status strong { color: var(--ink); font-size: 1rem; white-space: nowrap; }
.compare-view { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.compare-view:disabled { cursor: default; opacity: .45; }
.compare-projects { display: flex; flex-wrap: wrap; gap: 8px; }
.compare-project-chip { min-height: 48px; max-width: 100%; border: 1px solid var(--line); border-radius: 999px; padding: 5px 6px 5px 12px; display: inline-flex; align-items: center; gap: 6px; min-width: 0; background: #fff; }
.compare-project-chip strong { min-width: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.compare-project-chip button { flex: 0 0 auto; min-height: 48px; min-width: 48px; padding: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 0; border-radius: 999px; }
.compare-project-chip button .ui-icon { width: 18px; height: 18px; flex-basis: 18px; }
.compare-project-chip button span:not(.sr-only) { display: none; }
.compare-matrix { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: #fff; }
.compare-matrix-row { display: grid; grid-template-columns: minmax(78px, .9fr) repeat(var(--compare-count), minmax(0, 1fr)); min-width: 0; }
.compare-matrix-row + .compare-matrix-row { border-top: 1px solid var(--line); }
.compare-matrix-row > * { min-width: 0; padding: 11px 9px; overflow-wrap: anywhere; }
.compare-matrix-row > * + * { border-left: 1px solid var(--line); }
.compare-matrix-head { background: var(--soft); align-items: stretch; }
.compare-matrix-head > :first-child { padding: 0; }
.compare-matrix-project { display: flex; align-items: center; font-size: .79rem; line-height: 1.35; }
.compare-matrix-label { color: var(--muted); font-size: .78rem; display: flex; align-items: center; }
.compare-matrix-value { display: flex; align-items: center; }
.compare-matrix-value strong { font-size: 1.1rem; }

.form-grid { display: grid; gap: 16px; margin: 18px 0; }
.field { display: grid; gap: 7px; min-width: 0; font-size: .91rem; }
.field input { width: 100%; min-width: 0; }
.field small { color: var(--muted); }
.schedule { display: grid; gap: 8px; margin-top: 18px; }
.schedule-row { display: grid; grid-template-columns: 65px 1fr 1fr; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); min-width: 0; font-size: .88rem; }
.schedule-row > * { min-width: 0; overflow-wrap: anywhere; }
.schedule-row.header { font-weight: 700; background: var(--soft); border-radius: 10px; }
.plan-caption { margin-top: 16px; }

.records-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 18px 0; }
.records-toolbar input { max-width: 180px; }
.record-list { display: grid; gap: 8px; list-style: none; padding: 0; margin: 18px 0; }
.record { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 15px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.record time { font-size: .8rem; color: var(--muted); }
.actions { display: flex; gap: 9px; flex-wrap: wrap; }
.inline-error { padding: 14px; border: 1px solid #d4a399; border-radius: 12px; color: #813829; background: #fcf0ed; margin: 14px 0; }
.instruction-number { font-size: .76rem; font-weight: 750; color: #46735e; letter-spacing: .06em; margin-bottom: 8px; }

.participants { display: grid; gap: 12px; margin: 20px 0; }
.participant { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; min-width: 0; }
.participant legend { font-size: .82rem; font-weight: 700; padding: 0 7px; }
.participant .field { font-size: .75rem; gap: 6px; }
.participant input { padding: 8px; min-width: 0; width: 100%; }
.participant .field span { min-height: 2.5em; }
.field:has(#growth-reward) { grid-column: 1 / -1; }
.form-grid:has(#growth-reward) { grid-template-columns: repeat(2, minmax(0, 1fr)); }

dialog { width: min(440px, calc(100% - 30px)); border: 1px solid var(--line); border-radius: 20px; padding: 26px; color: var(--ink); }
dialog::backdrop { background: rgba(13, 37, 57, .48); }
dialog h2 { font-size: 1.25rem; }
.dialog-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
#toast { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 13px 20px; background: #183e3d; color: #fff; border-radius: 12px; z-index: 40; font-size: .9rem; }
[hidden] { display: none !important; }



@media (max-width: 419px) {
  .compare-matrix-row { grid-template-columns: minmax(70px, .82fr) repeat(var(--compare-count), minmax(0, 1fr)); }
  .compare-matrix-row > * { padding: 10px 7px; }
  .compare-matrix-project, .compare-matrix-label { font-size: .72rem; }
  .compare-matrix-value strong { font-size: 1rem; }
}

@media (max-width: 639px) {
  .hero { gap: 22px; }
  .hero-art { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .art-panel, .art-panel:first-child { grid-column: auto; padding: 12px 10px; border-radius: 14px; }
  .art-title { font-size: .73rem; gap: 4px; }
  .art-title .ui-icon, .art-check { width: 19px; height: 19px; }
  .art-dots { height: 24px; margin-top: 10px; gap: 3px; }
  .art-line { margin-top: 8px; height: 5px; }
}

/* Compact phones show either the project list or its detail, not a squeezed split view. */
@media (max-width: 899px) {
  .project-browser:not(.compare-mode):not(.detail-open) .project-detail-pane { display: none; }
  .project-browser:not(.compare-mode).detail-open .project-list-pane { display: none; }
  .project-browser.compare-mode .project-detail-pane { display: block; }
}

@media (min-width: 640px) {
  main { padding: 32px; }
  .hero { grid-template-columns: 1.15fr .85fr; }
  .hero-art { gap: 9px; }
  .art-panel { padding: 17px; }
  .hero-copy { gap: 18px; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-nav { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 2fr 1fr 1fr; }
  .participants { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid:has(#growth-reward) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-filter-fields { grid-template-columns: minmax(0, 1fr) minmax(150px, .42fr); }
  .related-services h2 { font-size: 1rem; }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tablet/desktop can reveal list and detail together while preserving the mobile mental model. */
@media (min-width: 900px) {
  .project-browser { grid-template-columns: minmax(320px, .88fr) minmax(360px, 1.12fr); align-items: start; }
  .project-detail-pane { position: sticky; top: 16px; }
  .comparison-panel { min-height: 300px; }
}

@media (min-width: 1060px) {
  .layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 10px; padding: 0 30px; }
  .desktop-nav { display: flex; flex-direction: column; gap: 6px; padding-top: 40px; position: sticky; top: 12px; align-self: start; }
  .desktop-nav .nav-button { background: transparent; border: 0; text-align: left; font-size: .88rem; padding: 11px 13px; min-height: 48px; }
  .desktop-nav .nav-button[aria-current="page"] { background: var(--mint); color: var(--brand); }
  .bottom-nav { display: none; }
  html { scroll-padding-bottom: 20px; }
  main { padding: 38px 22px 45px; width: 100%; }
  footer { padding-bottom: 30px; }
  .service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-copy > p:not(.eyebrow) { font-size: .95rem; }
  .hero h1 { font-size: clamp(2.2rem, 3.4vw, 3.4rem); }
  #toast { bottom: 30px; }
}

@media (max-width: 359px) {
  .project-context { align-items: stretch; flex-direction: column; }
  .project-context > button { width: 100%; justify-content: center; }
  main { padding: 20px 12px; }
  .topbar { padding-left: 14px; padding-right: 14px; }
  .brand { font-size: 1.4rem; }
  .hero { padding: 21px; }
  .art-panel { padding: 14px; }
  .category-button { padding: 8px 9px; }
  .schedule-row { grid-template-columns: 48px 1fr 1fr; font-size: .79rem; }
  .form-grid { gap: 12px; }
}

@media (hover: hover) and (pointer: fine) {
  button:hover { background: var(--soft); }
  button.primary:hover { background: #235958; }
  .service-card:hover { transform: translateY(-1px); background: #fff; box-shadow: 0 8px 25px rgba(20, 57, 59, .05); }
}

@media (forced-colors: active) {
  .badge, .notice, .result-block, .service-icon, .bottom-nav .nav-button[aria-current="page"] { forced-color-adjust: auto; }
  button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid Highlight; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.draft-actions { display: flex; justify-content: flex-end; margin-top: -4px; }
.draft-actions button { color: var(--muted); }

@media (max-width: 359px) {
  .status-panel { grid-template-columns: 40px minmax(0, 1fr); padding: 20px 16px; }
  .status-icon { width: 40px; height: 40px; }
  .status-action { grid-column: 1 / -1; width: 100%; justify-content: center; }
}


/* --------------------------------------------------------------------------
 * Visual hierarchy pass
 *
 * Goals:
 * - keep the mobile portrait flow unchanged;
 * - make each user-goal layer visually scannable without adding explanation;
 * - use icon + word actions instead of image-embedded text;
 * - improve depth/focus without animation-heavy or GPU-heavy decoration.
 * -------------------------------------------------------------------------- */
body {
  background:
    radial-gradient(circle at 12% 0%, rgba(194, 226, 211, .30), transparent 32rem),
    linear-gradient(180deg, #f8faf8 0, var(--paper) 30rem);
}
.topbar {
  box-shadow: 0 1px 0 rgba(17, 63, 67, .03);
}
.hero {
  background:
    radial-gradient(circle at 92% 4%, rgba(255, 255, 255, .62), transparent 17rem),
    linear-gradient(145deg, #e7f3ec, #dcece4);
  box-shadow: var(--shadow-soft);
}
.hero .primary { box-shadow: 0 8px 22px rgba(18, 63, 67, .14); }
.art-panel { box-shadow: 0 10px 28px rgba(30, 70, 58, .055); }

.quick-starts {
  padding: 18px;
  border: 1px solid rgba(199, 217, 209, .92);
  border-radius: 22px;
  background: var(--surface-raised);
}
.quick-button,
.related-grid .service-card {
  background: rgba(255, 255, 255, .88);
}
.quick-button .ui-icon { color: #416a5d; }
.related-services {
  background: linear-gradient(135deg, rgba(229, 242, 235, .88), rgba(255, 255, 255, .86));
  border-color: #c9ddd3;
}

.service-sections { gap: 18px; }
.service-section {
  --section-accent: #557c70;
  --section-soft: #edf5ef;
  position: relative;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-raised);
  box-shadow: 0 8px 28px rgba(31, 63, 57, .045);
  overflow: hidden;
}
.service-section::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--section-accent);
  opacity: .72;
}
.service-section[data-section="discover"] { --section-accent: #3b7281; --section-soft: #e9f3f5; }
.service-section[data-section="participate"] { --section-accent: #3f795e; --section-soft: #e9f4ed; }
.service-section[data-section="operate"] { --section-accent: #7c6940; --section-soft: #f5f0e5; }
.service-section[data-section="personal"] { --section-accent: #6c647f; --section-soft: #f1eef6; }
.service-section-head { justify-content: space-between; }
.service-section-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.service-section-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  background: var(--section-soft);
  color: var(--section-accent);
}
.service-section-icon .ui-icon { width: 20px; height: 20px; }
.service-section-head h2 { font-size: 1.02rem; }
.service-section .service-card {
  background: rgba(255, 255, 255, .92);
  border-color: #d4e0dc;
}
.service-section .service-icon {
  background: var(--section-soft);
  color: var(--section-accent);
}
.service-card:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--focus); }
.service-arrow { transition: transform .15s ease; }
.category-nav,
.preparation-flow {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
}
.category-button[aria-current="page"],
.preparation-step[aria-current="page"] {
  box-shadow: 0 8px 18px rgba(18, 63, 67, .12);
}
.panel { box-shadow: 0 8px 26px rgba(25, 61, 55, .04); }

@media (min-width: 640px) {
  .service-section { padding: 18px; }
}
@media (min-width: 1060px) {
  .desktop-nav {
    padding: 14px 10px;
    border: 1px solid rgba(210, 224, 219, .88);
    border-radius: 20px;
    background: rgba(255, 255, 255, .74);
  }
  .desktop-nav .nav-button[aria-current="page"] { box-shadow: inset 3px 0 0 var(--brand); }
  .service-section { padding: 20px; }
}
@media (hover: hover) and (pointer: fine) {
  .service-card:hover { box-shadow: var(--shadow-soft); border-color: #bfd3ca; }
  .service-card:hover .service-arrow { transform: translateX(2px); }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .bottom-nav, .service-section { background: #fff; }
}

@media (prefers-contrast: more) {
  :root { --line: #a9bab5; --muted: #3f565d; }
  .service-card, .panel, .category-nav, .preparation-flow, .related-services, .bottom-nav { border-color: #9fb3ad; }
  .badge { border: 1px solid currentColor; }
}
