/* Ship Marine AI shared stylesheet. Every colour is a token from tokens.json; Night is the default theme. */
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
.sm-root { background: var(--bg); color: var(--ink); font-family: var(--font-sans); }
.sm-pad { padding: 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.sm-stack { display: flex; flex-direction: column; gap: 12px; }
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.sm-only-light { display: none !important; }
[data-theme="light"] .sm-only-light { display: block !important; }
[data-theme="light"] .sm-only-dark { display: none !important; }
.sm-tnum { font-variant-numeric: tabular-nums; }

/* ---------- type ---------- */
.sm-kicker { margin: 0; font-size: 15px; font-weight: 500; color: var(--accent); }
.sm-h1 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(36px, 4.4vw, 52px); line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
.sm-h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.005em; }
.sm-h3 { margin: 0; font-size: 15px; font-weight: 600; }
.sm-lead { margin: 0; font-size: 17px; line-height: 1.6; color: var(--ink-muted); max-width: 70ch; }
.sm-hint { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-dim); }

/* ---------- buttons ---------- */
.sm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--ink); font-family: inherit; font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; box-sizing: border-box; }
.sm-btn:hover { background: var(--chip); }
.sm-btn--primary { padding: 0 24px; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.sm-btn--primary:hover { background: var(--accent); filter: brightness(1.06); }
.sm-btn--small { min-height: 38px; padding: 0 16px; font-size: 14px; }
.sm-btn--danger { color: var(--bad); border-color: var(--bad-line); }
.sm-btn--danger:hover { background: var(--bad-soft); }
.sm-btn[disabled] { opacity: 0.45; cursor: not-allowed; filter: none; }
.sm-link-back { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: 14px; color: var(--ink-muted); text-decoration: none; }
.sm-icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--ink-nav); cursor: pointer; padding: 0; flex-shrink: 0; }
.sm-icon-btn--round { border: 1px solid var(--line-strong); border-radius: 999px; }
.sm-icon-btn:hover { background: var(--chip); color: var(--ink); }
.sm-header-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.sm-header-link:hover { background: var(--chip); }

/* ---------- form fields ---------- */
.sm-field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-muted); min-width: 0; }
.sm-field .sm-hint { font-weight: 400; }
.sm-input { width: 100%; box-sizing: border-box; height: 46px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input); color: var(--ink); font-family: inherit; font-size: 15px; font-weight: 400; }
.sm-input::placeholder { color: var(--ink-dim); opacity: 1; }
.sm-input:focus { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
textarea.sm-input { height: auto; min-height: 92px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
select.sm-input { appearance: auto; }
.sm-input--upper { text-transform: uppercase; }
.sm-search { position: relative; display: block; min-width: 220px; }
.sm-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-dim); }
.sm-search .sm-input { padding-left: 42px; border-radius: 999px; }
.sm-grid-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px; }

/* ---------- checkboxes and radios ---------- */
.sm-check { display: flex; align-items: center; gap: 12px; min-height: 52px; box-sizing: border-box; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--input); font-size: 14px; color: var(--ink-nav); cursor: pointer; }
.sm-check input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }
.sm-check input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sm-check:has(input:checked) { border-color: var(--accent-border); background: var(--accent-soft); color: var(--ink); }
.sm-check--ack { align-items: flex-start; font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--warn-soft); border-color: var(--warn-line); }
.sm-check--ack input { margin-top: 2px; }
.sm-check--ack:has(input:checked) { background: var(--ok-soft); border-color: var(--ok-line); }
.sm-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }

/* ---------- status pills and badges ---------- */
.sm-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.35; white-space: nowrap; color: var(--ink-muted); background: var(--chip); border: 1px solid var(--line-strong); }
.sm-pill--ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.sm-pill--bad { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-line); }
.sm-pill--warn { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.sm-pill--info { color: var(--info); background: var(--info-soft); border-color: var(--info-line); }
.sm-pill--ref { color: var(--ref); background: var(--ref-soft); border-color: var(--ref-line); }
.sm-soon { font-size: 12px; font-weight: 500; color: var(--soon); background: var(--soon-soft); border: 1px solid var(--soon-line); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.sm-soon--accent { color: var(--accent); background: transparent; border-color: var(--accent-line); }

/* ---------- filter chips and segmented tabs ---------- */
.sm-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.sm-chip { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 16px; border-radius: 999px; font-family: inherit; font-size: 14px; cursor: pointer; border: 1px solid var(--line-strong); background: transparent; color: var(--ink-nav); }
.sm-chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.sm-chip[aria-pressed="true"] { border-color: var(--accent-border); background: var(--accent-soft); color: var(--ink); font-weight: 500; }
.sm-seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--chip); }
.sm-seg button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; font-family: inherit; font-size: 14px; cursor: pointer; background: transparent; color: var(--ink-muted); }
.sm-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-tab); }

/* ---------- cards, steps, notices ---------- */
.sm-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.sm-card--pad { padding: clamp(20px, 3vw, 32px); display: flex; flex-direction: column; gap: 22px; }
.sm-step-head { display: flex; gap: 14px; align-items: flex-start; }
.sm-step-head > div { display: flex; flex-direction: column; gap: 6px; }
.sm-step { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.sm-notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 12px; font-size: 14px; line-height: 1.6; color: var(--ink); background: var(--info-soft); border: 1px solid var(--info-line); }
.sm-notice strong { font-weight: 600; }
.sm-notice--warn { background: var(--warn-soft); border-color: var(--warn-line); }
.sm-notice--ok { background: var(--ok-soft); border-color: var(--ok-line); }
.sm-notice--banner { padding: 16px 20px; border-radius: 14px; font-size: 15px; line-height: 1.55; }
.sm-notice svg { flex-shrink: 0; margin-top: 2px; }
.sm-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 0; }
.sm-facts > div { padding: 18px 24px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.sm-facts > div:first-child { border-left: 0; }
.sm-facts dt { font-size: 13px; color: var(--ink-dim); }
.sm-facts dd { margin: 0; font-size: 15px; font-weight: 600; }

/* ---------- data table ---------- */
.sm-table-scroll { overflow-x: auto; }
.sm-table { font-size: 14.5px; }
.sm-tr { display: grid; column-gap: 12px; padding: 16px 20px; border-top: 1px solid var(--line); align-items: start; }
.sm-tr--head { padding: 14px 20px 12px; border-top: 0; color: var(--ink-dim); font-size: 13px; font-weight: 600; }
.sm-tr:not(.sm-tr--head):hover { background: var(--row-hover); }
.sm-tr > * { min-width: 0; }
.sm-cell-main { font-weight: 600; color: var(--ink); text-decoration: none; }
.sm-cell-sub { margin-top: 4px; font-size: 13px; color: var(--ink-dim); }
.sm-bar { margin-top: 8px; width: 88px; height: 4px; border-radius: 999px; background: var(--track); overflow: hidden; }
.sm-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.sm-bar--done > span { background: var(--ok); }
.sm-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.sm-empty { padding: 48px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sm-empty p { margin: 0; }
.sm-empty .sm-empty-title { font-size: 16px; font-weight: 600; }
.sm-empty .sm-empty-text { font-size: 14px; color: var(--ink-muted); }

/* ---------- app shell ---------- */
.sm-app { display: flex; align-items: flex-start; min-height: 100%; background: var(--bg); color: var(--ink); }
.sm-app-main { flex: 1; min-width: 0; }
.sm-side { width: 272px; flex-shrink: 0; box-sizing: border-box; background: var(--sidebar); border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 20px; padding: 14px 12px; align-self: stretch; }
.sm-side--collapsed { width: 72px; align-items: center; }
.sm-ws { width: 100%; min-height: 60px; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-raised); color: var(--ink); font-family: inherit; text-align: left; box-sizing: border-box; }
.sm-ws img { width: 40px; height: 40px; flex-shrink: 0; }
.sm-ws-name { flex: 1; font-size: 16px; font-weight: 600; white-space: nowrap; }
.sm-ws-name em { font-style: normal; color: var(--ai); }
.sm-side-search { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: transparent; color: var(--ink-muted); font-family: inherit; font-size: 14px; box-sizing: border-box; }
.sm-side-search span { flex: 1; text-align: left; }
.sm-side-search kbd { font-family: inherit; font-size: 12px; color: var(--ink-dim); border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; }
.sm-nav { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.sm-nav-label { margin: 0 0 6px; padding: 0 12px; font-size: 13px; color: var(--ink-dim); }
.sm-nav-item { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-nav); font-family: inherit; font-size: 15px; text-align: left; text-decoration: none; box-sizing: border-box; cursor: pointer; }
.sm-nav-item > span:first-of-type { flex: 1; white-space: nowrap; }
.sm-nav-item:hover { background: var(--chip); color: var(--ink); }
.sm-nav-item--group { color: var(--ink); font-weight: 500; }
.sm-nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 500; }
.sm-nav-item[aria-current="page"] svg:first-child { color: var(--accent); }
.sm-side--collapsed .sm-nav-item { width: 48px; justify-content: center; padding: 0; }
.sm-subnav { margin: 2px 0 6px 22px; padding: 0 0 0 14px; list-style: none; border-left: 1px solid var(--line-strong); display: flex; flex-direction: column; gap: 2px; }
.sm-subnav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 38px; padding: 0 12px; border-radius: 7px; font-size: 14px; color: var(--ink-nav); text-decoration: none; white-space: nowrap; }
.sm-subnav a:hover { background: var(--chip); color: var(--ink); }
.sm-subnav a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 500; }
.sm-user { margin-top: auto; width: 100%; min-height: 60px; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-raised); color: var(--ink); font-family: inherit; text-align: left; cursor: pointer; box-sizing: border-box; }
.sm-user > svg { color: var(--ink-muted); flex-shrink: 0; }
.sm-user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sm-avatar { width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent-line); box-sizing: border-box; color: var(--ink); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.sm-user-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-user-role { font-size: 13px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-header { position: sticky; top: 0; z-index: 10; background: var(--header); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.sm-header-inner { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.sm-header-inner > div { display: flex; align-items: center; gap: 10px; }
.sm-header-logo { height: 84px; width: auto; display: block; }
.sm-page { max-width: 1200px; margin: 0 auto; padding: clamp(28px, 4vw, 48px) clamp(16px, 4vw, 40px) clamp(56px, 7vw, 96px); display: flex; flex-direction: column; gap: 28px; }
.sm-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 32px; }
.sm-page-head > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sm-split { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 28px; }
.sm-split > :first-child { flex: 1 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.sm-split > aside { flex: 0 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 124px; }
.sm-footer { border-top: 1px solid var(--rule); }
.sm-footer > div { max-width: 1200px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; font-size: 14px; color: var(--ink-muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
