:root {
  --bg-white: #FFFFFF;
  --bg-subtle: #F5F5F7;
  --border-light: #E5E5EA;
  --border-hover: #D1D1D6;
  --text-dark: #1D1D1F;
  --text-body: #515154;
  --text-muted: #6E6E73;
  --text-subtle: #86868B;
  --radius-card: 24px;
  --radius-pill: 9999px;
  --green-bg: #ECFDF5;
  --green-border: #A7F3D0;
  --green-ink: #065F46;
  --amber-bg: #FFFBEB;
  --amber-border: #FDE68A;
  --amber-ink: #92400E;
  --red-bg: #FEF2F2;
  --red-border: #FECACA;
  --red-ink: #991B1B;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--bg-white);
  color: var(--text-dark);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  padding-bottom: 80px;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

/* Sticky frosted glass header */
.apple-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-dark);
}

.monogram {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: var(--text-dark);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

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

.container {
  max-width: 1080px;
  margin: 36px auto 0;
  padding: 0 20px;
}

.container-narrow {
  max-width: 640px;
  margin: 48px auto 0;
  padding: 0 20px;
}

.hero {
  margin-bottom: 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 12px;
}

h1 {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.hero-sub {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 720px;
}

/* KPI Strip */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 16px 18px;
}

.kpi-val {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-dark);
}

.kpi-lbl {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Cards */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 22px 24px;
  margin-bottom: 16px;
}

.card-subtle {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  margin-bottom: 16px;
}

/* Scrollbar-free pill strip */
.pill-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
  margin-bottom: 20px;
}

.pill-strip::-webkit-scrollbar {
  display: none;
}

.tab-pill {
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-body);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tab-pill:hover {
  border-color: var(--border-hover);
}

.tab-pill.active {
  background: var(--text-dark);
  color: #FFFFFF;
  border-color: var(--text-dark);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--text-dark);
  color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.88;
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-dark);
  border-color: var(--border-light);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--border-hover);
}

.btn-sm {
  padding: 6px 13px;
  font-size: 12.5px;
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-pill);
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.pill-green {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green-ink);
}

.pill-amber {
  background: var(--amber-bg);
  border-color: var(--amber-border);
  color: var(--amber-ink);
}

.pill-red {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red-ink);
}

.pill-neutral {
  background: var(--bg-subtle);
  border-color: var(--border-light);
  color: var(--text-body);
}

/* Forms & Inputs */
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.input, .textarea, .select {
  width: 100%;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 10px 13px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.15s ease;
}

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--text-dark);
}

.textarea {
  resize: vertical;
  min-height: 92px;
  line-height: 1.5;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.post-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 14px 16px;
  margin-top: 12px;
}

.reply-box {
  background: #FAFAFC;
  border: 1px dashed var(--border-hover);
  border-radius: 16px;
  padding: 14px 16px;
  margin-top: 10px;
}

.pre-copy {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-dark);
}

.char-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.char-count.over {
  color: var(--red-ink);
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--text-dark);
  color: #FFFFFF;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  z-index: 99;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(29, 29, 31, 0.35);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
}

.modal-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  max-width: 560px;
  width: 100%;
  padding: 24px;
  max-height: 88vh;
  overflow-y: auto;
}

.hidden {
  display: none !important;
}
