/* Smart Humanoid — new conference app UI (one responsive codebase: phone = app, wide = web) */
:root {
  --brand: #4f46e5; --brand-ink: #ffffff; --brand-soft: #eef2ff; --accent: #f59e0b;
  --bg: #f6f7fb; --surface: #ffffff; --surface-2: #f1f3f9; --ink: #111827; --ink-2: #4b5563; --ink-3: #9ca3af;
  --line: #e5e7eb; --ok: #16a34a; --warn: #d97706; --bad: #dc2626;
  --r-lg: 18px; --r-md: 12px; --r-sm: 8px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 14px rgba(16,24,40,.06);
  --tab-h: 64px; --side-w: 264px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1220; --surface: #171b2e; --surface-2: #1f2440; --ink: #eef0f7; --ink-2: #b4b9cc; --ink-3: #7c839c; --line: #2a3050;
  --brand-soft: #262d55; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: var(--ink); }
img { max-width: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.side { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 56px; }
.topbar h1 { font-size: 17px; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; position: relative; flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); border: 2px solid var(--surface); }
.content { flex: 1; padding: 14px 14px calc(var(--tab-h) + 24px); width: 100%; max-width: 1180px; margin: 0 auto; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; height: var(--tab-h); background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.tabbar a.on { color: var(--brand); }
.tabbar a.on svg { transform: translateY(-1px); }

.web-only { display: none !important; }

.brand { display: flex; gap: 10px; align-items: center; padding: 6px 8px 14px; }
.brand img, .brand .logo { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; background: var(--brand); flex: none; }
.brand b { display: block; font-size: 15px; line-height: 1.2; }
.brand small { color: var(--ink-3); font-size: 12px; }
.side h6 { margin: 16px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.side a.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 550; font-size: 14px; }
.side a.nav:hover { background: var(--surface-2); }
.side a.nav.on { background: var(--brand-soft); color: var(--brand); }
.side a.nav img { width: 22px; height: 22px; object-fit: contain; }
.side a.nav .lock { margin-left: auto; color: var(--ink-3); }

/* ---------- building blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.pad { padding: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stack > * + * { margin-top: 12px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 10px; }
.section-title h2 { margin: 0; font-size: 18px; }
.section-title a { font-size: 13px; font-weight: 600; }
h2.page { font-size: 22px; margin: 4px 2px 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px; font-weight: 650; background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.on { background: var(--brand-soft); color: var(--brand); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip .sw { width: 8px; height: 8px; border-radius: 50%; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.ok { background: #dcfce7; color: #166534; } .pill.bad { background: #fee2e2; color: #991b1b; } .pill.warn { background: #fef3c7; color: #92400e; }
:root[data-theme="dark"] .pill.ok { background: #14532d; color: #bbf7d0; } :root[data-theme="dark"] .pill.bad { background: #7f1d1d; color: #fecaca; } :root[data-theme="dark"] .pill.warn { background: #78350f; color: #fde68a; }

.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; }
.field { display: block; }
.field span { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink-2); margin: 0 0 6px 2px; }
.field input, .field textarea, .field select { width: 100%; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); outline: 0; }
.field textarea { height: 110px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 750; font-size: 16px; overflow: hidden; }
.avatar.lg { width: 96px; height: 96px; font-size: 30px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatars { display: flex; } .avatars .avatar { border: 2px solid var(--surface); margin-left: -8px; } .avatars .avatar:first-child { margin-left: 0; }

.empty { text-align: center; padding: 40px 18px; color: var(--ink-2); }
.empty .big { font-size: 40px; margin-bottom: 6px; }

.main { overflow-x: clip; }
.banners:not(:has(img)) { display: none; }
.source { display: inline-block; max-width: 100%; overflow-wrap: anywhere; font: 11.5px/1.35 ui-monospace, Consolas, monospace; color: #0f766e; background: #ccfbf1; border-radius: 8px; padding: 3px 8px; margin: 2px 4px 2px 0; }
.source.ui { color: #6d28d9; background: #ede9fe; }
.source.gap { color: #9a3412; background: #ffedd5; }
:root[data-theme="dark"] .source { background: #134e4a; color: #99f6e4; } :root[data-theme="dark"] .source.ui { background: #3b2a6b; color: #ddd6fe; } :root[data-theme="dark"] .source.gap { background: #5b2a12; color: #fed7aa; }
body:not(.dev) .source { display: none; }

/* ---------- home ---------- */
.hero { position: relative; overflow: hidden; border-radius: 22px; color: #fff; min-height: 190px; background: linear-gradient(135deg, var(--brand), #0f172a); display: flex; align-items: flex-end; }
.hero img.bgimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero .in { position: relative; padding: 18px; width: 100%; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.hero h2 { margin: 0 0 4px; font-size: 24px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; opacity: .95; }
.countdown { display: flex; gap: 8px; margin-top: 12px; }
.countdown div { background: rgba(255,255,255,.16); border-radius: 12px; padding: 6px 10px; text-align: center; min-width: 56px; backdrop-filter: blur(4px); }
.countdown b { display: block; font-size: 18px; }
.countdown small { font-size: 11px; opacity: .85; }
.banner-strip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; scrollbar-width: none; }
.banner-strip img { flex: none; width: 86%; max-width: 520px; aspect-ratio: 16/7; object-fit: cover; border-radius: 16px; scroll-snap-align: start; background: var(--surface-2); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 10px 4px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.2; min-height: 96px; }
.tile .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--tile-bg, var(--brand-soft)); }
.tile .ic img { width: 28px; height: 28px; object-fit: contain; }
.tile .lock { font-size: 10px; color: var(--ink-3); }
.now-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { padding: 14px; } .kpi b { display: block; font-size: 24px; } .kpi span { font-size: 12.5px; color: var(--ink-2); }

/* ---------- agenda ---------- */
.daytabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.daytab { flex: none; padding: 8px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: center; min-width: 74px; }
.daytab b { display: block; font-size: 15px; } .daytab small { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.daytab.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); } .daytab.on small { color: inherit; opacity: .85; }
.timeslot { display: grid; grid-template-columns: 62px 1fr; gap: 10px; margin-top: 10px; }
.timeslot .t { font-weight: 750; font-size: 13.5px; padding-top: 12px; color: var(--ink-2); text-align: right; }
.timeslot .t small { display: block; font-weight: 600; color: var(--ink-3); font-size: 11px; }
.sess { position: relative; display: block; padding: 12px 12px 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); overflow: hidden; }
.sess + .sess { margin-top: 8px; }
.sess::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--sess-c, var(--brand)); }
.sess h3 { margin: 4px 0 4px; font-size: 15px; line-height: 1.3; }
.sess .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.sess .save { position: absolute; top: 8px; right: 8px; }
.sess.live { border-color: var(--ok); box-shadow: 0 0 0 2px #bbf7d0; }
.sess.cancel h3 { text-decoration: line-through; color: var(--ink-3); }
.sess.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.split { display: grid; gap: 18px; grid-template-columns: 1fr; }

.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.toggle input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- detail ---------- */
.detail h2 { margin: 6px 0 8px; font-size: 21px; line-height: 1.25; }
.facts { display: grid; gap: 8px; }
.fact { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.fact svg { flex: none; margin-top: 2px; color: var(--ink-3); }
.desc { white-space: pre-wrap; font-size: 14px; color: var(--ink-2); }
.richtext { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; } .richtext p { margin: 6px 0; }
.role-group h4 { margin: 14px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.person-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; color: var(--ink); }
.person-row:hover { background: var(--surface-2); }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.actions .btn { flex-direction: column; height: auto; padding: 10px 4px; gap: 4px; font-size: 12px; }
.stars { display: flex; gap: 4px; } .stars button { font-size: 26px; color: var(--line); line-height: 1; } .stars button.on { color: var(--accent); }

/* ---------- lists ---------- */
.people-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
.pcard { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.pcard .n { font-weight: 700; font-size: 14.5px; }
.logo-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.lcard { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.lcard .logo { aspect-ratio: 16/9; border-radius: 10px; background: #fff; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); }
.lcard .logo img { max-height: 100%; object-fit: contain; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.list-row + .list-row { margin-top: 8px; }
.fileic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #fee2e2; color: #b91c1c; font-weight: 800; font-size: 11px; flex: none; }

/* ---------- sheets, toast, dev ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 18px; max-height: 88vh; overflow: auto; animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
.sheet h3 { margin: 0 0 12px; font-size: 18px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 16px); transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 12px; z-index: 80; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); max-width: 92vw; }
.devbar { position: fixed; right: 12px; bottom: calc(var(--tab-h) + 12px); z-index: 40; }
.devbar > button { background: #0f766e; color: #fff; border-radius: 999px; padding: 9px 14px; font-weight: 700; font-size: 12.5px; box-shadow: var(--shadow); }
.devpanel { position: absolute; right: 0; bottom: 46px; width: 300px; padding: 14px; }
.devpanel label { display: block; font-size: 12.5px; font-weight: 650; margin: 10px 0 4px; color: var(--ink-2); }
.devpanel input, .devpanel select { width: 100%; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 10px; }
.swatches { display: flex; gap: 8px; } .swatches button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }

/* catalogue */
table.cat { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.cat th, table.cat td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.cat th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.table-wrap { overflow-x: auto; }

/* chat */
.bubbles { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 78%; padding: 9px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.bubble.me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.bubble small { display: block; opacity: .7; font-size: 11px; margin-top: 2px; }
.quiz-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; }
.quiz-opt + .quiz-opt { margin-top: 8px; }
.quiz-opt.on { border-color: var(--brand); background: var(--brand-soft); }
.quiz-opt.right { border-color: var(--ok); background: #dcfce7; } .quiz-opt.wrong { border-color: var(--bad); background: #fee2e2; }
:root[data-theme="dark"] .quiz-opt.right { background: #14532d; } :root[data-theme="dark"] .quiz-opt.wrong { background: #7f1d1d; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; } .progress i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.gate { max-width: 420px; margin: 20px auto; }
.otp { display: flex; gap: 8px; justify-content: center; } .otp input { width: 46px; height: 54px; text-align: center; font-size: 22px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }

/* let grid/flex children shrink below their content width (prevents horizontal overflow on phones) */
.split { grid-template-columns: minmax(0, 1fr); }
.split > div, .timeslot > div, .now-grid > *, .people-grid > *, .grow { min-width: 0; }
.timeslot { grid-template-columns: 52px minmax(0, 1fr); }
.sess .meta .ellipsis { min-width: 0; max-width: 100%; display: inline-block; vertical-align: bottom; }
.list-row .grow > span { display: block; }

/* Mobile-first everywhere: the web version is the same phone layout. On a big screen it sits centred like an app. */
:root { --app-w: 480px; }
@media (min-width: 600px) {
  html { background: #e9ecf4; } :root[data-theme="dark"] { background: #070912; }
  body { background: transparent; }
  .shell { max-width: var(--app-w); margin: 0 auto; background: var(--bg); box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(15,23,42,.12); }
  .tabbar { left: 50%; right: auto; width: var(--app-w); transform: translateX(-50%); }
  .devbar { right: calc(50% - var(--app-w) / 2 + 12px); }
  .toast { bottom: calc(var(--tab-h) + 16px); }
  .sheet-bg { align-items: flex-end; } .sheet { max-width: var(--app-w); border-radius: 22px 22px 0 0; }
}
