/* Sea-service calculator (sea-service.html). Colours, type, buttons, the hero
   and the choice buttons (.route-option, .finder-option) come from
   css/career-paths.css, which this page loads first; the header, the section
   bar and the footer from css/site-chrome.css. This file is the calculator
   itself: the form (js/sea-service-view.js), the result and the two static
   sections under it. */
.calc-section { background: var(--soft); }
.calc { margin-top: 14px; }
.calc[hidden] { display: none; }
.calc-private { display: flex; align-items: baseline; gap: 6px; margin: 0; font-size: 0.875rem; color: var(--text-2); }
.calc-private i { color: var(--ok); }

.calc-step, .calc-result { margin-top: 14px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.calc-step-title { margin: 0 0 12px; font-size: 1.125rem; line-height: 1.35; color: var(--navy); }
.calc-groups, .calc-targets { display: flex; flex-wrap: wrap; gap: 8px; }
.calc-targets { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.calc-target[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.calc-routes { display: grid; gap: 10px; }
.calc-hint { margin: 0; font-size: 0.875rem; color: var(--text-2); }
.calc-step > .calc-hint { font-size: 1rem; }

/* Labelled controls: one look for dates, text and selects */
.calc-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.calc-field { display: grid; align-content: start; gap: 4px; min-width: 0; }
.calc-field label { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.calc-field input, .calc-field select { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); font: inherit; font-size: 1rem; }
.calc-field input:hover, .calc-field select:hover { border-color: var(--muted); }
.calc-field input:disabled { background: var(--soft); color: var(--muted); border-color: var(--line); }

/* One ship */
.calc-ships { display: grid; gap: 12px; margin-top: 12px; }
.ship-card { min-width: 0; margin: 0; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: 12px; }
.ship-card.has-problem { border-color: var(--warn-line); background: var(--warn-bg); }
.ship-card legend { padding: 0 6px; font-weight: 700; color: var(--navy); }
/* One column on a phone: a date needs the full width to show its year */
.ship-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ship-wide { grid-column: 1 / -1; }
.ship-open { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; }
.ship-open input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--primary); }
.ship-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-top: 8px; }
.ship-status { margin: 0; min-height: 1.4em; font-size: 0.875rem; font-weight: 600; color: var(--text-2); }
.ship-status.is-problem { color: var(--warn-text); }
.ship-remove { gap: 6px; min-height: 44px; margin-left: auto; text-decoration: none; }
.ship-remove:hover span { text-decoration: underline; }
.calc-add { margin-top: 12px; }
@media (min-width: 480px) {
    .ship-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Four across only where each date still shows its year */
@media (min-width: 800px) {
    .ship-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ship-grid > .ship-wide { grid-column: span 2; }
    .ship-grid > .ship-open { grid-column: 1 / -1; }
}

/* The result */
.calc-result { border: 2px solid var(--primary); }
.calc-waiting { margin: 0; color: var(--text-2); }
.calc-verdict { padding: 14px 16px; border-radius: 12px; background: var(--soft); border-left: 6px solid var(--warn-edge); }
.calc-verdict.tone-ok { border-left-color: var(--ok); }
.calc-headline { display: flex; align-items: baseline; gap: 10px; margin: 0; font-size: 1.25rem; font-weight: 700; line-height: 1.35; color: var(--navy); }
.calc-headline i { flex: none; color: var(--warn-edge); }
.tone-ok .calc-headline i { color: var(--ok); }
.calc-have { margin: 6px 0 0; color: var(--text-2); }
.calc-when { margin: 12px 0 4px; padding: 10px 12px; border-radius: 8px; background: var(--primary-light); color: var(--navy); font-weight: 600; }
.calc-when.is-blocked { background: var(--warn-bg); color: var(--warn-text); }
.calc-conds { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.cond { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-left: 6px solid var(--warn-edge); border-radius: 12px; }
.cond.is-met { border-left-color: var(--ok); }
.cond-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.cond-name { font-weight: 600; }
.cond-state { font-size: 0.875rem; font-weight: 600; color: var(--warn-text); }
.is-met .cond-state { color: var(--ok); }
.cond-bar { height: 8px; margin-top: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.cond-fill { display: block; height: 100%; border-radius: 999px; background: var(--warn-edge); }
.is-met .cond-fill { background: var(--ok); }
.cond-figures { margin: 6px 0 0; font-size: 0.875rem; color: var(--text-2); }
.calc-caution p { margin: 4px 0 0; }
.calc-sub { margin: 18px 0 4px; font-size: 1rem; color: var(--navy); }
.calc-list { margin: 0; padding-left: 20px; color: var(--text-2); }
.calc-list li { margin-bottom: 4px; }
.calc-final { margin: 10px 0 0; font-size: 0.875rem; color: var(--muted); }
.calc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

/* How it is counted, and every certificate */
.calc-method { padding-left: 22px; }
.calc-method li { margin-bottom: 8px; }
.calc-table th[scope="row"] { color: var(--navy); white-space: nowrap; }
.calc-table td:last-child { white-space: nowrap; }
.calc-table td:last-child a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.calc-cta-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
@media (max-width: 700px) {
    .calc-step, .calc-result { padding: 16px; }
    .calc-table, .calc-table tbody, .calc-table tr, .calc-table th, .calc-table td { display: block; }
    .calc-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .calc-table tbody tr { margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
    .calc-table tbody th, .calc-table tbody td { padding: 2px 0; border: 0; }
    .calc-table th[scope="row"] { font-size: 1.125rem; white-space: normal; }
}

/* On paper: the result, the certificate dates and the ships. The choices are buttons (the result names the certificate). */
@media print {
    .calc-private, .calc-choose, .calc-add, .ship-remove, .calc-actions, .calc-nojs, .cp-note, #method, #table { display: none; }
    .calc-step, .calc-result { border: 1px solid #999; break-inside: avoid; }
}
