:root {
  color: #1d252c;
  background: #f4f6f8;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid #dce4ec;
  background: #101820;
  color: #fff;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #20a77a;
  font-weight: 800;
}

.brand-name {
  font-weight: 750;
}

.brand-note,
.sidebar-label,
.sidebar-card p,
.subtle {
  color: #6d7884;
}

.brand-note {
  color: #b8c2cc;
  font-size: 12px;
}

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

.nav-item {
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cbd5df;
  text-align: left;
}

.nav-item.active {
  background: #fff;
  color: #101820;
  font-weight: 700;
}

.sidebar-card,
.account-card {
  margin-top: 28px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.account-card {
  display: grid;
  gap: 10px;
}

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

.account-form input {
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.account-form input::placeholder {
  color: #9facb8;
}

.account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mini-button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: #20a77a;
  color: #fff;
  font-weight: 700;
}

.mini-button.secondary {
  background: rgba(255, 255, 255, 0.13);
  color: #dce4ec;
}

.hidden {
  display: none !important;
}

.sidebar-label {
  color: #9facb8;
  font-size: 12px;
}

.sidebar-value {
  margin-top: 4px;
  font-weight: 700;
}

.sidebar-card p {
  margin: 10px 0 0;
  color: #c1cbd5;
  font-size: 13px;
}

.main {
  width: min(1180px, 100%);
  padding: 28px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero,
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 28px;
  border: 1px solid #dce4ec;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff 0%, #edf6f3 100%);
}

.eyebrow {
  color: #0a7a5a;
  font-size: 13px;
  font-weight: 750;
}

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

h1 {
  margin-top: 6px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.08;
}

h2 {
  margin-top: 6px;
  font-size: 30px;
  line-height: 1.2;
}

h3 {
  color: #101820;
  font-size: 17px;
}

.hero p,
.panel-head p {
  max-width: 680px;
  margin-top: 10px;
  color: #5c6670;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 92px);
  gap: 10px;
}

.stat {
  padding: 14px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  text-align: center;
}

.stat-value {
  display: block;
  color: #101820;
  font-size: 24px;
  font-weight: 800;
}

.stat-label {
  color: #687078;
  font-size: 12px;
}

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

.search,
.input-row {
  display: grid;
  align-items: center;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #fff;
}

.search {
  grid-template-columns: 44px minmax(0, 1fr);
  min-height: 48px;
  padding: 0 14px;
}

.search span {
  color: #87919b;
  font-size: 22px;
}

input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1d252c;
}

.button,
.icon-button,
.text-button,
.segment,
.chip,
.filter-pill,
.platform-option {
  border-radius: 8px;
}

.button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  background: #0b6bcb;
  color: #fff;
  font-weight: 700;
}

.button.dark {
  background: #101820;
}

.button.secondary {
  background: #e8eef3;
  color: #1d252c;
}

.filters {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.filter-row,
.preset-row,
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill,
.preset,
.platform-option {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #d8dee4;
  background: #fff;
  color: #39434d;
}

.filter-pill.active,
.platform-option.active {
  border-color: #101820;
  background: #101820;
  color: #fff;
}

.filter-pill.topic.active {
  border-color: #0a7a5a;
  background: #e8f6ef;
  color: #0a7a5a;
}

.result-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 18px 0 12px;
  color: #687078;
  font-size: 14px;
}

.segmented {
  display: flex;
  padding: 4px;
  border-radius: 8px;
  background: #e8eef3;
}

.segment {
  min-width: 64px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #5c6670;
}

.segment.active {
  background: #fff;
  color: #101820;
  font-weight: 700;
}

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

.analysis-panel {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid #dce4ec;
  border-radius: 8px;
  background: #fff;
}

.analysis-title {
  color: #101820;
  font-weight: 750;
}

.analysis-panel p {
  margin-top: 4px;
  color: #687078;
  font-size: 14px;
}

.analysis-results {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.analysis-results.active {
  display: grid;
}

.analysis-card {
  padding: 16px;
  border: 1px solid #e3e7eb;
  border-radius: 8px;
  background: #fff;
}

.analysis-card h3 {
  margin-bottom: 10px;
}

.analysis-card p {
  color: #39434d;
  font-size: 14px;
}

.post-card,
.panel {
  border: 1px solid #e3e7eb;
  border-radius: 8px;
  background: #fff;
}

.post-card {
  padding: 20px;
}

.post-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: #687078;
  font-size: 13px;
}

.post-meta strong {
  color: #0a7a5a;
}

.post-card h2 {
  margin-top: 10px;
  font-size: 21px;
  line-height: 1.32;
}

.post-card p {
  margin-top: 8px;
  color: #39434d;
}

.post-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-top: 12px;
}

.post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  background: #e8f2ff;
  color: #0b6bcb;
  font-size: 13px;
}

.read-link {
  flex: 0 0 auto;
  color: #0a7a5a;
  font-weight: 700;
  text-decoration: none;
}

.empty {
  padding: 42px 20px;
  border: 1px dashed #cfd7df;
  border-radius: 8px;
  background: #fff;
  color: #687078;
  text-align: center;
}

.settings-grid,
.deploy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.author-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.author-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #e3e7eb;
  border-radius: 8px;
  background: #fff;
}

.author-meta {
  color: #687078;
  font-size: 13px;
}

.author-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.follow-button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: #101820;
  color: #fff;
  font-weight: 700;
}

.follow-button.active {
  background: #e8f6ef;
  color: #0a7a5a;
}

.panel {
  padding: 20px;
}

.panel-head {
  align-items: center;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.text-button {
  border: 0;
  background: transparent;
  color: #0a7a5a;
  font-size: 14px;
}

.input-row {
  grid-template-columns: minmax(0, 1fr) 48px;
  padding-left: 14px;
}

.icon-button {
  width: 38px;
  height: 38px;
  margin-right: 5px;
  border: 0;
  background: #101820;
  color: #fff;
  font-size: 20px;
}

.preset-row {
  margin-top: 12px;
}

.preset {
  min-height: 32px;
}

.chips {
  min-height: 34px;
  margin-top: 12px;
}

.chip {
  gap: 8px;
  border: 0;
}

.chip button {
  border: 0;
  background: transparent;
  color: #687078;
}

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

.platform-option {
  height: 42px;
}

.action-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.plain-list {
  margin: 12px 0 0;
  padding-left: 20px;
  color: #39434d;
}

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

.source-item {
  padding: 12px;
  border: 1px solid #e3e7eb;
  border-radius: 8px;
  background: #f8fafb;
}

.source-item strong {
  display: block;
  color: #101820;
}

.source-item span {
  display: block;
  margin-top: 4px;
  color: #687078;
  font-size: 13px;
  word-break: break-all;
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

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

  .sidebar-card,
  .account-card {
    display: none;
  }

  .main {
    padding: 16px;
  }

  .hero,
  .panel-head {
    display: grid;
  }

  .stats,
  .settings-grid,
  .deploy-grid,
  .platform-grid {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .result-bar,
  .post-footer,
  .action-row,
  .analysis-panel {
    display: grid;
  }

  .analysis-results,
  .author-grid {
    grid-template-columns: 1fr;
  }
}
