:root {
  --nacex: #fe5000;
  --text: #333333;
  --muted: #777777;
  --line: #d3d3d3;
  --page: #ececec;
  --dark: #3c3c3c;
  --header-h: 48px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 8px);
  overflow-x: clip;
  overscroll-behavior-x: none;
}

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
}

body {
  font-family: Avenir, Verdana, Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--page);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: rgba(254, 80, 0, 0.18);
  overflow-x: clip;
}

a {
  color: var(--nacex);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

.topbar {
  background: var(--nacex);
  min-height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top, 0px);
}

.topbar-inner {
  width: 100%;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  position: relative;
  padding: 0 20px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  gap: 8px;
}

.logo {
  display: flex;
  align-items: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.logo img {
  height: 27px;
  width: 109px;
  max-width: none;
  display: block;
}

.nav {
  display: flex;
  align-items: stretch;
  height: var(--header-h);
  flex: 1;
  min-width: 0;
}

.nav a.nav-connect {
  display: none;
}

.nav a {
  color: #fff;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.2px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  text-decoration: none;
  line-height: 40px;
}

.nav a:hover {
  color: #333;
  font-weight: bold;
  text-decoration: none;
}

.nav a.active {
  font-weight: bold;
  color: #fff;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
}

.lang-switch button {
  background: none;
  border: 0;
  color: #fff;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
  padding: 0 4px;
  min-width: 28px;
  min-height: 44px;
  opacity: 0.7;
  touch-action: manipulation;
}

.lang-switch button:hover,
.lang-switch button.active {
  opacity: 1;
  color: #fff;
}

.lang-switch button.active {
  text-decoration: underline;
}

.lang-switch span {
  opacity: 0.55;
  font-weight: normal;
}

.btn-connect {
  display: inline-block;
  border: 1px solid #fff;
  color: #fff;
  background: transparent;
  font-weight: bold;
  font-size: 13px;
  text-transform: uppercase;
  padding: 6px 16px;
  text-decoration: none;
  letter-spacing: 0.4px;
}

.btn-connect:hover {
  background: #fff;
  color: var(--nacex);
  text-decoration: none;
}

.hero-strip {
  background: #2f2f2f;
  color: #fff;
  padding: 22px 16px 20px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.hero-strip h1 {
  margin: 0;
  font-size: 26px;
  font-weight: normal;
  color: #fff;
  padding: 0 4px;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

.panel {
  background: #fff;
  border: 1px solid #ddd;
  padding: 28px 32px 32px;
}

.panel h2 {
  margin: 0 0 8px;
  color: var(--nacex);
  font-size: 22px;
  font-weight: normal;
}

.lead {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 460px;
}

.field {
  display: flex;
  flex-direction: column;
}

.field-postal {
  max-width: 200px;
}

.field label {
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text);
}

.field input {
  height: 44px;
  border: 1px solid #bbb;
  border-radius: 0;
  padding: 0 10px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  width: 100%;
  max-width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.field input:focus {
  border-top: 2px solid var(--nacex);
  background: rgb(237, 220, 213);
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.btn {
  height: 44px;
  min-width: 150px;
  border: 1px solid var(--nacex);
  background: var(--nacex);
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  font-family: inherit;
  padding: 0 18px;
  cursor: pointer;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.btn:hover {
  background: #fff;
  color: var(--nacex);
}

.btn-gray {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

.btn-gray:hover {
  background: #fff;
  color: var(--dark);
  border-color: var(--dark);
}

.hint {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.error {
  display: none;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid #c9a;
  background: #fff4f4;
  color: #7a2a00;
  font-size: 14px;
}

.error.show {
  display: block;
}

#result {
  display: none;
  margin-top: 28px;
  scroll-margin-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 12px);
}

#result.show {
  display: block;
}

.status-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  border: 1px solid var(--nacex);
  padding: 16px 18px;
  margin-bottom: 22px;
  background: #fff8f5;
}

.status-kicker {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.status-main {
  color: var(--nacex);
  font-size: 22px;
  margin: 0;
  font-weight: bold;
}

.status-code {
  font-size: 18px;
  word-break: break-all;
}

.table-wrap {
  width: 100%;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px 24px;
  font-size: 14px;
  margin-bottom: 26px;
}

.meta-grid dt {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  margin: 0 0 2px;
}

.meta-grid dd {
  margin: 0;
  color: var(--text);
  font-weight: bold;
}

.meta-grid .dest-block {
  grid-column: 1 / -1;
}

.meta-grid .dest-value {
  font-weight: bold;
  line-height: 1.35;
  overflow-wrap: break-word;
}

h3 {
  color: var(--nacex);
  font-size: 18px;
  font-weight: normal;
  margin: 0 0 14px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.history-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  color: #fff;
  background: var(--dark);
  font-weight: normal;
  padding: 8px 10px;
}

.history-table td {
  padding: 10px;
  border-bottom: 1px solid #e5e5e5;
  vertical-align: top;
  color: var(--text);
}

.history-table tr.current td {
  background: #fff8f5;
  font-weight: bold;
}

.history-table tr.current td:nth-child(3) {
  color: var(--nacex);
}

.help-row {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px dotted var(--nacex);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.help-phone,
.help-mail {
  display: inline-block;
  font-weight: bold;
}

.site-footer {
  background: #3c3c3c;
  color: #ddd;
  padding: 28px 16px 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  font-size: 13px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-bottom: 16px;
}

.footer-links a {
  color: #fff;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.3px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-legal {
  border-top: 1px solid #555;
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  color: #bbb;
  font-size: 12px;
}

.footer-legal a {
  color: #bbb;
  margin-right: 10px;
}

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  width: 44px;
  height: 44px;
  padding: 0;
  flex-shrink: 0;
  touch-action: manipulation;
}

@media (max-width: 1100px) {
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .btn-connect {
    display: none;
  }

  .nav a.nav-connect {
    display: flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nacex);
    flex-direction: column;
    height: auto;
    max-height: min(70dvh, calc(100dvh - var(--header-h) - env(safe-area-inset-top, 0px)));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 8px 0 12px;
    z-index: 50;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    line-height: 1.2;
    min-height: 44px;
    padding: 12px 18px;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .status-box {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 20px 16px 24px;
  }

  .form-row {
    max-width: none;
  }

  .field-postal {
    max-width: none;
  }
}

@media (max-width: 700px) {
  .topbar-inner {
    padding: 0 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .logo {
    margin-right: 8px;
  }

  .logo img {
    width: 92px;
    height: 23px;
  }

  .hero-strip {
    padding: 16px 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .hero-strip h1 {
    font-size: 22px;
    padding: 0;
  }

  .wrap {
    padding: 16px 12px 40px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .panel {
    padding: 16px 12px 20px;
  }

  .panel h2 {
    font-size: 20px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
    min-width: 0;
  }

  .status-main {
    font-size: 20px;
  }

  .table-wrap {
    overflow: visible;
  }

  .history-table,
  .history-table tbody {
    display: block;
    width: 100%;
  }

  .history-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .history-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "date time"
      "status status"
      "place place";
    gap: 2px 12px;
    border: 1px solid #e5e5e5;
    margin-bottom: 10px;
    padding: 12px;
    background: #fff;
  }

  .history-table tr.current {
    border-color: var(--nacex);
    background: #fff8f5;
  }

  .history-table td {
    display: block;
    padding: 0;
    border-bottom: 0;
    font-weight: inherit;
  }

  .history-table td::before {
    display: none;
  }

  .history-table td:nth-child(1) {
    grid-area: date;
    font-variant-numeric: tabular-nums;
  }

  .history-table td:nth-child(2) {
    grid-area: time;
    color: var(--muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: normal;
  }

  .history-table td:nth-child(3) {
    grid-area: status;
    margin-top: 6px;
    font-weight: bold;
  }

  .history-table td:nth-child(4) {
    grid-area: place;
    color: var(--muted);
    font-size: 12px;
    font-weight: normal;
  }

  .history-table tr.current td:nth-child(3) {
    color: var(--nacex);
  }

  .footer-links {
    gap: 0 16px;
  }

  .footer-legal {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .footer-legal a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin: 0 14px 0 0;
  }
}

@media (max-width: 360px) {
  .logo img {
    width: 84px;
    height: 21px;
  }

  .lang-switch {
    gap: 2px;
    font-size: 11px;
  }

  .lang-switch button {
    min-width: 22px;
    padding: 0 2px;
  }

  .hero-strip h1 {
    font-size: 20px;
  }

  .panel h2 {
    font-size: 18px;
  }
}

@media (max-width: 1100px) and (max-height: 500px) and (orientation: landscape) {
  .nav {
    max-height: calc(100dvh - var(--header-h) - env(safe-area-inset-top, 0px));
  }

  .nav a {
    min-height: 40px;
    padding: 8px 18px;
  }
}

.cookie-banner {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: #fff;
  border-top: 3px solid var(--nacex);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.12);
  padding: 14px 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

.cookie-banner.is-visible {
  display: block;
}

.cookie-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.cookie-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #555;
}

.cookie-text a {
  margin-left: 4px;
}

.cookie-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.cookie-btn {
  height: 38px;
  min-width: 108px;
  border: 1px solid var(--nacex);
  background: var(--nacex);
  color: #fff;
  font-weight: bold;
  font-size: 13px;
  font-family: inherit;
  padding: 0 16px;
  cursor: pointer;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.cookie-btn:hover {
  background: #fff;
  color: var(--nacex);
}

.cookie-btn-ghost {
  background: #fff;
  color: #333;
  border-color: #bbb;
}

.cookie-btn-ghost:hover {
  background: #f4f4f4;
  color: #333;
  border-color: #999;
}

@media (max-width: 800px) {
  .cookie-actions {
    justify-content: stretch;
    width: 100%;
  }

  .cookie-btn {
    flex: 1;
    min-width: 0;
    height: 44px;
  }
}
