/* Hub demo: a readability layer over the hub's own unstyled pages. Neutral greys, soft
   cards, shading and spacing only: no brand colours, no logos, nothing moved. The real hub
   does not load this file. */
:root {
  --page: #f4f5f7;
  --card: #ffffff;
  --ink: #1d2128;
  --muted: #646b78;
  --line: #e3e6eb;
  --soft: #f8f9fb;
  --link: #2f4f86;
  --shopper: #eef1f5;
  --assistant: #ffffff;
  --shadow: 0 1px 2px rgba(20, 24, 31, .05), 0 4px 14px rgba(20, 24, 31, .05);
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* The demo's own bar, so nobody mistakes the figures for real ones. */
.demo-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 14px; align-items: center;
  padding: 10px 16px; background: #2a2e35; color: #e9ebef; font-size: 13px;
}
.demo-bar a { color: #fff; text-decoration: none; font-weight: 600; white-space: nowrap; }
.demo-bar span { opacity: .9; }

main.hub { max-width: 1120px; margin: 0 auto; padding: 18px 16px 64px; }

/* The hub's link row at the top of every page: shown as a row of pills. */
main.hub > p:first-child {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin: 0 0 18px; padding: 8px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); color: transparent; font-size: 0;  /* hides the " · " separators */
}
main.hub > p:first-child a {
  font-size: 14px; color: var(--ink); text-decoration: none;
  padding: 7px 12px; border-radius: 8px; transition: background .15s;
}
main.hub > p:first-child a:hover { background: var(--soft); }
main.hub > p:first-child a[aria-current="page"] { background: var(--shopper); font-weight: 600; }

h1 { font-size: 26px; line-height: 1.25; margin: 8px 0 14px; letter-spacing: -0.01em; }
h2 {
  font-size: 17px; margin: 34px 0 10px; padding-top: 4px;
  letter-spacing: -0.005em;
}
small { color: var(--muted); font-size: 13px; }
p { margin: 8px 0; }

/* The range picker and short notes read as quiet text. */
main.hub > h1 + p { color: var(--muted); }

/* Tables become cards, and scroll sideways on a phone instead of squashing. */
table {
  display: block; overflow-x: auto; max-width: 100%;
  border-collapse: separate; border-spacing: 0;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
}
thead, tbody, tr { width: 100%; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th {
  background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: #fbfbfc; }
tbody tr:hover td { background: #f3f5f8; }
td { font-variant-numeric: tabular-nums; }

/* A single-row figures table (revenue, engagement) shows as a grid of labelled tiles. */
table.figures {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0; overflow: hidden; background: var(--card);
}
table.figures thead { display: none; }
table.figures tbody, table.figures tr { display: contents; }
table.figures td {
  display: block; background: var(--card) !important; border: 0; box-shadow: inset -1px -1px 0 var(--line);
  font-size: 20px; font-weight: 600; padding: 14px 16px;
}
table.figures td::before {
  content: attr(data-label); display: block; margin-bottom: 4px;
  color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}

/* Conversation transcripts: each turn a card, shopper and assistant as chat bubbles. */
article {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin: 12px 0;
}
article + hr { display: none; }
article > p:first-child { margin-top: 0; }
p.bubble { padding: 10px 14px; border-radius: 14px; max-width: 760px; }
p.bubble-shopper { background: var(--shopper); margin-left: auto; margin-right: 0; border-bottom-right-radius: 4px; width: fit-content; }
p.bubble-assistant { background: var(--assistant); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
article ul { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
article li a, article li {
  font-size: 13px;
}
article li { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; }
article li a { text-decoration: none; }

/* Forms (settings, team, catalog health) */
form { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
td form, li form { background: none; box-shadow: none; padding: 0; display: inline-flex; gap: 6px; flex-wrap: wrap; }
label { display: inline-flex; flex-direction: column; gap: 4px; font-weight: 500; }
input:not([type="checkbox"]), textarea, select {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0;
}
input:not([type="checkbox"]), textarea { width: min(420px, 100%); }
label:has(input[type="checkbox"]) { flex-direction: row; align-items: center; }
input:focus, textarea:focus, select:focus { outline: 2px solid #b8c3d6; outline-offset: 1px; }
button {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--soft);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer;
}
button:hover { background: #eceff3; }
form > p > small { display: block; }
ul { padding-left: 20px; }

[role="alert"] { background: #fbf3e8; border-radius: 8px; padding: 8px 12px; }
[role="status"] { background: var(--shopper); border-radius: 8px; padding: 8px 12px; }

.demo-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #2a2e35; color: #fff; padding: 10px 16px; border-radius: 10px;
  box-shadow: var(--shadow); font-size: 14px; z-index: 20; max-width: calc(100% - 32px);
}

@media (max-width: 640px) {
  h1 { font-size: 22px; }
  .demo-bar { font-size: 12px; }
  table.figures { grid-template-columns: 1fr 1fr; }
  table.figures td { font-size: 17px; }

  /* Other tables stack: each row a card, each value with its column's name beside it. */
  table.labelled:not(.figures) { display: block; background: none; box-shadow: none; overflow: visible; }
  table.labelled:not(.figures) thead,
  table.labelled:not(.figures) tr:has(> th) { display: none; }
  table.labelled:not(.figures) tbody { display: block; }
  table.labelled:not(.figures) tr {
    display: block; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    margin-bottom: 10px; padding: 4px 0;
  }
  table.labelled:not(.figures) td {
    display: flex; justify-content: space-between; gap: 16px; text-align: right;
    background: none !important; padding: 7px 14px; border-bottom: 1px solid var(--line);
  }
  table.labelled:not(.figures) tr td:last-child { border-bottom: 0; }
  table.labelled:not(.figures) td::before {
    content: attr(data-label); flex: none; text-align: left;
    color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  }
  table.labelled:not(.figures) td:not([data-label])::before,
  table.labelled:not(.figures) td[data-label=""]::before { content: none; }
  table.labelled:not(.figures) td form { justify-content: flex-end; }
}
