/* Taylls OS shell — visual tokens from Taylls app (colors.dart). Author: Taylls */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
:root {
  --bg: #111111;
  --surface: #1a1a1a;
  --border: #2a2a2a;
  --text: #ffffff;
  --muted: #aaaaaa;
  --purple: #7b4dd7;
  --purple-mid: #5a3391;
  --purple-deep: #2a1548;
  --tells: #7b5ef8;
  --danger: #ff1f1f;
  --glass: rgba(255, 243, 243, 0.3);
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; }

#boot {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--purple-mid) 48%, var(--bg) 100%);
  z-index: 40; transition: opacity .5s ease;
}
#boot.gone { opacity: 0; pointer-events: none; }
.boot-inner { width: 100%; max-width: 620px; }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.mark {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 22px; color: #fff;
  background: linear-gradient(145deg, var(--purple), var(--purple-mid));
  box-shadow: 0 8px 28px rgba(123, 77, 215, .45);
}
.brand h1 { margin: 0; font-size: 22px; letter-spacing: .04em; font-weight: 700; color: #fff; }
.tagline { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--tells), var(--purple));
  transition: width .45s ease;
}
.pct { margin: 10px 0 18px; font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.pct .sep { opacity: .4; margin: 0 6px; }

.steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.steps li i {
  width: 14px; height: 14px; flex: 0 0 14px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.25);
}
.steps li.active { color: #fff; }
.steps li.active i { border-color: var(--purple); box-shadow: 0 0 10px rgba(123,77,215,.7); animation: pulse 1.1s infinite; }
.steps li.done { color: #d7c7ff; }
.steps li.done i { background: var(--purple); border-color: var(--purple); }
.steps li.fail i { background: var(--danger); border-color: var(--danger); }
.steps li.fail { color: #ffb4b4; }
@keyframes pulse { 50% { box-shadow: 0 0 3px rgba(123,77,215,.25); } }

.console {
  background: rgba(0,0,0,.35); border: 1px solid var(--border); border-radius: 12px;
  margin: 0 0 14px; padding: 12px; max-height: 168px; overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; line-height: 1.55; color: #d0d0d0;
  white-space: pre-wrap; word-break: break-word;
}
.console:empty { display: none; }
.boot-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.fineprint { font-size: 11.5px; color: var(--muted); margin: 12px 0 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

.ghost, .solid, .danger, .voice-btn {
  border-radius: 999px; padding: 11px 16px; cursor: pointer; font-size: 13px; border: none;
}
.ghost {
  background: var(--glass); color: #fff;
  border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(12px);
}
.solid {
  background: linear-gradient(140deg, var(--purple), var(--tells));
  color: #fff; font-weight: 700;
}
.solid[disabled], .ghost[disabled], .voice-btn[disabled] { opacity: .45; cursor: default; }
.danger { background: transparent; border: 1px solid var(--danger); color: #ffb4b4; }
.voice-btn {
  background: var(--purple-deep); color: #fff;
  border: 1px solid rgba(123,77,215,.55);
}
.voice-btn.listening {
  background: var(--purple); animation: pulse 1s infinite;
}

#os { display: flex; flex-direction: column; height: 100%;
  background: linear-gradient(180deg, #111 0%, #1a1028 42%, #111 100%); }
#os[hidden] { display: none; }
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: rgba(17,17,17,.82); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px); font-size: 12px;
}
.tb-brand { color: #fff; font-weight: 700; letter-spacing: .04em; }
.tb-dev { color: var(--muted); }
.tb-spacer { flex: 1; }
.tb-root {
  color: #fff; background: var(--purple); border-radius: 999px;
  padding: 3px 10px; font-size: 11px;
}
.tb-root.off { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.tb-clock { color: #fff; font-variant-numeric: tabular-nums; }
#micBtn { margin-left: 4px; }

.stage {
  flex: 1; overflow: auto; padding: 14px; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-content: start;
}

.win {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
}
.win > h2 {
  margin: 0; padding: 12px 14px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: #d7c7ff; background: #151515; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.win > h2 .x { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 16px; }
.win .body { padding: 14px; font-size: 14px; color: #eee; }
.kv { display: grid; grid-template-columns: 118px 1fr; gap: 8px 10px; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { color: #fff; word-break: break-word; }

.dock {
  display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  overflow-x: auto; background: rgba(17,17,17,.92); border-top: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
.dock button {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  color: #fff; border-radius: 14px; padding: 10px 14px; white-space: nowrap; cursor: pointer;
}
.dock button:hover, .dock button.active {
  border-color: var(--purple); background: rgba(123,77,215,.22); color: #fff;
}

.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--purple); color: #fff;
  padding: 10px 14px; border-radius: 12px; font-size: 13px; z-index: 50;
  max-width: min(90vw, 420px);
}
.toast[hidden] { display: none; }

.grid-apps { display: grid; gap: 10px; }
.app {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: #151515;
}
.app .nm { font-weight: 600; }
.app .ds { color: var(--muted); font-size: 12px; margin-top: 4px; }
.grow { flex: 1; min-width: 0; }
.pill {
  display: inline-block; font-size: 10px; letter-spacing: .04em; text-transform: uppercase;
  border-radius: 999px; padding: 2px 8px; margin-left: 6px;
}
.pill.on { background: var(--purple); color: #fff; }
.pill.off { background: #2a2a2a; color: var(--muted); }
.pill.free { background: rgba(123,77,215,.25); color: #d7c7ff; }
.pill.source-only, .pill.planned { background: #2a2a2a; color: var(--muted); }

.field {
  width: 100%; background: #1c1c1c; border: 1px solid #3f3f3f; border-radius: 12px;
  color: #fff; padding: 12px; font: inherit; margin: 8px 0 12px; resize: vertical; min-height: 88px;
}
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tips { margin: 8px 0; padding-left: 18px; color: var(--muted); }
.tips li { margin: 6px 0; }
.note { color: var(--muted); font-size: 13px; line-height: 1.45; }
.bridge {
  display: block; margin-top: 10px; padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(140deg, var(--purple-deep), var(--purple-mid));
  color: #fff; text-decoration: none; font-weight: 600; text-align: center;
}
.voice-hint {
  font-size: 12px; color: var(--muted); margin-top: 8px;
}
.voice-panel {
  margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: rgba(123,77,215,.12); border: 1px solid rgba(123,77,215,.35);
  font-size: 12px; color: #d7c7ff;
}
.term-form {
  display: flex; gap: 8px; align-items: center; margin: 8px 0 12px;
}
.term-prompt { color: var(--purple); flex: 0 0 auto; }
.term-in {
  flex: 1; min-height: 0; margin: 0; resize: none; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.term-out { max-height: 280px; min-height: 140px; display: block; }
