/* Platform additions on top of the marketing site's styles.css and portal.css.
   Uses the same tokens; nothing here redefines a brand colour. */

/* The demo hides its tab row until JavaScript runs. Here the tabs are plain links, so always show them. */
html.app .portal-tabs { display: flex; }
@media (min-width: 56rem) { html.app .portal-body { display: grid; } }

.portal-tabs a {
  flex: none; font-size: 0.9688rem; font-weight: 600; color: var(--text-muted); text-decoration: none;
  border-bottom: 3px solid transparent; padding: 0.875rem 1.125rem;
}
.portal-tabs a:hover { color: var(--heading); }
.portal-tabs a[aria-current="page"] { color: var(--heading); border-bottom-color: var(--current); background: var(--surface); }
.portal-tabs a:focus-visible { outline-offset: -3px; }
@media (min-width: 56rem) {
  .portal-tabs a { border-bottom: 0; border-left: 3px solid transparent; padding: 0.75rem 1.25rem; }
  .portal-tabs a[aria-current="page"] { border-left-color: var(--current); }
}

.app-section { padding-block: clamp(1.5rem, 4vw, 3rem); }
.app-user { display: flex; align-items: center; gap: 1rem; }
.app-user-name { color: var(--on-dark-muted); font-size: 0.9375rem; }
.app-user form { margin: 0; }
.app-back { color: var(--on-dark-muted); font-size: 0.9375rem; }
.app-footer { padding-block: 1.75rem; }
.app-footer p { margin: 0; max-width: none; }
.btn-small { font-size: 0.9375rem; padding: 0.5rem 0.875rem; }
button.btn-ghost { background: none; }

/* Sign-in and password pages */
.auth-card {
  max-width: 30rem; margin-inline: auto; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 6px; padding: clamp(1.5rem, 5vw, 2.5rem);
}
.auth-card h1 { font-size: 1.75rem; margin-bottom: 1rem; }
.auth-card p { color: var(--text-muted); }
.stack { display: grid; gap: 1.125rem; margin-top: 1.25rem; }
.stack p { margin: 0.25rem 0 0; }
.small { font-size: 0.9375rem; }

/* Messages */
.flash {
  margin: 0 0 1.25rem; max-width: none; padding: 0.75rem 1rem; border-radius: 4px;
  border-left: 4px solid var(--route-wider); background: var(--bg-tint); color: var(--heading); font-weight: 600;
}
.flash-error { border-left-color: #B3261E; }
.portal-panel p.flash { color: var(--heading); }
.empty { font-style: normal; }

/* Forms inside the portal */
.field select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--muted); border-radius: 3px; padding: 0.75rem 0.875rem;
}
.field select:focus-visible { outline: 3px solid var(--current); outline-offset: 1px; border-color: var(--current); }
.hint { display: block; margin-top: 0.3rem; font-size: 0.875rem; color: var(--text-muted); }
.check { display: flex; gap: 0.625rem; align-items: flex-start; font-weight: 600; color: var(--heading); margin: 1rem 0; }
.check input { margin-top: 0.3rem; width: 1.125rem; height: 1.125rem; flex: none; }
.field textarea { min-height: 5rem; }

.notice-form { margin-top: 1.25rem; }
.notice-form summary { display: inline-block; list-style: none; cursor: pointer; }
.notice-form summary::-webkit-details-marker { display: none; }
.notice-form[open] summary { margin-bottom: 1rem; }
.notice-form form { border: 1px solid var(--rule); border-radius: 4px; padding: 1.125rem 1.25rem; background: var(--bg-tint); }
.notice-given { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; margin-top: 1.25rem; }
.btn-quiet { color: var(--heading); }

.size { color: var(--text-muted); font-size: 0.875rem; }
@media (min-width: 40.0625rem) { .ptable .num + th, .ptable .num + td { padding-left: 1.5rem; } }

/* Admin */
.crumbs { font-size: 0.9375rem; margin-bottom: 0.5rem; }
.admin-form { margin: 1rem 0 0.5rem; border: 1px solid var(--rule); border-radius: 4px; }
.admin-form summary { cursor: pointer; padding: 0.75rem 1rem; font-weight: 600; color: var(--link); }
.admin-form form { padding: 0.25rem 1rem 1rem; }
.admin-form .btn { margin-top: 1.25rem; }
.inline { display: inline-flex; gap: 0.375rem; align-items: center; margin: 0; }
.inline input[type="date"] { font: inherit; font-size: 0.875rem; padding: 0.2rem 0.375rem; border: 1px solid var(--rule); border-radius: 3px; background: var(--surface); color: var(--text); }
.btn-link { font: inherit; font-size: 0.9375rem; background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.btn-link.danger { color: #B3261E; }
@media (prefers-color-scheme: dark) {
  .btn-link.danger { color: #FF9B93; }
  .flash-error { border-left-color: #FF9B93; }
}
.ptable td.actions > * { margin: 0 0.875rem 0.25rem 0; }
.ptable td.actions form { display: inline-flex; }
.mail-body { white-space: pre-wrap; font: inherit; font-size: 0.875rem; color: var(--text-muted); margin: 0.5rem 0 0; }
.portal-panel h2 .pill { vertical-align: middle; font-size: 0.8125rem; letter-spacing: 0; }

/* Emails waiting to be sent by hand */
.mail-card { border: 1px solid var(--rule); border-left: 4px solid var(--signal); border-radius: 4px; padding: 1rem 1.125rem; margin-bottom: 1rem; }
.mail-fields { display: grid; gap: 0.5rem; margin: 0 0 0.75rem; }
.mail-fields div { display: grid; grid-template-columns: 4.5rem 1fr; align-items: center; gap: 0.5rem; }
.mail-fields dt { font-size: 0.875rem; color: var(--text-muted); }
.mail-fields dd { margin: 0; }
.mail-fields input, .mail-text {
  width: 100%; font: inherit; font-size: 0.9375rem; color: var(--text); background: var(--bg-tint);
  border: 1px solid var(--rule); border-radius: 3px; padding: 0.4rem 0.6rem;
}
.mail-text { resize: vertical; line-height: 1.5; }
.mail-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; margin-top: 0.75rem; }

/* My account, two-step sign-in, audit */
.narrow-form { max-width: 26rem; }
.steps { padding-left: 1.25rem; list-style: decimal; display: grid; gap: 1.25rem; }
.steps li { padding-left: 0.25rem; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.25rem; letter-spacing: 0.08em; padding: 0.75rem 1rem; background: var(--bg-tint); border: 1px dashed var(--rule); border-radius: 4px; max-width: none; color: var(--heading); word-break: break-all; }
.recovery { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.5rem; margin: 1rem 0 1.5rem; }
.recovery code { display: block; font-size: 1.0625rem; padding: 0.5rem 0.75rem; background: var(--bg-tint); border-radius: 4px; text-align: center; color: var(--heading); }
.filters { display: grid; gap: 0.75rem 1rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); align-items: end; margin-bottom: 1rem; }
.filters p { margin: 0; display: flex; gap: 1rem; align-items: center; }
.ptable.audit td { font-size: 0.875rem; }
.ptable.audit code { font-size: 0.8125rem; word-break: break-all; }
h3 .btn-link.small { font-size: 0.875rem; font-weight: 500; margin-left: 0.75rem; }
.inline select { font: inherit; font-size: 0.875rem; padding: 0.2rem 0.375rem; border: 1px solid var(--rule); border-radius: 3px; background: var(--surface); color: var(--text); }

/* Phase 2: fleet and vessel management */
.pill-red { background: #B42318; border-color: #B42318; color: #FFFFFF; }
.subnav { margin: 0 0 1.5rem; border-bottom: 1px solid var(--rule); overflow-x: auto; }
.subnav ul { display: flex; gap: 0 1.25rem; list-style: none; margin: 0; padding: 0; white-space: nowrap; }
.subnav a { display: inline-block; padding: 0.5rem 0 0.625rem; font-size: 0.9375rem; text-decoration: none; color: var(--text-muted); border-bottom: 3px solid transparent; }
.subnav a:hover { color: var(--heading); }
.subnav a[aria-current="page"] { color: var(--heading); font-weight: 600; border-bottom-color: var(--signal); }
.portal-panel .vessel-head h3 a { color: inherit; text-decoration: none; }
.portal-panel .vessel-head h3 a:hover { text-decoration: underline; }
.vessel-more { margin: 1rem 0 0; font-size: 0.9375rem; }
.ptable tr:has(+ .row-actions) > * { border-bottom: 0; }
.ptable .row-actions > td { padding-top: 0; }
.row-actions td > details.admin-form, .row-actions td > form.inline { display: inline-block; vertical-align: top; margin: 0 1rem 0.25rem 0; }
.row-actions td > details.admin-form[open] { display: block; margin-right: 0; }

/* Phase 3: commercial */
.two-col { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); align-items: start; }
.invoice { border: 1px solid var(--rule); border-radius: 4px; padding: 1.5rem; margin-top: 1rem; background: var(--surface); }
.invoice-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.5rem; }
.invoice-title h2 { margin: 0 0 0.5rem; }
.invoice-title dl { display: grid; grid-template-columns: auto auto; gap: 0.25rem 1rem; margin: 0; }
.invoice-title dl div { display: contents; }
.invoice-title dt { color: var(--text-muted); font-size: 0.875rem; }
.invoice-title dd { margin: 0; font-weight: 600; color: var(--heading); }
.invoice-to, .invoice-bank { margin: 1.25rem 0; }
.todo { display: inline-block; padding: 0.125rem 0.5rem; border: 1px dashed var(--signal); border-radius: 3px; font-size: 0.875rem; }
@media print {
  .site-header, .site-footer, .portal-bar, .portal-tabs, .portal-flag, .no-print, .skip { display: none !important; }
  body, .portal, .portal-panel, .invoice { background: #fff !important; color: #000 !important; border: 0 !important; box-shadow: none !important; }
  .invoice { padding: 0; }
  .invoice * { color: #000 !important; }
  .todo { border-color: #000; }
}

/* Phase 5: dashboard tiles that open the page behind the figure */
a.tile-link { text-decoration: none; color: inherit; }
a.tile-link:hover, a.tile-link:focus-visible { border-color: var(--heading); }

/* Owner decisions, 19 November 2026 */
.prewrap { white-space: pre-wrap; }
.mia-answer { white-space: pre-wrap; border-left: 3px solid currentColor; padding-left: 1rem; }
.bl .facts dd { white-space: normal; }
