/* NMSeawise intranet: look and sizes taken from the NMSeawise app (src/theme.ts and the component styles). */
:root {
  --bg: #0A1628; --card: rgba(24,43,74,.78); --card-pressed: rgba(40,66,106,.92); --line: rgba(110,150,210,.28);
  --text: #EEF2F7; --silver: #C9D2DE; --muted: #A3B3C8; --blue: #4A8EE0; --link: #72AAF0;
  --tab-bg: #0A1526; --tab-active: #1C3354; --input: rgba(8,20,38,.85); --danger: #E88A8A; --ok: #5FD39A;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: #0C1D36 linear-gradient(#08131F 0%, #0C1D36 55%, #1A3862 100%) fixed; color: var(--text);
  font: 16px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; overflow: hidden;
}
#sky { position: fixed; inset: 0; pointer-events: none; }
#sky i { position: absolute; border-radius: 50%; background: #fff; }
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 6px; }

.app { position: relative; height: 100vh; height: 100dvh; height: var(--app-h, 100dvh); display: flex; max-width: 100%; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.screen { flex: 1; overflow-y: auto; overflow-x: hidden; outline: none; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); display: flex; flex-direction: column; overflow-wrap: anywhere; }
.screen { scroll-padding-block: 16px; }
.sched-wrap { overflow-wrap: normal; }
body.sub .screen, body.auth .screen { padding-bottom: env(safe-area-inset-bottom); }
.screen > * { flex-shrink: 0; }
.body { padding: 16px; display: flex; flex-direction: column; gap: 12px; padding-bottom: 40px; }
.side { display: none; }

.ico { width: 24px; height: 24px; fill: currentColor; flex: none; display: inline-block; vertical-align: middle; }

/* header of sub screens */
.hdr { display: flex; align-items: center; padding: 8px 12px; }
.hdr .side-slot { min-width: 44px; min-height: 44px; display: flex; align-items: center; color: var(--text); }
.hdr .side-slot.r { justify-content: flex-end; }
.hdr h1 { flex: 1; text-align: center; font-size: 19px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr.big { padding: 12px 20px 8px; } .hdr.big h1 { text-align: left; font-size: 26px; font-weight: 700; }

/* tab bar */
.tabs { display: flex; background: var(--tab-bg); padding: 8px env(safe-area-inset-right) calc(6px + env(safe-area-inset-bottom)) env(safe-area-inset-left); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--silver); font-size: 12px; }
.tabs .pill { width: 64px; height: 34px; border-radius: 17px; display: flex; align-items: center; justify-content: center; }
.tabs a[aria-current="page"] { color: var(--blue); font-weight: 600; } .tabs a[aria-current="page"] .pill { background: var(--tab-active); }
body.sub .tabs { display: none; }

/* cards, text, form parts */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; display: block; color: inherit; text-decoration: none; text-align: left; }
[data-go] { cursor: pointer; } .card[data-go]:active, .row-item:active, .note-item:active { background: var(--card-pressed); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.card-title { font-size: 19px; font-weight: 700; } .card-text { color: var(--silver); font-size: 14px; line-height: 20px; }
.link-text { color: var(--link); font-size: 14px; } .divider { height: 1px; background: var(--line); }
.muted { color: var(--muted); } .silver { color: var(--silver); }
.label { color: var(--muted); font-size: 13px; display: block; margin-bottom: 8px; }
.field { display: block; }
.input { width: 100%; min-height: 50px; background: var(--input); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; font-size: 16px; color: var(--text); outline: none; }
.input:focus { border-color: var(--blue); } .input::placeholder { color: var(--muted); }
textarea.input { padding: 12px 14px; resize: none; }
.btn { min-height: 56px; width: 100%; border-radius: 16px; border: 1px solid var(--blue); background: var(--blue); color: #fff; font-size: 17px; font-weight: 600; padding: 0 18px; }
.btn.dim, .btn:disabled { opacity: .45; } .btn.secondary { background: rgba(22,44,82,.9); border-color: rgba(90,140,210,.45); }
.btn:active:not(:disabled) { opacity: .85; }
.err { color: var(--danger); font-size: 14px; line-height: 20px; } .hint { color: var(--muted); font-size: 13px; line-height: 18px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; min-height: 40px; gap: 12px; color: var(--silver); font-size: 14px; }
.sw { position: relative; width: 52px; height: 32px; flex: none; }
.sw input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.sw span { position: absolute; inset: 4px 0; border-radius: 12px; background: var(--line); transition: .12s; }
.sw span::after { content: ""; position: absolute; top: -3px; left: -1px; width: 26px; height: 26px; border-radius: 50%; background: #E3E9F1; transition: .12s; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.sw input:checked + span { background: var(--blue); } .sw input:checked + span::after { left: 27px; background: #79CDB4; }
.sw input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 3px; }
.sw input:disabled { cursor: default; } .sw input:disabled + span { opacity: .5; }
.datefield { position: relative; display: flex; align-items: center; gap: 10px; min-height: 50px; background: var(--input); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; flex: 1; font-size: 16px; cursor: pointer; }
.datefield:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px var(--link); }
.datefield input { flex: 1; min-width: 0; min-height: 48px; background: transparent; border: 0; outline: 0; color: inherit; font: inherit; cursor: pointer; color-scheme: dark; }
.datefield.ph input { color: var(--muted); }
.datefield input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.datefield .ico { color: var(--silver); }
.row { display: flex; align-items: center; gap: 8px; } .row.between { justify-content: space-between; }
.x-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
.section { font-size: 18px; font-weight: 700; margin-top: 8px; }
.empty-center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 24px; flex: 1 1 auto; margin-bottom: 8vh; }
.empty-center h2 { font-size: 18px; font-weight: 600; } .empty-center p { color: var(--muted); font-size: 14px; line-height: 20px; max-width: 300px; }
.empty-center .ico { color: var(--silver); width: 44px; height: 44px; } .empty-center.big .ico { width: 56px; height: 56px; }
.empty-text { color: var(--muted); font-size: 14px; text-align: center; margin-top: 32px; }

/* avatar */
.avatar { border-radius: 50%; border: 2px solid var(--silver); background: rgba(60,72,92,.9); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--text); flex: none; position: relative; font-weight: 600; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-wrap { position: relative; display: inline-block; flex: none; }
.cam { display: none; position: absolute; right: -2px; bottom: -2px; width: 33px; height: 33px; border-radius: 50%; background: var(--blue); border: 2px solid #0C1D36; display: flex; align-items: center; justify-content: center; color: #fff; }
.cam .ico { width: 18px; height: 18px; }

/* home */
.home-head { display: flex; align-items: flex-start; justify-content: space-between; padding-top: 16px; }
.home-head .slot { width: 72px; display: flex; justify-content: flex-end; }
.greeting { font-size: clamp(21px, 5.7vw, 26px); font-weight: 700; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; padding: 0 18px; min-height: 44px; border-radius: 22px; border: 1px solid var(--line); background: rgba(12,26,48,.7); color: var(--link); font-size: 15px; text-decoration: none; }
.chip .ico { width: 18px; height: 18px; color: var(--silver); }
.saved { display: flex; align-items: center; gap: 10px; color: var(--silver); font-size: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.quick { display: flex; padding: 10px 4px; }
.quick button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0; border-radius: 14px; color: var(--silver); } .quick button:active { background: var(--card-pressed); }
.quick .ico { width: 26px; height: 26px; } .quick span { color: var(--text); font-size: 12px; white-space: nowrap; }
.cols { display: flex; gap: 14px; align-items: flex-start; } .cols > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.card.gap { display: flex; flex-direction: column; gap: 10px; }
.week { display: flex; justify-content: space-between; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 4px; } .wd small { color: var(--muted); font-size: 11px; }
.wd b { width: 22px; height: 22px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.wd b.today { background: var(--blue); } .wd i { width: 4px; height: 4px; border-radius: 2px; } .wd i.on { background: var(--silver); }
.next-title { font-size: 15px; font-weight: 600; }
.map-ico { color: #3FA7C9; } .map-ico .ico { width: 40px; height: 40px; }

/* my space */
.head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 16px; }
.head .name { font-size: 24px; font-weight: 700; margin-top: 8px; } .head .rank { color: var(--link); font-size: 16px; font-weight: 600; }
.head .details { color: var(--silver); font-size: 14px; } .head .add-photo { color: var(--link); font-size: 14px; margin-top: 4px; }
.list-card { padding: 0; overflow: hidden; }
.row-item { display: flex; align-items: center; gap: 14px; padding: 0 18px; min-height: 58px; width: 100%; text-decoration: none; color: var(--text); font-size: 16px; text-align: left; }
.row-item + .row-item { border-top: 1px solid var(--line); } .row-item .t { flex: 1; } .row-item .ico { color: var(--silver); } .row-item .ico:last-child { color: var(--muted); }
.lang-row { display: flex; align-items: center; justify-content: space-between; }
.seg { display: flex; background: rgba(20,34,58,.9); border-radius: 14px; padding: 4px; }
.seg button { padding: 0 18px; min-height: 40px; border-radius: 11px; color: var(--silver); font-size: 15px; font-weight: 500; } .seg button[aria-checked="true"] { background: var(--blue); color: #fff; font-weight: 600; }
.change { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--muted); font-size: 14px; align-self: flex-start; } .change .ico { width: 18px; height: 18px; }
.footer { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 0 16px; }
.footer .links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; font-size: 14px; }
.footer a, .footer button { min-height: 44px; display: inline-flex; align-items: center; color: var(--silver); text-decoration: none; font-size: 14px; } .footer .report { color: var(--link); display: inline-flex; align-items: center; gap: 4px; } .footer .report .ico { width: 14px; height: 14px; }
.footer .sep, .footer .copy { color: var(--muted); } .footer .copy { font-size: 12px; }

/* lists */
.task { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; min-height: 56px; }
.task .check { flex: 1; display: flex; align-items: center; gap: 12px; padding: 12px 0; text-align: left; min-width: 0; }
.task .tt { flex: 1; font-size: 16px; overflow-wrap: anywhere; } .task.done .tt { color: var(--muted); text-decoration: line-through; }
.task .ico { color: var(--silver); } .task .flag.on { color: var(--danger); } .task .flag { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.add-row { display: flex; gap: 10px; padding: 16px; } .add-row .input { flex: 1; } .add-btn { width: 50px; height: 50px; border-radius: 12px; background: var(--blue); display: flex; align-items: center; justify-content: center; color: #fff; flex: none; } .add-btn .ico { width: 30px; height: 30px; }
.note-item { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; text-decoration: none; color: inherit; }
.note-item b { font-size: 17px; font-weight: 600; } .note-item span { color: var(--silver); font-size: 14px; line-height: 20px; } .note-item small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.note-edit { display: flex; flex-direction: column; gap: 8px; padding: 16px; flex: 1; }
.note-edit input { background: none; border: 0; outline: none; font-size: 22px; font-weight: 600; padding: 8px 0; color: var(--text); width: 100%; }
.note-edit textarea { background: none; border: 0; outline: none; font-size: 16px; line-height: 24px; color: var(--text); flex: 1; min-height: 50vh; resize: none; width: 100%; }
.note-edit input::placeholder, .note-edit textarea::placeholder { color: var(--muted); }

/* calendar */
.month-row { display: flex; align-items: center; justify-content: space-between; }
.month-row button { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--text); } .month-row h2 { font-size: 19px; font-weight: 700; }
.days { display: flex; gap: 4px; }
.days button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; border-radius: 14px; border: 1px solid transparent; color: var(--text); }
.days button.sel { background: var(--card); border-color: var(--line); } .days small { color: var(--muted); font-size: 12px; }
.days b { width: 32px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; } .days b.today { background: var(--blue); }
.days i { width: 5px; height: 5px; border-radius: 3px; } .days i.on { background: var(--silver); }
.event { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.event .tm { color: var(--link); font-size: 15px; font-weight: 600; width: 50px; } .event .main { flex: 1; min-width: 0; font-size: 15px; overflow-wrap: anywhere; } .event small { display: block; color: var(--muted); font-size: 12px; }
.form-card { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 16px; } .form-card h3 { font-size: 16px; font-weight: 600; }
.cert { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.cert .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .cert b { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; } .cert span { color: var(--silver); font-size: 13px; } .cert .st { font-weight: 600; }

/* demo data tag: compact */
.demo { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px dashed #F0B35A; color: #F0B35A; font-size: 12px; background: rgba(240,179,90,.1); }
.person { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; } .person .main { flex: 1; min-width: 0; } .person b { font-weight: 600; } .person small { display: block; color: var(--silver); font-size: 13px; }
.bar { height: 8px; border-radius: 4px; background: var(--input); overflow: hidden; } .bar i { display: block; height: 100%; background: var(--blue); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); color: var(--silver); } .badge.Active { color: var(--ok); border-color: var(--ok); } .badge.Planning { color: #F0B35A; border-color: #F0B35A; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.sched-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
table.sched { border-collapse: collapse; width: 100%; min-width: 520px; } .sched th, .sched td { padding: 10px 6px; text-align: center; border-bottom: 1px solid var(--line); font-size: 14px; }
.sched th:first-child, .sched td:first-child { text-align: left; padding-left: 14px; position: sticky; left: 0; background: #17305a; min-width: 110px; } .sched th small { display: block; color: var(--muted); font-weight: 400; }
.shift { display: inline-block; min-width: 32px; padding: 3px 0; border-radius: 8px; font-weight: 600; font-size: 13px; } .shift.D { background: rgba(74,142,224,.28); } .shift.N { background: rgba(150,110,220,.3); } .shift.O { color: var(--muted); } .shift.L { background: rgba(240,179,90,.22); color: #F0B35A; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

/* sheet (photo / rank pickers) */
.overlay { position: fixed; inset: 0; background: rgba(4,10,20,.7); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet { width: 100%; max-width: 480px; max-height: 85vh; max-height: 85dvh; overflow-y: auto; overflow-wrap: anywhere; background: #12284a; border: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.sheet h3 { font-size: 19px; } .sheet p { color: var(--silver); font-size: 14px; line-height: 20px; }
.sheet .opt { min-height: 50px; border-radius: 12px; border: 1px solid var(--line); background: var(--input); font-size: 16px; text-align: left; padding: 0 14px; width: 100%; } .sheet .opt.on { border-color: var(--blue); }
.sheet .opt.danger { color: var(--danger); } .sheet .grp { color: var(--muted); font-size: 13px; margin-top: 6px; }
.toast { overflow-wrap: anywhere; position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #16294a; border: 1px solid var(--line); padding: 12px 18px; border-radius: 14px; z-index: 30; max-width: 90%; text-align: center; font-size: 14px; }

/* wide screens: same look, sidebar with the three app tabs, content centred */
@media (min-width: 900px) {
  .tabs { display: none; } body.sub .tabs { display: none; }
  .side { display: flex; flex-direction: column; gap: 6px; width: 240px; flex: none; padding: 22px 14px; background: var(--tab-bg); border-right: 1px solid var(--line); }
  .side .logo { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 0 18px; } .side .logo img { width: 96px; height: auto; } .side .logo b { font-size: 18px; font-weight: 400; }
  .side a { display: flex; align-items: center; gap: 12px; padding: 0 14px; min-height: 48px; border-radius: 24px; text-decoration: none; color: var(--silver); font-size: 16px; }
  .side a[aria-current="page"] { background: var(--tab-active); color: var(--blue); font-weight: 600; }
  .screen > * { max-width: 760px; margin-left: auto; margin-right: auto; width: 100%; }
  .body { padding: 24px; }
  .hdr { padding: 16px 24px 8px; } .hdr.big { padding: 20px 24px 8px; }
  .home-wide { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .screen.wide > * { max-width: 980px; }
}

/* signed out (login, sign up, password reset) and loading screens */
body.auth .side, body.auth .tabs { display: none; }
.auth-body { width: 100%; max-width: 440px; margin: 0 auto; padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 14px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--link); min-height: 44px; font-size: 15px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 8px 0; }
.auth-brand .app-name { color: var(--silver); font-size: 24px; font-weight: 400; letter-spacing: 1.5px; margin-top: 6px; } .auth-brand .tag { color: var(--muted); font-size: 15px; text-align: center; }
.title { font-size: 26px; font-weight: 700; } .title.center { text-align: center; margin-top: 12px; } .step { color: var(--muted); font-size: 13px; }
.body-text { color: var(--silver); font-size: 15px; line-height: 22px; } .q { font-size: 16px; font-weight: 600; margin-top: 4px; }
.err { color: var(--danger); font-size: 14px; line-height: 20px; } .err:empty { display: none; }
.ok-text { color: var(--ok); font-size: 14px; line-height: 20px; text-align: center; } .ok-text:empty { display: none; }
.center-link { color: var(--link); text-align: center; min-height: 44px; font-size: 15px; width: 100%; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; } .or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pw { position: relative; } .pw .input { padding-right: 52px; } .pw button { position: absolute; right: 2px; top: 1px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; color: var(--silver); }
.input.code { font-size: 24px; letter-spacing: 6px; text-align: center; min-height: 56px; }
.two { display: flex; gap: 12px; } .two > * { flex: 1; min-width: 0; }
.linkbtn { display: flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; font-size: 15px; }
.chipbtn { padding: 0 18px; min-height: 46px; border-radius: 23px; border: 1px solid var(--line); background: rgba(20,34,58,.8); color: var(--silver); font-size: 15px; }
.chipbtn.on { border-color: var(--blue); background: rgba(74,142,224,.25); color: #fff; font-weight: 600; }
.check-row { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; line-height: 22px; } .check-row input { width: 26px; height: 26px; margin: 0; flex: none; accent-color: var(--blue); } .check-row a { color: var(--link); }
.dept { display: flex; flex-direction: column; gap: 6px; text-align: left; min-height: 100px; padding: 16px; border-radius: 20px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); width: 100%; }
.dept b { font-size: 19px; } .dept span { color: var(--silver); font-size: 14px; line-height: 20px; } .dept.on { border-color: var(--blue); background: rgba(40,80,130,.55); }
.rank-opt { display: flex; align-items: center; min-height: 56px; padding: 0 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 17px; width: 100%; text-align: left; } .rank-opt.on { border-color: var(--blue); }
.row-item.danger { color: var(--danger); } .row-item.danger .ico { color: var(--danger); }
.offline-bar { background: rgba(240,179,90,.14); color: #F0B35A; text-align: center; font-size: 13px; padding: 6px 12px; }
@media (min-width: 900px) { body.auth .screen > * { max-width: 460px; } }

/* "Install NMSeawise" bar: sits between the content and the tab bar in the page flow, so it never covers navigation */
.install { flex: none; padding: 8px calc(12px + env(safe-area-inset-right)) 8px calc(12px + env(safe-area-inset-left)); background: var(--tab-bg); border-top: 1px solid var(--line); }
.install[hidden] { display: none; }
.install-in { display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto; }
.install-in img { border-radius: 10px; flex: none; }
.install-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 18px; color: var(--silver); } .install-txt b { color: var(--text); font-size: 15px; }
.install-txt .share { display: inline-block; vertical-align: -4px; color: var(--link); }
.install-go { flex: none; min-height: 44px; padding: 0 18px; border-radius: 22px; background: var(--blue); color: #fff; font-weight: 600; font-size: 15px; }
.install-x { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
body.auth .install { background: transparent; border-top: 0; }

/* mouse: hover states (touch devices have none) */
@media (hover: hover) {
  .card[data-go]:hover, .row-item:hover, .note-item:hover, .quick button:hover { background: var(--card-pressed); }
  .btn:hover:not(:disabled) { filter: brightness(1.1); } .chipbtn:hover, .seg button:hover:not([aria-checked="true"]) { color: #fff; }
  .side a:hover:not([aria-current="page"]), .tabs a:hover .pill { background: rgba(28,51,84,.55); }
  .back-link:hover, .link-text:hover, .center-link:hover, .footer a:hover, .footer button:hover { text-decoration: underline; }
}

/* phones: while a field is being typed in, the on-screen keyboard takes the space, so the tab bar steps aside */
@media (pointer: coarse) and (max-width: 899px) { body:has(.screen input:focus, .screen textarea:focus) :is(.tabs, .install) { display: none; } }

/* My ship */
.shipmap { position: relative; height: 280px; border-radius: 16px; overflow: hidden; background: #C9D6E3; border: 1px solid var(--line); isolation: isolate; }
.shipmap img { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; }
.shipmap .pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); pointer-events: none; }
.shipmap .zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.shipmap .zoom button { width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,.92); color: #0A1526; font-size: 24px; font-weight: 600; line-height: 1; }
.shipmap .zoom button:disabled { opacity: .4; cursor: default; }
.shipmap .credit { position: absolute; left: 0; bottom: 0; background: rgba(255,255,255,.8); color: #222; font-size: 11px; padding: 2px 6px; }
.shipres { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.shipres .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .shipres b { font-size: 18px; } .shipres small { color: var(--silver); font-size: 13px; }
.notset { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 20px; } .notset .ico { color: var(--silver); width: 32px; height: 32px; } .notset h2 { font-size: 18px; font-weight: 600; }
.ais { font-size: 15px; font-weight: 600; }
.add-btn:disabled { opacity: .45; cursor: default; }

/* "Install NMSeawise" card (login page, My Space) */
.getapp { display: flex; flex-direction: column; gap: 10px; }
.getapp-head { display: flex; align-items: center; gap: 12px; } .getapp-head img { border-radius: 10px; flex: none; } .getapp h2 { font-size: 19px; font-weight: 700; } .getapp h3 { font-size: 15px; font-weight: 600; }
.getapp .share { display: inline-block; vertical-align: -4px; color: var(--link); }
.getapp .apk { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 2px; }
/* the install bar sits at the very bottom when there is no tab bar: keep clear of the home indicator, without doubling the space below the screen */
body.sub .install, body.auth .install { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
body.sub:has(.install:not([hidden])) .screen, body.auth:has(.install:not([hidden])) .screen { padding-bottom: 0; }

/* deadlines */
.due { color: var(--silver); font-size: 13px; } .due.red, .cert .red, .red { color: var(--danger); font-weight: 600; }
.task .tt .due { display: inline-block; margin-top: 2px; }
.task .x-btn.edit, .cert .x-btn.edit { text-decoration: none; color: var(--silver); }
.addtask { flex-wrap: wrap; } .addtask .due-pick { flex: 1 1 100%; }
.tasks-card .task-mini { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--text); padding: 8px 0; border-top: 1px solid var(--line); min-height: 44px; justify-content: center; } .tasks-card .task-mini .tt { font-size: 15px; overflow-wrap: anywhere; }
.tasks-card .task-mini:first-of-type { border-top: 0; }
/* My ship web link card */
.shiplink { display: flex; flex-direction: column; gap: 12px; }
.shiplink-form { display: flex; flex-direction: column; gap: 12px; }
.shiplink-url { overflow-wrap: anywhere; word-break: break-all; color: var(--text, inherit); }
a.btn { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
/* Home button of sub-pages: logo + home icon (the wide layout has the logo and Home in the sidebar) */
.hdr .side-slot { gap: 2px; }
.side a.logo { display: flex; flex-direction: column; align-items: center; color: var(--text); text-decoration: none; min-height: 0; border-radius: 16px; }


/* Logo and Home are two separate links (never one combined button); nothing is laid over them */
.logobtn, .hdr .homebtn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 22px; color: var(--silver); text-decoration: none; position: relative; z-index: 1; }
.logobtn img { object-fit: contain; display: block; } .hdr .homebtn .ico { width: 24px; height: 24px; }
.logobtn.big { min-width: 0; min-height: 0; border-radius: 12px; } .home-head .logobtn { display: inline-flex; }
.hdr .side-slot { min-width: 132px; } .hdr.big .logobtn { margin-right: 6px; }
.hdr .iconbtn, .hdr-right a { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--text); text-decoration: none; }
.hdr-right { display: flex; align-items: center; margin-left: auto; }
.space-top { padding-bottom: 0; }
@media (min-width: 900px) { .hdr .homebtn, .hdr .logobtn, .space-top, .hdr.big .logobtn { display: none; } .home-head .logobtn.big { display: inline-flex; } .hdr .side-slot { min-width: 44px; } }

/* unread number (friend requests + message requests) */
.badge-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #E5484D; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; display: inline-block; }
.pill, .iconbtn { position: relative; } .pill .badge-n, .iconbtn .badge-n { position: absolute; top: 0; right: 8px; }
.side a { position: relative; } .side a .badge-n { margin-left: auto; }

/* messages list, people, requests */
.conv { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; text-decoration: none; color: var(--text); min-height: 64px; }
.conv:hover, .person-row:hover { background: rgba(40,66,106,.45); } .conv.req { background: rgba(74,142,224,.14); }
.conv .main, .person-row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.conv .top { display: flex; justify-content: space-between; gap: 8px; } .conv .top b, .person-row b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv small, .person-row small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .prev { color: var(--silver); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot-blue { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); flex: none; }
.avatar.sm { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--tab-active); color: var(--text); font-weight: 700; flex: none; overflow: hidden; }
.sect { font-size: 14px; font-weight: 600; color: var(--muted); margin: 10px 4px 2px; text-transform: none; }
.banner-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; }
.banner-row .t { flex: 1; font-weight: 600; }
.person-row { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 16px; flex-wrap: wrap; }
.person-row .who { display: flex; align-items: center; gap: 12px; flex: 1 1 200px; min-width: 0; text-decoration: none; color: var(--text); }
.person-row .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line); background: rgba(20,34,58,.8); color: var(--silver); font-size: 14px; }
.chip.primary { background: var(--blue); border-color: var(--blue); color: #fff; } .chip .ico { width: 18px; height: 18px; }
.searchbox { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 14px; border-radius: 14px; background: var(--input); border: 1px solid var(--line); }
.searchbox input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 16px; min-height: 48px; color: var(--text); } .searchbox:focus-within { border-color: var(--blue); }
.person-page { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; } .person-page .pname { font-size: 24px; } .person-page .prank { color: var(--link); }
.person-page .card { width: 100%; text-align: left; }
.empty-center .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }

/* chat */
body.chatpage .screen { overflow: hidden; }
.chat { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; width: 100%; }
.chat-rank { text-align: center; color: var(--link); font-size: 13px; margin-top: -4px; padding-bottom: 4px; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 14px; display: flex; flex-direction: column; gap: 8px; outline: none; }
.msg { display: flex; } .msg.mine { justify-content: flex-end; } .msg .bub { max-width: min(78%, 520px); padding: 8px 12px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.msg.mine .bub { background: var(--blue); border-color: var(--blue); color: #fff; } .msg .txt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 21px; }
.msg .tm { font-size: 11px; opacity: .8; align-self: flex-end; }
.msg .att { display: flex; align-items: center; gap: 8px; text-align: left; color: inherit; padding: 6px 0; } .msg .att .n { font-weight: 600; overflow-wrap: anywhere; } .msg .att small { display: block; opacity: .8; }
.outrow { display: flex; gap: 12px; font-size: 13px; text-decoration: underline; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--tab-bg); }
.composer textarea { flex: 1; min-width: 0; resize: none; max-height: 140px; min-height: 44px; padding: 10px 14px; border-radius: 22px; background: var(--input); border: 1px solid var(--line); outline: none; font-size: 16px; line-height: 21px; color: var(--text); } .composer textarea:focus { border-color: var(--blue); }
.composer .send { width: 46px; height: 46px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.req-banner { margin: 8px 12px; padding: 14px; border-radius: 18px; background: rgba(74,142,224,.16); border: 1px solid var(--blue); display: flex; flex-direction: column; gap: 8px; } .req-banner .hint { color: var(--silver); font-size: 14px; }
.chat-note { text-align: center; color: var(--silver); font-size: 14px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); }
.hdr .side-slot.r { min-width: 44px; }
.searchbox input:focus-visible, .composer textarea:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
