:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #222222;
  --muted: #64748b;
  --line: #d8e2ee;
  --accent: #2563eb;
  --accent-strong: #1e3a8a;
  --warm: #0ea5e9;
  --logo-gradient: linear-gradient(135deg, #2563eb 0%, #0ea5e9 52%, #67e8f9 100%);
  --accent-soft: #eff6ff;
  --summary-bg: #f0f7ff;
  --summary-line: #bfdbfe;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --topbar-height: 82px;
}

* {
  box-sizing: border-box;
}

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

html {
  scrollbar-gutter: stable;
}

@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: min(1240px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: calc(var(--topbar-height) + var(--safe-top)) 0 calc(42px + var(--safe-bottom));
}

.topbar {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1240px, 100%);
  max-width: 100%;
  min-height: calc(var(--topbar-height) + var(--safe-top));
  border-bottom: 1px solid var(--line);
  padding: calc(14px + var(--safe-top)) 22px 14px;
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  transform: none;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

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

.brand img {
  display: block;
  width: auto;
  height: 52px;
  max-width: min(280px, 60vw);
  object-fit: contain;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.icon-button,
.topic-form button,
.tab,
.focus-select,
.focus-settings,
.focus-remove {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  font-size: 24px;
}

.auth-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.auth-status {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--logo-gradient);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.auth-button.ghost {
  border-color: var(--line);
  background: #f8fbff;
  color: var(--accent-strong);
}

.topic-form {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  gap: 8px;
  flex: 1;
  justify-content: end;
  margin: 0 0 0 auto;
}

.topic-form input {
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 14px;
  background: #f8fbff;
  color: var(--ink);
  font-size: 16px;
}

.topic-form button {
  height: 46px;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--logo-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset;
  font-weight: 700;
}

.topic-form button:hover,
.topic-form button:focus-visible {
  filter: saturate(1.08) brightness(1.02);
}

.few-topics:not(.empty-mode) .topbar .topic-form input {
  border-color: rgba(37, 99, 235, 0.78);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.16), 0 0 22px rgba(37, 99, 235, 0.12);
}

.dashboard {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 0;
  max-width: 100%;
  min-height: calc(100vh - 82px);
}

.panel,
.feed-area {
  min-width: 0;
  max-width: 100%;
  background: var(--surface);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.panel {
  position: sticky;
  top: calc(var(--topbar-height) + var(--safe-top));
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height) - var(--safe-top));
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  padding: 22px 18px 24px 22px;
}

.feed-area {
  padding: 22px 22px 24px;
}

.panel-head,
.feed-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-head {
  flex: 0 0 auto;
}

.panel-head span {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.focus-list {
  display: grid;
  flex: 1 1 auto;
  gap: 6px;
  min-height: 0;
  margin-top: 10px;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.keyword-drawer-toggle,
.keyword-drawer-backdrop {
  display: none;
}

.focus-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  grid-template-rows: minmax(72px, auto);
  min-height: 72px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.focus-item.dragging {
  opacity: 0.78;
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.focus-item.load-loaded {
  opacity: 1;
}

.focus-item.load-loading {
  opacity: 0.5;
}

.focus-item.load-pending {
  opacity: 0.1;
}

.focus-item.load-pending .focus-drag,
.focus-item.load-pending .focus-select,
.focus-item.load-pending .focus-settings {
  cursor: default;
  pointer-events: none;
}

.focus-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.focus-drag {
  grid-column: 1;
  grid-row: 1;
  align-self: stretch;
  width: 28px;
  border: 0;
  border-right: 1px solid rgba(216, 226, 238, 0.72);
  background: rgba(248, 251, 255, 0.72);
  color: #94a3b8;
  cursor: grab;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  touch-action: none;
}

.focus-drag:active,
.topic-dragging .focus-drag {
  cursor: grabbing;
}

.focus-select {
  grid-column: 2 / 4;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 9px 44px 28px 10px;
  text-align: left;
  background: transparent;
}

.focus-remove {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  width: 30px;
  min-width: 30px;
  height: 30px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  line-height: 1;
  font-size: 20px;
  font-weight: 800;
}

.focus-settings-area {
  grid-column: 2 / 4;
  grid-row: 1;
  align-self: end;
  justify-self: end;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0 7px 6px 0;
  border-radius: 999px;
  background: var(--logo-gradient);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

.focus-settings {
  border: 0;
  background: transparent;
  color: #fff;
  min-height: 19px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 900;
}

.focus-select strong {
  display: block;
  max-height: 2.5em;
  overflow-wrap: anywhere;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.25;
}

.focus-select span {
  display: none;
  color: var(--muted);
  font-size: 11px;
}

.feed-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.feed-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f9ff;
}

.feed-tab {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.feed-tab.active {
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.08);
}

.source-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f9ff;
}

.tab {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab.active {
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: 0 1px 8px rgba(20, 28, 34, 0.08);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--warm);
  animation: status-pulse 900ms ease-in-out infinite;
}

.status[hidden] {
  display: none;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 100%;
  min-width: 0;
}

.empty-mode .feed-head {
  display: none;
}

.shell:has(.welcome-empty) {
  padding-top: 0;
}

.dashboard:has(.welcome-empty) {
  grid-template-columns: 1fr;
}

.shell:has(.welcome-empty) .topbar,
.dashboard:has(.welcome-empty) .panel,
.dashboard:has(.welcome-empty) .feed-head {
  display: none;
}

.empty-mode .topbar {
  display: none;
}

.empty-mode .topbar .topic-form {
  display: none;
}

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

.empty-mode .panel {
  display: none;
}

.empty-mode .feed-area {
  display: grid;
  align-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 22px;
}

.topic-section {
  display: grid;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 96px;
}

.topic-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  border-radius: 8px;
  padding: 18px 14px;
  background: #f1f3f5;
}

.topic-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.topic-section-head h3 {
  flex: 0 1 auto;
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.15;
  min-width: 0;
}

.topic-selected-tags {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #8293a1;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-section-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.topic-section-tools span {
  color: #a9b1b8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-align: right;
}

.topic-section-tools button {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  padding: 0 11px;
  background: var(--logo-gradient);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.topic-section-body {
  display: grid;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.topic-empty,
.topic-feed-sentinel {
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.add-topic-prompt {
  display: grid;
  place-items: center;
  gap: 10px;
  justify-self: center;
  width: 70%;
  max-width: 100%;
  min-height: 0;
  margin: 18px auto 8px;
  border: 0;
  border-radius: 0;
  padding: 12px 0;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.7;
  text-align: center;
}

.add-topic-prompt p {
  margin: 0;
}

.add-topic-suggestions-button {
  min-height: 34px;
  border: 1px solid #d8e4ee;
  border-radius: 999px;
  padding: 0 14px;
  background: #f8fbff;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

@media (hover: hover) and (pointer: fine) {
  .add-topic-suggestions-button:hover {
    border-color: var(--accent);
    background: #eef8fb;
  }
}

.topic-narrowing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  border: 1px solid #d8e4ee;
  border-radius: 8px;
  padding: 14px 16px;
  background: #f7fbff;
  color: #222222;
}

.topic-narrowing strong {
  display: block;
  color: var(--accent-strong);
  font-size: 14px;
}

.topic-narrowing p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.topic-narrowing button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 13px;
  background: var(--logo-gradient);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.topic-clarification {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid #d8e4ee;
  border-radius: 8px;
  padding: 18px;
  background: #f7fbff;
  overflow: hidden;
}

.topic-clarification-copy strong {
  display: block;
  max-width: 100%;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.topic-clarification-copy p,
.topic-clarification-empty {
  max-width: 100%;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.topic-clarification-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.topic-clarification-form input {
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
  font-size: 16px;
}

.topic-clarification-form button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--logo-gradient);
  color: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.topic-clarification-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.topic-clarification-tag {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
}

.topic-clarification-tag input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.topic-clarification-tag span {
  display: inline-grid;
  place-items: center;
  max-width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid #c8d8e8;
  border-radius: 999px;
  padding: 0 13px;
  background: #ffffff;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
  text-align: center;
}

.topic-clarification-tag input:focus-visible + span {
  border-color: var(--accent);
  background: #eef8ff;
}

@media (hover: hover) and (pointer: fine) {
  .topic-clarification-tag:hover span {
    border-color: var(--accent);
    background: #eef8ff;
  }
}

.topic-clarification-tag input:checked + span {
  border-color: transparent;
  background: var(--logo-gradient);
  color: #ffffff;
}

.topic-clarification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  max-width: 100%;
  min-width: 0;
}

.topic-clarification-actions .ghost-button,
.topic-clarification-actions .primary-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.topic-clarification-actions .primary-button {
  border-color: transparent;
  background: var(--logo-gradient);
  color: #ffffff;
}

.topic-clarification-actions .primary-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.topic-loading {
  display: grid;
  gap: 8px;
}

.topic-loading-row {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: linear-gradient(90deg, #f6f8f7 0%, #ffffff 48%, #f6f8f7 100%);
  background-size: 220% 100%;
  animation: topic-loading-shimmer 1.15s ease-in-out infinite;
}

.topic-loading-row span,
.topic-loading-row strong {
  display: block;
  border-radius: 999px;
  background: #e7ece8;
}

.topic-loading-row span {
  width: 104px;
  height: 24px;
}

.topic-loading-row strong {
  width: min(100%, 620px);
  height: 18px;
}

.topic-loading-row:nth-child(2) strong {
  width: min(82%, 520px);
}

.topic-loading-row:nth-child(3) strong {
  width: min(68%, 420px);
}

@keyframes topic-loading-shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

.item-accordion {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 2px;
}

.accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #f6f9ff;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 900;
}

.accordion-toggle:focus {
  outline: none;
}

.accordion-toggle:focus-visible {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18) inset;
}

.accordion-toggle::after {
  content: "＋";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
}

.accordion-toggle[aria-expanded="true"]::after {
  content: "−";
}

.accordion-toggle span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accordion-toggle small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.accordion-panel {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

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

.accordion-close {
  justify-self: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  background: #f8fbff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.accordion-close:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.checked-news .accordion-toggle {
  background: #f8fafc;
  color: var(--muted);
}

.related-videos {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.related-videos > h3 {
  margin: 4px 0 2px;
  color: var(--accent-strong);
  font-size: 15px;
}

.related-video-list {
  display: grid;
  gap: 8px;
}

.card {
  position: relative;
  display: grid;
  gap: 5px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  background: transparent;
  overflow: visible;
}

.card-surface {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.card.checked .card-surface {
  border-color: #f0b86a;
  background: #fff8ec;
  box-shadow: 0 0 0 1px rgba(240, 184, 106, 0.18), 0 8px 22px rgba(120, 73, 24, 0.08);
}

.card.checked .card-open {
  background: transparent;
}

.card a,
.card-open {
  display: grid;
  height: auto;
  width: 100%;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.card-open {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.rich-card {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.rich-card .card-surface {
  grid-template-columns: minmax(220px, 32%) minmax(0, 1fr);
}

.news-card {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.news-card .card-open {
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: stretch;
}

.news-card.social-card .card-open {
  grid-template-columns: 1fr;
}

.news-card.no-media .card-open {
  grid-template-columns: 1fr;
}

.news-card .card-media {
  width: 104px;
  min-height: 76px;
  aspect-ratio: auto;
}

.news-card.social-card .card-media {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 420px;
  background: #fff;
  overflow: hidden;
}

.social-embed iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 420px;
  border: 0;
  background: #fff;
  overflow: hidden;
}

.news-card.no-media .card-media {
  display: none;
}

.news-card .media-fallback {
  font-size: 22px;
}

.card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e7ebe8;
}

.card-media img,
.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  font-size: 42px;
  font-weight: 900;
}

.card-body {
  padding: 11px 12px 9px;
}

.news-card .card-body {
  padding: 9px 12px;
}

.card h3 {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.35;
}

.news-card h3 {
  display: -webkit-box;
  margin-bottom: 4px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.news-card p {
  display: -webkit-box;
  margin-bottom: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.news-card.no-summary p {
  display: none;
}

.card small {
  color: var(--accent-strong);
  font-weight: 800;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}

.source-badge {
  display: inline-grid;
  place-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.news-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-thumb {
  position: relative;
}

.video-embed {
  position: relative;
  min-width: 0;
  background: #111;
  aspect-ratio: 16 / 9;
  min-height: 124px;
}

.video-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.youtube-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 18px;
  background: rgba(20, 22, 24, 0.9);
  color: #ffffff;
  text-align: center;
}

.embed-error iframe {
  opacity: 0.18;
}

.embed-error .youtube-fallback {
  display: flex;
}

.youtube-fallback span {
  font-size: 12px;
  font-weight: 700;
}

.youtube-fallback a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #ffffff;
  color: #222222;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.youtube-fallback a:hover {
  background: #f3f4f2;
}

.video-thumb .play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(15, 118, 110, 0.92);
  color: #fff;
  transform: translate(-50%, -50%);
  font-size: 24px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  align-self: end;
  padding: 0 2px;
  background: transparent;
}

.check-button,
.good-button,
.bad-button,
.close-button {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 26px;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.good-button,
.bad-button {
  padding: 0;
}

.good-button svg,
.bad-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.soft-pop::after,
.bad-button.bad-drop::after,
.good-button.good-float::after,
.good-button.good-float::before,
.bad-button.bad-drop::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
}

.soft-pop::after,
.good-button.good-float::after,
.bad-button.bad-drop::after {
  background: inherit;
  border: inherit;
  box-shadow: inherit;
  z-index: 2;
}

.check-button.soft-pop::after {
  content: "✓";
  display: grid;
  place-items: center;
}

.good-button.good-float::before,
.bad-button.bad-drop::before {
  z-index: 3;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 15px 15px;
}

.good-button.good-float::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10v11'/%3E%3Cpath d='M15 6.8 14 10h4.8a2 2 0 0 1 2 2.3l-1.2 7a2 2 0 0 1-2 1.7H7'/%3E%3Cpath d='M7 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3'/%3E%3Cpath d='M14 10V5a2 2 0 0 0-2-2l-5 7'/%3E%3C/svg%3E");
}

.bad-button.bad-drop::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 14V3'/%3E%3Cpath d='M9 17.2 10 14H5.2a2 2 0 0 1-2-2.3l1.2-7A2 2 0 0 1 6.4 3H17'/%3E%3Cpath d='M17 14h3a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-3'/%3E%3Cpath d='M10 14v5a2 2 0 0 0 2 2l5-7'/%3E%3C/svg%3E");
}

.good-button.good-float::after,
.good-button.good-float::before {
  animation: good-float 1300ms cubic-bezier(0.35, 0, 0.65, 1);
  will-change: transform, opacity;
}

.soft-pop::after {
  animation:
    check-pop-move 650ms cubic-bezier(0.45, 0, 0.85, 1),
    check-pop-fade 650ms linear;
  will-change: transform, opacity;
}

@keyframes check-pop-move {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(2.65);
  }
}

@keyframes check-pop-fade {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes good-float {
  0% {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-81px) translateX(var(--good-drift, 0px)) scale(1.1);
  }
}

.bad-button.bad-drop::after,
.bad-button.bad-drop::before {
  animation:
    bad-drop-move 1700ms cubic-bezier(0.38, 0, 0.78, 1),
    bad-drop-fade 1700ms cubic-bezier(0.18, 0, 0.22, 1);
  will-change: transform, opacity;
}

@keyframes bad-drop-move {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(142px) rotate(12deg) scale(0.8);
  }
}

@keyframes bad-drop-fade {
  0% {
    opacity: 1;
  }
  45% {
    opacity: 0.96;
  }
  82% {
    opacity: 0.58;
  }
  100% {
    opacity: 0;
  }
}

.close-button:hover,
.close-button:focus-visible {
  border-color: var(--warm);
  background: var(--warm);
  color: #fff;
}

.check-button:hover,
.check-button:focus-visible,
.good-button:hover,
.good-button:focus-visible {
  border-color: transparent;
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 58%, #2563eb 100%);
  color: #fff;
}

.bad-button:hover,
.bad-button:focus-visible {
  border-color: transparent;
  background: linear-gradient(135deg, #fb7185 0%, #ef4444 55%, #b91c1c 100%);
  color: #fff;
}

.check-button.active,
.good-button.active {
  border-color: transparent;
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 58%, #2563eb 100%);
  color: #fff;
}

.bad-button.active {
  border-color: transparent;
  background: linear-gradient(135deg, #fb7185 0%, #ef4444 55%, #b91c1c 100%);
  color: #fff;
}

.image-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: #e7ebe8;
}

.detail-dialog {
  width: min(920px, calc(100% - 28px));
  max-height: min(760px, calc(100vh - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(16, 22, 28, 0.28);
}

.settings-dialog {
  width: min(560px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(16, 22, 28, 0.24);
}

.suggestions-dialog {
  width: min(680px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(16, 22, 28, 0.24);
}

.settings-dialog::backdrop {
  background: rgba(16, 22, 28, 0.32);
}

.suggestions-dialog::backdrop {
  background: rgba(16, 22, 28, 0.32);
}

.settings-shell {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 24px;
}

.suggestions-shell {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 24px;
}

.settings-head,
.suggestions-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.settings-summary,
.settings-loading,
.suggestions-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.settings-tags,
.topic-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-suggestion-choice {
  cursor: pointer;
}

.topic-suggestion-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.topic-suggestion-choice span {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: #f8fbff;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 850;
}

.topic-suggestion-choice input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.topic-suggestion-choice input:disabled + span {
  opacity: 0.35;
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .topic-suggestion-choice:hover input:not(:disabled) + span {
    border-color: var(--accent);
    background: #eef8fb;
  }
}

.suggestions-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.suggestions-actions button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--logo-gradient);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

.suggestions-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}

.settings-custom-tag {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.settings-custom-tag input {
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #f8fbff;
  color: var(--ink);
}

.settings-custom-tag button {
  height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--logo-gradient);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

.settings-tag {
  cursor: pointer;
}

.settings-tag input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-tag span {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #f8fbff;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.settings-tag input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.settings-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #f8fbff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.settings-actions button[type="submit"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.page-top-button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 45;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--logo-gradient);
  color: #fff;
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  transition: opacity 160ms ease, transform 160ms ease;
}

.page-top-button.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.page-top-button:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.35);
  outline-offset: 3px;
}

.playing-video-button {
  position: fixed;
  right: 78px;
  bottom: 22px;
  z-index: 45;
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  background: #ffffff;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.playing-video-button.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.playing-video-button:hover {
  border-color: var(--accent);
}

.playing-video-button:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.35);
  outline-offset: 3px;
}

.detail-dialog::backdrop {
  background: rgba(16, 22, 28, 0.38);
}

.detail-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  max-height: inherit;
  overflow: auto;
}

.detail-close {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 22px;
}

.detail-media {
  min-height: 360px;
  background: #e7ebe8;
}

.detail-media:empty {
  display: none;
}

.detail-media iframe {
  width: 100%;
  height: 100%;
  min-height: 360px;
  border: 0;
}

.detail-body {
  padding: 34px 28px 28px;
}

.detail-kicker {
  margin-bottom: 12px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.detail-body h2 {
  margin-bottom: 14px;
  font-size: 26px;
  line-height: 1.22;
}

.detail-body p {
  color: var(--muted);
  line-height: 1.7;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.detail-actions a,
.detail-actions button {
  display: inline-grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #f6f9ff;
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
}

.detail-actions a {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.empty {
  position: relative;
  display: grid;
  align-content: center;
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  padding: 220px 24px 64px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  color: var(--muted);
  box-shadow: none;
}

.empty-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: auto;
  height: 78px;
  max-width: min(420px, 82%);
  object-fit: contain;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.96);
  animation: empty-logo-intro 2600ms cubic-bezier(0.16, 1, 0.3, 1) 120ms forwards;
  pointer-events: none;
}

.empty h3 {
  max-width: 760px;
  margin: 0 auto 14px;
  color: var(--ink);
  font-size: 72px;
  line-height: 1.08;
  opacity: 0;
  filter: blur(22px);
  transform: translateY(22px) scale(0.98);
  animation: empty-reveal 1800ms cubic-bezier(0.16, 1, 0.3, 1) 3020ms forwards;
}

.empty-mode .empty h3 span {
  display: block;
}

body:not(.empty-mode) .empty:not(.welcome-empty) h3,
body:not(.empty-mode) .empty:not(.welcome-empty) p {
  opacity: 1;
  filter: none;
  transform: none;
  animation: none;
}

body:not(.empty-mode) .empty:not(.welcome-empty) h3 {
  font-size: 28px;
  line-height: 1.35;
}

.empty h3,
.empty p,
.empty-divider,
.empty-logo,
.empty-input-note,
.starter-topics,
.starter-topics button,
.empty-topic-form {
  transition:
    opacity 1350ms ease,
    filter 1450ms ease,
    transform 1550ms cubic-bezier(0.18, 0.74, 0.18, 1);
}

.empty p {
  max-width: 760px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.9;
  opacity: 0;
  filter: blur(14px);
  transform: translateY(12px);
}

.empty > p:not(.empty-suggestion-copy) {
  animation: empty-reveal 1500ms cubic-bezier(0.16, 1, 0.3, 1) 5040ms forwards;
}

.empty-divider {
  width: min(520px, 100%);
  height: 1px;
  margin: 34px auto 20px;
  background: var(--line);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
  animation: empty-line 1050ms cubic-bezier(0.16, 1, 0.3, 1) 7290ms forwards;
}

.empty-suggestion-copy {
  color: var(--accent-strong);
  font-weight: 800;
  animation: empty-reveal 1050ms cubic-bezier(0.16, 1, 0.3, 1) 8490ms forwards;
}

.empty-input-note {
  grid-column: 1 / -1;
  display: block;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  opacity: 1;
  filter: none;
  transform: none;
  animation: none;
}

.empty-topic-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: min(560px, calc(100% - 2px));
  max-width: 100%;
  margin: 64px auto 0;
  opacity: 0;
  filter: blur(12px);
  transform: translateY(12px);
  animation: empty-reveal 1120ms cubic-bezier(0.16, 1, 0.3, 1) 10840ms forwards;
}

.empty-topic-form input {
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

.empty-topic-form button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--logo-gradient);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

.starter-topics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 680px;
  margin: 14px auto 0;
  overflow: visible;
}

.empty-launch-word {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--accent-strong);
  font-size: 72px;
  font-weight: 950;
  line-height: 1.12;
  opacity: 0;
  transform: scale(0.72);
  text-shadow: 0 16px 42px rgba(30, 58, 138, 0.18);
  pointer-events: none;
}

.empty.launching h3,
.empty.launching p,
.empty.launching .empty-divider,
.empty.launching .empty-logo,
.empty.launching .empty-input-note,
.empty.launching .starter-topics,
.empty.launching .empty-topic-form {
  animation: none;
  opacity: 0;
  filter: blur(22px);
  transform: scale(1.1);
}

.empty.launching .starter-topics button {
  animation: none;
  opacity: 0;
  filter: blur(20px);
  transform: scale(1.1);
}

.empty.launching .empty-launch-word {
  display: none;
}

@keyframes empty-reveal {
  0% {
    opacity: 0;
    filter: blur(18px);
    transform: translateY(18px) scale(0.98);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes empty-logo-intro {
  0% {
    opacity: 0;
    filter: blur(18px);
    transform: translate(-50%, -50%) scale(0.96);
  }
  20% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1);
  }
  44% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, calc(-50% - min(38vh, 320px))) scale(0.86);
  }
}

@keyframes empty-line {
  0% {
    opacity: 0;
    transform: scaleX(0);
  }
  100% {
    opacity: 1;
    transform: scaleX(1);
  }
}

.starter-topics button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 800;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(10px) scale(0.96);
  animation: empty-tag-reveal 780ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.starter-topics button:nth-child(1) {
  animation-delay: 9290ms;
}

.starter-topics button:nth-child(2) {
  animation-delay: 9510ms;
}

.starter-topics button:nth-child(3) {
  animation-delay: 9730ms;
}

.starter-topics button:nth-child(4) {
  animation-delay: 9950ms;
}

.starter-topics button:nth-child(5) {
  animation-delay: 10170ms;
}

.starter-topics button:nth-child(n + 6) {
  animation-delay: 10390ms;
}

@keyframes empty-tag-reveal {
  0% {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(10px) scale(0.96);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 520px) {
  .empty {
    padding: 188px 14px 38px;
  }

  .empty-logo {
    height: 66px;
    max-width: 84%;
  }

  .empty h3 {
    font-size: 44px;
  }

  .empty-launch-word {
    font-size: 42px;
  }

  .empty p {
    font-size: 15px;
  }

  .empty-topic-form {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .empty-topic-form input,
  .topic-form input,
  .settings-custom-tag input {
    font-size: 16px;
  }

  .suggestions-dialog {
    width: min(420px, calc(100% - 20px));
  }

  .suggestions-shell {
    padding: 20px 16px;
  }

  .topic-suggestions-list {
    gap: 7px;
  }

  .topic-suggestion-choice span {
    min-height: 38px;
    padding: 0 12px;
    font-size: 12px;
  }

  .suggestions-actions button {
    width: 100%;
  }
}

@media (max-width: 820px) {
  :root {
    --topbar-height: 118px;
  }

  .empty h3 {
    font-size: 56px;
  }

  .shell {
    padding-top: calc(var(--topbar-height) + var(--safe-top));
  }

  .topbar {
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    min-height: calc(var(--topbar-height) + var(--safe-top));
    padding: calc(10px + var(--safe-top)) 12px 10px;
  }

  .topbar .topic-form {
    order: 3;
    grid-template-columns: 1fr auto;
    width: 100%;
    flex-basis: 100%;
  }

  .auth-box {
    margin-left: auto;
  }

  .empty-mode .shell {
    padding-top: 0;
  }

  .empty-mode .feed-area {
    min-height: 100dvh;
  }

  .topic-section {
    scroll-margin-top: calc(var(--topbar-height) + var(--safe-top) + 14px);
  }

  .dashboard,
  .detail-shell {
    grid-template-columns: 1fr;
  }

  .dashboard {
    min-height: 0;
  }

  .panel {
    position: static;
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 16px 12px;
  }

  .panel-head {
    display: none;
  }

  .keyword-drawer-toggle {
    position: fixed;
    left: 0;
    top: auto;
    bottom: calc(16px + var(--safe-bottom));
    z-index: 75;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 41px;
    min-height: 118px;
    border: 0;
    border-radius: 0 8px 8px 0;
    padding: 0 14px 0 12px;
    background: var(--logo-gradient);
    color: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
    font-size: 11px;
    font-weight: 900;
    writing-mode: vertical-rl;
    letter-spacing: 0.04em;
  }

  .keyword-drawer-toggle::before {
    content: "▶";
    writing-mode: horizontal-tb;
    font-size: 12px;
    line-height: 1;
  }

  .keyword-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    background: rgba(15, 23, 42, 0.24);
  }

  .keyword-drawer-backdrop[hidden] {
    display: none;
  }

  .focus-list {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: min(320px, calc(100dvw - 52px));
    max-width: calc(100% - 52px);
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 72px 12px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-right: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 18px 0 46px rgba(15, 23, 42, 0.18);
    transform: translateX(calc(-100% - 8px));
    transition: transform 180ms ease;
  }

.focus-list .focus-item {
    flex: 0 0 auto;
    min-height: 72px;
  }

  .focus-list::before {
    content: "キーワード";
    position: fixed;
    left: 16px;
    top: 22px;
    color: var(--ink);
    font-size: 18px;
    font-weight: 900;
  }

  .keyword-drawer-open .focus-list {
    transform: translateX(0);
  }

  .feed-area {
    padding: 18px 16px 24px;
  }

  .empty-mode .feed-area {
    min-height: 100dvh;
    padding: 18px 12px 24px;
  }

  .rich-card .card-surface {
    grid-template-columns: 1fr;
  }

  .detail-media,
  .detail-media iframe {
    min-height: 260px;
  }

  .feed-head {
    display: grid;
  }

  .topic-section-head h3 {
    font-size: 23px;
  }

  .topic-section-head {
    align-items: flex-start;
  }

  .topic-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    max-width: calc(100% - 72px);
  }

  .topic-selected-tags {
    width: 100%;
    max-width: 100%;
  }

  .topic-section-tools {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

  .topic-section-tools span {
    max-width: 150px;
    font-size: 10px;
  }

  .topic-loading-row {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: 86px;
  }

  .topic-narrowing {
    align-items: stretch;
    flex-direction: column;
  }

  .topic-narrowing button {
    width: fit-content;
    max-width: 100%;
  }

  .topic-clarification {
    gap: 12px;
    padding: 14px 12px;
  }

  .topic-clarification-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topic-clarification-tags {
    gap: 7px;
  }

  .topic-clarification-tag span {
    min-height: 32px;
    padding: 0 11px;
    font-size: 12px;
  }

  .topic-clarification-actions {
    justify-content: stretch;
  }

  .topic-clarification-actions .ghost-button,
  .topic-clarification-actions .primary-button {
    flex: 1 1 132px;
    min-width: 0;
  }

  .source-tabs {
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 520px) {
  :root {
    --topbar-height: 116px;
  }

  .shell {
    width: 100%;
    padding-top: calc(var(--topbar-height) + var(--safe-top));
  }

  .empty h3 {
    font-size: 44px;
  }

  .page-top-button {
    right: 14px;
    bottom: calc(16px + var(--safe-bottom));
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .playing-video-button {
    right: 66px;
    bottom: calc(16px + var(--safe-bottom));
    min-height: 42px;
    max-width: calc(100% - 132px);
    padding: 0 12px;
    font-size: 12px;
  }

  .topbar {
    min-height: calc(var(--topbar-height) + var(--safe-top));
    padding: calc(10px + var(--safe-top)) 12px 10px;
  }

  .topic-section {
    scroll-margin-top: calc(var(--topbar-height) + var(--safe-top) + 14px);
  }

  .brand img {
    height: 44px;
    max-width: min(220px, 64vw);
  }

  .topbar .topic-form {
    grid-template-columns: 1fr auto;
  }

  .topic-form button {
    width: auto;
  }

  .news-card .card-open {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .news-card.social-card .card-open {
    grid-template-columns: 1fr;
  }

  .news-card.no-media .card-open {
    grid-template-columns: 1fr;
  }

  .news-card .card-media {
    width: 78px;
    min-height: 84px;
  }

  .card-actions {
    padding: 0 6px;
  }

  .check-button,
  .good-button,
  .bad-button,
  .close-button {
    min-width: 30px;
    min-height: 28px;
  }

  .news-card.social-card .card-media,
  .social-embed iframe {
    width: 100%;
    min-height: 360px;
    height: 360px;
  }
}
