.i4s-notam-app,
.i4s-notam-app * {
  box-sizing: border-box;
}

.i4s-notam-app {
  --notam-navy: #061d33;
  --notam-navy-light: #0b2a46;
  --notam-blue: #0f6d96;
  --notam-gold: #b08a5b;
  --notam-gold-light: #d7b47f;
  --notam-white: #ffffff;
  --notam-ink: #071927;
  --notam-muted: #b8c7d6;
  --notam-line: rgba(255, 255, 255, 0.16);
  width: 100%;
  margin: 20px 0;
  overflow: hidden;
  border: 1px solid rgba(6, 29, 51, 0.16);
  border-radius: 8px;
  background: var(--notam-navy);
  box-shadow: 0 14px 36px rgba(6, 29, 51, 0.16);
  color: var(--notam-white);
  font-family: inherit;
  padding: 22px;
}

.i4s-notam-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.i4s-notam-header h2,
.i4s-notam-header p,
.i4s-notam-footer p,
.i4s-notam-status,
.i4s-notam-input-help,
.i4s-notam-record h3 {
  margin: 0;
  letter-spacing: 0;
}

.i4s-notam-header h2 {
  color: var(--notam-white);
  font-size: 30px;
  line-height: 1.1;
}

.i4s-notam-header p {
  margin-top: 7px;
  color: var(--notam-muted);
  font-size: 15px;
  line-height: 1.45;
}

.i4s-notam-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(176, 138, 91, 0.58);
  border-radius: 6px;
  color: var(--notam-white);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 11px;
  text-decoration: none;
  white-space: nowrap;
}

.i4s-notam-brand:visited {
  color: var(--notam-white);
}

.i4s-notam-brand:hover,
.i4s-notam-brand:focus-visible {
  border-color: var(--notam-gold);
  color: var(--notam-white);
  outline: none;
}

.i4s-notam-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 112px 112px;
  gap: 10px;
  align-items: end;
}

.i4s-notam-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.i4s-notam-form label span {
  color: var(--notam-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.i4s-notam-form input,
.i4s-notam-form button,
.i4s-notam-copy {
  min-height: 44px;
  border-radius: 6px;
  font: inherit;
}

.i4s-notam-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--notam-white);
  color: var(--notam-ink);
  font-size: 16px;
  font-weight: 800;
  outline: none;
  padding: 10px 12px;
  text-transform: uppercase;
}

.i4s-notam-form input::placeholder {
  color: #66798a;
  font-weight: 500;
  text-transform: none;
}

.i4s-notam-form input:focus {
  border-color: var(--notam-gold);
  box-shadow: 0 0 0 3px rgba(176, 138, 91, 0.25);
}

.i4s-notam-form button,
.i4s-notam-copy {
  border: 1px solid var(--notam-gold);
  background: var(--notam-gold);
  color: #081828;
  cursor: pointer;
  font-weight: 900;
  padding: 9px 13px;
}

.i4s-notam-form .i4s-notam-pdf-button {
  background: transparent;
  color: var(--notam-white);
}

.i4s-notam-form button:hover:not(:disabled),
.i4s-notam-form button:focus-visible,
.i4s-notam-copy:hover,
.i4s-notam-copy:focus-visible {
  border-color: var(--notam-gold-light);
  background: var(--notam-gold-light);
  color: #081828;
  outline: none;
}

.i4s-notam-form button:disabled,
.i4s-notam-copy:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.i4s-notam-input-help {
  margin-top: 6px;
  color: var(--notam-muted);
  font-size: 12px;
}

.i4s-notam-status {
  min-height: 20px;
  margin: 16px 0;
  color: var(--notam-muted);
  font-size: 13px;
  line-height: 1.45;
}

.i4s-notam-status.is-error {
  color: #ffbcbc;
}

.i4s-notam-status.is-success {
  color: #b8efd5;
}

.i4s-notam-status.is-loading::after {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: var(--notam-gold-light);
  border-radius: 50%;
  vertical-align: -1px;
  animation: i4s-notam-spin 0.75s linear infinite;
}

@keyframes i4s-notam-spin {
  to { transform: rotate(360deg); }
}

.i4s-notam-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--notam-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
}

.i4s-notam-summary[hidden] {
  display: none;
}

.i4s-notam-summary > div {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 72px;
  border-right: 1px solid var(--notam-line);
  padding: 12px 14px;
}

.i4s-notam-summary > div:last-child {
  border-right: 0;
}

.i4s-notam-summary span,
.i4s-notam-summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.i4s-notam-summary span {
  color: var(--notam-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.i4s-notam-summary strong {
  margin-top: 4px;
  color: var(--notam-white);
  font-size: 15px;
  line-height: 1.3;
}

.i4s-notam-results {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.i4s-notam-record {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--notam-line);
  border-radius: 8px;
  background: var(--notam-navy-light);
}

.i4s-notam-record > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 55px;
  border-bottom: 1px solid var(--notam-line);
  padding: 10px 14px;
}

.i4s-notam-record h3 {
  min-width: 0;
  color: var(--notam-white);
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.i4s-notam-record-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.i4s-notam-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 150px;
  overflow: hidden;
  border: 1px solid rgba(215, 180, 127, 0.5);
  border-radius: 5px;
  color: var(--notam-gold-light);
  font-size: 11px;
  font-weight: 900;
  padding: 5px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.i4s-notam-copy {
  min-height: 30px;
  background: transparent;
  color: var(--notam-white);
  font-size: 12px;
  padding: 5px 9px;
}

.i4s-notam-details {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 108px minmax(0, 1fr);
  gap: 7px 10px;
  margin: 0;
  border-bottom: 1px solid var(--notam-line);
  padding: 13px 14px;
}

.i4s-notam-details dt,
.i4s-notam-details dd {
  min-width: 0;
  margin: 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.i4s-notam-details dt {
  color: var(--notam-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.i4s-notam-details dd {
  color: var(--notam-white);
  font-size: 13px;
  font-weight: 700;
}

.i4s-notam-message,
.i4s-notam-raw pre {
  margin: 0;
  color: var(--notam-white);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.i4s-notam-message {
  padding: 15px 14px;
}

.i4s-notam-raw {
  border-top: 1px solid var(--notam-line);
  color: var(--notam-muted);
  font-size: 12px;
  padding: 9px 14px 12px;
}

.i4s-notam-raw summary {
  color: var(--notam-gold-light);
  cursor: pointer;
  font-weight: 800;
}

.i4s-notam-raw pre {
  max-height: 300px;
  margin-top: 10px;
  overflow: auto;
  border: 1px solid var(--notam-line);
  background: rgba(0, 0, 0, 0.14);
  font-size: 11px;
  padding: 10px;
}

.i4s-notam-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 86px;
  border: 1px dashed var(--notam-line);
  border-radius: 8px;
  color: var(--notam-muted);
  font-size: 14px;
  padding: 16px;
  text-align: center;
}

.i4s-notam-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--notam-line);
  padding-top: 14px;
}

.i4s-notam-footer p {
  max-width: 82ch;
  color: var(--notam-muted);
  font-size: 12px;
  line-height: 1.5;
}

.i4s-notam-footer a,
.i4s-notam-footer a:visited {
  flex: 0 0 auto;
  color: var(--notam-gold-light);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.i4s-notam-footer a:hover,
.i4s-notam-footer a:focus-visible {
  color: var(--notam-white);
  outline: none;
  text-decoration: underline;
}

@media (max-width: 760px) {
  .i4s-notam-form {
    grid-template-columns: minmax(0, 1fr) 1fr 1fr;
  }

  .i4s-notam-form label {
    grid-column: 1 / -1;
  }

  .i4s-notam-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .i4s-notam-summary > div:nth-child(2) {
    border-right: 0;
  }

  .i4s-notam-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--notam-line);
  }

  .i4s-notam-details {
    grid-template-columns: 96px minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .i4s-notam-app {
    padding: 16px;
  }

  .i4s-notam-header,
  .i4s-notam-footer,
  .i4s-notam-record > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .i4s-notam-header h2 {
    font-size: 25px;
  }

  .i4s-notam-form {
    grid-template-columns: 1fr;
  }

  .i4s-notam-form label {
    grid-column: auto;
  }

  .i4s-notam-summary,
  .i4s-notam-details {
    grid-template-columns: 1fr;
  }

  .i4s-notam-summary > div,
  .i4s-notam-summary > div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--notam-line);
  }

  .i4s-notam-summary > div:last-child {
    border-bottom: 0;
  }

  .i4s-notam-record-actions {
    width: 100%;
    justify-content: space-between;
  }

  .i4s-notam-footer a {
    white-space: normal;
  }
}

@page {
  size: A4 portrait;
  margin: 13mm;
}

@media print {
  .i4s-notam-form,
  .i4s-notam-input-help,
  .i4s-notam-pdf-button,
  .i4s-notam-copy,
  .i4s-notam-raw,
  .i4s-notam-brand {
    display: none !important;
  }

  .i4s-notam-app {
    border: 0;
    background: #ffffff;
    box-shadow: none;
    color: #071927;
    margin: 0;
    padding: 0;
  }

  .i4s-notam-header h2,
  .i4s-notam-summary strong,
  .i4s-notam-record h3,
  .i4s-notam-details dd,
  .i4s-notam-message {
    color: #071927;
  }

  .i4s-notam-record,
  .i4s-notam-summary {
    break-inside: avoid;
    border-color: #aebbc5;
    background: #ffffff;
  }
}
