/* A named legacy layer avoids specificity wars with earlier theme generations. */
@import url("app.css") layer(legacy);
@import url("skins.css") layer(legacy);

:root {
  color-scheme: light;
  --bg:#F4F3F6; --surface:#FFFFFF; --surface-2:#ECEAF0; --surface-3:#E2DFE8;
  --ink:#1E1928; --ink-2:#3B334D; --ink-3:#595367; --text:#1E1928;
  --muted:#595367; --muted-2:#666075; --line:#DFDCE5; --line-2:#B4AFBF;
  --accent:#67519A; --accent-soft:#E6E2F1; --accent-line:#9C91B5;
  --emerald:var(--accent); --emerald-soft:var(--accent-soft);
  --brass:var(--accent); --brass-2:#8A74C7; --brass-soft:var(--accent-soft);
  --control:#857F94; --focus:#67519A; --nav:#595367;
  --sidebar-1:#1E1928; --sidebar-2:#15121B; --topbar-bg:rgba(244,243,246,.96);
  --r-xs:8px; --r-sm:12px; --r:18px; --r-lg:24px; --r-xl:28px;
  --sh-1:0 2px 5px rgb(30 25 40 / 3%); --sh-2:0 8px 28px rgb(30 25 40 / 7%);
  --sh-3:0 24px 64px rgb(30 25 40 / 16%); --sh-brass:0 4px 12px rgb(43 30 74 / 12%);
  --assistant-fill:#67519A; --assistant-on:#FFFFFF;
  --glass:rgb(255 255 255 / 76%); --glass-strong:rgb(255 255 255 / 90%);
  --glass-rim:rgb(255 255 255 / 92%); --wash-a:rgb(124 95 190 / 21%); --wash-b:rgb(111 173 192 / 12%);
  --motion-enter:200ms; --motion-exit:140ms; --motion-ease:cubic-bezier(.2,0,0,1);
  font-family:'IBM Plex Sans Arabic',system-ui,sans-serif;
}
:root[data-theme="dark"] {
  color-scheme:dark; --bg:#100E15; --surface:#1A1723; --surface-2:#231E2F; --surface-3:#2F2840;
  --ink:#EFEDF5; --ink-2:#D4D0DF; --ink-3:#B4AEC2; --text:#EFEDF5;
  --muted:#B4AEC2; --muted-2:#A29BB1; --line:#383049; --line-2:#5E5572;
  --accent:#9475DD; --accent-soft:#2B2539; --accent-line:#61557E;
  --control:#7F7597; --focus:#9475DD; --nav:#B4AEC2; --brass-2:#B29CE5;
  --sidebar-1:#181520; --sidebar-2:#110F17; --topbar-bg:rgba(16,14,21,.96);
  --glass:rgb(26 23 35 / 78%); --glass-strong:rgb(26 23 35 / 93%);
  --glass-rim:rgb(169 149 216 / 20%); --wash-a:rgb(81 56 138 / 21%); --wash-b:rgb(61 116 142 / 14%);
}
body[data-app] { background:radial-gradient(ellipse at 85% 8%,var(--wash-a),transparent 48%),radial-gradient(ellipse at 10% 70%,var(--wash-b),transparent 52%),var(--bg); background-attachment:fixed; color:var(--ink); }
.main,.stage { background:transparent; }
body[data-app]::before, body[data-app]::after { content:none; }
.beam { display:none; }
.card, .stat, .panel, .day-card, .work-card { background:var(--glass-strong); border:1px solid var(--glass-rim); border-radius:var(--r); box-shadow:inset 0 1px var(--glass-rim),var(--sh-2); backdrop-filter:none; }
.card::before, .card::after, .stat::before, .stat::after { content:none; }
.card:not(:has(> .card-head,> .card-body)):not(.card-p) { padding:22px; }
.card > .card-head { padding:18px 22px; border-bottom:1px solid var(--line); }
.card > .card-body,.card.card-p { padding:22px; }
.wk .wk-card,.wk .wk-load { background:var(--glass-strong); box-shadow:var(--sh-1); }
.content { animation:none; }
.page-head { gap:16px; margin-block:12px 28px; }
.page-head h1 { font-family:inherit; font-size:clamp(1.55rem,2.8vw,2.1rem); font-weight:700; letter-spacing:-.5px; line-height:1.5; }
.page-head p, .page-head .sub { color:var(--muted); line-height:1.8; }
.topbar { background:var(--glass); border-bottom:1px solid var(--glass-rim); box-shadow:none; backdrop-filter:blur(20px) saturate(1.2); -webkit-backdrop-filter:blur(20px) saturate(1.2); }
.sidebar { background:var(--glass); border-inline-end:1px solid var(--glass-rim); box-shadow:var(--sh-2); color:var(--ink); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); }
.sidebar::before, .sidebar::after { content:none; }
.sidebar .nav-item { min-height:44px; margin:4px 12px; border-radius:12px; color:var(--muted); font-weight:500; }
.sidebar .nav-item.active { background:var(--accent-soft); color:var(--accent); font-weight:700; border:0; box-shadow:inset -3px 0 var(--accent); }
.sidebar .nav-item:hover { background:var(--surface-2); color:var(--ink); }
.sidebar .nav-label, .sidebar .sb-section { color:var(--muted); }
.btn { min-height:44px; border-radius:14px; box-shadow:none; font-weight:600; }
.btn.primary, .btn-primary { background:var(--accent); color:var(--bg); border:1px solid var(--accent); }
.input, .select, input:not([type="checkbox"]):not([type="radio"]), select, textarea { border-radius:12px; }
.input, .select { background:var(--surface); border:1px solid var(--control); min-height:44px; }
.table th { background:var(--surface-2); color:var(--muted); font-weight:600; }
.table td { padding-block:16px; border-color:var(--line); }
.table tbody tr:hover { background:var(--accent-soft); }
.stat .v, .stat .value { font-variant-numeric:tabular-nums; letter-spacing:-.8px; }
button, a, input, textarea, select { -webkit-tap-highlight-color:transparent; }
:focus-visible { outline:3px solid var(--focus); outline-offset:3px; }
.ul-sr-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }

/* The assistant's signature: a quiet book seal, never a spinning ornament. */
.ul-orb { display:inline-grid; place-items:center; position:relative; isolation:auto; width:32px; height:32px; flex:none; border-radius:11px; background:var(--assistant-fill); color:var(--assistant-on); box-shadow:none; overflow:hidden; }
.ul-orb::before, .ul-orb::after { content:none; }
.ul-orb svg { width:61%; height:61%; animation:none; filter:none; }
.ul-orb.lg { width:42px; height:42px; border-radius:14px; }
.ul-orb.sm { width:26px; height:26px; border-radius:8px; margin-top:8px; }
.ul-bot-fab { display:flex; gap:9px; align-items:center; position:fixed; inset:auto auto 24px 24px; height:auto; min-height:52px; padding:8px 16px 8px 8px; border:1px solid rgb(255 255 255 / 20%); border-radius:18px; background:var(--assistant-fill); color:var(--assistant-on); box-shadow:var(--sh-3); animation:none; z-index:900; transform:none; cursor:pointer; }
.ul-bot-fab::before,.ul-bot-fab::after,.ul-fab-t::after { content:none; }
.ul-bot-fab .ul-fab-t { font:600 14px/1.5 'IBM Plex Sans Arabic',sans-serif; background:none; color:inherit; -webkit-text-fill-color:currentColor; }
.ul-bot-fab:hover { background:#262033; transform:none; }
.ul-bot-fab { background:linear-gradient(145deg,rgb(59 41 101 / 88%),rgb(37 32 50 / 94%)); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); box-shadow:inset 0 1px rgb(255 255 255 / 30%),0 8px 30px rgb(27 23 37 / 22%); }
.ul-bot-tease { position:fixed; inset:auto auto 90px 24px; display:block; width:min(292px,calc(100vw - 32px)); padding:18px; border:1px solid var(--accent-line); border-radius:22px 22px 8px 22px; color:var(--ink); background:var(--surface); box-shadow:var(--sh-3); text-align:start; z-index:901; opacity:1; transform:none; transition:none; cursor:auto; }
.ul-bot-tease::before,.ul-bot-tease::after { content:none; }
.ul-welcome-top { display:flex; align-items:center; gap:8px; margin-block-end:8px; }
.ul-welcome-top small { font-size:11px; color:var(--muted); flex:1; }
.ul-welcome-top button { width:44px; height:44px; margin:-10px -8px -10px -10px; border:0; background:none; color:var(--muted); font-size:22px; cursor:pointer; }
.ul-bot-tease > b { font-size:17px; }
.ul-bot-tease p { font-size:13px; line-height:1.8; color:var(--muted); margin:6px 0 10px; }
.ul-welcome-go { display:flex; justify-content:space-between; width:100%; min-height:44px; align-items:center; padding:8px 12px; background:var(--accent-soft); color:var(--accent); border:0; border-radius:12px; font:inherit; font-size:14px; font-weight:600; cursor:pointer; }
.ul-bot-panel { position:fixed; inset:24px auto 24px 24px; margin:0; width:min(480px,calc(100vw - 48px)); max-width:none; height:auto; max-height:calc(100dvh - 48px); padding:0; border:1px solid var(--line); border-radius:28px; color:var(--ink); background:var(--bg); box-shadow:var(--sh-3); overflow:hidden; animation:none; }
.ul-bot-panel[open] { display:flex; flex-direction:column; }
.ul-bot-panel::backdrop { background:rgb(14 12 19 / 28%); }
.ul-bot-panel { background:var(--glass); backdrop-filter:blur(28px) saturate(1.25); -webkit-backdrop-filter:blur(28px) saturate(1.25); border-color:var(--glass-rim); box-shadow:inset 0 1px var(--glass-rim),0 24px 80px rgb(13 11 18 / 24%); }
.ul-bot-panel::backdrop { background:rgb(14 12 19 / 20%); }
.ul-bot-head { display:flex; gap:12px; padding:18px 20px; align-items:center; background:var(--glass); border-bottom:1px solid var(--line); flex:none; }
.ul-bot-id { flex:1; min-width:0; }
.ul-bot-id b { display:block; font-size:16px; }
.ul-bot-id small { display:block; font-size:11px; margin-top:3px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ul-bot-ic { display:grid; place-items:center; width:44px; height:44px; border-radius:14px; flex:none; padding:0; border:0; background:var(--surface-2); color:var(--ink); font-size:24px; cursor:pointer; }
.ul-bot-ic svg { width:18px; height:18px; }
.ul-bot-body { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; padding:24px; scroll-behavior:auto; background:radial-gradient(ellipse at 90% 0%,var(--wash-a),transparent 65%); }
.ul-hero { position:relative; margin:0; padding:6px 0 20px; }
.ul-hero-eyebrow { display:block; font-size:11px; color:var(--muted); margin-bottom:22px; }
.ul-orb.hero-seal { width:58px; height:58px; border-radius:19px; margin-bottom:18px; }
.ul-orb.hero-seal { box-shadow:inset 0 1px rgb(255 255 255 / 35%),0 10px 24px rgb(40 34 53 / 16%); transform:rotate(-4deg); }
.ul-hero h3 { font-size:clamp(24px,3vw,29px); font-weight:700; line-height:1.6; letter-spacing:-.6px; margin:0 0 12px; color:var(--ink); }
.ul-hero h3 em { font-style:normal; color:var(--accent); }
.ul-hero p { font-size:14px; line-height:1.9; color:var(--muted); margin:0; max-width:34ch; }
.ul-brief-action { display:flex; gap:8px; align-items:center; min-height:44px; padding:8px 0; margin-top:12px; color:var(--accent); background:none; border:0; font:inherit; font-size:13px; font-weight:600; cursor:pointer; }
.ul-brief-action svg { width:18px; height:18px; }
.ul-tiles { margin:4px 0 8px; }
.ul-tiles > small { display:block; color:var(--muted); font-size:12px; margin-bottom:10px; }
.ul-tiles > div { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.ul-tiles button { display:grid; gap:12px; align-content:start; min-height:104px; padding:16px; text-align:start; background:var(--glass-strong); border:1px solid var(--glass-rim); box-shadow:inset 0 1px var(--glass-rim),var(--sh-1); border-radius:18px; font:500 13px/1.65 'IBM Plex Sans Arabic',sans-serif; color:var(--ink); cursor:pointer; transition:border-color .16s; }
.ul-tiles button:hover { border-color:var(--accent); background:var(--accent-soft); translate:none; box-shadow:none; }
.ul-tiles i { display:grid; place-items:center; width:30px; height:30px; background:var(--accent-soft); border-radius:10px; color:var(--accent); }
.ul-tiles i svg { width:18px; height:18px; }
.ul-msg { gap:8px; margin:16px 0; }
.ul-msg .ul-bubble { border-radius:18px; font-size:14px; line-height:1.9; overflow-wrap:anywhere; }
.ul-msg.bot .ul-bubble { background:var(--surface); color:var(--ink); border:1px solid var(--line); padding:14px 16px; box-shadow:none; max-width:calc(100% - 34px); }
.ul-msg.me .ul-bubble { background:var(--assistant-fill); color:var(--assistant-on); padding:12px 16px; box-shadow:none; }
.ul-msg.bot .ul-bubble:has(.ul-bot-card) { max-width:calc(100% - 34px); background:none; border:0; padding:0; box-shadow:none; }
.ul-bot-card { padding:16px; border-radius:18px; border:1px solid var(--line); box-shadow:none; background:var(--surface); }
.ul-bot-card .tag { font-size:12px; border-radius:8px; }
.ul-bot-copy,.ul-bot-src,.ul-bot-goto,.ul-follow button { min-height:44px; line-height:1.6; padding:8px 12px; border-radius:12px; white-space:normal; }
.ul-bot-foot { flex:none; display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:16px 20px max(14px,env(safe-area-inset-bottom)); background:var(--glass-strong); border-top:1px solid var(--glass-rim); }
.ul-bot-foot input { flex:1; min-width:0; width:auto; min-height:48px; border:1px solid var(--control); background:var(--bg); border-radius:16px; font:400 16px/1.5 'IBM Plex Sans Arabic',sans-serif; color:var(--ink); padding:12px 14px; }
.ul-bot-foot button { width:48px; height:48px; display:grid; place-items:center; flex:none; border-radius:16px; background:var(--surface-2); color:var(--muted); border:0; scale:1; box-shadow:none; }
.ul-bot-foot button.can { background:var(--assistant-fill); color:var(--assistant-on); box-shadow:none; }
.ul-bot-foot button svg { width:20px; height:20px; }
.ul-bot-disclaimer { flex-basis:100%; text-align:center; font-size:10px; color:var(--muted); }
.ul-bot-tease { background:var(--glass-strong); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); box-shadow:inset 0 1px var(--glass-rim),var(--sh-3); }
.dock-inner,.sheet-bar { background:var(--glass); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); border:1px solid var(--glass-rim); }
.sidebar .nav-item { transition:background-color 150ms,color 150ms; }
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  .btn,.ul-tiles button,.ul-bot-fab,.ul-welcome-go { transition:transform 180ms var(--motion-ease),background-color 150ms,box-shadow 150ms; }
  .btn:hover,.ul-tiles button:hover { transform:translateY(-2px); }
}
@media (prefers-reduced-motion:no-preference) {
  body[data-input="pointer"] :is(.btn,.ul-tiles button,.ul-bot-fab,.ul-welcome-go):active { transform:scale(.98); }
}
@media (prefers-reduced-transparency:reduce) {
  :root { --glass:var(--surface); --glass-strong:var(--surface); }
  .topbar,.sidebar,.dock-inner,.ul-bot-panel,.ul-bot-tease { backdrop-filter:none; -webkit-backdrop-filter:none; }
}
@supports not (backdrop-filter:blur(1px)) {
  .ul-bot-panel,.ul-bot-tease,.sidebar,.topbar,.dock-inner { background:var(--surface); }
}
@media (max-width:600px) {
  .card:not(:has(> .card-head,> .card-body)):not(.card-p) { padding:16px; }
  .ul-bot-fab { left:16px; bottom:calc(84px + env(safe-area-inset-bottom)); }
  .ul-bot-tease { left:16px; bottom:calc(150px + env(safe-area-inset-bottom)); }
  .ul-bot-panel { inset:12px; width:auto; height:calc(100dvh - 24px); max-height:calc(100dvh - 24px); border-radius:24px; }
  .ul-bot-body { padding:20px; }
  .ul-bot-head { padding:14px; gap:8px; }
  .ul-bot-foot { padding-inline:14px; }
}
@media (max-width:360px) {
  .ul-tiles > div { grid-template-columns:1fr; }
  .ul-tiles button { min-height:64px; grid-template-columns:30px 1fr; align-items:center; }
  .ul-bot-id b { font-size:14px; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
  .stat:hover,.btn:hover,.ul-tiles button:hover { transform:none; translate:none; }
}
