:root {
  --bg: #f4f1ec;
  --surface: #ffffff;
  --surface-soft: #faf8f5;
  --text: #25231f;
  --muted: #6d6860;
  --border: #ded8cf;
  --accent: #4d675d;
  --accent-dark: #334a42;
  --danger: #9d3f3f;
  --shadow: 0 12px 36px rgba(45, 39, 31, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 56px; }
.hero { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 24px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.04em; }
h2 { margin-bottom: 10px; font-size: clamp(1.35rem, 3vw, 1.8rem); }
h3 { margin-bottom: 8px; }
.eyebrow, .section-kicker { margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.74rem; font-weight: 800; color: var(--accent); }
.tagline, .muted { color: var(--muted); }
.tagline { margin-bottom: 0; font-size: 1.05rem; }
.beta-note { display: inline-block; margin: 10px 0 0; padding: 6px 10px; border-radius: 999px; background: #ece7df; color: #5e574f; font-size: .78rem; font-weight: 800; }
.muted { line-height: 1.55; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: clamp(18px, 3vw, 30px); box-shadow: var(--shadow); margin-bottom: 22px; }
.hidden { display: none !important; }
.badge { border-radius: 999px; padding: 8px 12px; font-size: 0.8rem; font-weight: 800; white-space: nowrap; }
.badge-waiting { background: #ece7df; color: #675f55; }
.badge-online { background: #dfeae4; color: #345247; }
.badge-offline { background: #f1dddd; color: #7b3737; }

.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 5px; margin: 22px 0 18px; background: #eee9e2; border-radius: 13px; }
.auth-tab { border: 0; border-radius: 10px; padding: 10px 12px; background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.auth-tab.active { background: white; color: var(--text); box-shadow: 0 2px 10px rgba(45,39,31,.07); }
.auth-form { display: grid; gap: 14px; max-width: 520px; }
.auth-form label { display: grid; gap: 7px; font-size: .86rem; font-weight: 800; }
.auth-form input { width: 100%; border: 1px solid var(--border); border-radius: 11px; padding: 11px 12px; background: white; color: var(--text); outline: none; }
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(77,103,93,.11); }
.form-note { margin: -2px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.form-message { min-height: 1.3em; margin: 12px 0 0; color: var(--danger); font-size: .86rem; font-weight: 700; }

.account-bar { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.account-status { margin-bottom: 0; }
.text-button { border: 0; background: transparent; color: var(--accent-dark); font-weight: 800; cursor: pointer; padding: 7px 0; }
.trial-card { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 16px 18px; margin: 20px 0; border: 1px solid #cfdad4; background: #f0f5f2; border-radius: 15px; }
.trial-card p { margin: 4px 0 0; font-size: .9rem; }
.trial-count { min-width: 48px; height: 48px; display: grid; place-items: center; border-radius: 999px; background: var(--accent); color: white; font-size: 1.15rem; font-weight: 900; }
.install-card { display: grid; gap: 12px; padding: 16px 18px; margin: 0 0 22px; border: 1px solid var(--border); background: var(--surface-soft); border-radius: 15px; }
.install-card p { margin: 4px 0 0; font-size: .9rem; }
.install-actions, .launch-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.launch-actions { margin-top: 2px; }
.launch-actions > button { flex: 1 1 220px; }

.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.set-card { display: grid; grid-template-columns: 54px 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; text-align: left; padding: 17px; border: 2px solid var(--border); border-radius: 16px; background: var(--surface-soft); color: var(--text); cursor: pointer; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.set-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(45, 39, 31, .07); }
.set-card.selected { border-color: var(--accent); background: #f0f5f2; }
.set-card img { width: 54px; height: 54px; object-fit: contain; grid-row: 1 / 3; }
.set-card span { font-weight: 800; }
.set-card small { color: var(--muted); margin-top: 3px; }
.primary-button, .secondary-button, .danger-button { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 800; cursor: pointer; }
.primary-button { background: var(--accent); color: white; }
.primary-button:hover { background: var(--accent-dark); }
.primary-button:disabled, .secondary-button:disabled { opacity: .42; cursor: not-allowed; }
.secondary-button { background: #ebe7e1; color: var(--text); }
.danger-button { background: #f1dddd; color: var(--danger); }
.session-topline, .workspace-heading, .invite-row, .action-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.room-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 900; padding: 9px 12px; border-radius: 10px; background: var(--surface-soft); border: 1px solid var(--border); }
.advisor-tools { margin: 22px 0 26px; padding: 18px; border-radius: 16px; background: var(--surface-soft); border: 1px solid var(--border); }
.advisor-tools label { display: block; margin-bottom: 8px; font-size: .85rem; font-weight: 800; }
.invite-row { align-items: stretch; }
.invite-row input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: white; }
.action-row { justify-content: flex-end; margin-top: 12px; }
.workspace-heading { margin: 24px 0 14px; align-items: flex-end; }
.selection-counter { padding: 8px 11px; border-radius: 10px; background: #ebe7e1; font-size: .85rem; font-weight: 800; white-space: nowrap; }
.card-grid, .selected-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px; }
.card { position: relative; min-width: 0; border: 2px solid transparent; border-radius: 14px; overflow: hidden; background: #f1eee9; aspect-ratio: 2 / 3; padding: 0; cursor: pointer; box-shadow: 0 3px 12px rgba(45, 39, 31, .06); transition: transform .15s ease, border-color .15s ease, opacity .15s ease; }
.card:hover { transform: translateY(-2px); }
.card img { width: 100%; height: 100%; display: block; object-fit: cover; }
.card .card-number { position: absolute; top: 7px; left: 7px; min-width: 25px; height: 25px; display: grid; place-items: center; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.88); color: #28251f; font-size: .75rem; font-weight: 900; }
.card.selected { border-color: var(--accent); opacity: .58; }
.card.readonly { cursor: default; }
.card.readonly:hover { transform: none; }
.selected-section { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); }
.selected-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 160px)); }
.selected-card { position: relative; }
.selected-card .selection-order { position: absolute; right: 7px; top: 7px; background: var(--accent); color: white; border-radius: 999px; padding: 5px 8px; font-size: .72rem; font-weight: 900; }
.selected-card.client-editable { cursor: pointer; }
.empty-state { grid-column: 1 / -1; padding: 28px; text-align: center; border: 1px dashed var(--border); border-radius: 14px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: min(560px, calc(100% - 32px)); padding: 11px 15px; border-radius: 12px; background: #27241f; color: white; box-shadow: var(--shadow); font-weight: 700; }

@media (max-width: 720px) {
  .app-shell { width: min(100% - 18px, 1180px); padding-top: 18px; }
  .hero { align-items: center; }
  .set-grid { grid-template-columns: 1fr; }
  .session-topline, .workspace-heading { align-items: flex-start; }
  .invite-row, .action-row, .install-actions { flex-direction: column; align-items: stretch; }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .selected-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .account-bar { flex-direction: column; }
  .trial-card { align-items: flex-start; }
}

@media (max-width: 420px) {
  .hero { flex-direction: column; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
