:root {
  color-scheme: dark;
  --bg: #0f1116;
  --panel: #171b23;
  --panel-2: #1d2330;
  --text: #eff3f8;
  --muted: #9ea8b8;
  --line: #2a3241;
  --accent: #7dd3fc;
  --accent-2: #38bdf8;
  --danger: #fb7185;
  --success: #34d399;
  --shadow: 0 10px 40px rgba(0,0,0,0.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; background: radial-gradient(circle at top, #151a25 0%, var(--bg) 55%); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
.shell { width: min(920px, calc(100vw - 32px)); margin: 0 auto; padding: 24px 0 40px; display: grid; gap: 14px; }
.narrow-shell { width: min(760px, calc(100vw - 32px)); }
.admin-shell { width: min(1240px, calc(100vw - 32px)); }
.panel { background: rgba(23,27,35,0.92); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 20px; backdrop-filter: blur(10px); }
.inset-panel { background: rgba(29,35,48,0.86); }
.hero-panel h1 { margin: 10px 0 8px; font-size: clamp(1.9rem, 6vw, 2.7rem); line-height: 1.05; }
.hero-panel.compact h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.hero-badge { display: inline-block; padding: 8px 12px; border-radius: 999px; background: rgba(125,211,252,0.12); color: var(--accent); font-size: 0.85rem; letter-spacing: 0.02em; }
.hero-copy { margin: 0; max-width: 44rem; }
.brand-lockup { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.brand-mark { width: 62px; height: 62px; border-radius: 18px; display: block; flex: 0 0 auto; box-shadow: 0 14px 28px rgba(0,0,0,0.22); }
.brand-copy { min-width: 0; }
.brand-copy h1 { margin-top: 12px; }
.brand-copy .hero-copy { max-width: 38rem; }
.brand-lockup.compact { gap: 12px; }
.brand-lockup.compact .brand-mark { width: 50px; height: 50px; border-radius: 14px; }
.brand-lockup.compact .brand-copy h1 { margin-top: 10px; }
.subtle { color: var(--muted); }
.small { font-size: 0.9rem; }
.hidden { display: none !important; }
.actions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.action-card { min-height: 88px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(180deg, rgba(29,35,48,0.98) 0%, rgba(23,27,35,0.98) 100%); color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 14px; text-align: left; transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, opacity 140ms ease; }
.action-card:hover { transform: translateY(-2px); border-color: rgba(125,211,252,0.55); box-shadow: 0 18px 36px rgba(0,0,0,0.22); }
.action-card:disabled { opacity: 0.6; cursor: wait; transform: none; box-shadow: none; }
.action-icon { font-size: 1.9rem; flex: 0 0 auto; }
.action-copy { display: grid; gap: 4px; }
.action-label { font-size: 1.05rem; font-weight: 700; }
.action-note { font-size: 0.92rem; color: var(--muted); }
.recorder-panel, .result-panel { display: grid; gap: 14px; }
.recorder-header { justify-content: space-between; }
.inline-row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.space-between { justify-content: space-between; }
.gap-md { gap: 12px; }
.text-input, .textarea-input, .link-output, .select-input { width: 100%; padding: 12px 14px; background: #0f141d; color: var(--text); border: 1px solid var(--line); border-radius: 14px; outline: none; }
.textarea-input { resize: vertical; min-height: 120px; }
.link-output { font-size: 0.95rem; }
.button-primary, .button-secondary, .button-danger, .link-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1px solid transparent; border-radius: 14px; text-decoration: none; cursor: pointer; }
.button-primary { background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%); color: #06121a; font-weight: 700; }
.button-secondary { background: rgba(255,255,255,0.03); color: var(--text); border-color: var(--line); }
.button-danger { background: rgba(251,113,133,0.12); color: #ffd6dd; border-color: rgba(251,113,133,0.35); }
.pill { display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border-radius: 999px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); }
.status-panel { transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease; }
.status-panel[data-state="working"] { border-color: rgba(125,211,252,0.55); box-shadow: 0 0 0 1px rgba(125,211,252,0.16), var(--shadow); }
.status-panel[data-state="success"] { border-color: rgba(52,211,153,0.5); box-shadow: 0 0 0 1px rgba(52,211,153,0.14), var(--shadow); }
.status-panel[data-state="error"] { border-color: rgba(251,113,133,0.45); box-shadow: 0 0 0 1px rgba(251,113,133,0.12), var(--shadow); }
.status-text { font-weight: 700; font-size: 1rem; }
.status-error { color: #ffd6dd; font-weight: 700; }
.result-header { display: grid; gap: 4px; }
.form-grid { display: grid; gap: 12px; }
.section-title { margin: 0 0 6px; }
.key-help { margin: 0; }
.admin-key-panel { display: grid; gap: 12px; }
.admin-toolbar { margin-top: 14px; }
.admin-key-actions { justify-content: flex-start; }
.admin-grid { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.objects-list { display: grid; gap: 10px; max-height: 70vh; overflow: auto; }
.objects-list:empty::before { content: "No objects yet."; color: var(--muted); }
.object-card { width: 100%; text-align: left; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: #0f141d; color: var(--text); cursor: pointer; }
.object-card.active { border-color: rgba(125,211,252,0.55); }
.object-card small { display: block; color: var(--muted); margin-top: 4px; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.meta-item { padding: 10px 12px; border-radius: 14px; background: #0f141d; border: 1px solid var(--line); }
.inspect-render img { max-width: 100%; border-radius: 18px; display: block; }
.inspect-render audio { width: 100%; }
.inspect-render { margin-top: 16px; }
.viewer-media img { display: block; max-width: 100%; width: auto; height: auto; max-height: min(78vh, 960px); margin: 0 auto; border-radius: 18px; object-fit: contain; }
.viewer-media audio { width: 100%; }
.site-footer { text-align: center; padding: 2px 4px 10px; }
.footer-inline { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.footer-link { color: var(--muted); text-decoration: none; font-size: 0.86rem; }
.footer-link:hover { color: var(--text); text-decoration: underline; }
.footer-divider { color: var(--muted); font-size: 0.82rem; }
.terms-panel { display: grid; gap: 18px; }
.terms-block { display: grid; gap: 8px; }
.terms-block h2 { margin: 0; font-size: 1.02rem; }
.terms-block p { margin: 0; color: var(--text); line-height: 1.6; }
.terms-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text); }

@media (max-width: 820px) {
  .actions-grid, .admin-grid { grid-template-columns: 1fr; }
  .shell, .narrow-shell, .admin-shell { width: min(100vw - 24px, 100%); }
  .admin-toolbar > .inline-row:first-child { width: 100%; }
}
@media (max-width: 640px) {
  .shell { padding-top: 18px; padding-bottom: 28px; }
  .brand-lockup { grid-template-columns: 1fr; justify-items: start; }
  .brand-mark { width: 54px; height: 54px; border-radius: 16px; }
  .brand-lockup.compact .brand-mark { width: 46px; height: 46px; border-radius: 14px; }
  .panel { padding: 16px; border-radius: 20px; }
  .hero-panel h1 { font-size: clamp(1.7rem, 8vw, 2.2rem); }
  .action-card { min-height: 76px; padding: 14px 16px; gap: 12px; }
  .action-icon { font-size: 1.65rem; }
  .action-label { font-size: 1rem; }
  .action-note { font-size: 0.86rem; }
  .button-primary, .button-secondary, .button-danger, .link-button { width: 100%; }
  .admin-key-actions, .admin-toolbar { width: 100%; }
  .admin-toolbar > .inline-row:first-child { width: 100%; }
  .select-input { min-width: 0; }
  .meta-grid { grid-template-columns: 1fr; }
  .site-footer { padding-bottom: 2px; }
}
