:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-strong: #eef3ef;
  --ink: #17211c;
  --muted: #627069;
  --line: #d9e1dc;
  --accent: #136f63;
  --accent-strong: #0c5048;
  --amber: #a65f00;
  --shadow: 0 16px 40px rgba(23, 33, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
}

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 10px;
  font-size: 21px;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.home-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--accent-strong);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.home-link:hover,
.home-link:focus-visible {
  border-color: var(--accent);
  outline: 3px solid rgba(19, 111, 99, 0.14);
}

.icon-button,
.primary-button,
.secondary-button,
.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.delete-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.icon-button {
  width: 54px;
  background: var(--surface-strong);
  border-color: var(--line);
  color: var(--accent-strong);
  font-size: 13px;
}

.primary-button {
  width: 100%;
  background: var(--accent);
  color: white;
}

.secondary-button {
  padding: 0 14px;
  background: var(--surface-strong);
  border-color: var(--line);
  color: var(--ink);
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.delete-button {
  min-height: 34px;
  padding: 0 10px;
  background: transparent;
  border-color: var(--line);
  color: #9b2d20;
}

.app-shell {
  display: grid;
  gap: 22px;
  padding: 24px clamp(18px, 4vw, 52px) 48px;
}

.toolbar,
.map-panel,
.panel,
.results-panel,
.article-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.map-panel {
  padding: 18px;
}

.map-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.map-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.world-map {
  position: relative;
  overflow: hidden;
  height: clamp(360px, 52vw, 620px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #a9d3df;
}

.leaflet-container {
  font: inherit;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-container {
  overflow: hidden;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
}

.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-control-container .leaflet-top {
  top: 10px;
}

.leaflet-control-container .leaflet-right {
  right: 10px;
}

.leaflet-control-container .leaflet-bottom {
  bottom: 10px;
}

.leaflet-control-container .leaflet-left {
  left: 10px;
}

.leaflet-control {
  clear: both;
  pointer-events: auto;
}

.leaflet-left .leaflet-control {
  float: left;
}

.leaflet-right .leaflet-control {
  float: right;
}

.leaflet-top .leaflet-control {
  margin-top: 10px;
}

.leaflet-bottom .leaflet-control {
  margin-bottom: 10px;
}

.leaflet-left .leaflet-control {
  margin-left: 10px;
}

.leaflet-right .leaflet-control {
  margin-right: 10px;
}

.leaflet-control-zoom a {
  display: block;
  width: 30px;
  height: 30px;
  border-bottom: 1px solid #ccc;
  background: #fff;
  color: #111;
  line-height: 30px;
  text-align: center;
  text-decoration: none;
}

.leaflet-control-attribution {
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.86);
  font-size: 11px;
}

.map-marker {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  box-shadow: 0 8px 18px rgba(12, 80, 72, 0.24);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.map-marker::after {
  position: absolute;
  inset: -9px;
  border: 1px solid rgba(19, 111, 99, 0.22);
  border-radius: 50%;
  content: "";
}

.map-marker:hover,
.map-marker:focus-visible {
  background: var(--amber);
  outline: 3px solid rgba(166, 95, 0, 0.22);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(5, minmax(128px, 180px));
  gap: 14px;
  align-items: end;
  padding: 18px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel,
.results-panel {
  padding: 18px;
}

.add-panel {
  position: sticky;
  top: 18px;
}

#articleForm {
  display: grid;
  gap: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
}

.results-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.results-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.articles-list {
  display: grid;
  gap: 14px;
}

.article-card {
  padding: 18px;
  outline: 3px solid transparent;
  box-shadow: none;
}

.card-topline,
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.new-badge {
  display: none;
  border-radius: 999px;
  background: #f3c34d;
  color: #31220a;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.article-card.is-new {
  border-color: rgba(166, 95, 0, 0.38);
  background: #fffaf0;
}

.article-card.is-new .new-badge {
  display: inline-flex;
}

.article-type {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.article-year {
  color: var(--amber);
  font-weight: 800;
}

.article-card h3 {
  margin: 8px 0;
  font-size: 20px;
  line-height: 1.25;
}

.article-meta,
.article-location,
.article-notes {
  color: var(--muted);
}

.article-notes {
  margin-bottom: 12px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag {
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--accent-strong);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}

.article-link {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.empty-state {
  padding: 36px 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 920px) {
  .toolbar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .add-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .app-header,
  .results-header,
  .card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    justify-content: flex-start;
  }

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

.map-marker.is-selected {
  background: var(--amber);
  outline: 4px solid rgba(166, 95, 0, 0.26);
}

.map-tooltip {
  width: min(340px, calc(100vw - 48px));
  max-width: min(340px, calc(100vw - 48px));
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  white-space: normal;
}

.map-tooltip-content {
  display: grid;
  gap: 6px;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.map-tooltip-content strong {
  color: var(--accent-strong);
  font-size: 13px;
}

.map-tooltip-content p,
.map-tooltip-content ul {
  margin: 0;
}

.map-tooltip-content ul {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-left: 16px;
}

.map-tooltip-content li {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.map-tooltip-content li span {
  color: var(--muted);
}

.map-tooltip-content em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.map-tooltip-more {
  color: var(--muted);
  font-weight: 700;
}


.form-status {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-status[data-tone="success"] {
  color: var(--accent-strong);
}

.form-status[data-tone="error"] {
  color: #9b2d20;
}

.suggestions-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(19, 111, 99, 0.24);
  border-radius: 8px;
  background: #f7fbf8;
}

.suggestions-panel[hidden] {
  display: none;
}

.suggestions-header,
.suggestion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.suggestions-header h3 {
  margin: 0;
  font-size: 18px;
}

.suggestions-list {
  display: grid;
  gap: 12px;
}

.suggestion-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.suggestion-card h3 {
  margin: 8px 0;
  font-size: 18px;
  line-height: 1.3;
}
