/* salman.ai — game-style UI (Duolingo-like palette) */
:root {
  --green: #58CC02; --green-d: #58A700; --green-l: #D7FFB8;
  --blue: #1CB0F6; --blue-d: #1899D6; --blue-l: #DDF4FF; --blue-b: #84D8FF;
  --yellow: #FFC800; --yellow-d: #E5B400; --yellow-l: #FFF4CC;
  --orange: #FF9600; --orange-d: #E08A00; --orange-l: #FFF5E5;
  --red: #FF4B4B; --red-d: #EA2B2B; --red-l: #FFDFE0;
  --purple: #CE82FF; --purple-d: #A568CC;
  --text: #4B4B4B; --muted: #777777; --faint: #AFAFAF; --line: #E5E5E5; --line-d: #CECECE; --bg: #FFFFFF;
  --r: 16px;
  --font: Nunito, "Trebuchet MS", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-weight: 700; -webkit-tap-highlight-color: transparent; }
body { padding-top: env(safe-area-inset-top, 0px); }
button, input, select, textarea { font-family: inherit; font-weight: 700; color: inherit; }
a { color: var(--blue-d); }
button svg, a svg { width: 22px; height: 22px; flex: 0 0 auto; }
h1, h2, h3 { margin: 0; font-weight: 900; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 17px; }
p { margin: 0; line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
code, .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.code { background: #F7F7F7; border: 2px solid var(--line); border-radius: 12px; padding: 12px; white-space: pre-wrap; word-break: break-all; margin: 8px 0; }

/* ---------- Animations ---------- */
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes bounceX { 0%,100% { transform: translate(-50%,0); } 50% { transform: translate(-50%,-6px); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 70% { transform: scale(.94); } 100% { transform: scale(1); } }
@keyframes floatUp { 0% { transform: translate(-50%,0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(-50%,-60px); opacity: 0; } }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fall { 0% { transform: translateY(-20px) rotate(0); opacity: 1; } 100% { transform: translateY(105vh) rotate(720deg); opacity: .9; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
@keyframes dots { 0%,80%,100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
.bob { animation: bob 2.4s ease-in-out infinite; }
.pop { animation: pop .5s ease-out; }
.wiggle { animation: wiggle .5s ease-in-out 3; }
.shake { animation: shake .4s ease-in-out; }
.fade-in { animation: fadeIn .35s ease-out both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- Chunky buttons ---------- */
.btn { --c: var(--green); --s: var(--green-d); --t: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border: none; border-radius: var(--r); background: var(--c); color: var(--t); box-shadow: 0 4px 0 var(--s);
  font-size: 15px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: transform .08s, box-shadow .08s, filter .15s; user-select: none; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--s); }
.btn:disabled { --c: var(--line); --s: var(--line-d); --t: var(--faint); cursor: not-allowed; }
.btn-green { --c: var(--green); --s: var(--green-d); }
.btn-blue { --c: var(--blue); --s: var(--blue-d); }
.btn-orange { --c: var(--orange); --s: var(--orange-d); }
.btn-red { --c: var(--red); --s: var(--red-d); }
.btn-ghost { --c: #fff; --s: var(--line); --t: var(--blue); border: 2px solid var(--line); }
.btn-ghost-muted { --c: #fff; --s: var(--line); --t: var(--muted); border: 2px solid var(--line); }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 13px; border-radius: 12px; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 2px solid var(--line); background: #fff; box-shadow: 0 3px 0 var(--line); cursor: pointer; color: var(--muted); transition: transform .08s, box-shadow .08s; }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.icon-btn svg { width: 22px; height: 22px; }

/* Selectable chips / options */
.opt { min-height: 48px; padding: 0 16px; border-radius: var(--r); border: 2px solid var(--line); background: #fff; box-shadow: 0 4px 0 var(--line); cursor: pointer; font-size: 15px; font-weight: 800; color: var(--text); text-align: left; transition: transform .08s, box-shadow .08s; }
.opt:active { transform: translateY(4px); box-shadow: 0 0 0 var(--line); }
.opt.on { background: var(--blue-l); border-color: var(--blue-b); box-shadow: 0 4px 0 var(--blue-b); color: var(--blue); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .opt { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 999px; }
.seg { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 8px; }
.seg .opt { text-align: center; padding: 0 6px; }

/* ---------- Cards, bars ---------- */
.card { border: 2px solid var(--line); border-radius: 18px; padding: 18px; background: #fff; }
.card + .card { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.bar { position: relative; height: 16px; border-radius: 8px; background: var(--line); overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; background: var(--yellow); transition: width .6s cubic-bezier(.3,1.6,.5,1); }
.bar > i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 4px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.35); }
.bar > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; color: var(--text); }
.bar.lg { height: 20px; border-radius: 10px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: #F2F2F2; font-size: 12px; font-weight: 800; color: var(--muted); }
.alert { padding: 12px 14px; border-radius: 14px; background: var(--red-l); color: #B3261E; font-weight: 800; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; font-weight: 900; color: var(--text); }
.field small { color: var(--muted); font-weight: 700; font-size: 12px; }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 50px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--line); background: #F7F7F7; font-size: 16px; font-weight: 700; outline: none; transition: border-color .15s, background .15s; }
.field textarea, textarea.input { padding: 12px 14px; min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue-b); background: #fff; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex: 0 0 250px; border-right: 2px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; }
.brand b { font-size: 27px; font-weight: 900; color: var(--green); letter-spacing: -.02em; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 14px; border-radius: 14px; border: 2px solid transparent; text-decoration: none; color: var(--muted); font-weight: 900; font-size: 15px; letter-spacing: .05em; text-transform: uppercase; }
.nav a:hover { background: #F7F7F7; }
.nav a.on { background: var(--blue-l); border-color: var(--blue-b); color: var(--blue); }
.nav svg { width: 28px; height: 28px; flex: 0 0 auto; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 2px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 20; }
.stats { display: flex; align-items: center; gap: 16px; }
.stat { display: inline-flex; align-items: center; gap: 5px; font-weight: 900; font-size: 17px; white-space: nowrap; flex: 0 0 auto; }
.stat svg { flex: 0 0 auto; }
.stat svg { width: 24px; height: 24px; }
.stat.streak { color: var(--orange); } .stat.xp { color: var(--yellow-d); } .stat.bal { color: var(--blue); }
.stat.off { color: var(--faint); }
.view { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 24px 120px; }
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 2px solid var(--line); padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px)); gap: 4px; }
.tabbar a { flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 14px; border: 2px solid transparent; text-decoration: none; color: var(--faint); font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.tabbar a.on { background: var(--blue-l); border-color: var(--blue-b); color: var(--blue); }
.tabbar svg { width: 26px; height: 26px; }
@media (max-width: 999px) {
  .sidebar { display: none; }
  .topbar { display: flex; }
  .tabbar { display: flex; }
  .view { padding: 18px 16px 110px; }
}

/* ---------- Today ---------- */
.today { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
@media (max-width: 1199px) { .today { grid-template-columns: minmax(0, 1fr); } }
.rail { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 24px; }
@media (max-width: 1199px) { .rail { position: static; } .rail .stats { display: none; } }
.unit { border-radius: 18px; background: var(--green); box-shadow: 0 5px 0 var(--green-d); color: #fff; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.unit small { font-size: 13px; font-weight: 900; letter-spacing: .06em; opacity: .92; text-transform: uppercase; }
.unit .title { font-size: 21px; font-weight: 900; line-height: 1.25; }
.unit .ubtn { min-height: 46px; padding: 0 16px; border-radius: 14px; border: 2px solid #89E219; background: var(--green); box-shadow: 0 4px 0 var(--green-d); color: #fff; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; transition: transform .08s, box-shadow .08s; }
.unit .ubtn:active { transform: translateY(4px); box-shadow: 0 0 0 transparent; }
.unit .ubtn svg { width: 20px; height: 20px; }
.brief { display: flex; gap: 14px; align-items: flex-start; }
.bubble { position: relative; flex: 1; padding: 14px 16px; border: 2px solid var(--line); border-radius: 18px; background: #fff; line-height: 1.5; }
.bubble::before { content: ""; position: absolute; left: -10px; top: 22px; width: 16px; height: 16px; background: #fff; border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(45deg); }

.path { position: relative; display: flex; flex-direction: column; align-items: center; gap: 46px; padding: 60px 0 30px; }
.node-row { display: flex; align-items: center; gap: 16px; width: 340px; max-width: 100%; transition: transform .3s; }
.node-wrap { position: relative; width: 78px; height: 78px; flex: 0 0 auto; }
.node { position: relative; width: 78px; height: 78px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .08s, box-shadow .08s; }
.node svg { width: 36px; height: 36px; }
.node.done { background: var(--yellow); box-shadow: 0 7px 0 var(--yellow-d); color: #A07800; }
.node.current { background: var(--green); box-shadow: 0 7px 0 var(--green-d); color: #fff; }
.node.todo { background: var(--line); box-shadow: 0 7px 0 var(--line-d); color: var(--faint); }
.node:active { transform: translateY(7px); box-shadow: 0 0 0 transparent; }
.node-wrap .ring { position: absolute; inset: 0; border-radius: 50%; background: var(--green); animation: pulse 1.6s ease-out infinite; }
.node-wrap .start { position: absolute; left: 50%; top: -50px; padding: 8px 14px; border-radius: 12px; background: #fff; border: 2px solid var(--line); color: var(--green); font-weight: 900; font-size: 14px; letter-spacing: .06em; white-space: nowrap; animation: bounceX 1.2s ease-in-out infinite; }
.node-wrap .start::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px; margin-left: -6px; background: #fff; border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(45deg); }
.node-label { min-width: 0; text-align: left; background: none; border: none; padding: 6px 0; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.node-label small { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: .03em; }
.node-label b { font-size: 17px; font-weight: 900; color: var(--text); line-height: 1.25; }
.node-label.done b { color: var(--faint); text-decoration: line-through; }
.node-label .slip { color: var(--orange); }
.xp-float { position: absolute; left: 50%; top: -6px; font-weight: 900; font-size: 20px; color: var(--yellow-d); white-space: nowrap; pointer-events: none; animation: floatUp .9s ease-out forwards; z-index: 5; }
.path-mascot { position: absolute; right: 0; top: 470px; width: 110px; }
@media (max-width: 559px) { .node-row { width: 290px; } .stats { gap: 12px; } .stat { font-size: 15px; } }
@media (max-width: 700px) { .path-mascot { display: none; } }
.empty { text-align: center; padding: 30px 10px; display: flex; flex-direction: column; align-items: center; gap: 14px; }

.quest { display: flex; align-items: center; gap: 12px; }
.quest svg { width: 34px; height: 34px; flex: 0 0 auto; }
.quest .grow { display: flex; flex-direction: column; gap: 6px; }

/* ---------- Coach ---------- */
.coach { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100vh - 150px); }
.coach-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid var(--line); }
.msgs { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 18px 0; }
.msg { display: flex; gap: 10px; align-items: flex-end; animation: fadeIn .3s ease-out both; }
.msg .av { width: 44px; height: 48px; flex: 0 0 auto; }
.msg .txt { max-width: 82%; padding: 12px 15px; border-radius: 18px; border: 2px solid var(--line); background: #fff; line-height: 1.5; font-size: 15.5px; overflow-wrap: anywhere; }
.msg .txt ul { margin: 6px 0; padding-left: 20px; }
.msg .txt p + p { margin-top: 8px; }
.msg.user { justify-content: flex-end; }
.msg.user .txt { background: var(--blue-l); border-color: var(--blue-b); color: #0B6E9E; }
.msg .kind { display: inline-block; margin-bottom: 6px; padding: 2px 10px; border-radius: 999px; background: var(--orange-l); color: #B36200; font-size: 12px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0 54px; }
.act { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--green-l); color: #3F7A00; font-size: 13px; font-weight: 900; animation: pop .4s ease-out both; }
.act svg { width: 16px; height: 16px; }
.typing .txt { display: flex; gap: 6px; padding: 16px; }
.typing i { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); animation: dots 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.composer { position: sticky; bottom: 0; background: #fff; padding: 12px 0 8px; border-top: 2px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.composer .row textarea { flex: 1; min-height: 52px; max-height: 160px; padding: 13px 16px; border-radius: 16px; border: 2px solid var(--line); background: #F7F7F7; font-size: 16px; resize: none; outline: none; line-height: 1.4; }
.composer .row textarea:focus { border-color: var(--blue-b); background: #fff; }
.send { width: 52px; height: 52px; border-radius: 16px; border: none; background: var(--green); box-shadow: 0 4px 0 var(--green-d); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: transform .08s, box-shadow .08s; }
.send:active { transform: translateY(4px); box-shadow: 0 0 0 transparent; }
.send:disabled { background: var(--line); box-shadow: 0 4px 0 var(--line-d); color: var(--faint); }
.send svg { width: 24px; height: 24px; }
@media (max-width: 999px) { .composer { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } .coach { min-height: calc(100vh - 200px); } }

/* ---------- Plan ---------- */
.plan { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.chain { display: flex; flex-direction: column; gap: 10px; }
.banner { border-radius: 16px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; color: #fff; text-align: left; border: none; width: 100%; cursor: pointer; transition: transform .08s, box-shadow .08s; }
.banner:active { transform: translateY(4px); box-shadow: 0 0 0 transparent !important; }
.banner small { font-size: 12px; font-weight: 900; letter-spacing: .07em; opacity: .92; text-transform: uppercase; }
.banner b { font-size: 16px; font-weight: 900; line-height: 1.25; }
.banner .pct { font-size: 18px; font-weight: 900; }
.lv-year { background: var(--purple); box-shadow: 0 5px 0 var(--purple-d); }
.lv-month { background: var(--green); box-shadow: 0 5px 0 var(--green-d); }
.lv-week { background: var(--blue); box-shadow: 0 5px 0 var(--blue-d); }
.banner.ghost { background: #fff; color: var(--muted); border: 2px dashed var(--line); box-shadow: none; }
.week { display: grid; grid-template-columns: 44px repeat(7, minmax(0, 1fr)) 44px; gap: 6px; align-items: center; }
.day { height: 66px; border-radius: 14px; border: 2px solid var(--line); background: #fff; box-shadow: 0 4px 0 var(--line); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0; transition: transform .08s, box-shadow .08s; }
.day:active { transform: translateY(4px); box-shadow: 0 0 0 var(--line); }
.day small { font-size: 11px; font-weight: 900; color: var(--muted); text-transform: uppercase; }
.day b { font-size: 18px; font-weight: 900; }
.day i { font-style: normal; font-size: 10px; font-weight: 800; color: var(--faint); }
.day.today b { color: var(--green); }
.day.on { background: var(--blue-l); border-color: var(--blue-b); box-shadow: 0 4px 0 var(--blue-b); }
.day.on b, .day.on small { color: var(--blue); }
.day.full i { color: var(--green-d); }
.tlist { display: flex; flex-direction: column; gap: 10px; }
.trow { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 16px; background: #fff; }
.check { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 10px; border: 2px solid var(--line); background: #fff; box-shadow: 0 3px 0 var(--line); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: transparent; transition: transform .08s; }
.check svg { width: 22px; height: 22px; }
.check.on { background: var(--green); border-color: var(--green); box-shadow: 0 3px 0 var(--green-d); color: #fff; }
.check:active { transform: translateY(3px); }
.trow .tt { flex: 1; min-width: 0; background: none; border: none; text-align: left; cursor: pointer; padding: 4px 0; display: flex; flex-direction: column; gap: 2px; }
.trow .tt b { font-size: 16px; font-weight: 900; }
.trow .tt small { font-size: 12px; color: var(--muted); font-weight: 800; }
.trow.done .tt b { color: var(--faint); text-decoration: line-through; }
.goal { border: 2px solid var(--line); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.goal .gt { background: none; border: none; padding: 0; text-align: left; cursor: pointer; font-size: 16px; font-weight: 900; line-height: 1.3; }
.goal.done .gt { color: var(--green-d); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .icon-btn { width: 38px; height: 38px; }

/* ---------- Money ---------- */
.money { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.balance { border-radius: 20px; background: var(--blue); box-shadow: 0 6px 0 var(--blue-d); color: #fff; padding: 18px 20px; display: flex; align-items: center; gap: 12px; }
.balance small { font-size: 12px; font-weight: 900; letter-spacing: .07em; opacity: .92; text-transform: uppercase; }
.balance .big { font-size: 36px; font-weight: 900; letter-spacing: -.01em; display: inline-block; }
.balance .ubtn { border-color: var(--blue-b); background: var(--blue); box-shadow: 0 4px 0 var(--blue-d); }
.accts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.acct { border: 2px solid var(--line); border-radius: 16px; box-shadow: 0 4px 0 var(--line); padding: 12px; display: flex; align-items: center; gap: 10px; background: #fff; cursor: pointer; text-align: left; transition: transform .08s, box-shadow .08s; }
.acct:active { transform: translateY(4px); box-shadow: 0 0 0 var(--line); }
.dot { width: 38px; height: 38px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 15px; flex: 0 0 auto; }
.dot svg { width: 20px; height: 20px; }
.acct small { font-size: 12px; color: var(--muted); font-weight: 800; display: block; }
.acct b { font-size: 16px; font-weight: 900; }
.tip { display: flex; gap: 10px; align-items: flex-end; }
.tip .bubble { background: var(--orange-l); border-color: #FFD9A0; color: #8A4B00; }
.tip .bubble::before { background: var(--orange-l); border-color: #FFD9A0; }
.txrow { display: flex; align-items: center; gap: 12px; min-height: 58px; border-bottom: 2px solid #F2F2F2; background: none; border-left: none; border-right: none; border-top: none; width: 100%; text-align: left; cursor: pointer; padding: 6px 0; }
.txrow .grow b { display: block; font-size: 15px; font-weight: 900; }
.txrow .grow small { font-size: 12px; color: var(--muted); font-weight: 700; }
.amt { font-size: 15px; font-weight: 900; }
.amt.in { color: var(--green-d); }

/* ---------- Settings ---------- */
.settings { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.list-edit { display: flex; flex-direction: column; gap: 10px; }
.list-edit .row input, .list-edit .row select { min-height: 44px; }

/* ---------- Sheet (modal) ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .2s ease-out; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: #fff; border-radius: 22px 22px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px)); animation: slideUp .3s cubic-bezier(.2,1.1,.4,1); display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 700px) { .backdrop { align-items: center; } .sheet { border-radius: 22px; } }
.sheet .sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Result banner (like lesson feedback) */
.result { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--green-l); animation: slideUp .35s cubic-bezier(.2,1.2,.4,1); }
.result .inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.result .badge { width: 56px; height: 56px; border-radius: 50%; background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--green-d); animation: pop .5s ease-out; }
.result .badge svg { width: 32px; height: 32px; }
.result h3 { color: var(--green-d); font-size: 22px; }
.result p { color: var(--green-d); font-weight: 800; }

/* Toasts & confetti */
#toasts { position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 12px 18px; border-radius: 16px; background: var(--text); color: #fff; font-weight: 900; box-shadow: 0 5px 0 #2F2F2F; animation: pop .4s ease-out; }
.toast.xp { background: var(--yellow); color: #5C4500; box-shadow: 0 5px 0 var(--yellow-d); }
.toast.err { background: var(--red); box-shadow: 0 5px 0 var(--red-d); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; }

/* Login & setup */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.auth-card form { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.setup-body { padding: 24px 16px 60px; }
.setup-card { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.setup-card h2 { margin-top: 10px; }
.setup-head { display: flex; align-items: center; gap: 14px; }

/* ======================================================================
   Planner / Command Center (Plan tab)
   ====================================================================== */
.planner { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.phead { position: sticky; top: 0; z-index: 15; display: flex; flex-direction: column; gap: 12px; padding: 12px 0 14px; margin-top: -12px;
  background: rgba(255,255,255,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 2px solid var(--line); }
@media (max-width: 999px) { .phead { position: static; background: #fff; } }
.pnav { display: flex; align-items: center; gap: 8px; }
.prange { font-size: 17px; font-weight: 900; padding-left: 6px; }
.addbar { display: grid; grid-template-columns: minmax(180px, 1fr) 130px 150px 116px 84px auto auto; gap: 8px; align-items: center; }
.addbar .input { min-height: 46px; padding: 0 10px; font-size: 15px; }
.ab-star { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 12px; border-radius: 14px; border: 2px solid var(--line); cursor: pointer; font-weight: 900; color: var(--yellow-d); white-space: nowrap; }
.ab-star input { width: 18px; height: 18px; accent-color: var(--yellow-d); }
.ab-star:has(input:checked) { background: var(--yellow-l); border-color: var(--yellow); }
@media (max-width: 999px) { .addbar { grid-template-columns: 1fr 1fr 1fr; } .addbar .ab-title { grid-column: 1 / -1; } .addbar .btn { grid-column: span 1; } }
@media (max-width: 559px) { .addbar { grid-template-columns: 1fr 1fr; } }
.check-line { display: flex; align-items: center; gap: 10px; font-weight: 800; cursor: pointer; }
.check-line input { width: 20px; height: 20px; accent-color: var(--yellow-d); }
.carry-note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--orange-l); border: 2px solid #FFD9A0; color: #8A4B00; text-decoration: none; font-weight: 800; }
.carry-note svg { color: var(--orange); width: 22px; height: 22px; flex: 0 0 auto; }

.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
@media (max-width: 899px) { .pgrid { grid-template-columns: minmax(0, 1fr); } }
.pcard { gap: 10px; }
.pcard h3 { font-size: 18px; }
.pill.good { background: var(--green-l); color: #3F7A00; }
.dayhead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.dayhead h2 { font-size: 24px; margin-right: 4px; }
.pill.when { font-size: 13px; padding: 4px 12px; }
.pill.when-today { background: var(--green-l); color: #3F7A00; }
.pill.when-past { background: #F2F2F2; color: var(--muted); }
.pill.when-upcoming { background: var(--blue-l); color: #0B6E9E; }
.pill.theme { font-size: 13px; padding: 4px 12px; background: var(--yellow-l); color: #7A5600; }
.top3 { border-color: #FFE38A; }
.top3.alldone { background: #FFFBEA; border-color: var(--yellow); animation: pop .5s ease-out; }
.slot { min-height: 50px; display: flex; align-items: center; padding: 0 14px; border-radius: 14px; border: 2px dashed var(--line); color: var(--faint); font-size: 14px; }

/* Task row */
.prow { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 8px 6px 10px; border-radius: 14px; border: 2px solid var(--line); background: #fff; }
.prow.done .ptxt b { color: var(--faint); text-decoration: line-through; }
.prow .check { width: 32px; height: 32px; }
.prow .check svg { width: 20px; height: 20px; }
.adot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; display: inline-block; }
.ptxt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ptxt b { display: block; text-align: left; font-size: 15px; font-weight: 900; line-height: 1.3; overflow-wrap: break-word; }
.ptxt small { font-size: 12px; color: var(--muted); font-weight: 800; }
.ptxt .slip { color: var(--orange-d); }
.tacts { display: flex; align-items: center; gap: 4px; }
.tacts .tact { opacity: 0; transition: opacity .15s; }
.prow:hover .tact, .prow:focus-within .tact, .tacts .tact.star, .tacts .tact.on { opacity: 1; }
@media (hover: none) { .tacts .tact { opacity: 1; } }
.tact { min-width: 34px; height: 34px; padding: 0 6px; border-radius: 10px; border: 2px solid var(--line); background: #fff; color: var(--muted); font-size: 15px; font-weight: 900; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; transition: transform .08s; }
.tact:active { transform: translateY(2px); }
.tact small { font-size: 11px; margin-left: 1px; }
.tact.star { color: var(--yellow-d); border-color: var(--yellow); background: var(--yellow-l); }
.tact.on { border-color: var(--blue-b); background: var(--blue-l); }
.tact.wide { padding: 0 10px; font-size: 13px; color: var(--orange-d); border-color: #FFD9A0; }
.prow.compact { position: relative; min-height: 44px; padding: 4px 6px; gap: 6px; border-width: 2px; border-left-width: 5px; }
.prow.compact .check { width: 26px; height: 26px; border-radius: 8px; }
.prow.compact .check svg { width: 16px; height: 16px; }
.prow.compact .ptxt b { font-size: 13px; }
.prow.compact .tacts { display: none; position: absolute; top: -14px; right: 2px; z-index: 4; padding: 3px; border-radius: 12px; background: #fff; box-shadow: 0 3px 0 var(--line), 0 0 0 2px var(--line); }
.prow.compact:hover .tacts, .prow.compact:focus-within .tacts { display: flex; }
@media (hover: none) { .prow.compact { flex-wrap: wrap; } .prow.compact .tacts { display: flex; position: static; width: 100%; justify-content: flex-end; box-shadow: none; padding: 0; } }
.prow.compact .tact { min-width: 28px; height: 28px; font-size: 13px; }
.carried .prow { border-color: #FFE0B8; }

/* Calendar events */
.erow { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 12px; border-radius: 12px; background: var(--blue-l); border: 2px solid var(--blue-b); color: #0B6E9E; text-decoration: none; }
.erow b { font-size: 14px; font-weight: 900; }
.etime { font-size: 12px; font-weight: 900; min-width: 52px; }

/* Week */
.weekscroll { overflow-x: auto; margin: 0 -4px 18px; padding: 4px 4px 10px; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.weekcols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1199px) { .weekcols { grid-template-columns: repeat(7, 210px); align-items: start; } .wcol { scroll-snap-align: start; min-height: 180px; } }
.wcol { display: flex; flex-direction: column; gap: 8px; padding: 8px; min-width: 0; border-radius: 18px; border: 2px solid var(--line); background: #fff; min-height: 260px; }
.wcol.is-today { border-color: var(--green); box-shadow: 0 4px 0 var(--green-d); background: #F6FFEE; }
.whead { display: flex; align-items: baseline; gap: 6px; background: none; border: none; padding: 2px; cursor: pointer; text-align: left; }
.whead small { font-size: 12px; font-weight: 900; color: var(--muted); text-transform: uppercase; }
.whead b { font-size: 22px; font-weight: 900; }
.whead span { font-size: 12px; font-weight: 800; color: var(--faint); }
.wcol.is-today .whead b, .wcol.is-today .whead small { color: var(--green-d); }
.wtheme { font-size: 11px; font-weight: 800; color: #7A5600; background: var(--yellow-l); padding: 3px 8px; border-radius: 8px; line-height: 1.3; }
.echip { display: block; padding: 5px 8px; border-radius: 10px; background: var(--blue-l); color: #0B6E9E; font-size: 12px; font-weight: 800; text-decoration: none; line-height: 1.3; overflow-wrap: anywhere; }
.echip i { font-style: normal; font-weight: 900; margin-right: 4px; }
.wtasks { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.wadd { min-height: 38px; border-radius: 12px; border: 2px dashed var(--line); background: none; color: var(--muted); font-weight: 900; cursor: pointer; }
.wadd:hover { border-color: var(--green); color: var(--green-d); }

/* Goals */
.garea { display: flex; flex-direction: column; gap: 6px; }
.gtitle { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.grow-row { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 4px 8px; border-radius: 12px; border: 2px solid var(--line); }
.grow-row .check { width: 30px; height: 30px; }
.grow-row .check svg { width: 18px; height: 18px; }
.grow-row.done span { color: var(--faint); text-decoration: line-through; }
.gform { flex-wrap: wrap; }
.gform select { max-width: 140px; min-height: 44px; }
.gform input { min-height: 44px; min-width: 160px; }

/* Month */
.mgrid-card { padding: 12px; margin-bottom: 18px; }
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mhead { text-align: center; font-size: 12px; font-weight: 900; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.mcell { position: relative; min-height: 96px; padding: 8px; border-radius: 14px; border: 2px solid var(--line); background: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; transition: transform .08s; }
.mcell:active { transform: translateY(2px); }
.mcell b { font-size: 16px; font-weight: 900; }
.mcell small { font-size: 11px; font-weight: 800; color: var(--muted); }
.mcell .mev { color: #0B6E9E; }
.mcell.out { opacity: .4; }
.mcell.is-today { border-color: var(--green); box-shadow: 0 3px 0 var(--green-d); }
.mcell.is-today b { color: var(--green-d); }
.mdots { display: flex; gap: 3px; flex-wrap: wrap; min-height: 10px; }
.mdots .adot { width: 8px; height: 8px; }
.mbar { margin-top: auto; width: 100%; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.mbar i { display: block; height: 100%; border-radius: 3px; background: var(--green); }
@media (max-width: 699px) {
  .mgrid { gap: 3px; } .mcell { min-height: 62px; padding: 4px; border-radius: 10px; gap: 2px; }
  .mcell b { font-size: 13px; } .mlong { display: none; } .mcell small { font-size: 10px; }
  .mgrid-card { padding: 6px; }
}

/* Monitor */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 699px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { border: 2px solid var(--line); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; background: #fff; }
.tile small { font-size: 12px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tile b { font-size: 32px; font-weight: 900; display: inline-flex; align-items: center; gap: 6px; }
.tile span { font-size: 13px; color: var(--muted); font-weight: 700; }
.tile.streak.lit { border-color: #FFD9A0; background: var(--orange-l); }
.tile.streak.lit b { color: var(--orange-d); }
.flame svg { width: 32px; height: 32px; display: block; }
.bars14 { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; height: 170px; align-items: end; padding-top: 8px; border-bottom: 2px solid var(--line); }
.b14 { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline: none; }
.b14fill { width: 70%; max-width: 26px; border-radius: 4px 4px 0 0; background: var(--green); transition: height .6s cubic-bezier(.3,1.6,.5,1); }
.b14fill.none { background: var(--line); }
.b14 small { position: absolute; bottom: -20px; font-size: 10px; font-weight: 800; color: var(--muted); }
.b14:hover::after, .b14:focus::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 6px 10px; border-radius: 10px; background: var(--text); color: #fff; font-size: 12px; font-weight: 800; z-index: 3; pointer-events: none; }
.b14:first-child:hover::after, .b14:first-child:focus::after { left: 0; transform: none; }
.b14:last-child:hover::after, .b14:last-child:focus::after { left: auto; right: 0; transform: none; }
.bars14 + details { margin-top: 26px; }
.ptable { width: 100%; border-collapse: collapse; margin-top: 8px; }
.ptable th, .ptable td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.arow { display: flex; align-items: center; gap: 10px; }
.aname { width: 120px; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; }
.anum { min-width: 44px; text-align: right; font-size: 13px; font-weight: 900; color: var(--muted); }
.arow .bar > i::after { display: none; }
.lrow { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 6px 10px; border-radius: 14px; border: 2px solid var(--line); background: #fff; cursor: pointer; text-align: left; font-weight: 800; font-size: 14px; }
.lv-year-pill { background: #F3E4FF; color: #7B3FB0; } .lv-month-pill { background: var(--green-l); color: #3F7A00; } .lv-week-pill { background: var(--blue-l); color: #0B6E9E; }
.pbody { display: flex; flex-direction: column; gap: 18px; }
.pbody > .weekscroll { margin-bottom: 0; }
.pbody > .mgrid-card { margin-bottom: 0; }
.pbody > .tiles { margin-bottom: 0; }
/* Touch / narrow screens: actions drop to their own line so titles keep their width */
@media (hover: none), (max-width: 699px) {
  .prow { flex-wrap: wrap; }
  .prow .ptxt { flex: 1 1 0; }
  .prow .tacts { width: 100%; justify-content: flex-end; padding-left: 44px; }
  .prow .tacts .tact { opacity: 1; }
  .prow.compact .tacts { display: flex; position: static; box-shadow: none; padding: 0; }
}

/* ======================================================================
   Spark built-in brain: search / command bar + answers
   ====================================================================== */
kbd { font-family: inherit; font-size: 11px; font-weight: 900; padding: 2px 6px; border-radius: 6px; border: 2px solid var(--line); color: var(--muted); background: #fff; }
.askbar { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 12px; border-radius: 14px; border: 2px solid var(--line); background: #F7F7F7; color: var(--muted); font: 800 15px var(--font); cursor: pointer; text-align: left; }
.askbar span { flex: 1; }
.askbar:hover { border-color: var(--blue-b); background: #fff; }
.askbar svg { color: var(--blue); }
.palette-back { position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,.4); display: flex; justify-content: center; align-items: flex-start; padding: 8vh 16px 16px; animation: fadeIn .15s ease-out; }
.palette { width: 100%; max-width: 680px; max-height: 84vh; display: flex; flex-direction: column; background: #fff; border-radius: 22px; box-shadow: 0 6px 0 var(--line-d), 0 20px 60px rgba(0,0,0,.2); overflow: hidden; animation: pop .25s ease-out; }
@media (max-width: 699px) { .palette-back { padding: 0; align-items: stretch; } .palette { max-height: none; height: 100%; border-radius: 0; } }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 18px; border-bottom: 2px solid var(--line); }
.pal-input > svg { width: 24px; height: 24px; color: var(--blue); flex: 0 0 auto; }
.pal-input input { flex: 1; min-width: 0; border: none; outline: none; font: 800 18px var(--font); color: var(--text); background: none; min-height: 44px; }
.pal-body { flex: 1; overflow: auto; padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.pal-sec { font-size: 12px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.pal-ask, .pal-item { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 12px; border-radius: 12px; border: 2px solid transparent; background: none; text-align: left; cursor: pointer; font: 700 15px var(--font); color: var(--text); width: 100%; }
.pal-ask { background: var(--blue-l); border-color: var(--blue-b); color: #0B6E9E; }
.pal-ask span { flex: 1; }
.pal-item:hover, .pal-item:focus-visible { background: #F7F7F7; }
.pal-item svg, .pal-ask svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--muted); }
.pal-item small { color: var(--muted); font-weight: 800; }
.pal-foot { display: flex; align-items: center; gap: 6px; padding: 10px 18px; border-top: 2px solid var(--line); flex-wrap: wrap; }
.pal-q { font-weight: 800; }
.pal-more { align-self: flex-start; font-weight: 800; }
.typing-line { display: flex; align-items: center; gap: 10px; }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); animation: dots 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }

.answer { display: flex; flex-direction: column; gap: 10px; }
.answer.busy { opacity: .5; pointer-events: none; }
.areply { line-height: 1.5; font-size: 15.5px; }
.areply ul { margin: 6px 0; padding-left: 20px; }
.areply p + p { margin-top: 6px; }
.acard { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px; background: #F7F7F7; }
.acard-title { font-size: 12px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 0 2px; }
.arow-task { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 10px; border-radius: 12px; background: #fff; border: 2px solid var(--line); }
.arow-task .check { width: 30px; height: 30px; }
.arow-task .check svg { width: 18px; height: 18px; }
.arow-task .grow { display: flex; flex-direction: column; min-width: 0; }
.arow-task b { font-size: 14.5px; font-weight: 900; overflow-wrap: break-word; }
.arow-task small { font-size: 12px; color: var(--muted); font-weight: 800; }
.arow-task.done b { color: var(--faint); text-decoration: line-through; }
.alist { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 10px; border-radius: 10px; background: #fff; }
.alist .grow { display: flex; flex-direction: column; min-width: 0; }
.alist b { font-size: 14px; font-weight: 800; }
.alist small { font-size: 12px; color: var(--muted); font-weight: 700; }
.aright { font-weight: 900; font-size: 14px; white-space: nowrap; }
.achoices .opt { min-height: 42px; }
.afb { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.afb > span { flex: 1; }
.linkbtn { background: none; border: none; padding: 6px 4px; cursor: pointer; font: 800 13px var(--font); color: var(--blue-d); }
.linkbtn:hover { text-decoration: underline; }
.afb-pick { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; background: var(--yellow-l); }
.afb-pick .opt { min-height: 38px; font-size: 13px; }
.msg .txt .answer { gap: 8px; }
.msg .txt.choice { background: #fff; border-style: dashed; color: var(--muted); }
.msg .txt { max-width: 88%; }
.tiles.mini { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; }
.tiles.mini .tile b { font-size: 24px; }
@media (max-width: 559px) { .tiles.mini { grid-template-columns: 1fr 1fr; } }
@media (max-width: 699px) {
  .composer .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .composer .chips::-webkit-scrollbar { display: none; }
  .composer .chips .opt { flex: 0 0 auto; white-space: nowrap; }
}

/* ======================================================================
   Reminders: Now screen, Start bubble, widget steps
   ====================================================================== */
button.start { cursor: pointer; font-family: var(--font); z-index: 3; }
button.start:hover { background: var(--green-l); }
.node-wrap .start.started { color: #fff; background: var(--green); border-color: var(--green-d); }
.node-wrap .start.started::after { background: var(--green); border-color: var(--green-d); }
.nowscreen { max-width: 520px; margin: 0 auto; padding-top: 10px; }
.nowcard { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 28px 22px; border-radius: 24px; border: 2px solid var(--line); box-shadow: 0 6px 0 var(--line); background: #fff; }
.nowcard h1 { font-size: 30px; line-height: 1.2; }
.nowcard.late { border-color: #FFD9A0; box-shadow: 0 6px 0 #FFD9A0; }
.nowcard.started { border-color: var(--green); box-shadow: 0 6px 0 var(--green-d); }
.nowcard.done { border-color: var(--green); background: #F6FFEE; }
.nowstatus { font-size: 14px; padding: 6px 14px; background: var(--blue-l); color: #0B6E9E; }
.nowcard.late .nowstatus { background: var(--orange-l); color: #B36200; }
.nowcard.started .nowstatus, .nowcard.done .nowstatus { background: var(--green-l); color: #3F7A00; }
.nowbig { min-height: 60px; font-size: 18px; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; }
.steps b { font-weight: 900; }

/* ---------- Page watch ---------- */
.dotcount { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font: 900 11px var(--font); font-style: normal; letter-spacing: 0; }
.dotcount[hidden] { display: none; }
.nav a .dotcount { margin-left: auto; }
.tabbar a { position: relative; }
.tabbar .dotcount { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; border: 2px solid #fff; }
.pages-note { background: var(--red-l); border-color: #FFB8BA; color: #A01C1C; }
.pages-note svg { color: var(--red); }
.pgwrap { display: flex; flex-direction: column; gap: 18px; }
.pgunit { background: var(--red); box-shadow: 0 5px 0 var(--red-d); }
.pgunit .ubtn { background: var(--red); border-color: #FF8A8A; box-shadow: 0 4px 0 var(--red-d); }
.pgunit .ubtn.spin svg { animation: pgspin 1s linear infinite; }
@keyframes pgspin { to { transform: rotate(360deg); } }
.pgchips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.pgchips::-webkit-scrollbar { display: none; }
.pgchips .opt { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; flex: 0 0 auto; }
.pggrid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 1099px) { .pggrid { grid-template-columns: minmax(0, 1fr); } }
.pgfeed { gap: 14px; }
.pgpost { border: 2px solid var(--line); border-radius: 18px; padding: 14px 16px; background: #fff; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 3px 0 var(--line); }
.pgpost.new { border-color: #FFB8BA; box-shadow: 0 3px 0 #FFB8BA; animation: pgin .4s ease-out both; }
@keyframes pgin { from { transform: translateY(8px); opacity: 0; } }
.pgpost h3 { margin: 0; font-size: 17px; font-weight: 900; line-height: 1.35; }
.pgpost-head { gap: 8px; }
.pgname { text-decoration: none; background: var(--blue-l); color: #0B6E9E; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.newtag { color: var(--red); font-weight: 900; letter-spacing: .05em; }
.pgbody { margin: 0; white-space: pre-line; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.pgbody.open { -webkit-line-clamp: unset; display: block; }
.pgimg { width: 100%; max-height: 360px; object-fit: cover; border-radius: 14px; border: 2px solid var(--line); background: #F7F7F7; }
.pgopen { align-self: flex-start; }
.pgopen svg { width: 18px; height: 18px; }
.pgrow { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-top: 2px solid #F2F2F2; }
.pgrow:first-of-type { border-top: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; }
.icon-btn.sm svg { width: 18px; height: 18px; }
.icon-btn.on { color: var(--green-d); border-color: #A5ED6E; box-shadow: 0 3px 0 #A5ED6E; background: var(--green-l); }
.pg-help summary { cursor: pointer; font-weight: 900; color: var(--blue-d); }
.pg-help[open] summary { margin-bottom: 8px; }
.pg-preview { padding: 10px 12px; border-radius: 12px; background: #F7F7F7; }
.pg-empty { max-width: 640px; margin: 0 auto; }

/* ---------- Notes (Keep-style) ---------- */
@media (max-width: 440px) { .tabbar { gap: 2px; padding-left: 4px; padding-right: 4px; } .tabbar a { font-size: 9.5px; letter-spacing: .02em; } .tabbar svg { width: 24px; height: 24px; } }
.nwrap { display: flex; flex-direction: column; gap: 16px; }
.nunit { background: var(--yellow); box-shadow: 0 5px 0 var(--yellow-d); color: #5C4500; }
.nunit .ubtn { background: var(--yellow); border-color: #FFE066; box-shadow: 0 4px 0 var(--yellow-d); color: #5C4500; }
.nsearch { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border: 2px solid var(--line); border-radius: 16px; background: #F7F7F7; }
.nsearch:focus-within { border-color: var(--blue-b); background: #fff; }
.nsearch span, .nsearch a { display: inline-flex; color: var(--muted); }
.nsearch svg { width: 22px; height: 22px; }
.nsearch input { flex: 1; min-width: 0; border: 0; background: transparent; font: 800 16px var(--font); color: var(--text); outline: none; }
.nchipsbar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.nchipsbar::-webkit-scrollbar { display: none; }
.nchipsbar .opt { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; flex: 0 0 auto; }
.nchipsbar .opt svg { width: 16px; height: 16px; }
.ntrash-note { text-align: center; margin: 0; }
.nsec { margin: 4px 4px -6px; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ngrid { columns: 240px; column-gap: 14px; }
.ncard { break-inside: avoid; margin: 0 0 14px; position: relative; border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px 6px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: box-shadow .15s, transform .15s; outline: none; }
.ncard[style*="#FFFFFF"] { border-color: var(--line); }
.ncard:not([style*="#FFFFFF"]) { border-color: transparent; }
.ncard:hover, .ncard:focus-visible { box-shadow: 0 4px 0 rgba(0,0,0,.12); transform: translateY(-2px); }
.ncard h3 { margin: 0; padding-right: 30px; font-size: 16px; font-weight: 900; line-height: 1.35; overflow-wrap: anywhere; }
.ncard-body { white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 600; line-height: 1.5; font-size: 15px; max-height: 18em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent); }
.ncard-body:only-of-type, .ncard h3 + .ncard-body { }
.ncard-body a, .ncard-items a { color: var(--blue-d); }
.ncard-items { display: flex; flex-direction: column; gap: 2px; }
.ncard-item { display: flex; align-items: flex-start; gap: 8px; font-weight: 600; font-size: 15px; line-height: 1.4; cursor: pointer; overflow-wrap: anywhere; }
.ncard-item input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--green); flex: 0 0 auto; }
.nmore { color: var(--muted); font-weight: 800; padding-left: 25px; }
.nbtn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 50%; color: #5f6368; cursor: pointer; flex: 0 0 auto; }
.nbtn:hover { background: rgba(0,0,0,.07); }
.nbtn svg { width: 19px; height: 19px; }
.ncard .npin { position: absolute; top: 6px; right: 6px; opacity: 0; transition: opacity .15s; }
.ncard .npin.on, .ncard:hover .npin { opacity: 1; }
.npin.on { color: var(--text); }
.ncard-tools { display: flex; gap: 2px; margin: 0 -10px; opacity: 0; transition: opacity .15s; }
.ncard:hover .ncard-tools, .ncard:focus-within .ncard-tools { opacity: 1; }
@media (hover: none) { .ncard .npin { opacity: 1; } .ncard-tools { display: none; } .ncard { padding-bottom: 12px; } }
.nchips { display: flex; flex-wrap: wrap; gap: 6px; }
.nchips:empty { display: none; }
.nlabel, .nremind { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: rgba(0,0,0,.07); font-size: 12px; font-weight: 800; color: var(--text); text-decoration: none; }
.nremind svg { width: 13px; height: 13px; }
.nremind.past { text-decoration: line-through; color: var(--muted); }
.ncompose { width: 100%; max-width: 600px; margin: 0 auto; display: flex; align-items: center; border: 2px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 3px 0 var(--line); padding: 0 8px 0 0; }
.ncompose-btn { flex: 1; text-align: left; border: 0; background: transparent; min-height: 52px; padding: 0 16px; font: 800 16px var(--font); color: var(--muted); cursor: text; }
.ncompose.open { display: block; padding: 0; border-color: transparent; box-shadow: 0 4px 0 rgba(0,0,0,.14), 0 0 0 2px var(--line); overflow: hidden; }
.neditor { display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 8px 16px; border-radius: 16px; transition: background .2s; }
.nedit-top { display: flex; align-items: flex-start; gap: 6px; }
.ntitle { flex: 1; min-width: 0; border: 0; background: transparent; font: 900 18px var(--font); color: var(--text); outline: none; padding: 6px 0; }
.nbody { width: 100%; border: 0; background: transparent; resize: none; font: 600 16px/1.5 var(--font); color: var(--text); outline: none; padding: 2px 0; min-height: 2.6em; }
.nitems { display: flex; flex-direction: column; }
.nitem { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; border-top: 1px solid transparent; border-bottom: 1px solid transparent; }
.nitem:focus-within { border-color: rgba(0,0,0,.12); }
.nitem input[type=checkbox] { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--green); flex: 0 0 auto; }
.nitem-t { flex: 1; min-width: 0; border: 0; background: transparent; resize: none; font: 600 16px/1.45 var(--font); color: var(--text); outline: none; padding: 1px 0; overflow: hidden; }
.nitem.done .nitem-t { text-decoration: line-through; color: var(--muted); }
.nitem-x { border: 0; background: transparent; color: var(--muted); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; opacity: 0; display: inline-flex; align-items: center; justify-content: center; }
.nitem-x svg { width: 16px; height: 16px; }
.nitem:hover .nitem-x, .nitem:focus-within .nitem-x { opacity: 1; }
@media (hover: none) { .nitem-x { opacity: .6; } }
.nadd-item { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 6px 0; font: 800 15px var(--font); color: var(--muted); cursor: pointer; align-self: flex-start; }
.nadd-item svg { width: 18px; height: 18px; }
.ndone { border-top: 1px solid rgba(0,0,0,.1); padding-top: 6px; }
.ndone summary { cursor: pointer; font-size: 14px; font-weight: 800; color: var(--muted); padding: 4px 0; }
.nedited { text-align: right; font-size: 12px; font-weight: 700; color: var(--muted); }
.ntools { display: flex; align-items: center; gap: 2px; margin-left: -8px; flex-wrap: wrap; }
.nclose { border: 0; background: transparent; font: 900 15px var(--font); color: var(--text); padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.nclose:hover { background: rgba(0,0,0,.07); }
.sheet.nsheet { padding: 0; gap: 0; max-width: 620px; background: transparent; overflow: visible; }
.nsheet-host { max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; background: #fff; }
.nsheet .neditor { border-radius: 22px 22px 0 0; min-height: 260px; padding: 18px 16px calc(10px + env(safe-area-inset-bottom, 0px)) 20px; }
@media (min-width: 700px) { .nsheet-host, .nsheet .neditor { border-radius: 18px; } }
.npop { position: fixed; z-index: 300; background: #fff; border: 2px solid var(--line); border-radius: 16px; box-shadow: 0 6px 0 rgba(0,0,0,.08), 0 10px 30px rgba(0,0,0,.12); padding: 8px; animation: pop .2s ease-out; max-width: calc(100vw - 16px); }
.ncolors { display: grid; grid-template-columns: repeat(6, 34px); gap: 6px; }
.nswatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; font-weight: 900; color: var(--text); }
.nswatch:hover { border-color: var(--line-d); }
.nswatch.on { border-color: var(--blue); }
.nswatch.none { border-color: var(--line); }
.nmenu { display: flex; flex-direction: column; min-width: 230px; gap: 2px; }
.nmenu-h { font-size: 13px; padding: 4px 8px 6px; }
.nmenu > button { display: flex; justify-content: space-between; gap: 16px; border: 0; background: transparent; padding: 10px 10px; border-radius: 10px; font: 800 15px var(--font); color: var(--text); cursor: pointer; text-align: left; }
.nmenu > button:hover { background: #F2F2F2; }
.nmenu > button small { color: var(--muted); font-weight: 700; }
.nmenu .ndanger { color: var(--red-d); }
.nmenu .ngo { color: var(--blue-d); justify-content: center; }
.nmenu-custom { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; font-size: 13px; font-weight: 800; }
.nmenu-custom input, .nlabel-in { border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; font: 700 15px var(--font); color: var(--text); background: #F7F7F7; }
.nlabel-in { margin: 0 4px 6px; }
.nlabel-list { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow: auto; padding: 0 8px; }
.nlabel-list .check-line { font-size: 15px; padding: 4px 0; }
.nlabel-list .check-line[hidden] { display: none; }
.nsnack { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 250; display: flex; align-items: center; gap: 18px; padding: 12px 12px 12px 18px; border-radius: 14px; background: var(--text); color: #fff; font-weight: 800; box-shadow: 0 5px 0 #2F2F2F; animation: pop .3s ease-out; max-width: calc(100vw - 32px); }
.nsnack button { border: 0; background: transparent; color: #FFC800; font: 900 15px var(--font); text-transform: uppercase; letter-spacing: .05em; cursor: pointer; padding: 6px 8px; }
@media (min-width: 1000px) { .nsnack { bottom: 28px; } }
.nempty svg { width: 90px; height: 90px; color: #E5E5E5; }
.nlabels-edit .row { gap: 8px; align-items: center; }
.npinned { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); text-decoration: none; color: var(--text); }
.npinned[style*="#FFFFFF"] { border-color: var(--line); }
.npinned small { color: var(--muted); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: none) { .ncard .npin:not(.on) { display: none; } }
@media (max-width: 560px) {
  .ngrid { columns: 2; column-gap: 10px; }
  .ncard { margin-bottom: 10px; padding: 12px 12px 10px; gap: 6px; border-radius: 14px; }
  .ncard h3 { font-size: 15px; padding-right: 22px; }
  .ncard-body, .ncard-item { font-size: 14px; }
  .ncard .npin { top: 2px; right: 2px; }
  .nlabel, .nremind { font-size: 11px; padding: 2px 8px; }
  .nmore { padding-left: 0; }
}
.check-line input[type=checkbox] { flex: 0 0 auto; }
