:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f6f7;
  --border: #e4e6ea;
  --text: #111111;
  --muted: #5b6471;
  --accent: #c87800;
  --accent-soft: rgba(200, 120, 0, 0.12);
  --new: #1f8e4a;
  --new-soft: rgba(31, 142, 74, 0.14);
  --radius: 12px;
  --max-width: 720px;
  --serif:
    "Didot", "Bodoni 72", "Hoefler Text", "Big Caslon", Cambria, Georgia,
    serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 16px 24px;
}

.hidden {
  display: none !important;
}

/* --- top bar -------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: env(safe-area-inset-top) 16px 6px;
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.title {
  display: inline-block;
  width: auto;
  padding: 2px 4px;
  margin: 6px 0 0;
  line-height: 1.05;
  font-family: inherit;
  font-style: italic;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #000000;
  background: transparent;
  border: none;
  cursor: pointer;
}

.tagline {
  display: inline-block;
  background: #2563eb;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  margin: 2px 0 6px;
  letter-spacing: 0.02em;
}

.title:active {
  opacity: 0.7;
}

.search {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 6px 0 0;
}

.search input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-style: italic;
  font-weight: 700;
  font-size: 38px;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #000;
  background: transparent;
  border: none;
  padding: 2px 4px;
  text-align: center;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: font-size 120ms ease;
}

.search input::placeholder {
  color: #c4c8cd;
  font-style: italic;
}

.search input::-webkit-search-cancel-button,
.search input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

#search-close {
  flex-shrink: 0;
  background: transparent;
  color: #000;
  border: none;
  width: auto;
  height: auto;
  padding: 0 6px;
  font-family: inherit;
  font-size: 30px;
  font-style: italic;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

#search-close:active {
  opacity: 0.6;
}

.regions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 2px;
  padding: 2px 0 0;
}

.region {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 6px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

.region[aria-pressed="true"] {
  color: #1f8e4a;
  text-decoration: underline;
  text-decoration-color: #1f8e4a;
}

/* --- news list ------------------------------------------------ */

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.item {
  position: relative;
  isolation: isolate;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  padding: 10px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.item:first-child {
  border-top: none;
  padding-top: 4px;
}

.item:active {
  opacity: 0.7;
}

.item-head {
  position: absolute;
  bottom: -6px;
  right: -4px;
  z-index: -1;
  pointer-events: none;
  line-height: 1;
}

.rank {
  font-size: 92px;
  font-weight: 800;
  color: #dde1e5;
  letter-spacing: -0.04em;
  line-height: 1;
}

.badge-new {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--new);
  background: var(--new-soft);
  padding: 2px 6px;
  border-radius: 999px;
  vertical-align: middle;
  transform: translateY(-1px);
}

.item-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 4px;
}

.bullets {
  margin: 0;
  padding-left: 18px;
  color: #1d232c;
  font-size: 14px;
  line-height: 1.3;
}

.bullets li + li {
  margin-top: 2px;
}

.full {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 15px;
  color: var(--text);
  white-space: pre-wrap;
}

.item[aria-expanded="false"] .full,
.item[aria-expanded="false"] .regions-tag,
.item[aria-expanded="false"] .share-btn {
  display: none;
}

.share-btn {
  display: inline;
  margin: 0 8px 0 0;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  border: none;
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 120ms ease;
}

.share-btn:active {
  opacity: 0.7;
}

.share-btn[data-copied="true"] {
  color: #1f8e4a;
}

.regions-tag {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 24px 8px;
  font-size: 14px;
}
