:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-accent: #0d1b31;
  --surface: rgba(15, 23, 42, 0.78);
  --surface-strong: #111b2e;
  --text: #e5eefb;
  --muted: #9eb1cc;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(148, 163, 184, 0.3);
  --primary: #4ade80;
  --primary-soft: rgba(74, 222, 128, 0.16);
  --primary-strong: #16a34a;
  --danger: #fb7185;
  --shadow: 0 14px 34px rgba(2, 6, 23, 0.34);
  --scrollbar-track: rgba(15, 23, 42, 0.48);
  --scrollbar-thumb: rgba(74, 222, 128, 0.34);
  --scrollbar-thumb-hover: rgba(74, 222, 128, 0.58);
}

* { box-sizing: border-box; }

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.5), rgba(59, 130, 246, 0.38));
  border: 2px solid rgba(5, 11, 21, 0.7);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.72), rgba(59, 130, 246, 0.52));
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

html, body {
  min-height: 100%;
  height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(74, 222, 128, 0.16), transparent 32%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 28%),
    linear-gradient(180deg, #050b15 0%, var(--bg) 56%, #040812 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 90%);
  opacity: 0.45;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 11, 21, 0.84);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.2);
}

main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.topbar h1 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.topbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.compact-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.locale-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.locale-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.76);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.locale-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(17, 24, 39, 0.9);
}

.locale-btn.active {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.6);
  color: #d1fae5;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.06);
}

.flag-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.floating-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 0;
  flex-wrap: wrap;
}

.btn,
.icon-btn,
.interval-btn,
.action-btn {
  border: 1px solid var(--line-strong);
  background: rgba(15, 23, 42, 0.82);
  color: var(--text);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease, opacity 120ms ease;
}

.btn:hover,
.icon-btn:hover,
.interval-btn:hover,
.action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(74, 222, 128, 0.45);
}

.btn {
  padding: 8px 10px;
  font-weight: 700;
  font-size: 0.82rem;
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color: rgba(74, 222, 128, 0.7);
  color: #04211d;
}

.btn.danger {
  background: rgba(127, 29, 29, 0.15);
  color: #fecdd3;
  border-color: rgba(251, 113, 133, 0.45);
}

.interval-btn {
  padding: 7px 9px;
  font-weight: 700;
  font-size: 0.78rem;
  background: rgba(15, 23, 42, 0.76);
}

.interval-btn.active {
  background: var(--primary-soft);
  border-color: rgba(74, 222, 128, 0.5);
  color: #d1fae5;
}

.tabs-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--tab-column-width, 400px);
  grid-template-rows: 1fr;
  gap: 10px;
  padding: 10px;
  height: 100%;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  align-content: stretch;
  justify-content: start;
}

.tab-column {
  min-height: 0;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(9, 14, 28, 0.96));
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.empty-slot {
  border-style: dashed;
  border-color: rgba(74, 222, 128, 0.22);
  background: linear-gradient(180deg, rgba(12, 18, 34, 0.96), rgba(9, 14, 28, 0.92));
  height: 100%;
}

.empty-slot.primary {
  border-color: rgba(74, 222, 128, 0.45);
  background: linear-gradient(180deg, rgba(15, 24, 43, 0.98), rgba(10, 17, 31, 0.94));
}

.empty-slot-inner {
  min-height: 0;
  height: 100%;
  display: grid;
  gap: 10px;
  align-content: center;
  justify-items: center;
  padding: 18px;
  text-align: center;
}

.empty-slot-copy {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.empty-slot strong {
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 860;
  letter-spacing: 0.01em;
}

.empty-slot-description,
.trends-slot-description {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  max-width: none;
  width: 100%;
}

.empty-slot.primary .empty-slot-inner {
  grid-template-rows: auto auto 1fr;
  align-content: start;
  justify-items: stretch;
  padding: 12px;
  text-align: left;
}

.empty-slot.primary .empty-slot-copy {
  width: 100%;
  justify-items: stretch;
  text-align: left;
}

.empty-slot.primary .empty-add-btn {
  justify-self: auto;
  width: auto;
  order: 0;
}

.empty-slot-quick-create {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(74, 222, 128, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(10, 16, 30, 0.99)),
    linear-gradient(135deg, rgba(74, 222, 128, 0.12), transparent 42%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 24px rgba(2, 6, 23, 0.22);
  position: relative;
  overflow: hidden;
}

.empty-slot-query-input {
  flex: 1 1 auto;
  min-width: 0;
  margin-top: 0;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #edf5ff;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: 0.012em;
  outline: none;
  line-height: 1.25;
}

.empty-slot-query-input::placeholder {
  color: rgba(177, 196, 221, 0.6);
}

.empty-add-btn {
  flex: 0 0 auto;
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
  font-size: 1.05rem;
  line-height: 1;
}

.trends-panel {
  width: 100%;
  display: grid;
  gap: 8px;
  min-height: 0;
  align-content: start;
}

.trends-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.trends-country-label {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trends-country-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
}

.trends-hour-btn {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 3px 7px;
  border-radius: 2px;
  background: rgba(15, 23, 42, 0.82);
  color: var(--text);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  line-height: 1;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.trends-hour-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(74, 222, 128, 0.45);
}

.trends-hour-btn:focus-visible {
  outline: 2px solid rgba(74, 222, 128, 0.45);
  outline-offset: 2px;
}

.trends-hour-btn.active {
  background: rgba(22, 163, 74, 0.16);
  color: #d1fae5;
  border-color: rgba(74, 222, 128, 0.5);
}

.trends-country-btn {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 3px 7px;
  border-radius: 2px;
  background: rgba(15, 23, 42, 0.82);
  color: var(--text);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  line-height: 1;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.trends-country-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(74, 222, 128, 0.45);
}

.trends-country-btn:focus-visible {
  outline: 2px solid rgba(74, 222, 128, 0.45);
  outline-offset: 2px;
}

.trends-country-btn.active {
  background: rgba(22, 163, 74, 0.16);
  color: #d1fae5;
  border-color: rgba(74, 222, 128, 0.5);
}

.trends-status {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.trends-list {
  list-style: none;
  margin: 0;
  padding: 8px 0 10px;
  display: grid;
  gap: 6px;
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: auto;
  scrollbar-gutter: stable;
}

.trend-item {
  width: 100%;
  margin-bottom: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(7, 14, 28, 0.76);
  color: var(--text);
  border-radius: 2px;
  text-align: left;
  cursor: pointer;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: start;
  position: relative;
  overflow: visible;
}

.trend-item:hover {
  border-color: rgba(74, 222, 128, 0.42);
  background: rgba(10, 18, 34, 0.92);
}

.trend-item::after {
  content: "+";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translate(8px, -50%) scale(0.92);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.55);
  background: rgba(6, 18, 15, 0.96);
  color: #d1fae5;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.trend-item:hover::after,
.trend-item:focus-visible::after {
  opacity: 1;
  transform: translate(8px, -50%) scale(1);
  border-color: rgba(74, 222, 128, 0.85);
  background: rgba(10, 32, 21, 0.98);
}

.trend-item.trend-empty {
  cursor: default;
  color: var(--muted);
  font-size: 0.76rem;
  grid-template-columns: 1fr;
}

.trend-image {
  width: 88px;
  height: 88px;
  overflow: hidden;
  border-radius: 3px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.6);
}

.trend-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.trend-body {
  display: grid;
  gap: 6px;
  min-width: 0;
  align-content: start;
}

.trend-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.trend-rank {
  color: #93c5fd;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.trend-time {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.trend-title {
  color: #d7e0ed;
  font-weight: 780;
  font-size: 0.96rem;
  line-height: 1.34;
  letter-spacing: 0;
  text-decoration: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.trend-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.trend-chip {
  white-space: nowrap;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(15, 23, 42, 0.72);
}

.trend-chip-traffic {
  color: #d1fae5;
  border-color: rgba(74, 222, 128, 0.22);
}

.trend-chip-date {
  color: #cbd5e1;
}

.trend-chip-source {
  color: #fca5a5;
  border-color: rgba(251, 113, 133, 0.24);
}

.trend-description {
  margin: 0;
  color: #b3bfd3;
  font-size: 0.84rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.trend-item:hover .trend-title {
  color: #b9f7eb;
}

.trend-item--no-image {
  grid-template-columns: 1fr;
}

.trend-item--no-image .trend-image {
  display: none;
}

.empty-slot .btn.primary {
  width: auto;
  justify-content: center;
}

.tab-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}

.tab-header-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
  width: 100%;
}

.tab-header-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.tab-title-shell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
  padding: 12px 14px;
  border: 1px solid rgba(74, 222, 128, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(10, 16, 30, 0.99)),
    linear-gradient(135deg, rgba(74, 222, 128, 0.12), transparent 42%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 24px rgba(2, 6, 23, 0.22);
  position: relative;
  overflow: hidden;
}

.tab-title-shell::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.9), rgba(96, 165, 250, 0.4));
}

.tab-signal {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  border: 1px solid rgba(74, 222, 128, 0.45);
  background: rgba(4, 9, 18, 0.9);
  color: #86efac;
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  text-transform: none;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.06);
}

.tab-signal.active {
  background: rgba(22, 163, 74, 0.18);
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.08), inset 0 0 0 1px rgba(74, 222, 128, 0.12);
}

.tab-title-input {
  width: 100%;
  padding: 0;
  margin-top: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #edf5ff;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: 0.012em;
  text-transform: none;
  outline: none;
  line-height: 1.25;
}

.tab-title-input::placeholder {
  color: rgba(177, 196, 221, 0.6);
}

.tab-status {
  min-width: 26px;
  padding: 5px 8px;
  border-radius: 2px;
  border: 1px solid rgba(74, 222, 128, 0.24);
  background: rgba(13, 21, 39, 0.82);
  color: #86efac;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  white-space: nowrap;
  text-align: center;
}

.state-pill {
  padding: 4px 7px;
  border-radius: 2px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #d8e5f7;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: none;
}

.tab-control-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
  align-items: center;
  padding-right: 2px;
}

.control-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 2px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: none;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, opacity 120ms ease;
  justify-content: center;
  line-height: 1;
}

.lang-btn {
  min-width: 42px;
  letter-spacing: 0.06em;
}

.sort-btn {
  margin-left: auto;
  justify-content: center;
  gap: 0;
  min-width: 34px;
  padding: 7px 8px;
}

.control-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(74, 222, 128, 0.45);
}

.control-btn.active {
  background: var(--primary-soft);
  border-color: rgba(74, 222, 128, 0.5);
  color: #d1fae5;
}

.control-btn.danger {
  background: rgba(127, 29, 29, 0.14);
  color: #fecdd3;
  border-color: rgba(251, 113, 133, 0.4);
}

.control-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.action-btn {
  padding: 7px 9px;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  font-weight: 700;
  font-size: 0.78rem;
}

.icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  background: rgba(15, 23, 42, 0.74);
  line-height: 1;
}

.icon-btn.danger {
  background: rgba(127, 29, 29, 0.14);
}

.icon-btn.armed {
  background: rgba(22, 163, 74, 0.18);
  color: #86efac;
  border: 1px solid rgba(74, 222, 128, 0.52);
}

.tab-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  justify-self: end;
  padding-top: 2px;
}

.icon-wrap {
  width: 1em;
  height: 1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
}

.icon-glyph {
  width: 100%;
  height: 100%;
  display: block;
  background-color: currentColor;
  -webkit-mask: var(--icon-url) no-repeat center / contain;
  mask: var(--icon-url) no-repeat center / contain;
}

.action-btn .icon-wrap,
.control-btn .icon-wrap {
  width: 1em;
  height: 1em;
}

.tab-header-actions .icon-wrap {
  width: 0.95em;
  height: 0.95em;
}

.freshness-group {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  overflow: visible;
}

.freshness-btn {
  min-width: 84px;
  justify-content: center;
}

.freshness-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  min-width: 132px;
  width: 100%;
  max-width: 170px;
  background: rgba(6, 12, 24, 0.96);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  z-index: 5;
  overflow: visible;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 0s linear 180ms;
}

.freshness-group:hover .freshness-menu,
.freshness-group.open .freshness-menu,
.freshness-group:focus-within .freshness-menu {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 0s;
}

.freshness-option {
  flex: 0 0 auto;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.74);
  color: var(--text);
  border-radius: 2px;
  padding: 7px 10px;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}

.freshness-option:hover {
  border-color: rgba(74, 222, 128, 0.42);
  color: #d1fae5;
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 8px 12px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.tab-column.loading .tab-header {
  position: relative;
  box-shadow: inset 0 1px 0 rgba(74, 222, 128, 0.08);
}

.tab-column.loading .tab-header::after {
  content: none;
}

.tab-column.loading .news-list {
  opacity: 1;
}

.news-item {
  margin-bottom: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(7, 14, 28, 0.76);
  border-radius: 2px;
}

.news-item.read {
  opacity: 0.88;
}

.news-image {
  width: 100%;
  overflow: hidden;
  border-radius: 3px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.6);
}

.news-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.news-body {
  display: grid;
  gap: 8px;
}

.news-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.news-time {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.news-item a {
  color: #d7e0ed;
  text-decoration: none;
  font-weight: 780;
  font-size: 0.96rem;
  line-height: 1.34;
  letter-spacing: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.news-item a:hover {
  color: #b9f7eb;
}

.news-item p {
  margin: 0;
  color: #b3bfd3;
  font-size: 0.84rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.tag {
  font-size: 0.68rem;
  color: #c4d1e4;
  letter-spacing: 0.03em;
}

.dialog {
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  width: min(580px, 95vw);
  padding: 0;
  color: var(--text);
  background: transparent;
  box-shadow: var(--shadow);
}

.compact-dialog {
  width: min(420px, 94vw);
}

.dialog::backdrop {
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
}

.dialog-content {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(10, 16, 29, 0.98), rgba(11, 18, 33, 0.98));
}

.compact-content {
  gap: 16px;
}

.compact-content p {
  margin: 0;
  color: var(--text);
}

input,
select {
  width: 100%;
  margin-top: 5px;
  border-radius: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  background: rgba(15, 23, 42, 0.88);
  color: var(--text);
}

.inline-control {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.inline-control span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
}

#intervalSelect {
  width: 74px;
  height: 32px;
  margin-top: 0;
  padding: 0 10px;
  border-radius: 4px;
}

.refresh-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  height: 32px;
}

.refresh-meter {
  --progress: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
  background:
    conic-gradient(from -90deg, rgba(74, 222, 128, 0.95) calc(var(--progress) * 1turn), rgba(74, 222, 128, 0.08) 0),
    radial-gradient(circle, rgba(4, 9, 18, 0.98) 58%, rgba(4, 9, 18, 0.98) 59%, transparent 60%);
  box-shadow:
    inset 0 0 0 1px rgba(148, 163, 184, 0.18),
    0 0 0 3px rgba(74, 222, 128, 0.08);
  overflow: hidden;
  transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.refresh-meter::after {
  content: "↻";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #86efac;
  font-size: 0.95rem;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.65) rotate(-40deg);
  transition: opacity 180ms ease, transform 180ms ease;
}

.refresh-meter[data-phase="updated"] {
  background:
    radial-gradient(circle, rgba(134, 239, 172, 0.22) 0 62%, rgba(4, 9, 18, 0.98) 63%),
    radial-gradient(circle, rgba(4, 9, 18, 0.98) 58%, rgba(4, 9, 18, 0.98) 59%, transparent 60%);
  box-shadow:
    inset 0 0 0 1px rgba(134, 239, 172, 0.35),
    0 0 0 4px rgba(134, 239, 172, 0.1);
}

.refresh-meter[data-phase="updated"]::after {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

input::placeholder {
  color: rgba(158, 177, 204, 0.7);
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .tab-header {
    flex-direction: column;
  }

  .tab-header-top {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .tab-header-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 0;
  }

  .tab-control-row {
    width: 100%;
  }

  .control-btn {
    flex: 1 1 112px;
    justify-content: center;
  }
}
