:root {
  --bg: #f5f2eb;
  --surface: #fffdf8;
  --surface-2: #f0ebe1;
  --text: #1e1b17;
  --muted: #766f66;
  --line: #ded6c9;
  --gold: #9f7a3d;
  --gold-soft: #d9c7a5;
  --success: #2d7d4d;
  --danger: #a74343;
  --shadow: 0 20px 45px rgba(46, 38, 27, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

button, select { font: inherit; }
button { cursor: pointer; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px;
  background: #181611;
  color: #fffaf0;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
}
.brand-block { display: flex; align-items: center; gap: 13px; margin-bottom: 38px; }
.brand-mark {
  width: 42px; height: 42px; border: 1px solid #7d6742; border-radius: 50%;
  display: grid; place-items: center; color: #e6d1aa; font-family: Georgia, serif; font-size: 21px;
}
.brand-name { font-family: Georgia, serif; letter-spacing: .16em; font-size: 17px; }
.brand-subtitle { font-size: 12px; color: #b8aa93; margin-top: 2px; }

.nav { display: grid; gap: 8px; }
.nav-item {
  border: 0; background: transparent; color: #c8bda8; border-radius: 12px;
  padding: 13px 14px; display: flex; align-items: center; gap: 12px; text-align: left;
}
.nav-item:hover, .nav-item.active { background: #2a261f; color: #fff8eb; }
.nav-item.active { box-shadow: inset 3px 0 0 var(--gold-soft); }

.sidebar-footer { margin-top: auto; border-top: 1px solid #342f27; padding-top: 18px; }
.status-row { display: flex; gap: 9px; align-items: center; font-size: 13px; }
.status-dot { width: 8px; height: 8px; background: #54b876; border-radius: 50%; box-shadow: 0 0 0 4px rgba(84,184,118,.12); }
.small-muted { color: var(--muted); font-size: 12px; }
.sidebar .small-muted { color: #948875; margin-top: 6px; }

.main { margin-left: 250px; width: calc(100% - 250px); padding: 36px 42px 60px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--gold); font-size: 11px; letter-spacing: .2em; font-weight: 700; }
h1 { margin: 0; font: 42px/1.1 Georgia, serif; }
.subtitle { margin: 9px 0 0; color: var(--muted); }

.top-actions { display: flex; gap: 10px; }
select, .primary-btn, .secondary-btn {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--surface);
}
.primary-btn { background: #1d1a15; color: #fff; border-color: #1d1a15; }
.secondary-btn { color: var(--text); }

.loading-panel, .error-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow);
}
.error-panel { color: var(--danger); flex-direction: column; align-items: flex-start; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line);
  border-top-color: var(--gold); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

.account-strip {
  display: grid; grid-template-columns: 1.8fr repeat(4, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 19px 22px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.account-strip > div { padding: 0 18px; border-right: 1px solid var(--line); }
.account-strip > div:first-child { padding-left: 0; }
.account-strip > div:last-child { border-right: 0; }
.account-strip .label { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 6px; }
.account-strip strong { display: block; font-size: 21px; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; box-shadow: var(--shadow); min-height: 136px;
}
.metric-card.accent { background: #201d18; color: #fffaf0; border-color: #201d18; }
.metric-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 18px; }
.metric-card.accent .metric-label, .metric-card.accent .metric-foot { color: #b7aa95; }
.metric-card strong { display: block; font: 30px/1.1 Georgia, serif; margin-bottom: 9px; }
.metric-foot { color: var(--muted); font-size: 11px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.panel-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font: 23px/1.2 Georgia, serif; }
.panel-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
canvas { width: 100%; max-width: 100%; }

.recommendations { display: grid; gap: 12px; }
.recommendation {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 15px;
  background: #faf7f0; display: flex; gap: 10px; line-height: 1.45;
}
.recommendation span:first-child { color: var(--gold); font-weight: 800; }

.details-list { margin: 0; }
.details-list > div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 13px 0; }
.details-list > div:last-child { border-bottom: 0; }
.details-list dt { color: var(--muted); }
.details-list dd { margin: 0; font-weight: 600; }

.list-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.list-item { border: 1px solid var(--line); border-radius: 13px; padding: 16px; background: #faf7f0; }
.list-item h3 { margin: 0 0 8px; font-size: 16px; }
.list-item p { margin: 0; color: var(--muted); font-size: 12px; }

.pins-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pin-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #faf7f0; }
.pin-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: #e8e0d3; }
.pin-card-body { padding: 14px; }
.pin-card h3 { margin: 0 0 8px; font-size: 14px; }
.pin-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

.account-box { padding: 18px; border-radius: 14px; background: #211e19; color: #fffaf0; }
.account-box strong { font: 28px Georgia, serif; display: block; margin-bottom: 8px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: right; font-size: 13px; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; }

.report-summary { display: grid; gap: 16px; }
.report-block { border: 1px solid var(--line); background: #faf7f0; border-radius: 13px; padding: 17px; }
.report-block h3 { margin: 0 0 10px; font: 19px Georgia, serif; }
.report-block p { margin: 5px 0; color: #4e473f; line-height: 1.5; }

@media (max-width: 1050px) {
  .sidebar { width: 210px; }
  .main { margin-left: 210px; width: calc(100% - 210px); padding: 30px 24px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .account-strip { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .account-strip > div { border-right: 0; padding: 0; }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: 100%; min-height: auto; }
  .app-shell { display: block; }
  .main { margin-left: 0; width: 100%; padding: 24px 16px; }
  .topbar, .top-actions { flex-direction: column; width: 100%; }
  .top-actions select, .top-actions button { width: 100%; }
  .metrics-grid, .two-col, .list-grid, .pins-grid, .account-strip { grid-template-columns: 1fr; }
  .nav { grid-template-columns: repeat(4, 1fr); }
  .nav-item { justify-content: center; padding: 10px 5px; font-size: 12px; }
  .sidebar-footer { display: none; }
}


.voice-btn {
  border: 1px solid var(--gold-soft);
  border-radius: 10px;
  padding: 10px 14px;
  background: #fffaf0;
  color: #5d4521;
  font-weight: 700;
}
.voice-btn:hover { background: #f4ead7; }

.voice-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 28px 80px rgba(32, 27, 20, .24);
  z-index: 50;
}
.voice-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.voice-panel-head h2 {
  margin: 0;
  font: 28px/1.15 Georgia, serif;
}
.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-size: 22px;
  line-height: 1;
}
.voice-orb-wrap {
  display: grid;
  place-items: center;
  margin: 26px 0 20px;
}
.voice-orb {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 35% 30%, #d8c39a, #8a6733 68%, #4f391b);
  box-shadow: 0 16px 36px rgba(122, 88, 37, .28);
  color: white;
  font-size: 30px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.voice-orb:hover { transform: scale(1.04); }
.voice-orb.listening {
  animation: voicePulse 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 14px rgba(159, 122, 61, .13), 0 16px 36px rgba(122, 88, 37, .28);
}
@keyframes voicePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
#voice-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.voice-transcript,
.voice-response {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-top: 12px;
  background: #faf7f0;
}
.voice-transcript p,
.voice-response p {
  margin: 8px 0 0;
  line-height: 1.55;
}
.voice-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.voice-quick-actions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: white;
  color: var(--text);
  font-size: 12px;
}
.voice-quick-actions button:hover {
  border-color: var(--gold-soft);
  background: #f7efe1;
}

@media (max-width: 760px) {
  .voice-panel {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    max-height: 76vh;
  }
}


.brand-avatar {
  overflow: hidden;
  background: #f7f0e2;
  border: 1px solid #8d754e;
}
.brand-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.platform-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  min-height: 170px;
}
.platform-card.upcoming {
  background: #eee9df;
  color: #766f66;
}
.platform-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.platform-kicker {
  display: block;
  font-size: 10px;
  letter-spacing: .15em;
  color: var(--gold);
  font-weight: 800;
  margin-bottom: 5px;
}
.platform-card h2 {
  margin: 0;
  font: 22px/1.15 Georgia, serif;
}
.connection-badge {
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  background: #e5f3e9;
  color: #2d7d4d;
  white-space: nowrap;
}
.connection-badge.muted {
  background: #ded8cc;
  color: #6f675d;
}
.platform-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.platform-metrics span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 5px;
}
.platform-metrics strong {
  font: 17px Georgia, serif;
}

.funnel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.funnel-grid > div {
  background: #faf7f0;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 18px;
  position: relative;
}
.funnel-grid > div:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  z-index: 2;
}
.funnel-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 10px;
}
.funnel-grid strong {
  font: 27px Georgia, serif;
}
.setup-card {
  background: #fff8e8;
  border: 1px solid #dfc58f;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}
.setup-card h2 { margin-top: 0; font: 24px Georgia, serif; }
.setup-card code {
  display: block;
  background: #2a261f;
  color: #fff7e7;
  border-radius: 8px;
  padding: 9px 11px;
  margin-top: 8px;
}

@media (max-width: 1100px) {
  .platform-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .platform-grid, .funnel-grid { grid-template-columns: 1fr; }
  .funnel-grid > div:not(:last-child)::after { display: none; }
}
