:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: #0d1118;
  --panel-soft: #111722;
  --panel-raised: #151d2a;
  --text: #f3f7fb;
  --muted: #8d9aaa;
  --line: #202b3a;
  --line-strong: #314057;
  --cyan: #38d9ff;
  --green: #4ade80;
  --amber: #f59e0b;
  --rose: #fb7185;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(rgba(56, 217, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 217, 255, 0.03) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

input {
  min-width: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 340px;
  gap: 18px;
  width: min(1520px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.left-rail,
.right-rail {
  position: sticky;
  top: 18px;
  align-self: start;
  display: grid;
  gap: 14px;
}

.left-rail {
  height: calc(100vh - 36px);
  grid-template-rows: auto auto 1fr auto auto;
  border-right: 1px solid var(--line);
  padding-right: 18px;
}

.brand-lockup,
.compact-account,
.app-topbar,
.feed-header,
.feed-item,
.mini-panel,
.pricing-modal,
.auth-modal,
.notice-modal {
  border: 1px solid var(--line);
  background: rgba(13, 17, 24, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-lockup,
.compact-account {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 16px;
  padding: 12px;
}

.brand-mark,
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  font-weight: 900;
}

.brand-mark {
  width: 42px;
  height: 42px;
  background: #f5f9ff;
  color: #05070b;
}

.brand-lockup strong,
.compact-account strong,
.user-card strong {
  display: block;
}

.brand-lockup small,
.compact-account small,
.user-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.main-nav {
  display: grid;
  gap: 8px;
}

.main-nav a,
.main-nav .nav-button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 780;
  text-align: left;
}

.main-nav a:hover,
.main-nav a.active,
.main-nav .nav-button:hover {
  background: var(--panel-raised);
}

.main-nav span,
.main-nav .nav-button span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #1e293b;
  color: var(--cyan);
  font-size: 0.72rem;
}

.subscribe-button,
.pill-button,
.pulse-button,
.rail-button,
.plan-card button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: #f8fafc;
  color: #05070b;
  font-weight: 900;
}

.subscribe-button {
  width: 100%;
  min-height: 50px;
  font-size: 1rem;
}

.compact-account {
  align-self: end;
}

.left-rail-spacer {
  min-height: 12px;
}

.account-summary-panel {
  display: grid;
  gap: 12px;
  align-items: stretch;
}

.account-summary-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.account-summary-main > div {
  flex: 1 1 auto;
  min-width: 0;
}

.account-summary-main strong,
.account-summary-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-summary-actions {
  display: grid;
  gap: 8px;
}

.sidebar-plan-panel {
  align-self: end;
}

.avatar {
  width: 38px;
  height: 38px;
  background: var(--panel-raised);
  color: var(--cyan);
}

.avatar.large {
  width: 46px;
  height: 46px;
}

.plan-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 28px;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.content-shell {
  min-width: 0;
}

.app-topbar {
  position: sticky;
  top: 18px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 18px;
  padding: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: #080c12;
}

.search-box span {
  color: var(--cyan);
  font-weight: 900;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

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

.ghost-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: transparent;
  color: var(--text);
  font-weight: 800;
}

.feed-page {
  padding-top: 18px;
}

.feed-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border-radius: 20px;
  padding: 24px;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 4.6rem);
  line-height: 1;
}

.feed-header p,
.feed-item p,
.mini-panel p,
.plan-card p,
.modal-heading p,
.auth-modal p,
.notice-modal p {
  color: var(--muted);
  line-height: 1.55;
}

.notice-modal p {
  white-space: pre-line;
}

.recommended-source-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.recommended-source-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #080c12;
}

.recommended-source-card b {
  display: block;
  margin-bottom: 4px;
  color: var(--cyan);
}

.recommended-source-card p {
  margin-bottom: 6px;
}

.recommended-source-card a {
  color: var(--green);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.recommended-source-card button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: #f8fafc;
  color: #05070b;
  font-weight: 900;
}

.pulse-button {
  background: #122034;
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(56, 217, 255, 0.22);
}

.topic-strip,
.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.topic-strip em {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 38px;
  color: var(--muted);
  font-size: 0.88rem;
  font-style: normal;
}

.topic-strip span,
.topic-strip button,
.tool-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(17, 23, 34, 0.8);
  color: var(--text);
  font-weight: 760;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.topic-strip span {
  gap: 8px;
}

.topic-remove {
  min-height: 20px !important;
  width: 20px;
  border-radius: 999px !important;
  padding: 0 !important;
  border-color: rgba(248, 113, 113, 0.26) !important;
  background: rgba(248, 113, 113, 0.08) !important;
  color: #fecdd3 !important;
  font-size: 0.72rem;
}

.topic-strip span {
  color: var(--green);
}

.empty-feed {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  background: rgba(8, 12, 18, 0.72);
}

.empty-feed h2 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.empty-feed p {
  color: var(--muted);
}

.topic-strip.guest-topics span:first-child {
  border-color: rgba(56, 217, 255, 0.48);
  color: var(--cyan);
}

.topic-strip.guest-topics button {
  border-color: rgba(248, 250, 252, 0.2);
  background: #f8fafc;
  color: #05070b;
}

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

.feed-item {
  border-radius: 18px;
  padding: 18px;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.feed-item:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.feed-item.expanded {
  border-color: rgba(56, 217, 255, 0.54);
  background:
    linear-gradient(135deg, rgba(56, 217, 255, 0.08), rgba(13, 17, 24, 0.92)),
    var(--panel);
}

.feed-item.read h2 {
  color: #cbd5e1;
}

.feed-item.locked {
  border-color: rgba(245, 158, 11, 0.42);
  background:
    linear-gradient(90deg, rgba(245, 158, 11, 0.08), rgba(13, 17, 24, 0.88)),
    var(--panel);
}

.feed-meta,
.feed-footer,
.panel-title,
.user-card,
.modal-heading,
.plan-head {
  display: flex;
  align-items: center;
}

.feed-meta {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.feed-meta div {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.feed-meta b {
  color: var(--green);
}

.feed-meta em {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--muted);
  font-style: normal;
}

.feed-item h2 {
  margin-bottom: 8px;
  font-size: 1.22rem;
  line-height: 1.25;
}

.item-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.item-title-row h2 {
  flex: 1 1 auto;
}

.translate-chip {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid rgba(56, 217, 255, 0.3);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(56, 217, 255, 0.1);
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.translate-chip:disabled {
  cursor: default;
  opacity: 0.62;
}

.feed-footer {
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.feed-footer button {
  border: 0;
  background: transparent;
  color: var(--cyan);
  font-weight: 900;
}

.feed-footer strong {
  max-width: 560px;
  color: #d9f99d;
}

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

.item-detail {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 16px;
}

.detail-side,
.detail-note {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 12, 18, 0.82);
}

.detail-side {
  padding: 16px;
}

.detail-main h3,
.detail-side h3 {
  margin-bottom: 10px;
  color: var(--cyan);
  font-size: 0.9rem;
}

.detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 10px;
}

.detail-toolbar h3 {
  margin-bottom: 4px;
}

.detail-toolbar span,
.translation-note {
  color: var(--muted);
  font-size: 0.78rem;
}

.detail-toolbar button {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid rgba(56, 217, 255, 0.3);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(56, 217, 255, 0.1);
  color: var(--cyan);
  font-weight: 900;
}

.detail-toolbar button:disabled {
  cursor: default;
  opacity: 0.62;
}

.detail-summary {
  color: #e5f9ff;
}

.detail-main p {
  margin-bottom: 12px;
  color: var(--text);
  line-height: 1.62;
}

.detail-main p:last-child {
  margin-bottom: 0;
}

.detail-side ul {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.detail-side ul:last-child {
  margin-bottom: 0;
}

.detail-side a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border-radius: 8px;
  padding: 2px 6px;
  background: rgba(56, 217, 255, 0.08);
  color: var(--cyan);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.detail-side a:hover {
  background: rgba(56, 217, 255, 0.16);
  color: #e5f9ff;
}

.detail-side a span {
  flex: 0 0 auto;
  font-size: 0.72rem;
}

.translation-error {
  color: var(--rose);
}

.detail-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  color: #d9f99d;
  font-size: 0.92rem;
}

.compliance-warning {
  color: var(--amber);
}

.detail-note button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: #f8fafc;
  color: #05070b;
  font-weight: 900;
}

.ai-panel {
  margin-top: 14px;
  border: 1px solid rgba(74, 222, 128, 0.26);
  border-radius: 16px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(74, 222, 128, 0.08), rgba(8, 12, 18, 0.9)),
    #080c12;
}

.ai-panel h3 {
  margin-bottom: 8px;
  color: var(--green);
}

.ai-panel button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 13px;
  background: #f8fafc;
  color: #05070b;
  font-weight: 900;
}

.ai-panel button:disabled {
  cursor: default;
  opacity: 0.58;
}

.ai-score {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.ai-score strong {
  font-size: 2.2rem;
  color: var(--green);
}

.ai-score span,
.ai-panel small {
  color: var(--muted);
}

.ai-list {
  margin-top: 10px;
}

.ai-list b {
  color: var(--cyan);
}

.ai-list ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.status-error {
  color: var(--rose);
}

.source-citation {
  margin-top: 12px;
  border: 1px solid rgba(56, 217, 255, 0.24);
  border-radius: 16px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(56, 217, 255, 0.08), rgba(8, 12, 18, 0.9)),
    #080c12;
}

.citation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.citation-head h3 {
  margin-bottom: 6px;
  color: var(--cyan);
}

.citation-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.citation-head span {
  flex: 0 0 auto;
  border: 1px solid rgba(56, 217, 255, 0.32);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--cyan);
  font-size: 0.74rem;
  font-weight: 900;
}

.source-citation dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.source-citation dl div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(13, 17, 24, 0.72);
}

.source-citation .citation-wide {
  grid-column: 1 / -1;
}

.source-citation dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.source-citation dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.source-citation a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-top: 12px;
  border-radius: 999px;
  padding: 0 13px;
  background: #f8fafc;
  color: #05070b;
  text-decoration: none;
  font-weight: 900;
}

.right-rail {
  gap: 12px;
}

.mini-panel {
  border-radius: 18px;
  padding: 16px;
}

.panel-title {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
}

.panel-title span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-title b {
  flex: 0 0 auto;
  color: var(--cyan);
  font-size: 0.82rem;
  text-align: right;
  white-space: nowrap;
}

.user-card {
  gap: 12px;
  margin-bottom: 12px;
}

.rail-button {
  width: 100%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.rail-button.primary {
  margin-top: 12px;
  border: 0;
  background: #f8fafc;
  color: #05070b;
}

.plan-meter {
  margin-top: 12px;
}

.plan-meter div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.plan-meter i {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #0a0f17;
}

.plan-meter em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
}

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

.source-list span {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.topic-settings-panel {
  display: grid;
  gap: 16px;
}

.topic-manager,
.custom-source-block,
.custom-source-form,
.custom-source-list {
  display: grid;
  gap: 10px;
}

.topic-manager + .custom-source-block {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.topic-manager strong,
.custom-source-block strong {
  display: block;
  margin-bottom: 2px;
  color: var(--cyan);
  font-size: 0.82rem;
  line-height: 1.25;
}

.topic-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.topic-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(17, 23, 34, 0.8);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.topic-pill.selected {
  border-color: rgba(74, 222, 128, 0.32);
  background: rgba(74, 222, 128, 0.08);
  color: var(--green);
}

.custom-source-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.custom-source-form input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: rgba(6, 10, 16, 0.88);
  color: var(--text);
}

.custom-source-form .checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 650;
  line-height: 1.45;
}

.custom-source-form .checkbox-line input {
  min-height: auto;
  margin-top: 3px;
}

.custom-source-form button,
.custom-source-record button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: #f8fafc;
  color: #05070b;
  font-weight: 900;
}

.custom-source-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: rgba(8, 12, 18, 0.7);
}

.custom-source-record div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.custom-source-record a {
  color: var(--cyan);
  font-size: 0.74rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.custom-source-record span {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
}

.custom-source-record button {
  min-height: 26px;
  width: 26px;
  padding: 0;
  background: rgba(248, 113, 113, 0.12);
  color: #fecdd3;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  background: #0a0f17;
  color: var(--text);
  text-align: left;
}

.toggle-row.enabled {
  border-color: rgba(74, 222, 128, 0.45);
}

.toggle-row b {
  color: var(--green);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
}

.pricing-modal,
.auth-modal,
.notice-modal,
.source-policy-modal {
  position: relative;
  width: min(1040px, 100%);
  max-height: min(860px, calc(100vh - 40px));
  overflow: auto;
  border-radius: 22px;
  padding: 24px;
}

.auth-modal,
.notice-modal {
  width: min(500px, 100%);
}

.source-policy-modal {
  width: min(820px, 100%);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #0a0f17;
  color: var(--text);
}

.modal-heading {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding-right: 42px;
}

.modal-heading h2,
.auth-modal h2,
.notice-modal h2 {
  margin-bottom: 8px;
  font-size: 1.8rem;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  background: #080c12;
}

.segmented button {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.segmented button.active {
  background: #f8fafc;
  color: #05070b;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.plan-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #0a0f17;
}

.plan-card.recommended {
  border-color: rgba(56, 217, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(56, 217, 255, 0.25);
}

.plan-card.selected {
  border-color: rgba(74, 222, 128, 0.55);
}

.plan-head {
  justify-content: space-between;
  gap: 8px;
  font-weight: 950;
}

.plan-head b {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--green);
  font-size: 0.68rem;
}

.price {
  font-size: 2rem;
  font-weight: 950;
}

.plan-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.plan-card button:disabled {
  cursor: default;
  opacity: 0.48;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}

.auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-tabs button.active {
  background: #f8fafc;
  color: #05070b;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.auth-form input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  background: #080c12;
  color: var(--text);
  outline: 0;
}

.notice-modal .pill-button {
  margin-top: 12px;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.policy-grid article {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #080c12;
}

.policy-grid h3 {
  margin-bottom: 8px;
  color: var(--cyan);
}

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .right-rail {
    grid-column: 2;
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .left-rail,
  .right-rail,
  .app-topbar {
    position: static;
  }

  .left-rail {
    height: auto;
    grid-template-rows: none;
    border-right: 0;
    padding-right: 0;
  }

  .main-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .main-nav a {
    justify-content: center;
  }

  .compact-account {
    align-self: auto;
  }

  .app-topbar,
  .feed-header,
  .modal-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .segmented {
    width: 100%;
  }

  .right-rail,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

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

  .source-citation dl,
  .policy-grid {
    grid-template-columns: 1fr;
  }

  .detail-note {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Compact product UI refinement */
:root {
  --bg: #080b10;
  --panel: #0d1117;
  --panel-raised: #121821;
  --text: #eef3f8;
  --muted: #8b96a6;
  --line: #1b2430;
  --line-strong: #2a3544;
  --cyan: #5ddcff;
  --green: #7ddc9b;
  --shadow: 0 10px 32px rgba(0, 0, 0, 0.22);
}

body {
  background: var(--bg);
  background-image: none;
  font-size: 14px;
}

.app-shell {
  grid-template-columns: 224px minmax(520px, 1fr) 292px;
  gap: 12px;
  width: min(1360px, 100%);
  padding: 12px;
}

.left-rail,
.right-rail {
  top: 12px;
  gap: 10px;
}

.left-rail {
  height: calc(100vh - 24px);
  grid-template-rows: auto auto 1fr auto auto;
  padding-right: 12px;
}

.brand-lockup,
.compact-account,
.app-topbar,
.feed-header,
.feed-item,
.mini-panel,
.pricing-modal,
.auth-modal,
.notice-modal,
.source-policy-modal {
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.brand-lockup,
.compact-account,
.mini-panel,
.feed-item,
.feed-header,
.app-topbar {
  border-radius: 12px;
}

.brand-lockup,
.compact-account {
  padding: 10px;
}

.account-summary-panel {
  gap: 9px;
}

.account-summary-main {
  gap: 9px;
}

.plan-chip {
  min-height: 26px;
  padding: 0 9px;
  font-size: 0.7rem;
}

.account-summary-actions {
  gap: 6px;
}

.sidebar-plan-panel {
  padding: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
}

.avatar.large {
  width: 38px;
  height: 38px;
}

.main-nav {
  gap: 4px;
}

.main-nav a,
.main-nav .nav-button {
  min-height: 36px;
  gap: 9px;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 0.92rem;
  font-weight: 720;
}

.main-nav span,
.main-nav .nav-button span {
  width: 20px;
  height: 20px;
  font-size: 0.65rem;
}

.subscribe-button,
.pill-button,
.pulse-button,
.rail-button,
.plan-card button {
  min-height: 36px;
  padding: 0 13px;
  font-size: 0.9rem;
  font-weight: 800;
}

.subscribe-button {
  min-height: 40px;
  font-size: 0.94rem;
}

.app-topbar {
  top: 12px;
  gap: 10px;
  padding: 8px;
}

.search-box {
  min-height: 36px;
  padding: 0 12px;
}

.ghost-button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.88rem;
  font-weight: 720;
}

.language-button {
  min-width: 54px;
}

.feed-page {
  padding-top: 12px;
}

.feed-header {
  align-items: center;
  padding: 16px;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(1.35rem, 2.4vw, 2.05rem);
  line-height: 1.12;
}

.feed-header p,
.feed-item p,
.mini-panel p,
.plan-card p,
.modal-heading p,
.auth-modal p,
.notice-modal p {
  line-height: 1.45;
}

.topic-strip,
.tool-row {
  gap: 7px;
  margin: 10px 0;
}

.topic-strip span,
.topic-strip button,
.tool-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.topic-strip em {
  min-height: 30px;
  font-size: 0.8rem;
}

.topic-remove {
  min-height: 18px !important;
  width: 18px;
}

.feed-list {
  gap: 9px;
}

.feed-item {
  padding: 14px;
}

.feed-item:hover {
  transform: none;
}

.feed-meta {
  gap: 8px;
  margin-bottom: 7px;
  font-size: 0.72rem;
  font-weight: 760;
}

.feed-meta div {
  gap: 7px;
}

.feed-item h2 {
  margin-bottom: 6px;
  font-size: 1rem;
  line-height: 1.3;
}

.item-title-row {
  gap: 10px;
}

.translate-chip {
  min-height: 27px;
  padding: 0 9px;
  font-size: 0.72rem;
}

.feed-footer {
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.8rem;
}

.item-actions {
  gap: 8px;
}

.feed-footer button {
  font-weight: 780;
}

.item-detail {
  margin-top: 12px;
  padding-top: 12px;
}

.detail-grid {
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 10px;
}

.detail-main,
.detail-side,
.detail-note,
.ai-panel,
.source-citation {
  border-radius: 12px;
  background: #090d13;
}

.detail-side,
.source-citation {
  padding: 12px;
}

.detail-main {
  border-radius: 0;
  background: transparent;
}

.detail-main h3,
.detail-side h3,
.ai-panel h3,
.citation-head h3 {
  margin-bottom: 7px;
  font-size: 0.82rem;
}

.detail-toolbar {
  align-items: center;
  margin-bottom: 8px;
}

.detail-toolbar button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.detail-toolbar span,
.translation-note {
  font-size: 0.74rem;
}

.detail-main p {
  margin-bottom: 9px;
}

.detail-side ul,
.ai-list ul {
  gap: 6px;
  font-size: 0.82rem;
}

.detail-note {
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  font-size: 0.84rem;
}

.ai-panel {
  padding: 12px;
}

.ai-score strong {
  font-size: 1.65rem;
}

.source-citation dl {
  gap: 7px;
}

.source-citation dl div {
  border-radius: 10px;
  padding: 8px;
}

.source-citation dt {
  font-size: 0.66rem;
}

.source-citation dd {
  font-size: 0.82rem;
}

.source-citation a {
  min-height: 32px;
  padding: 0 11px;
  font-size: 0.84rem;
}

.mini-panel {
  padding: 12px;
}

.panel-title {
  margin-bottom: 9px;
}

.panel-title span {
  font-size: 0.7rem;
}

.panel-title b {
  font-size: 0.76rem;
}

.user-card {
  gap: 9px;
  margin-bottom: 9px;
}

.plan-meter {
  margin-top: 9px;
}

.plan-meter div {
  margin-bottom: 6px;
  font-size: 0.78rem;
}

.source-list {
  gap: 6px;
}

.source-list span {
  border-radius: 9px;
  padding: 7px 8px;
  font-size: 0.78rem;
}

.topic-settings-panel {
  gap: 14px;
}

.topic-manager,
.custom-source-block,
.custom-source-form,
.custom-source-list {
  gap: 9px;
}

.topic-manager + .custom-source-block {
  margin-top: 2px;
  padding-top: 14px;
}

.topic-manager strong,
.custom-source-block strong {
  margin-bottom: 1px;
  font-size: 0.78rem;
}

.toggle-row {
  min-height: 36px;
  margin-top: 6px;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.modal-heading h2,
.auth-modal h2,
.notice-modal h2,
.source-policy-modal h2 {
  font-size: 1.35rem;
}

.pricing-modal,
.auth-modal,
.notice-modal,
.source-policy-modal {
  border-radius: 16px;
  padding: 18px;
}

.pricing-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.plan-card {
  min-height: auto;
  border-radius: 12px;
  padding: 13px;
}

.price {
  font-size: 1.55rem;
}

.plan-card ul {
  font-size: 0.82rem;
}

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 208px minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .left-rail {
    grid-template-rows: none;
  }

  .left-rail-spacer {
    display: none;
  }

  .main-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-nav a,
  .main-nav .nav-button {
    justify-content: flex-start;
  }

  .detail-grid,
  .source-citation dl,
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}
