:root {
  --bg: #0b1622;
  --panel: #0f2034;
  --panel-2: #0c1a2b;
  --border: #1e2a38;
  --text: #e6edf3;
  --muted: #a3b3c3;
  --accent: #79e4a5;
  --accent-2: #4cc9ff;
  --danger: #e55d5d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

html,
body {
  width: 100%;
  max-width: 100%;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font: inherit;
  border: none;
  background: none;
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background: #0f1e2b;
}

.brand-block {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.site-logo {
  width: clamp(84px, 10vw, 132px);
}

.site-header h1 {
  margin: 0;
  font-size: 1.6rem;
}

.header-subtitle {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

nav {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

nav a {
  font-weight: 600;
  color: var(--muted);
}

nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

nav a[aria-current="page"] {
  color: var(--text);
}

.nav-button {
  padding: 0.35rem 0.62rem;
}

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.dashboard-page .layout {
  width: min(1180px, 100%);
}

.panel {
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  min-width: 0;
}

.panel h2 {
  margin: 0 0 0.2rem;
}

.status-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.clock {
  margin: 0.15rem 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(1.1rem, 4vw, 1.8rem);
  color: var(--accent);
}

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tab-btn {
  background: #0f2034;
  color: var(--accent-2);
  border: 1px solid var(--border);
  padding: 0.36rem 0.64rem;
}

.tab-btn.active {
  background: var(--accent);
  color: #04231f;
}

.blog-filter-tabs {
  margin: 0.9rem 0 1rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.form-grid,
.toolbar {
  display: grid;
  gap: 0.72rem;
}

.range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

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

input,
textarea,
select {
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1a28;
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: #6a8299;
}

button,
input[type="submit"] {
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #04231f;
  font-weight: 700;
  letter-spacing: 0.02em;
}

button.secondary {
  background: #14253b;
  color: var(--text);
  border-color: var(--border);
}

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px dashed var(--border);
}

button.danger {
  background: var(--danger);
  color: #fff;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
  width: 100%;
  max-width: 100%;
}

.toolbar + .card-grid {
  margin-top: 0.8rem;
}

#admin-dashboard-panel .toolbar + .card-grid {
  margin-top: 1.2rem;
}

.dashboard-page .card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.blog-page .post-list {
  max-width: none;
}

.post-category {
  display: inline-flex;
  align-items: center;
  margin: 0.35rem 0 0;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(121, 228, 165, 0.28);
  border-radius: 999px;
  background: rgba(121, 228, 165, 0.12);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card,
.post-card {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0.75rem;
  background: #102338;
}

.card-head,
.post-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: flex-start;
  min-width: 0;
}

.card-title-wrap {
  display: grid;
  gap: 0.35rem;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  min-width: 0;
}

.site-category {
  background: rgba(76, 201, 255, 0.18);
  color: #92e5ff;
  border: 1px solid rgba(76, 201, 255, 0.4);
  width: fit-content;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
}

.card-actions {
  display: flex;
  gap: 0.42rem;
  flex-wrap: wrap;
}

#website-list .card-actions button {
  padding: 0.34rem 0.56rem;
  font-size: 0.78rem;
  border-radius: 8px;
}

#website-list .admin-card-head {
  display: block;
}

#website-list .admin-title-wrap {
  display: grid;
  gap: 0.42rem;
  width: 100%;
}

#website-list .admin-inline-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  width: 100%;
}

#website-list .admin-inline-actions button {
  width: 100%;
  white-space: nowrap;
  padding: 0.32rem 0.3rem;
  font-size: 0.72rem;
}

.card h3,
.post-card h3 {
  margin: 0;
  font-size: 1rem;
}

.site-notes,
.post-content {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0.7rem;
  white-space: pre-wrap;
}

.site-image-meta {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.site-forecast {
  margin: 0 0 0.7rem;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #1f2937;
  font-size: 0.92rem;
  line-height: 1.5;
  border: 1px solid #dde3ea;
  white-space: pre-wrap;
}

.site-link {
  color: var(--accent-2);
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  white-space: normal;
}

.title-link {
  font-size: 0.86rem;
}

.alert-scroller {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f2034;
  padding: 0.55rem 0;
}

.alert-track {
  display: inline-flex;
  gap: 1.25rem;
  white-space: nowrap;
  padding-left: 100%;
  animation: alert-marquee 22s linear infinite;
}

.alert-item {
  color: #ffd58f;
  font-weight: 600;
}

.alert-heading {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  flex-wrap: wrap;
}

.alert-current {
  margin: 0.65rem 0 0;
}

.alert-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #8fd3ff;
  font-weight: 600;
  text-decoration: none;
}

.alert-link:hover,
.alert-link:focus-visible {
  text-decoration: underline;
}

.severe-indicator {
  color: #ff4d4d;
  font-size: 1rem;
  font-weight: 800;
  margin-left: 0.25rem;
  animation: severe-flash 1s steps(2, start) infinite;
}

@keyframes alert-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

@keyframes severe-flash {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0.2;
  }
}

.site-image-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  margin: 0.65rem 0 0.9rem;
  max-width: 100%;
  overflow: hidden;
}

.site-image-list.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.site-image-item {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  max-width: 100%;
}

.site-image {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0;
  background: #0a1521;
  display: block;
  max-width: 100%;
  object-fit: contain;
}

.image-name {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.image-count {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.image-input-group {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 0.6rem;
  display: grid;
  gap: 0.6rem;
}

.post-list {
  display: grid;
  gap: 0.75rem;
  max-width: 860px;
}

.post-image-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin: 0.45rem 0 0.7rem;
}

.post-image-list.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-image-item {
  display: grid;
  gap: 0.3rem;
}

.post-image {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0;
  background: #0a1521;
}

.post-date {
  font-size: 0.86rem;
  color: var(--muted);
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 9px;
  padding: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.auth-panel {
  max-width: 480px;
  margin-inline: auto;
}

.auth-error {
  margin: 0.5rem 0 0;
  color: var(--danger);
  font-weight: 600;
}

.secret-login-link {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  font-size: 1.5rem;
  color: #33455c;
  opacity: 0.5;
}

.secret-login-link:hover {
  opacity: 1;
}

.blog-layout .panel:first-child {
  max-width: 860px;
}

.blog-layout .panel:nth-child(2) {
  max-width: 860px;
}

.blog-layout .panel:nth-child(2) h2 {
  margin-bottom: 0.6rem;
}

.blog-layout .panel:nth-child(2) .card-grid {
  grid-template-columns: 1fr;
}

.blog-layout .post-card {
  background: #0f1e2b;
}

.blog-layout .post-card h3 {
  font-size: 1.2rem;
}

.blog-layout .post-card header {
  align-items: center;
}

.blog-layout .post-card header h3 {
  color: var(--accent);
}

.blog-layout .post-card header .post-date {
  color: var(--muted);
}

.blog-layout .post-card header button {
  margin-left: auto;
}

.blog-layout .post-card .post-content {
  margin-top: 0.4rem;
}

.blog-layout .post-card .post-image {
  border-radius: 12px;
}

.blog-layout .post-card .post-image-list {
  margin-top: 0.6rem;
}

.blog-layout .post-card .post-image-list.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.blog-layout .post-card .post-image-item .image-name {
  margin-top: 0.25rem;
}

.blog-layout .post-card .post-image-item .image-name:first-child {
  margin-top: 0;
}

.blog-layout .post-card .post-image-list.two-col .post-image-item {
  align-items: start;
}

.blog-layout .post-card .post-image-list .post-image {
  background: #0b1622;
}

.blog-layout .post-card .post-image-list .image-name {
  color: var(--muted);
}

.blog-layout .post-card .post-image-list .image-name strong {
  color: var(--text);
}

.blog-layout .post-card .post-image-list .image-name a {
  color: var(--accent-2);
}

.blog-layout .post-card .post-image-list .image-name a:hover {
  text-decoration: underline;
}

.blog-layout .post-card .post-image-list .image-name a:visited {
  color: var(--accent-2);
}

.blog-layout .post-card .post-image-list .image-name a:active {
  color: var(--accent-2);
}

.blog-layout .post-card .post-image-list .image-name a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.blog-layout .post-card .post-image-list .image-name a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.blog-layout .post-card .post-image-list .image-name a:focus:not(:focus-visible) {
  outline: none;
}

.blog-layout .post-card .post-image-list .image-name a:visited {
  color: var(--accent-2);
}

.blog-layout .post-card .post-image-list .image-name a:active {
  color: var(--accent-2);
}

@media (min-width: 920px) {
  .layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-layout {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-layout .status-panel,
  .dashboard-layout .panel:nth-child(2),
  .dashboard-layout .panel:nth-child(3) {
    grid-column: span 2;
  }

  .blog-layout {
    grid-template-columns: 1fr;
  }

  .blog-layout .status-panel,
  .blog-layout .panel:nth-child(2) {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-block {
    width: 100%;
    justify-content: space-between;
  }

  nav {
    width: 100%;
    justify-content: flex-start;
  }

  .tab-row {
    gap: 0.35rem;
  }

  .time-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-page .card-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-page .site-image-list.two-col {
    grid-template-columns: 1fr;
  }
}

.radar-layout {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.radar-layout > .panel {
  grid-column: span 12;
}

.noaa-workspace-panel {
  grid-column: span 12;
}

.noaa-workspace-grid {
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.noaa-sidebar {
  display: grid;
  gap: 0.9rem;
}

.noaa-control-group {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem;
  border: 1px solid rgba(146, 229, 255, 0.16);
  border-radius: 14px;
  background: rgba(9, 17, 26, 0.7);
}

.noaa-control-group h3 {
  margin: 0;
  font-size: 0.98rem;
}

.toggle-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1a28;
}

.toggle-chip input {
  margin: 0;
}

.noaa-frame-wrap {
  min-width: 0;
}

.noaa-radar-frame {
  width: 100%;
  min-height: 860px;
  border: 1px solid rgba(146, 229, 255, 0.18);
  border-radius: 18px;
  background: #08131f;
}

.radar-hero {
  display: grid;
  gap: 1rem;
  background:
    radial-gradient(circle at top right, rgba(76, 201, 255, 0.22), transparent 30%),
    linear-gradient(135deg, #08131f 0%, #102943 62%, #173657 100%);
}

.radar-hero h2 {
  margin: 0.15rem 0 0.45rem;
  font-size: clamp(1.5rem, 4vw, 2.35rem);
}

.hero-copy,
.hero-meta-text {
  color: var(--muted);
  line-height: 1.5;
}

.radar-meta-grid,
.ops-stat-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.radar-meta-card,
.ops-stat-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(146, 229, 255, 0.18);
  background: rgba(6, 17, 28, 0.44);
  backdrop-filter: blur(4px);
}

.radar-meta-card strong,
.ops-stat-card strong {
  font-size: 1.02rem;
}

.radar-controls-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.radar-stage-panel {
  grid-column: span 8;
}

.radar-sidebar {
  grid-column: span 4;
}

.radar-secondary-panel {
  grid-column: span 6;
}

.radar-stage-shell {
  display: grid;
  gap: 0.75rem;
}

.radar-stage-frame {
  position: relative;
  min-height: 520px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(146, 229, 255, 0.22);
  background:
    radial-gradient(circle at center, rgba(76, 201, 255, 0.16), rgba(0, 0, 0, 0) 38%),
    linear-gradient(180deg, #040b12 0%, #06101a 100%);
}

.radar-stage-image,
.feature-image {
  width: 100%;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #09111a;
}

.radar-stage-image {
  height: 100%;
  min-height: 520px;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}

.radar-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ring,
.crosshair {
  position: absolute;
  border-color: rgba(121, 228, 165, 0.32);
}

.ring {
  border-style: solid;
  border-width: 1px;
  border-radius: 999px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ring-1 {
  width: 26%;
  height: 26%;
}

.ring-2 {
  width: 52%;
  height: 52%;
}

.ring-3 {
  width: 80%;
  height: 80%;
}

.crosshair-h,
.crosshair-v {
  background: rgba(121, 228, 165, 0.26);
}

.crosshair-h {
  top: 50%;
  left: 6%;
  width: 88%;
  height: 1px;
}

.crosshair-v {
  top: 6%;
  left: 50%;
  width: 1px;
  height: 88%;
}

.scanline {
  position: absolute;
  inset-inline: 0;
  top: -20%;
  height: 24%;
  background: linear-gradient(180deg, rgba(76, 201, 255, 0), rgba(76, 201, 255, 0.1), rgba(76, 201, 255, 0));
  animation: radar-scan 7s linear infinite;
  pointer-events: none;
}

.compact-head {
  margin-bottom: 0.5rem;
}

.compact-select {
  display: grid;
  gap: 0.3rem;
  min-width: 160px;
}

.alert-stack {
  margin-top: 1rem;
}

.alert-list {
  display: grid;
  gap: 0.65rem;
}

.alert-card {
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem;
  border-radius: 12px;
  background: #132234;
  border: 1px solid rgba(229, 93, 93, 0.2);
  color: var(--muted);
}

.alert-card strong {
  color: #ffd58f;
}

.alert-body,
.alert-instruction {
  margin: 0.25rem 0 0;
  line-height: 1.45;
}

.alert-instruction strong {
  color: var(--text);
}

.radar-thumb-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.radar-thumb-card {
  display: grid;
  gap: 0.45rem;
}

.dashboard-satellite-image {
  width: 62.5%;
  margin-inline: auto;
}

.dashboard-satellite-panel {
  max-width: 720px;
  justify-self: center;
  width: 100%;
}

.dashboard-satellite-panel .panel-head > div {
  display: grid;
  gap: 0.2rem;
}

.dashboard-satellite-panel h3 {
  margin: 0;
}

@keyframes radar-scan {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(560%);
  }
}

@media (max-width: 980px) {
  .noaa-workspace-grid {
    grid-template-columns: 1fr;
  }

  .radar-stage-panel,
  .radar-sidebar,
  .radar-secondary-panel {
    grid-column: span 12;
  }

  .radar-stage-frame,
  .radar-stage-image {
    min-height: 380px;
  }
}

@media (max-width: 640px) {
  .noaa-radar-frame {
    min-height: 560px;
  }

  .radar-thumb-grid {
    grid-template-columns: 1fr;
  }

  .preset-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
