:root {
  color-scheme: dark;
  --bg: #0d0f13;
  --panel: rgba(25, 28, 35, .82);
  --panel-solid: #191c23;
  --panel-soft: #222630;
  --text: #f6f3ec;
  --muted: #999fab;
  --line: rgba(255, 255, 255, .08);
  --accent: #ff754c;
  --accent-2: #ffae58;
  --green: #52d68b;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow-x: hidden; }
button, textarea, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }

.ambient { position: fixed; border-radius: 999px; filter: blur(80px); opacity: .18; pointer-events: none; }
.ambient-a { width: 260px; height: 260px; background: var(--accent); top: -130px; right: -80px; }
.ambient-b { width: 240px; height: 240px; background: #7b5cff; left: -140px; bottom: 10%; opacity: .1; }

.app { width: min(760px, 100%); min-height: 100dvh; margin: auto; padding: env(safe-area-inset-top) 16px calc(106px + env(safe-area-inset-bottom)); position: relative; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; background: linear-gradient(var(--bg) 68%, transparent); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-weight: 900; font-size: 20px; color: #17120e; background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 8px 28px rgba(255, 117, 76, .25); }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 15px; letter-spacing: .01em; }
.brand span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); margin-right: 5px; box-shadow: 0 0 12px currentColor; }
.status-dot.online { background: var(--green); }
.icon-button, .composer-button { border: 1px solid var(--line); background: var(--panel); border-radius: 14px; width: 42px; height: 42px; display: grid; place-items: center; font-size: 22px; }

.view { display: none; animation: enter .24s ease; }
.view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }

.welcome { text-align: center; padding: 8vh 4px 150px; }
.hero-orb { width: 76px; height: 76px; border-radius: 25px; margin: 0 auto 24px; display: grid; place-items: center; color: #1c120c; font-weight: 900; font-size: 22px; background: radial-gradient(circle at 35% 25%, #ffd08b, var(--accent) 55%, #b42a17); box-shadow: 0 20px 60px rgba(255, 99, 57, .22); transform: rotate(-4deg); }
.eyebrow { color: var(--accent-2); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; margin: 0 0 10px; }
h1 { font-size: clamp(28px, 8vw, 42px); line-height: 1.05; letter-spacing: -.045em; margin: 0; }
.welcome > p:last-of-type, .section-title > p:last-child { color: var(--muted); font-size: 14px; line-height: 1.55; max-width: 520px; margin: 16px auto 28px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.quick-grid button { min-height: 92px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(35,39,49,.94), rgba(22,25,31,.88)); display: flex; flex-direction: column; justify-content: space-between; }
.quick-grid b { color: var(--accent-2); font-size: 20px; }
.quick-grid span { font-size: 13px; font-weight: 700; line-height: 1.25; }

.messages { padding: 12px 0 160px; display: flex; flex-direction: column; gap: 14px; }
.message { max-width: 88%; padding: 13px 15px; border-radius: 19px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user { align-self: flex-end; background: linear-gradient(135deg, #e55b36, var(--accent)); color: #fff; border-bottom-right-radius: 6px; }
.message.assistant { align-self: flex-start; background: var(--panel-solid); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.message.assistant p { margin: 0 0 10px; }
.message.assistant p:last-child { margin-bottom: 0; }
.message.assistant code { padding: 2px 5px; border-radius: 6px; background: #0d0f13; color: #ffd08b; }
.message.assistant pre { overflow: auto; padding: 12px; border-radius: 12px; background: #0a0c10; }
.activity { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(114px + env(safe-area-inset-bottom)); z-index: 15; background: rgba(31,34,42,.96); border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; align-items: center; gap: 4px; box-shadow: 0 12px 35px rgba(0,0,0,.35); }
.activity:not(.hidden) { display: flex; }
.activity span { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-2); animation: pulse 1s infinite alternate; }
.activity span:nth-child(2) { animation-delay: .2s; }
.activity span:nth-child(3) { animation-delay: .4s; }
.activity em { margin-left: 5px; color: var(--muted); font-size: 11px; font-style: normal; }
@keyframes pulse { to { opacity: .25; transform: translateY(-3px); } }

.composer-wrap { position: fixed; width: min(728px, calc(100% - 32px)); bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 20; padding-top: 15px; background: linear-gradient(transparent, var(--bg) 24%); }
.composer { display: flex; align-items: flex-end; gap: 7px; padding: 7px; border: 1px solid rgba(255,255,255,.11); background: rgba(28,31,38,.96); border-radius: 21px; box-shadow: 0 16px 50px rgba(0,0,0,.35); backdrop-filter: blur(18px); }
.composer textarea { flex: 1; resize: none; max-height: 128px; min-height: 42px; padding: 11px 4px; border: 0; outline: 0; background: transparent; color: var(--text); }
.composer textarea::placeholder { color: #767c87; }
.composer .composer-button { width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); }
.send-button { width: 40px; height: 40px; border: 0; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 900; font-size: 20px; }
.composer-wrap > small { display: block; color: #656b75; text-align: center; font-size: 9px; margin-top: 7px; }
.attachment-preview { margin: 0 6px 8px; padding: 10px 12px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; font-size: 12px; color: var(--muted); }

.bottom-nav { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: 0; width: min(760px, 100%); height: calc(66px + env(safe-area-inset-bottom)); padding: 7px 14px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4,1fr); background: rgba(17,19,24,.94); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
.bottom-nav button { border: 0; background: transparent; color: #777d88; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; }
.bottom-nav i { font-style: normal; font-size: 18px; height: 25px; }
.bottom-nav button.active { color: var(--accent-2); }

.section-title { padding: 24px 2px 10px; }
.section-title h1 { font-size: 34px; }
.section-title > p:last-child { margin-left: 0; margin-bottom: 22px; }
.card-list, .equipment-grid { display: grid; gap: 10px; padding-bottom: 30px; }
.session-card, .equipment-card { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 17px; text-align: left; }
.session-card { width: 100%; }
.session-card header, .equipment-card header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.session-card b, .equipment-card b { font-size: 14px; line-height: 1.35; }
.session-card time, .equipment-card small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.session-card p, .equipment-card p { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 10px 0 0; }
.session-card footer { margin-top: 12px; color: #737985; font-size: 10px; display: flex; gap: 10px; }
.chips { display: flex; gap: 7px; overflow: auto; padding: 0 0 16px; scrollbar-width: none; }
.chips button { flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: var(--panel); color: var(--muted); font-size: 11px; }
.chips button.active { background: var(--text); color: #15171c; }
.equipment-card .status { display: inline-flex; margin-top: 12px; padding: 6px 9px; border-radius: 999px; background: rgba(255,255,255,.06); font-size: 10px; }
.equipment-card .open-record { color: #ffc07b; background: rgba(255,143,74,.08); border-radius: 12px; padding: 10px; }
.equipment-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 13px; }
.equipment-actions button { border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; background: rgba(255,255,255,.04); font-size: 10px; }

.feature-list { display: grid; gap: 9px; }
.feature-list article { display: flex; align-items: center; gap: 13px; padding: 16px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.feature-list i { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: rgba(255,117,76,.1); color: var(--accent-2); font-style: normal; }
.feature-list div { flex: 1; }
.feature-list b, .feature-list span { display: block; }
.feature-list b { font-size: 13px; }
.feature-list span { color: var(--muted); font-size: 10px; margin-top: 4px; }
.feature-list em { color: var(--green); font-size: 9px; font-style: normal; }
.model-card { margin-top: 16px; padding: 20px; border-radius: 21px; background: linear-gradient(135deg, rgba(255,117,76,.16), rgba(120,82,255,.12)); border: 1px solid rgba(255,160,105,.18); }
.model-card span, .model-card strong, .model-card small { display: block; }
.model-card span { color: var(--muted); font-size: 10px; }
.model-card strong { margin: 8px 0 3px; font-size: 20px; }
.model-card small { color: var(--muted); }

.locked { min-height: 70dvh; display: grid; place-content: center; text-align: center; padding: 30px; }
.locked .lock-icon { color: var(--accent-2); font-size: 42px; margin-bottom: 20px; }
.locked h1 { font-size: 30px; }
.locked p { color: var(--muted); line-height: 1.5; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 32px); padding: 11px 14px; border-radius: 13px; background: #f4eee4; color: #17181c; font-size: 12px; box-shadow: 0 12px 45px rgba(0,0,0,.4); }

@media (min-width: 700px) {
  .quick-grid { grid-template-columns: repeat(4,1fr); }
  .equipment-grid { grid-template-columns: 1fr 1fr; }
}
