/* ============================================================================
 * Host-app shell components (PRODUCT_PLAN P-phase). Shared by the dashboard,
 * event-detail, checkout, and account pages so the dark work-surface chrome
 * lives in one place. Reads tokens; loaded by layout-app.
 * ========================================================================== */

/* Host console base. Keep the app matte; rainbow lives only in interaction states. */
html[data-theme="host"] body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), transparent 180px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 5px);
  opacity: .65;
}
html[data-theme="host"] #main { position: relative; z-index: 1; }

.wrap { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; padding: 90px 18px 80px; }
.wrap-narrow { max-width: 560px; }

.shell-head { margin: 0 0 18px; }
.shell-head h1 { margin: 0; font-size: 22px; font-weight: 750; letter-spacing: 0; }
.shell-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

.card { background: var(--elev-card), var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--shadow-sm), var(--ring-top); padding: 18px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 16px; font-weight: 700; letter-spacing: 0; }
html[data-theme="light"] .card { background: #fff; }

/* ---- UI Kit interactive layer (client console). Labels are Space Mono uppercase; inputs +
 * buttons are Space Grotesk with the kit's flat accent + crisp focus ring. These retune the
 * shared low-specificity element rules in place, so bespoke button classes still override them. ---- */
label { display: block; font-family: var(--font-mono-ui); font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin: 12px 0 6px; }
input, select, textarea { width: 100%; padding: 10px 12px; border-radius: var(--r-ctl); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14px; font-family: var(--font-ui); outline: none;
  transition: border-color var(--t-base) var(--ease-standard), box-shadow var(--t-base) var(--ease-standard); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-quiet); }
input::placeholder, textarea::placeholder { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: flex-end; }
.row > div { flex: 1; }

button { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: var(--r-ctl); padding: 10px 16px; font-size: 14px;
  font-family: var(--font-ui); font-weight: 500; line-height: 1; color: #fff; background: var(--accent);
  transition: background var(--t-base) var(--ease-standard), border-color var(--t-base) var(--ease-standard),
    color var(--t-base) var(--ease-standard), transform var(--t-fast) var(--ease-standard); }
button:hover { background: var(--accent-hi); }
button:active { background: var(--accent-lo); transform: translateY(1px); }
button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
button:disabled { opacity: .4; cursor: not-allowed; transform: none; }
button.ghost { background: transparent; color: var(--text); border-color: var(--border); }
button.ghost:hover { background: var(--surface-2); border-color: var(--border); }
button.danger { background: transparent; color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, transparent); }
button.danger:hover { background: color-mix(in srgb, var(--err) 13%, transparent); }
html[data-theme="light"] button.danger { color: var(--err); border-color: rgba(217,69,63,.4); }
button.small { padding: 7px 12px; font-size: 13px; }

.events { display: flex; flex-direction: column; gap: 10px; }
.ev { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--border);
  border-radius: var(--r-card); background: var(--elev-card), var(--surface); box-shadow: var(--ring-top);
  cursor: pointer; text-decoration: none; color: inherit;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast); }
.ev:hover { border-color: var(--border-2); transform: translateY(-1px); box-shadow: var(--shadow-sm), var(--ring-top); }
.ev img, .ev .noimg { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.ev .meta { min-width: 0; flex: 1; }
.ev .name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .info { font-size: 12px; color: var(--muted); margin-top: 2px; }

.pill { display: inline-block; padding: 3px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase; }
.pill.live { background: rgba(66,212,131,.11); color: var(--ok); border: 1px solid rgba(66,212,131,.22); }
.pill.draft { background: rgba(255,255,255,.055); color: var(--muted); border: 1px solid var(--border); }
.pill.suspended { background: rgba(239,185,90,.11); color: var(--warn); border: 1px solid rgba(239,185,90,.28); }
.pill.ended, .pill.archived { background: rgba(239,107,97,.11); color: #ff9f98; border: 1px solid rgba(239,107,97,.24); }
html[data-theme="light"] .pill.ended, html[data-theme="light"] .pill.archived { color: var(--err); }
.pill.role { background: rgba(76,125,240,.12); color: var(--accent-2); border: 1px solid rgba(76,125,240,.22); }

.secret { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--surface-2);
  border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; margin: 6px 0; word-break: break-all; }
.note { font-size: 12px; color: var(--muted); line-height: 1.5; }
a { color: var(--accent); }

.back { background: none; border: none; color: var(--accent); font-size: 14px; font-weight: 650; padding: 0; margin-bottom: 14px; cursor: pointer; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; }

.queue { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.qitem { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface-2); }
.qitem img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; cursor: pointer; }
.qitem .qmeta { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); }
.qitem .qbtns { display: flex; gap: 6px; flex: none; }

/* onboarding card */
.onboard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 20px; margin-bottom: 16px; position: relative; box-shadow: var(--ring-top); }
.onboard h2 { margin: 0 0 4px; font-size: 18px; }
.onboard ol { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.onboard .dismiss { position: absolute; top: 12px; right: 12px; background: none; color: var(--muted); padding: 4px 8px; width: auto; }

/* checkout (light money page) */
.co-line { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.co-line:last-of-type { border-bottom: none; }
.co-line .k { color: var(--muted); }
.co-line .v { font-weight: 650; }
.co-total { display: flex; justify-content: space-between; padding: 14px 0 4px; font-size: 17px; font-weight: 750; }
.co-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.co-actions button { width: 100%; padding: 14px; }
.co-safe { text-align: center; font-size: 12px; color: var(--muted); margin-top: 14px; }

/* ============================================================================
 * UI Kit — .ts-btn family, dark client console only ([data-theme="host"]). Flat accent,
 * no gradient/glow, Space Grotesk, the kit's hover/active/focus. Marketing + light pages keep
 * their own .ts-btn look (they're not [data-theme="host"]).
 * ========================================================================== */
[data-theme="host"] .ts-btn { font-family: var(--font-ui); font-weight: 500; font-size: 14px; letter-spacing: 0;
  border-radius: var(--r-ctl); padding: 10px 16px; border: 1px solid transparent; position: relative;
  transition: background var(--t-base) var(--ease-standard), border-color var(--t-base) var(--ease-standard),
    color var(--t-base) var(--ease-standard), transform var(--t-fast) var(--ease-standard); }
[data-theme="host"] .ts-btn:active { transform: translateY(1px); }
[data-theme="host"] .ts-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
[data-theme="host"] .ts-btn--primary { background: var(--accent); color: #fff; box-shadow: none; }
[data-theme="host"] .ts-btn--primary:hover { background: var(--accent-hi); filter: none; }
[data-theme="host"] .ts-btn--primary:active { background: var(--accent-lo); }
[data-theme="host"] .ts-btn--ghost { background: transparent; color: var(--text); border-color: var(--border); box-shadow: none; }
[data-theme="host"] .ts-btn--ghost:hover { background: var(--surface-2); border-color: var(--border); }
