:root {
  --bg: #05040f;
  --bg-raised: #0c0b1a;
  --bg-card: rgba(255, 255, 255, 0.045);
  --bg-card-solid: #100e20;
  --bg-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.62);
  --text-faint: rgba(255, 255, 255, 0.4);
  --accent: #33ffff;
  --accent-ink: #000000;
  --accent-soft: rgba(51, 255, 255, 0.14);
  --accent-line: rgba(51, 255, 255, 0.5);
  --warn: #ffcf5c;
  --bad: #ff6b6b;
  --input-radius: 16px;
  --card-radius: 16px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  font-family: "Inter Tight", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 100%;
  font-family: "Inter Tight", "Segoe UI", system-ui, -apple-system, sans-serif;
}

.hidden {
  display: none !important;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 50% -12%, rgba(51, 255, 255, 0.12), transparent),
    var(--bg);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 34px 30px;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.login-brand i {
  color: var(--accent);
}

.login-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.login-sub {
  color: var(--text-dim);
  margin: 10px 0 26px;
  font-size: 14px;
}

.field {
  display: block;
  margin-bottom: 18px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  padding: 13px 15px;
  border-radius: var(--input-radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

.field input:focus,
.search-wrap input:focus,
.mini-field input:focus,
.mini-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.primary-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.primary-button:hover {
  filter: brightness(1.06);
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.login-error {
  color: var(--bad);
  font-size: 13px;
  min-height: 18px;
  margin: 14px 0 0;
  text-align: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand i {
  color: var(--accent);
}

.ghost-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.ghost-button:hover {
  background: var(--bg-hover);
  border-color: var(--accent-line);
}

.ghost-button.small {
  padding: 8px 13px;
  font-size: 13px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  flex: 0 0 auto;
}

.sidebar-close {
  display: none;
}

.icon-btn:hover {
  background: var(--bg-hover);
}

.app {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  align-items: start;
  max-width: 100%;
}

.app > * {
  min-width: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.app.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.app.sidebar-collapsed .sidebar {
  display: none;
}

.app.sidebar-collapsed .brand-mini {
  display: flex;
}

.app.sidebar-collapsed .content {
  margin: 0 auto;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px 16px;
}

.post-nav {
  flex: 1 1 auto;
  min-height: 0;
}

.sidebar-bottom {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.view-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.vt-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.vt-option.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar-actions {
  display: flex;
  gap: 8px;
}

.sidebar-actions .ghost-button {
  flex: 1 1 0;
  justify-content: center;
  padding: 9px 10px;
}

.sidebar-backdrop {
  display: none;
}

.content-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  padding: 12px 0;
  margin-bottom: 6px;
}

.brand-mini {
  display: none;
  font-size: 18px;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 4px 10px 12px;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.post-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 13px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 14px;
  border: 1px solid transparent;
}

.post-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

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

.post-item .post-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.count-badge {
  flex-shrink: 0;
  min-width: 22px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
}

.count-badge.zero {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-faint);
}

.content {
  padding: 22px 26px 60px;
  max-width: 720px;
  min-width: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-wrap i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
}

.search-wrap input {
  width: 100%;
  padding: 12px 15px 12px 40px;
  border-radius: var(--input-radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.filter-dropdown {
  position: relative;
  flex: 0 0 auto;
}

#filtersToggle.active {
  border-color: var(--accent-line);
  color: var(--text);
}

.filter-count {
  min-width: 20px;
  text-align: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
}

.filter-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  width: min(360px, 92vw);
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  gap: 12px;
}

.filter-panel.open {
  display: flex;
}

.panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.panel-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.panel-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

.panel-field input,
.panel-field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.panel-field input:focus,
.panel-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.panel-field select {
  cursor: pointer;
}

.panel-field select option {
  background: var(--bg-card-solid);
  color: var(--text);
}

.filter-panel .ghost-button.small {
  justify-content: center;
}

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

.content-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 17px 19px;
  position: relative;
  min-width: 0;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.card.unread {
  border-color: var(--accent-line);
}

.card.unread::before {
  content: "";
  position: absolute;
  left: 0;
  top: 17px;
  bottom: 17px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.card-author {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  flex: 0 0 auto;
}

.avatar-dot {
  position: relative;
  overflow: hidden;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
}

.avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-faint);
  font-size: 12.5px;
}

.card-date {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-post-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 11px;
}

.card-body {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  max-width: 100%;
}

.link-chip:hover {
  background: rgba(51, 255, 255, 0.22);
}

.link-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(320px, 100%);
}

.card.compact {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 10px 14px;
  overflow: hidden;
  cursor: pointer;
}

.compact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.card.compact.expanded {
  background: var(--bg-hover);
}

.compact-expand {
  width: 100%;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compact-expand .card-embeds,
.compact-expand .card-links {
  margin-top: 0;
}

.card.compact .avatar-dot {
  width: 30px;
  height: 30px;
  font-size: 13px;
  flex: 0 0 auto;
}

.compact-main {
  flex: 1 1 auto;
  min-width: 0;
}

.compact-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.compact-author {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 1 auto;
}

.compact-post {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-faint);
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-date {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-faint);
  flex: 0 0 auto;
}

.compact-links {
  margin-top: 4px;
}

.compact-links .link-chip {
  padding: 4px 10px;
  font-size: 12px;
}

.compact-read {
  flex: 0 0 auto;
  padding: 8px;
  width: 36px;
  height: 36px;
  justify-content: center;
}

.card.compact.unread::before {
  top: 10px;
  bottom: 10px;
}

.card-embeds {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 13px;
  max-width: 520px;
}

.embed {
  width: 100%;
  min-width: 0;
}

.embed-load {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.embed-load:hover {
  background: var(--bg-hover);
  border-color: var(--accent-line);
}

.embed-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 12px;
  background-color: #000;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  padding: 0;
}

.embed-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.embed-play i {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.embed-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12px;
}

.embed-frame {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.embed-frame.ratio-16x9 {
  aspect-ratio: 16 / 9;
}

.embed-frame.h-ig {
  height: 860px;
}

.embed-frame.h-tt {
  height: 900px;
}

@media (max-width: 540px) {
  .embed-frame.h-ig {
    height: 620px;
  }

  .embed-frame.h-tt {
    height: 660px;
  }
}

.embed-frame.h-tweet {
  height: 560px;
}

.embed-frame iframe,
.embed-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.embed-thumb-link {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.embed-thumb-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.embed-loading,
.embed-fallback {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 13px;
}

.embed-fallback a {
  color: var(--accent);
}

.embed-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  align-self: flex-start;
}

.embed-open:hover {
  text-decoration: underline;
}

.tweet-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tweet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.tweet-handle {
  color: var(--text-faint);
  font-weight: 400;
  font-size: 13px;
}

.tweet-text {
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.tweet-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.tweet-photos img {
  width: 100%;
  border-radius: 10px;
}

.card-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 13px;
}

.read-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.read-toggle:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.read-toggle.is-read {
  color: var(--accent);
  border-color: var(--accent-line);
}

.fav-heading {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.fav-heading i {
  color: var(--accent);
}

.fav-item.active .post-name i,
.fav-toggle.is-fav {
  color: var(--accent);
}

.fav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-faint);
  font-size: 16px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.fav-toggle:hover {
  color: var(--accent);
  background: var(--bg-hover);
}

.fav-toggle:active {
  transform: scale(0.86);
}

.card.compact .fav-toggle {
  width: 34px;
  height: 34px;
}

.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-faint);
}

.empty-state i {
  font-size: 42px;
  margin-bottom: 14px;
  display: block;
}

.button-text {
  display: inline;
}

@media (max-width: 860px) {
  .app,
  .app.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .brand-mini {
    display: flex;
  }

  .sidebar-close {
    display: flex;
  }

  .sidebar,
  .app.sidebar-collapsed .sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: 280px;
    max-width: 85vw;
    background: var(--bg-raised);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 60;
  }
  .sidebar.open,
  .app.sidebar-collapsed .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 50;
  }

  .content {
    max-width: 100%;
    padding: 14px 16px 60px;
  }

  .toolbar {
    gap: 8px;
    flex-wrap: nowrap;
  }
  .search-wrap {
    flex: 1 1 auto;
    min-width: 0;
  }

  .content-header {
    gap: 10px;
  }
}
