/* دفتري: one narrow column, sticky search on top, tabs, category chips, list; editors open as a bottom sheet. */
:root {
  --bg: #f2f4f7; --surface: #ffffff; --ink: #18212b; --muted: #5f6d7b; --line: #dfe4ea;
  --accent: #3d4fd6; --accent-ink: #ffffff; --accent-soft: #e8ebfc; --danger: #c43a3a; --ok: #228a5a; --warn-soft: #fdeceb; --late-soft: #fdf1e7;
  --shadow: 0 1px 2px rgba(20, 30, 45, .06), 0 4px 14px rgba(20, 30, 45, .06);
  --f-display: "Readex Pro", "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --f-body: "IBM Plex Sans Arabic", Tahoma, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #11151a; --surface: #1a2027; --ink: #e7ecf1; --muted: #98a5b2; --line: #2b343d;
    --accent: #8b97ff; --accent-ink: #0f1330; --accent-soft: #242b4f; --danger: #ff7b7b; --ok: #5cc593; --warn-soft: #3a2123; --late-soft: #33261a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11151a; --surface: #1a2027; --ink: #e7ecf1; --muted: #98a5b2; --line: #2b343d;
  --accent: #8b97ff; --accent-ink: #0f1330; --accent-soft: #242b4f; --danger: #ff7b7b; --ok: #5cc593; --warn-soft: #3a2123; --late-soft: #33261a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box }
html, body { margin: 0; min-height: 100% }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--f-body); -webkit-text-size-adjust: 100% }
button, input, textarea, select { font: inherit; color: inherit }
button { cursor: pointer; background: none; border: 0; padding: 0 }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
[hidden] { display: none !important }
.boot { min-height: 100vh }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 120px }
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: calc(14px + env(safe-area-inset-top)) 0 10px }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px }
.brand h1 { font: 600 22px/1.2 var(--f-display); margin: 0; display: flex; align-items: center; gap: 9px }
.brand h1 svg { color: var(--accent) }
.brand .side { display: flex; align-items: center; gap: 10px; min-width: 0 }
.sync { font-size: 12.5px; color: var(--muted); white-space: nowrap }
.sync.err { color: var(--danger) }
.me { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 3px 4px 3px 12px; font-size: 14px; max-width: 46vw }
.me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.me b { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 600 14px var(--f-display) }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; box-shadow: var(--shadow) }
.search svg { flex: none; color: var(--muted) }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: 12px 0; outline: 0 }
.search:focus-within { border-color: var(--accent) }
.search .clear { color: var(--muted); padding: 6px; display: none }
.search.has .clear { display: block }
.search kbd { font: 500 12px var(--f-body); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px }
.search.has kbd, .search:focus-within kbd { display: none }
.tabs { display: flex; gap: 4px; margin: 12px 0 10px; border-bottom: 1px solid var(--line) }
.tab { padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 6px; align-items: center }
.tab[aria-selected="true"] { color: var(--ink); border-color: var(--accent) }
.tab .n { font-size: 12px; background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 0 7px; min-width: 20px; text-align: center }
.tab .n.late { background: var(--danger); color: #fff }
.tabs.dim .tab[aria-selected="true"] { color: var(--muted); border-color: transparent }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none }
.chips::-webkit-scrollbar { display: none }
.chip { flex: none; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 13px; font-size: 14px }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink) }
.chip i, .chip-c i { width: 9px; height: 9px; border-radius: 50%; display: inline-block }
.chip.tool { color: var(--muted); border-style: dashed }
.chip-c { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); flex: none }
.notice { display: none; align-items: center; gap: 10px; justify-content: space-between; background: var(--accent-soft); border-radius: 10px; padding: 9px 12px; font-size: 14px; margin-bottom: 12px }
.notice.on { display: flex }
.notice button { color: var(--accent); font-weight: 600; white-space: nowrap }
.quick { display: none; gap: 8px; margin-bottom: 12px }
.quick.on { display: flex }
.quick input { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px }
.quick button { background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 0 16px; font-weight: 600 }
.sec { font: 600 14px/1 var(--f-display); color: var(--muted); margin: 18px 0 10px; display: flex; gap: 8px; align-items: center }
.sec span { font-weight: 400 }
.sec.late { color: var(--danger) }
.list { display: grid; gap: 10px }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; box-shadow: var(--shadow); cursor: pointer; display: block; width: 100%; text-align: start }
.card:hover { border-color: var(--accent) }
.card h3 { margin: 0; font: 600 16px/1.4 var(--f-display); display: flex; align-items: center; justify-content: space-between; gap: 8px }
.card h3 svg { color: var(--accent); flex: none }
.card .prev { margin: 4px 0 8px; color: var(--muted); font-size: 14.5px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden }
.card .meta { display: flex; gap: 12px; align-items: center; font-size: 12.5px; color: var(--muted) }
mark { background: #ffe27a; color: #2a2200; border-radius: 3px; padding: 0 1px }
.task { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow) }
.task.late { background: linear-gradient(var(--late-soft), var(--late-soft)) padding-box; }
.chk { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; color: transparent }
.chk:hover { border-color: var(--accent) }
.task.done .chk { background: var(--ok); border-color: var(--ok); color: #fff }
.task.done .ttl { text-decoration: line-through; color: var(--muted) }
.tmain { flex: 1; min-width: 0; text-align: start; display: grid; gap: 2px; padding: 4px 0 }
.ttl { overflow-wrap: anywhere }
.due { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px }
.due.late { color: var(--danger); font-weight: 500 }
.empty { text-align: center; color: var(--muted); padding: 44px 12px }
.empty b { display: block; color: var(--ink); font: 600 17px var(--f-display); margin-bottom: 4px }
.fab { position: fixed; inset-block-end: calc(22px + env(safe-area-inset-bottom)); inset-inline-end: 22px; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(30, 40, 120, .35); z-index: 6 }
.fab:active { transform: scale(.96) }
/* sheets */
.ov { position: fixed; inset: 0; background: rgba(10, 15, 22, .5); z-index: 20; display: flex; align-items: flex-end; justify-content: center }
.sheet { background: var(--surface); width: 100%; max-width: 680px; max-height: 94%; overflow: auto; border-radius: 18px 18px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px }
@media (min-width: 700px) { .ov { align-items: center } .sheet { border-radius: 18px; max-height: 88% } }
.sh-head { display: flex; gap: 8px; align-items: center; justify-content: space-between }
.sh-head .grow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.sh-head strong { font: 600 18px var(--f-display) }
select, .field { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px }
.field { min-width: 0 }
.btn { border-radius: 9px; padding: 8px 14px; font-weight: 500; border: 1px solid var(--line); background: var(--bg) }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600 }
.btn.danger { color: var(--danger) }
.btn.danger.arm { background: var(--danger); color: #fff; border-color: var(--danger) }
.btn.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent) }
.btn.sm { padding: 5px 10px; font-size: 13.5px }
.e-title { width: 100%; border: 0; background: none; font: 600 22px/1.4 var(--f-display); padding: 4px 0; outline: 0 }
.e-body { width: 100%; border: 0; background: none; resize: none; min-height: 240px; line-height: 1.9; outline: 0; font-size: 16.5px }
.e-note { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; resize: vertical; min-height: 70px }
.sh-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); padding-top: 12px }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.lbl { font-size: 13px; color: var(--muted); font-weight: 500 }
.opt { display: flex; gap: 10px; align-items: center }
.opt input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent) }
.grid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px }
.grid { border-collapse: collapse; min-width: 100% }
.grid th, .grid td { border: 1px solid var(--line); padding: 0; min-width: 120px }
.grid th { background: var(--bg) }
.grid .rn { min-width: 34px; width: 34px; text-align: center; background: var(--bg) }
.grid input { width: 100%; border: 0; background: none; padding: 9px 10px; outline: 0 }
.grid input:focus { background: var(--accent-soft) }
.grid tfoot td { padding: 6px 10px; font-size: 13px; color: var(--muted); font-weight: 600 }
.hc { display: flex; align-items: center }
.hc input { font-weight: 600 }
.mini { color: var(--muted); width: 26px; height: 26px; flex: none; border-radius: 6px }
.mini:hover { color: var(--danger); background: var(--warn-soft) }
.catrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line) }
.catrow input.nm { flex: 1; min-width: 120px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px }
.sw { display: flex; gap: 6px }
.sw button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent }
.sw button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset }
/* account + people */
.blk { display: grid; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line) }
.blk h4 { margin: 0; font: 600 15px var(--f-display) }
.blk p { margin: 0; color: var(--muted); font-size: 13.5px }
.frm { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) }
.frm .field { width: 100% }
.err { color: var(--danger); font-size: 14px; margin: 0 }
.people { display: grid; gap: 8px }
.person { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px }
.person .who { flex: 1; min-width: 150px; display: grid }
.person .who small { color: var(--muted); font-size: 12.5px }
.person .tag { font-size: 11.5px; border-radius: 99px; padding: 1px 8px; background: var(--accent-soft); color: var(--accent); margin-inline-start: 6px }
.person .tag.off { background: var(--warn-soft); color: var(--danger) }
.person .acts { display: flex; gap: 6px; flex-wrap: wrap }
/* sign-in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px }
.lcard { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px; box-shadow: var(--shadow); display: grid; gap: 14px }
.lcard .mark { width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center }
.lcard h1 { margin: 0; font: 600 26px/1.2 var(--f-display) }
.lcard p { margin: 0; color: var(--muted); font-size: 14.5px }
.lcard label { display: grid; gap: 5px; font-size: 13.5px; color: var(--muted); font-weight: 500 }
.lcard input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 16px; color: var(--ink) }
.lcard input:focus { outline: 0; border-color: var(--accent) }
.lcard .go { background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 12px; font-weight: 600; font-size: 16px }
.lcard .go:disabled { opacity: .6 }
.pwbox { position: relative }
.pwbox input { padding-inline-end: 52px }
.pwbox button { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; padding: 6px 8px }
/* toasts */
.toasts { position: fixed; inset-block-start: calc(10px + env(safe-area-inset-top)); inset-inline: 12px; z-index: 40; display: grid; gap: 8px; max-width: 480px; margin-inline: auto; pointer-events: none }
.toast { pointer-events: auto; background: var(--ink); color: var(--bg); border-radius: 12px; padding: 12px 14px; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); display: grid; gap: 8px }
.toast b { font-weight: 600; overflow-wrap: anywhere }
.toast .acts { display: flex; gap: 8px; flex-wrap: wrap }
.toast .acts button { background: rgba(127, 127, 127, .22); color: inherit; border-radius: 8px; padding: 6px 12px; font-size: 14px }
.toast .acts button.p { background: var(--accent); color: var(--accent-ink); font-weight: 600 }
@media (prefers-reduced-motion: no-preference) { .sheet { animation: up .18s ease-out } @keyframes up { from { transform: translateY(24px); opacity: .4 } } }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; display: none }

/* ---------- v2: home, note parts, sketch, assistant ---------- */
.iconbtn { display: grid; place-items: center; min-width: 36px; height: 36px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 8px }
.iconbtn:hover { border-color: var(--accent); color: var(--accent) }
.langb { font-size: 13px; font-weight: 600 }
.brand .side { flex-wrap: nowrap }
@media (max-width: 480px) { .me span { display: none } .me { padding: 3px } .sync { display: none } }
.dim { color: var(--muted) }
.soft { color: var(--muted); font-size: 14.5px; margin: 0 0 6px }
.sp { flex: 1 }
.link { margin-inline-start: auto; color: var(--accent); font: 500 13.5px var(--f-body) }
.tabs { overflow-x: auto; scrollbar-width: none }
.tabs::-webkit-scrollbar { display: none }
.tab { white-space: nowrap }
.chips[hidden] { display: none }
/* home */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 4px 0 14px }
.big { position: relative; overflow: hidden; border-radius: 16px; min-height: 150px; padding: 16px 18px; text-align: start; color: #111; display: flex; align-items: flex-start }
.big.green { background: #4ca744 }
.big.purple { background: #9a5fe6 }
.big .bt { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; font: 600 20px/1.2 var(--f-display) }
.big .art { position: absolute; inset-inline-end: -6px; bottom: -8px; width: 58%; max-width: 230px; height: auto }
[dir="rtl"] .big .art { transform: scaleX(-1) }
.big:hover { filter: brightness(1.05) }
.big:active { transform: scale(.99) }
.tiles { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px }
.tile { display: grid; justify-items: center; align-content: center; gap: 10px; min-height: 104px; padding: 12px 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; font-weight: 500; text-align: center }
.tile svg { width: 28px; height: 28px; color: var(--ink) }
.tile:hover { border-color: var(--accent) }
.tile:hover svg { color: var(--accent) }
.wrap { max-width: 980px }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)) } .big { min-height: 118px } .big .bt { font-size: 17px } }
@media (max-width: 380px) { .hero { grid-template-columns: 1fr } }
.cards2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) }
/* cards with a picture */
.card { display: flex; gap: 12px; align-items: stretch }
.card .cbody { flex: 1; min-width: 0; display: block }
.card .meta { display: flex; flex-wrap: wrap }
.thumb { flex: none; width: 74px; height: 74px; object-fit: cover; border-radius: 9px; background: var(--bg); border: 1px solid var(--line) }
.badges { display: inline-flex; gap: 8px; margin-inline-start: auto }
.badges span { display: inline-flex; align-items: center; gap: 3px }
/* events */
.event { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow) }
.event:hover { border-color: var(--accent) }
.event.past { opacity: .6 }
.ev-day { flex: none; width: 46px; display: grid; justify-items: center; line-height: 1.1; border-inline-end: 1px solid var(--line); padding-inline-end: 10px }
.ev-day b { font: 600 20px var(--f-display); color: var(--accent) }
.ev-day small { font-size: 12px; color: var(--muted) }
.ev-main { flex: 1; min-width: 0; display: grid; gap: 2px }
/* a note's parts */
.sheet.note { max-width: 820px }
.blocks { display: grid; gap: 6px }
.b-text { width: 100%; border: 0; background: none; resize: none; line-height: 1.9; outline: 0; font-size: 16.5px; min-height: 34px; padding: 2px 0; overflow: hidden }
.blocks .b-text:first-child { min-height: 64px }
.b-row { display: flex; align-items: center; gap: 6px }
.b-h { flex: 1; min-width: 0; border: 0; background: none; outline: 0; font: 600 19px/1.4 var(--f-display); padding: 4px 0 }
.b-check { display: flex; align-items: center; gap: 10px }
.chk.sm { width: 22px; height: 22px; border-width: 2px }
.chk.sm svg { width: 12px; height: 12px }
.b-check.done .chk { background: var(--ok); border-color: var(--ok); color: #fff }
.b-check.done .b-ci { text-decoration: line-through; color: var(--muted) }
.b-ci { flex: 1; min-width: 0; border: 0; background: none; outline: 0; padding: 5px 0; font-size: 16px }
.b-media { margin: 4px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg) }
.b-media img { display: block; width: 100%; min-height: 60px; max-height: 520px; object-fit: contain; background: #fff; cursor: zoom-in }
.b-media figcaption { padding: 4px 10px 0 }
.b-cap { width: 100%; border: 0; background: none; outline: 0; font-size: 14px; color: var(--muted); padding: 4px 0 }
.b-tools { display: flex; gap: 4px; align-items: center; justify-content: flex-end; padding: 4px 8px 8px; flex-wrap: wrap }
.b-row .b-tools, .b-audio .b-tools, .b-file .b-tools { padding: 0 }
.mini { display: inline-grid; place-items: center }
.mini.wide { width: auto; padding: 0 10px; gap: 5px; display: inline-flex; align-items: center; font-size: 13px; height: 30px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; text-decoration: none }
.mini.wide:hover { color: var(--accent); background: var(--accent-soft) }
.mini.rm:hover { color: var(--danger) }
.b-wait { padding: 18px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; color: var(--muted); font-size: 14px }
.b-audio { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--bg); flex-wrap: wrap }
.b-audio audio { flex: 1; min-width: 200px; height: 40px }
.b-file { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--bg); flex-wrap: wrap }
.b-file > a:first-child { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none }
.b-file > a:first-child span { display: grid; min-width: 0 }
.b-file b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.b-file small { color: var(--muted); font-size: 12.5px }
.sheet.note { overflow: hidden; padding-bottom: 0; height: 94% }
@media (min-width: 700px) { .sheet.note { height: 88% } }
.sh-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; margin: 0 -16px; padding: 0 16px 14px }
.toolbar { flex: none; display: flex; gap: 4px; overflow-x: auto; background: var(--surface); border-top: 1px solid var(--line); margin: 0 -16px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); scrollbar-width: none }
.toolbar::-webkit-scrollbar { display: none }
.tb { flex: none; display: grid; justify-items: center; gap: 2px; min-width: 62px; padding: 6px 6px; border-radius: 10px; color: var(--ink); font-size: 11.5px }
.tb:hover { background: var(--accent-soft); color: var(--accent) }
.tb.ai { color: var(--accent) }
.bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; flex-wrap: wrap }
.bar.rec { background: var(--warn-soft) }
.bar select { padding: 4px 8px }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger) }
.dot.g { background: var(--ok) }
@media (prefers-reduced-motion: no-preference) { .dot { animation: blink 1s infinite } @keyframes blink { 50% { opacity: .25 } } }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent) }
@media (prefers-reduced-motion: no-preference) { .spin { animation: rot .8s linear infinite } @keyframes rot { to { transform: rotate(360deg) } } }
/* the assistant */
.aibox { border: 1px solid var(--accent); border-radius: 14px; padding: 12px; display: grid; gap: 10px; background: linear-gradient(var(--accent-soft), var(--accent-soft)) padding-box }
.ai-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
.ai-h b { display: inline-flex; align-items: center; gap: 6px; font: 600 15px var(--f-display); color: var(--accent) }
.ai-h .dim { font-size: 12.5px; flex: 1 }
.ai-acts { display: flex; gap: 6px; flex-wrap: wrap }
.ai-acts .btn:disabled { opacity: .5 }
.ai-ask { display: flex; gap: 8px; align-items: stretch }
.ai-ask .field, .ai-ask textarea { flex: 1; min-width: 0 }
.ai-out { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 15.5px; line-height: 1.8; max-height: 320px; overflow: auto }
.okline { color: var(--ok) !important }
.blk.first { border-top: 0; padding-top: 0 }
.lhead { display: flex; align-items: center; justify-content: space-between }
/* sketch */
.sk-ov { position: fixed; inset: 0; z-index: 60; background: #2a2f36; display: grid; grid-template-rows: auto 1fr; color: var(--ink) }
.sk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; background: var(--surface); border-bottom: 1px solid var(--line) }
.sk-grp { display: flex; align-items: center; gap: 3px; padding-inline-end: 8px; border-inline-end: 1px solid var(--line) }
.skb { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; color: var(--ink) }
.skb[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent) }
.skc { width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 2px solid var(--line); margin: 0 1px }
.skc[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent) }
.skdot { display: block; border-radius: 50%; background: currentColor }
.sk-stage { display: grid; place-items: center; overflow: hidden; touch-action: none; padding: 8px }
.sk-stage canvas { background: #fff; border-radius: 6px; box-shadow: 0 6px 30px rgba(0, 0, 0, .35); touch-action: none; cursor: crosshair }
@media (max-width: 700px) { .sk-grp { border: 0 } .skb { width: 34px; height: 34px } }
