:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --border: #d8dde3;
  --text: #1f2933;
  --muted: #61707f;
  --green: #1f9d55;
  --red: #d64545;
  --orange: #d9822b;
  --black: #202b33;
  --blue: #276ef1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px;
}

.site-header {
  background: #0f1720;
  color: white;
  margin-bottom: 16px;
}

.title-row h1 {
  margin: 0;
  padding-top: 6px;
}

.title-row h1 a {
  color: white;
  text-decoration: none;
}

.subtitle {
  color: #b7c0cb;
  margin-top: 4px;
}

.metadata-grid,
.stats-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.meta-card,
.stat-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.meta-card {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #0f1720;
}

.panel {
  padding: 16px;
  margin-bottom: 16px;
}

.filters-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.filters-grid label,
.detail-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

input:not([type="checkbox"]),
select,
button,
.secondary-button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  font: inherit;
}

button,
.secondary-button {
  background: var(--blue);
  color: white;
  cursor: pointer;
  text-align: center;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #7a8693;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

.stat-card {
  padding: 16px;
  text-align: center;
}

.stat-card strong {
  display: block;
  font-size: 28px;
  margin-bottom: 6px;
}

.state-green {
  border-left: 5px solid var(--green);
}

.state-red {
  border-left: 5px solid var(--red);
}

.state-orange {
  border-left: 5px solid var(--orange);
}

.state-black {
  border-left: 5px solid var(--black);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.hut-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hut-card {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfd;
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 6px;
}

.status-green {
  background: var(--green);
}

.status-red {
  background: var(--red);
}

.status-orange {
  background: var(--orange);
}

.status-black {
  background: var(--black);
}

.hut-title-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
}

.hut-title-row h3 {
  margin: 0;
}

.hut-meta,
.hut-details {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  color: var(--muted);
}

.favorite-button {
  min-height: unset;
  border: 0;
  background: transparent;
  color: #d9822b;
  font-size: 22px;
  padding: 0 6px;
}

.favorite-button.is-favorite {
  color: #ffb020;
}

.favorites-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.favorite-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: #eef4ff;
  border: 1px solid #c7d7fe;
}

.muted {
  color: var(--muted);
}

.detail-form {
  display: flex;
  gap: 10px;
  align-items: end;
}

.detail-status-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  margin-top: 16px;
}

.days-table-wrapper {
  overflow-x: auto;
}

.days-table {
  width: 100%;
  border-collapse: collapse;
}

.days-table th,
.days-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.row-green td:first-child {
  border-left: 4px solid var(--green);
}

.row-red td:first-child {
  border-left: 4px solid var(--red);
}

.row-orange td:first-child {
  border-left: 4px solid var(--orange);
}

.row-black td:first-child {
  border-left: 4px solid var(--black);
}

.json-block {
  overflow-x: auto;
  padding: 12px;
  border-radius: 8px;
  background: #111827;
  color: #e5eefb;
}

@media (max-width: 700px) {
  .section-header,
  .hut-title-row,
  .detail-form,
  .actions {
    flex-direction: column;
    align-items: stretch;
  }
}


.meta-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.freshness-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: bold;
  color: white;
}

.freshness-green {
  background: var(--green);
}

.freshness-orange {
  background: var(--orange);
}

.freshness-red {
  background: var(--red);
}

.freshness-gray {
  background: #7a8693;
}

.meta-card.freshness-green {
  border-left: 5px solid var(--green);
}

.meta-card.freshness-orange {
  border-left: 5px solid var(--orange);
}

.meta-card.freshness-red {
  border-left: 5px solid var(--red);
}

.meta-card.freshness-gray {
  border-left: 5px solid #7a8693;
}

.info-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-section {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfd;
}

.info-section h3 {
  margin: 0 0 14px 0;
  font-size: 18px;
}



.info-value a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 700px) {
  .info-grid {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }

  .info-key {
    margin-top: 8px;
  }

  .info-value {
    margin-bottom: 6px;
  }
}

.info-image-wrapper {
  margin-bottom: 14px;
}

.info-image {
  display: block;
  max-width: 100%;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.info-list-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-list-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
}

.info-list-card h4 {
  margin: 0 0 10px 0;
  font-size: 16px;
}

.nested-block {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.nested-block h5 {
  margin: 0 0 8px 0;
  font-size: 14px;
}

.nested-grid {
  margin-top: 6px;
}

.nested-table-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nested-table-card {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfd;
}

.info-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.info-row {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid #e8edf2;
}

.info-row:last-child {
  border-bottom: 0;
}

.info-row-key {
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.info-row-value {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.info-row-value a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.info-rows.compact .info-row {
  padding: 8px 0;
}
@media (max-width: 700px) {
  .info-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .info-row-key {
    margin-bottom: 2px;
  }
}

.info-row-value p {
  margin: 0 0 8px 0;
}

.info-row-value p:last-child {
  margin-bottom: 0;
}

.info-row-value ul,
.info-row-value ol {
  margin: 6px 0 6px 20px;
  padding: 0;
}

.info-row-value br {
  line-height: 1.6;
}

.map-frame-wrapper {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.map-frame {
  display: block;
  width: 100%;
  height: 420px;
  border: 0;
}

.hut-map {
  width: 100%;
  height: 600px;
  border-radius: 10px;
  overflow: hidden;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.title-left {
  display: flex;
  flex-direction: column;
}

/* NAV */
.main-nav {
  display: flex;
  gap: 12px;
}

.main-nav a {
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: #cbd5f5;
  font-weight: 500;
  transition: background 0.2s ease;
}

.main-nav a:hover {
  background: rgba(255,255,255,0.1);
}

.main-nav a.active {
  background: rgba(255,255,255,0.2);
  color: white;
  font-weight: 600;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.legend-green {
  background: #22c55e;
}

.legend-red {
  background: #ef4444;
}

.legend-orange {
  background: #f97316;
}

.legend-black {
  background: #444444;
}

.legend-favorite {
  background: #fbbf24;
}

.map-checkbox {
  align-self: center;
  margin-top: 24px;
}

@media (max-width: 700px) {
  .map-checkbox {
    justify-content: start;
  }
}

.checkbox {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

.checkbox span {
  color: var(--text);
}