:root {
  --bg: #f6fbf8;
  --bg-blue: #eff8ff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #ffffff;
  --surface-green: #e9f8ef;
  --surface-blue: #eaf7ff;
  --ink: #183331;
  --muted: #617a77;
  --line: #d8ebe6;
  --primary: #38aa82;
  --primary-dark: #245965;
  --blue: #5bb8d5;
  --blue-dark: #2d7690;
  --brand-red: #d73535;
  --rose: #c85f74;
  --shadow: 0 18px 44px rgba(43, 107, 99, 0.12);
  --radius: 20px;
  --radius-sm: 14px;
  font-family:
    "Segoe UI",
    Tahoma,
    Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(223, 245, 238, 0.96), rgba(239, 248, 255, 0.9) 44%, #f9fcfb 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  padding-bottom: 92px;
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset-inline: 12px;
  bottom: 12px;
  display: grid;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(167, 220, 207, 0.8);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  border-radius: 26px;
}

.brand,
.sidebar-footer {
  display: none;
}

.nav {
  display: grid;
  grid-template-columns: repeat(12, minmax(74px, 1fr));
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav-item {
  min-width: 62px;
  min-height: 58px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 7px 5px;
  text-align: center;
  font-size: 11px;
}

.nav-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-blue);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
}

.notice-band {
  display: grid;
  gap: 6px;
  padding: 15px 18px;
  border: 1px solid #b9ead7;
  border-radius: 12px;
  background: #eaf9f1;
  color: var(--ink);
}

.notice-band strong {
  font-size: 16px;
}

.notice-band span {
  color: var(--muted);
  line-height: 1.7;
}

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

.calendar-item {
  min-height: 150px;
  padding: 15px;
}

.calendar-item strong {
  display: block;
  margin-bottom: 10px;
  color: var(--primary-dark);
}

.calendar-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--primary-dark);
  background: linear-gradient(135deg, #e2f7ee, #e8f7ff);
}

.nav-item.is-active .nav-icon {
  background: var(--primary);
  color: white;
}

.main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.topbar h2,
.brand h1,
.panel h3,
.hero-panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h2 {
  font-size: clamp(25px, 8vw, 36px);
  line-height: 1.15;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

select,
input,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  padding: 11px 13px;
  outline: none;
}

textarea {
  line-height: 1.7;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(91, 184, 213, 0.18);
}

.icon-button,
.small-button,
.primary-button {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0 15px;
  background: var(--surface-solid);
  color: var(--ink);
  font-weight: 800;
}

.primary-button {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary), #6fcbb3);
  color: white;
}

.small-button:hover,
.icon-button:hover {
  border-color: var(--blue);
  color: var(--blue-dark);
}

.install-button {
  background: var(--surface-blue);
}

.full {
  width: 100%;
  margin-top: 14px;
}

.view {
  display: none;
}

.view.is-visible {
  display: grid;
  gap: 14px;
}

.hero-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(156, 220, 205, 0.9);
  border-radius: 28px;
  background:
    radial-gradient(circle at 10% 10%, rgba(129, 216, 183, 0.35), transparent 34%),
    linear-gradient(135deg, #f7fffb, #ecf8ff);
  box-shadow: var(--shadow);
}

.hero-panel h3 {
  max-width: 720px;
  font-size: clamp(25px, 7vw, 46px);
  line-height: 1.18;
}

.hero-panel p {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.planning-hero {
  display: grid;
  gap: 18px;
  align-items: end;
  background: linear-gradient(135deg, rgba(233, 248, 239, 0.96), rgba(234, 247, 255, 0.96));
}

.planning-hero p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

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

.metric,
.panel,
.app-card,
.calendar-item,
.keyword-box,
.post-card,
.topic-chip {
  border: 1px solid rgba(216, 235, 230, 0.95);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 112px;
  padding: 16px;
}

.metric strong {
  display: block;
  margin-bottom: 7px;
  color: var(--primary-dark);
  font-size: clamp(26px, 8vw, 38px);
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-weight: 700;
}

.panel {
  padding: 16px;
}

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

.panel-head h3 {
  font-size: 18px;
}

.two-column,
.editor-grid,
.stack,
.form-stack,
.checklist,
.insight-list,
.post-list,
.reply-list,
.topic-grid,
.topic-suggestions {
  display: grid;
  gap: 12px;
}

.plan-item,
.check-item,
.empty-state {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-blue);
}

.insight-list p,
.app-card p,
.post-card p,
.output p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.table-wrap {
  overflow: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.72);
}

th,
td {
  padding: 13px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}

th {
  color: var(--blue-dark);
  font-size: 13px;
}

.app-grid,
.channel-grid,
.calendar-grid,
.keyword-grid,
.topic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.app-card {
  display: grid;
  gap: 9px;
  padding: 15px;
  text-align: start;
}

.app-card.is-active {
  border-color: var(--primary);
  outline: 4px solid rgba(55, 169, 133, 0.15);
  background: linear-gradient(135deg, #fafffd, #eef9ff);
}

.app-card h4 {
  margin: 0;
  font-size: 18px;
}

.legacy-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.campaign-card {
  align-content: start;
}

.campaign-board {
  align-content: start;
  gap: 12px;
}

.campaign-stage-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-blue);
}

.campaign-stage-item span {
  color: var(--muted);
  line-height: 1.5;
}

.price-line {
  color: var(--primary-dark);
  font-size: 20px;
  line-height: 1.3;
}

.app-card pre {
  margin: 0;
  white-space: pre-wrap;
  overflow: auto;
  max-height: 280px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-green);
  padding: 12px;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.6;
}

.topic-chip {
  display: grid;
  gap: 7px;
  padding: 14px;
  color: var(--ink);
  text-align: start;
}

.topic-chip strong {
  color: var(--primary-dark);
  line-height: 1.45;
}

.topic-chip span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.topic-chip:hover,
.topic-chip.is-active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #fafffd, #eef9ff);
}

.topic-suggestions {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.topic-suggestions .topic-chip {
  min-height: 44px;
  padding: 10px 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
}

label input,
label textarea,
label select {
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}

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

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.output {
  display: grid;
  gap: 12px;
}

.copy-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.78);
  padding: 13px;
}

.copy-block strong {
  display: block;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.copy-block code {
  display: block;
  white-space: pre-wrap;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.65;
}

.post-list,
.reply-list {
  max-height: 720px;
  overflow: auto;
}

.post-card {
  padding: 14px;
}

.post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.post-card pre {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.7;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-green);
  padding: 12px;
  color: var(--ink);
  font-family:
    "Segoe UI",
    Tahoma,
    Arial,
    sans-serif;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 30px;
  border: 1px solid rgba(91, 184, 213, 0.32);
  border-radius: 999px;
  background: var(--surface-blue);
  color: var(--blue-dark);
  padding: 4px 10px;
  font-weight: 900;
}

.danger {
  color: var(--rose);
  border-color: rgba(200, 95, 116, 0.35);
}

.toast {
  position: fixed;
  z-index: 30;
  inset-inline: 16px;
  bottom: 104px;
  max-width: 420px;
  margin-inline: auto;
  border-radius: 999px;
  background: #183331;
  color: white;
  padding: 13px 18px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

[dir="ltr"] .nav-item,
[dir="ltr"] th,
[dir="ltr"] td {
  text-align: left;
}

@media (max-width: 430px) {
  .main {
    padding: 12px;
  }

  .topbar-actions {
    grid-template-columns: 1fr 78px 70px;
  }

  .small-button,
  .primary-button {
    padding-inline: 11px;
  }

  .panel,
  .hero-panel {
    padding: 15px;
  }
}

@media (min-width: 720px) {
  .main {
    padding: 24px;
  }

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

  .app-grid,
  .channel-grid,
  .calendar-grid,
  .keyword-grid,
  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .hero-panel {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .planning-hero {
    grid-template-columns: 1fr auto;
  }
}

@media (min-width: 1080px) {
  .shell {
    display: grid;
    grid-template-columns: 320px 1fr;
    padding-bottom: 0;
  }

  .sidebar {
    position: sticky;
    top: 0;
    bottom: auto;
    inset-inline: auto;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    padding: 24px 20px;
    background: #f7fcf9;
    box-shadow: none;
    align-content: start;
  }

  .brand,
  .sidebar-footer {
    display: flex;
  }

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

  .brand-logo {
    width: 146px;
    height: auto;
    display: block;
    border-radius: 10px;
  }

  .brand-mark {
    width: 58px;
    height: 58px;
    display: none;
    border-radius: 12px;
    box-shadow: var(--shadow);
  }

  .brand h1 {
    font-size: 18px;
  }

  .nav {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .nav-item {
    min-height: 56px;
    grid-template-columns: 34px 1fr;
    place-items: center start;
    text-align: start;
    font-size: 15px;
    padding: 9px 12px;
    border-radius: 12px;
  }

  .nav-item.is-active {
    background: #5ed394;
    color: #06231c;
  }

  .nav-item.is-active .nav-icon {
    background: transparent;
    color: #06231c;
  }

  .sidebar-footer {
    margin-top: 24px;
    gap: 9px;
  }

  .main {
    width: 100%;
    padding: 24px 32px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .topbar-actions {
    min-width: 520px;
  }

  .two-column {
    grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
  }

  .app-grid,
  .channel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
