:root {
  --bg: #0c0c0e;
  --panel: #151518;
  --panel2: #1c1c21;
  --line: #26262d;
  --text: #f3f1ec;
  --muted: #8d8b94;
  --accent: #ff9f1c;
  --accent-ink: #1a1206;
  --green: #30d158;
  --red: #ff453a;
  --blue: #64a8ff;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  min-height: 100dvh; overscroll-behavior-y: none;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--red); min-height: 1.2em; font-size: 14px; }
h1 { font-size: 30px; letter-spacing: -0.02em; margin: 0; font-weight: 750; }
h2 { margin: 0; }
h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.eyebrow { margin: 0 0 2px; font-size: 13px; color: var(--accent); text-transform: capitalize; font-weight: 600; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; width: 100%; outline: none; -webkit-appearance: none; appearance: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }
select { background-image: none; }

.btn { font: inherit; font-weight: 650; border: 0; border-radius: 12px; padding: 12px 16px; cursor: pointer; color: var(--text); background: var(--panel2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.sm { padding: 10px 14px; }
.btn.block { width: 100%; }
.btn:active { transform: scale(.98); }
.row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.row .btn { flex: 1; }

/* login */
.screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-box { width: 100%; max-width: 340px; text-align: center; }
.login-box form { display: grid; gap: 12px; margin-top: 24px; }
.logo { width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 16px; display: grid; place-items: center; font-size: 38px; font-weight: 800; background: var(--accent); color: var(--accent-ink); }

/* layout */
main { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-t) + 18px) 18px calc(var(--safe-b) + 150px); }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: 13px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.empty { color: var(--muted); text-align: center; padding: 26px 10px; }
.hint { background: #2a2110; border: 1px solid #4a3812; color: #ffd08a; padding: 12px; border-radius: 12px; font-size: 14px; margin-bottom: 8px; }

/* focus ring */
.focus-ring { position: relative; width: 58px; height: 58px; }
.focus-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.focus-ring circle { fill: none; stroke-width: 3.2; }
.focus-ring .track { stroke: var(--line); }
.focus-ring .bar { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 97.4; stroke-dashoffset: 97.4; transition: stroke-dashoffset .6s; }
.focus-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 750; font-size: 17px; }

/* status */
.status-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.status-line { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #30d15822; flex: none; }
.dot.paused { background: var(--muted); box-shadow: none; }
.chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 13px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.chip.on { color: var(--accent); border-color: var(--accent); }

/* tasks */
.add-task { display: grid; grid-template-columns: 76px 1fr 52px; gap: 8px; margin-bottom: 14px; }
.add-task #taskTitle { grid-column: 1 / -1; }
.add-task select { padding: 12px 8px; text-align: center; font-size: 14px; }
.tasks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.task { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 12px 10px; display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; align-items: center; }
.task.doing { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: none; color: var(--accent-ink); font-weight: 900; cursor: pointer; justify-self: center; }
.task.done .check { background: var(--green); border-color: var(--green); }
.t-title { font-weight: 600; }
.t-meta { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--panel2); color: var(--muted); font-weight: 600; }
.badge.p1 { color: #ffb4ad; background: #3a1715; }
.badge.warn { color: #ffd08a; background: #3a2a0f; }
.badge.doing { color: var(--accent-ink); background: var(--accent); }
.badge.goal { color: #b9d6ff; background: #14233a; }
.more { background: none; border: 0; color: var(--muted); font-size: 22px; padding: 4px 8px; cursor: pointer; }
.task-actions { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; padding-top: 6px; }
.task-actions button { font: inherit; font-size: 13px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); }

.fab { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 84px); font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 14px 22px; background: var(--green); color: #04210d; box-shadow: 0 10px 30px #0008; display: flex; gap: 8px; align-items: center; z-index: 5; white-space: nowrap; }

/* goals */
.goal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; display: grid; gap: 8px; }
.goal-head { display: flex; gap: 8px; }
.goal-head input { font-weight: 700; }
.goal .del { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 12px; width: 46px; flex: none; }

/* progreso */
.bars { display: flex; align-items: flex-end; gap: 5px; height: 120px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar-col .b { width: 100%; border-radius: 6px 6px 3px 3px; background: var(--accent); min-height: 3px; }
.bar-col .b.none { background: var(--line); }
.bar-col small { font-size: 10px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.kpi b { display: block; font-size: 24px; letter-spacing: -0.02em; }
.kpi span { font-size: 12px; color: var(--muted); }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list li { background: var(--panel2); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-right: 6px; text-transform: uppercase; }
.pill.excusa { background: #3a1715; color: #ffb4ad; }
.pill.valida { background: #0f2e19; color: #8ff0ac; }
.pill.missed, .pill.declined { background: #3a1715; color: #ffb4ad; }
.pill.done, .pill.active { background: #0f2e19; color: #8ff0ac; }
.list details summary { cursor: pointer; list-style: none; }
.list details p { margin: 6px 0 0; color: var(--muted); }
.list details p b { color: var(--text); }

.days { display: flex; gap: 6px; }
.days button { flex: 1; font: inherit; font-size: 13px; font-weight: 700; padding: 9px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); }
.days button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.toggle { display: flex; gap: 10px; align-items: center; margin: 10px 0; }
.toggle input { width: 22px; height: 22px; accent-color: var(--accent); -webkit-appearance: auto; appearance: auto; }

/* tabs */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: #0c0c0ef0; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); padding: 8px 6px calc(var(--safe-b) + 8px); z-index: 6; }
.tabs button { font: inherit; font-size: 11px; background: none; border: 0; color: var(--muted); display: grid; gap: 2px; justify-items: center; padding: 4px; }
.tabs button i { font-style: normal; font-size: 18px; }
.tabs button.on { color: var(--accent); }

/* llamada */
.call { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 40px) 22px calc(var(--safe-b) + 28px); overflow: hidden; }
.call-bg { position: absolute; inset: -20%; z-index: -1; background:
  radial-gradient(60% 45% at 30% 20%, #5a3a0c 0%, transparent 70%),
  radial-gradient(60% 50% at 80% 70%, #2b1d3d 0%, transparent 70%), #0b0a0d;
  filter: blur(10px); animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(-3%, 4%) scale(1.06); } }
.call-head { text-align: center; }
.avatar { width: 108px; height: 108px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 48px; font-weight: 800; position: relative; }
.avatar.ring::before, .avatar.ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: ring 1.8s ease-out infinite; }
.avatar.ring::after { animation-delay: .9s; }
.avatar.speaking { animation: talk .5s ease-in-out infinite alternate; }
@keyframes ring { from { transform: scale(1); opacity: .8; } to { transform: scale(1.8); opacity: 0; } }
@keyframes talk { to { box-shadow: 0 0 0 10px #ff9f1c33; } }
.call-head h2 { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; }
.incoming { margin-top: auto; display: flex; justify-content: space-around; padding-bottom: 20px; }
.call-btn-wrap { display: grid; justify-items: center; gap: 8px; font-size: 14px; }
.round { width: 76px; height: 76px; border-radius: 50%; border: 0; font-size: 30px; color: #fff; cursor: pointer; }
.round.sm { width: 60px; height: 60px; font-size: 22px; margin: 10px auto 0; display: block; }
.round.green { background: var(--green); }
.round.red { background: var(--red); }
.round.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.incall { margin-top: 18px; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.transcript { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 2px 10px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 16px; }
.msg.mentor { background: #ffffff14; align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.user { background: var(--accent); color: var(--accent-ink); align-self: flex-end; border-bottom-right-radius: 6px; font-weight: 550; }
.thinking { display: flex; gap: 5px; padding: 8px 14px; }
.thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .2; } }
.reply { display: grid; grid-template-columns: 48px 1fr 48px; gap: 8px; }
.reply input { border-radius: 999px; background: #ffffff14; border-color: transparent; }
.mic, .send { border: 0; border-radius: 50%; font-size: 20px; background: #ffffff1a; color: var(--text); }
.mic.rec { background: var(--red); animation: pulse 1s infinite; }
.send { background: var(--accent); color: var(--accent-ink); }

.toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 150px); transform: translateX(-50%); background: #2a2a30; color: var(--text); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 60; box-shadow: 0 8px 24px #0008; max-width: 90vw; text-align: center; }
.pill.focus, .pill.wake { background: #2a2110; color: #ffd08a; }
.pill.app { background: #3a1715; color: #ffb4ad; }
.steps { padding-left: 20px; font-size: 14px; margin: 12px 0 0; }
.steps li { margin: 6px 0; }
#hookUrl { font-size: 12px; }
