@font-face {
  font-family: "SLIM Noto Sans";
  src: url("/fonts/NotoSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "SLIM Noto Sans";
  src: url("/fonts/NotoSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

:root {
  --navy: #192c4c;
  --beige: #d0c8a3;
  --beige-light: #f1eee2;
  --bg: #f7f7f5;
  --card: rgb(255 255 255 / 0.86);
  --fg: #0d1117;
  --muted: #4b5563;
  --line: #d4d7dc;
  --alert: #c8102e;
  --warn-bg: #fff4d6;
  --st-planned: #e7ebf2;
  --st-prep: #ffe28a;
  --st-done: #b7f0b7;
  --st-reg: #a6ecf7;
  --st-out: #d9dde4;
  --st-prob: #ffb3ad;
  --radius: 2px;
  --font: "SLIM Noto Sans", "Noto Sans", "DejaVu Sans", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
}

[hidden] { display: none !important; }

.backdrop {
  position: fixed;
  right: -8vmin;
  bottom: -10vmin;
  z-index: -1;
  width: 72vmin;
  height: 72vmin;
  fill: var(--navy);
  opacity: 0.045;
  pointer-events: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  background: var(--navy);
  color: #ffffff;
}
.head .signet { width: 36px; height: 36px; fill: var(--beige); flex: none; }
.head strong { color: var(--beige); font-size: 24px; font-weight: 700; letter-spacing: 0.01em; }
.head .title { font-size: 20px; }
.head .tools { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.head .link.who { color: var(--beige); }
.head .link { color: #ffffff; }

button, input, select { font: inherit; color: inherit; }

button {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius);
  background: var(--navy);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}
button:hover { background: #24406d; }
button.secondary { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
button.link {
  min-height: 0;
  padding: 4px 0;
  background: none;
  color: var(--navy);
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 3px;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}
button:disabled { opacity: 0.6; cursor: progress; }

input, select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #9aa3af;
  border-radius: var(--radius);
  background: #ffffff;
}

main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 28px 24px; }

.loading { color: var(--muted); }

.card {
  max-width: 420px;
  margin: 32px auto;
  padding: 28px;
  border-top: 4px solid var(--beige);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}
.card h1 { margin: 0 0 20px; color: var(--navy); font-size: 24px; }
.card form, .account form { display: grid; gap: 16px; }
.card label, .account label { display: grid; gap: 6px; font-weight: 700; }
.card .actions, .account .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.card > .hint { margin-top: 18px; }
#password-reason:empty { display: none; }
#password-reason { margin-bottom: 16px; }
.error { margin: 0; color: var(--alert); font-weight: 700; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 10px;
}
.companies { flex: 1 1 100%; color: var(--navy); font-size: 22px; font-weight: 700; }
.toolbar .search { flex: 2 1 260px; }
.toolbar .vessel { flex: 1 1 220px; }
.lists { display: flex; flex: none; }
.lists button { min-width: 0; padding: 0 16px; white-space: nowrap; }
.lists button + button { margin-left: -2px; }
.lists button[aria-pressed="true"] { background: var(--navy); color: #ffffff; }
.lists button[aria-pressed="false"]:hover { background: var(--beige-light); }

.as-of { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.stale {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-left: 4px solid #d99a00;
  background: var(--warn-bg);
  font-weight: 700;
}

.table-wrap { overflow-x: auto; border-radius: var(--radius); background: var(--card); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }

.transports { width: 100%; border-collapse: collapse; }
.transports thead tr { background: var(--beige); }
.transports th {
  padding: 10px 12px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.transports td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.transports tbody tr:nth-child(even) { background: rgb(25 44 76 / 0.025); }
.transports .number, .transports .date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.transports .number { font-weight: 700; }
.transports .sub { display: block; color: var(--muted); font-size: 13px; }
.transports .uncertain { margin-left: 2px; color: var(--alert); font-weight: 700; }
.transports .packages summary { cursor: pointer; white-space: nowrap; }
.transports .packages summary::marker { color: var(--muted); }
.transports .packages details div { margin-top: 2px; padding-left: 16px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.transports .note { display: block; margin-top: 4px; color: var(--alert); font-size: 14px; }
.transports .remark { min-width: 160px; max-width: 320px; white-space: pre-line; overflow-wrap: anywhere; }

.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius);
  background: var(--st-planned);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.st-in_preparation { background: var(--st-prep); }
.st-done { background: var(--st-done); }
.st-customs_registered { background: var(--st-reg); }
.st-goods_out { background: var(--st-out); }
.st-problem { background: var(--st-prob); }

.empty { margin: 32px 0; color: var(--muted); text-align: center; }

.account {
  width: min(480px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 22px 28px 28px;
  border: 0;
  border-top: 4px solid var(--beige);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--fg);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.28);
}
.account::backdrop { background: rgb(13 17 23 / 0.45); }
.account-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.account h2 { margin: 0; color: var(--navy); font-size: 22px; }
.account h3 { margin: 0 0 12px; color: var(--navy); font-size: 17px; }
.facts { display: grid; gap: 10px; margin: 0 0 22px; }
.facts div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; }
.facts dt { color: var(--muted); font-size: 14px; font-weight: 700; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.account-part { padding-top: 18px; border-top: 1px solid var(--line); }
.account-part + .account-part { margin-top: 22px; }
.account-part > .hint { margin-bottom: 12px; }
.setup { display: grid; gap: 10px; margin-bottom: 16px; }
.qr svg { display: block; width: 196px; height: 196px; background: #ffffff; box-shadow: 0 0 0 1px var(--line); }
.qr path { fill: #000000; }
.key { font-family: ui-monospace, Consolas, monospace; font-size: 15px; overflow-wrap: anywhere; }
.saved { margin: 0 0 12px; color: #17672f; font-weight: 700; }

.foot {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.foot a { color: var(--navy); }

@media (max-width: 760px) {
  .head { flex-wrap: wrap; padding: 10px 16px; }
  .head .title { font-size: 16px; }
  .head .tools { flex-basis: 100%; justify-content: flex-end; }
  .lists { flex: 1 1 100%; }
  .lists button { flex: 1; }
  main { padding: 16px 12px; }
  .card { margin: 8px auto; padding: 20px; }
  .account { padding: 18px 18px 22px; }
  .facts div { grid-template-columns: 1fr; gap: 0; }
  .table-wrap { overflow: visible; background: none; box-shadow: none; }
  .transports thead { display: none; }
  .transports, .transports tbody, .transports tr, .transports td { display: block; }
  .transports tr {
    margin-bottom: 12px;
    padding: 8px 0;
    border-radius: var(--radius);
    background: var(--card) !important;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
  }
  .transports td { display: grid; grid-template-columns: 110px 1fr; gap: 8px; padding: 4px 14px; border: 0; }
  .transports td::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 700; }
  .transports .remark { min-width: 0; max-width: none; }
}
