/* danny.css - the look of Danny (login + app). RTL first. Tokens on :root, dark theme by system preference or data-theme. */
:root {
  --bg: #f4f7fb; --surface: #ffffff; --surface2: #edf2f9; --line: #dde5f0; --ink: #0f172a; --muted: #546178; --faint: #8592a8;
  --brand: #0f6fd4; --brand-ink: #ffffff; --brand-soft: #e2effd; --brand-strong: #0a58ab; --sky: #1fa5ff; --navy: #0b1330;
  --coral: #0f8fe6; --coral-soft: #def2ff; --mint: #14a67f; --mint-soft: #dcf5ec; --amber: #e09100; --amber-soft: #fff2d6; --red: #d83a52; --red-soft: #fde4e8;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 6px 22px rgba(15,23,42,.07); --shadow-lg: 0 10px 40px rgba(15,23,42,.18);
  --radius: 16px; --radius-sm: 10px; --side: 252px;
  --font: 'Heebo', 'Segoe UI', Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070d1f; --surface: #0e1730; --surface2: #162243; --line: #233358; --ink: #eaf0fb; --muted: #9fb0cf; --faint: #6f82a6;
    --brand: #3aa6ff; --brand-ink: #04122b; --brand-soft: #12294f; --brand-strong: #86c9ff; --sky: #3aa6ff; --navy: #0b1330;
    --coral: #5bb8ff; --coral-soft: #12294f; --mint: #3ccf9f; --mint-soft: #153c33; --amber: #f2b13d; --amber-soft: #43330f; --red: #ff6b82; --red-soft: #451c27;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 22px rgba(0,0,0,.35); --shadow-lg: 0 10px 40px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] {
  --bg: #070d1f; --surface: #0e1730; --surface2: #162243; --line: #233358; --ink: #eaf0fb; --muted: #9fb0cf; --faint: #6f82a6;
  --brand: #3aa6ff; --brand-ink: #04122b; --brand-soft: #12294f; --brand-strong: #86c9ff; --sky: #3aa6ff; --navy: #0b1330;
  --coral: #5bb8ff; --coral-soft: #12294f; --mint: #3ccf9f; --mint-soft: #153c33; --amber: #f2b13d; --amber-soft: #43330f; --red: #ff6b82; --red-soft: #451c27;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 22px rgba(0,0,0,.35); --shadow-lg: 0 10px 40px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid transparent; border-radius: 999px; padding: 10px 20px; font-weight: 700; background: var(--brand); color: var(--brand-ink); transition: background .15s, transform .1s, box-shadow .15s; min-height: 42px; }
.btn:hover { background: var(--brand-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.soft:hover { background: var(--line); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.danger:hover { background: var(--red); color: #fff; }
.btn.sm { padding: 6px 14px; min-height: 34px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); display: inline-grid; place-items: center; position: relative; }
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.icon-btn svg, .ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.badge-dot { position: absolute; top: 4px; inset-inline-start: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .lbl { font-size: 13.5px; font-weight: 700; color: var(--muted); }
.input, .select, .textarea { width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 14px; min-height: 44px; transition: border-color .15s, box-shadow .15s; }
.textarea { min-height: 90px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.input[dir="ltr"], .ltr { direction: ltr; text-align: left; }
.row { display: flex; gap: 12px; align-items: center; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; } .gap-s { gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 11px; font-size: 12.5px; font-weight: 700; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.chip.coral { background: var(--coral-soft); color: var(--coral); } .chip.mint { background: var(--mint-soft); color: var(--mint); } .chip.amber { background: var(--amber-soft); color: var(--amber); } .chip.red { background: var(--red-soft); color: var(--red); } .chip.gray { background: var(--surface2); color: var(--muted); }
.switch { position: relative; width: 46px; height: 27px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(-19px); }
.switch input:focus-visible + i { outline: 2.5px solid var(--brand); outline-offset: 2px; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--faint); background: transparent; display: inline-grid; place-items: center; flex: none; padding: 0; color: transparent; transition: all .15s; }
.check:hover { border-color: var(--brand); }
.check.on { background: var(--mint); border-color: var(--mint); color: #fff; }
.check svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- cards / lists ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card h3 { font-size: 16.5px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h3 .ico { color: var(--brand); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .t { font-weight: 600; word-break: break-word; } .item .s { font-size: 13px; color: var(--muted); }
.item.done .t { text-decoration: line-through; color: var(--faint); }
.item .acts { display: flex; gap: 2px; opacity: .55; } .item:hover .acts, .item:focus-within .acts { opacity: 1; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .ico-big { width: 46px; height: 46px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 12px; }
.empty .ico-big svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty h4 { margin: 0 0 4px; color: var(--ink); font-size: 16px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 10px 14px; font-weight: 700; color: var(--muted); border-bottom: 2.5px solid transparent; white-space: nowrap; }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.seg { display: inline-flex; background: var(--surface2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 6px 14px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.prio { width: 4px; align-self: stretch; border-radius: 4px; background: transparent; } .prio.p1 { background: var(--amber); } .prio.p2 { background: var(--red); }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--surface); border-inline-end: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 14px; font-weight: 800; font-size: 22px; color: var(--ink); }
.logo b { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, var(--brand), var(--sky)); display: grid; place-items: center; color: #fff; font-size: 18px; }
.nav-sec { font-size: 12px; font-weight: 800; color: var(--faint); padding: 14px 12px 4px; letter-spacing: .04em; }
.nav { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; border: 0; background: none; width: 100%; text-align: start; }
.nav:hover { background: var(--surface2); text-decoration: none; color: var(--ink); }
.nav.on { background: var(--brand-soft); color: var(--brand); }
.nav .cnt { margin-inline-start: auto; font-size: 12px; font-weight: 800; background: var(--surface2); border-radius: 9px; padding: 1px 8px; color: var(--muted); }
.side .foot { margin-top: auto; padding: 10px; font-size: 13px; color: var(--faint); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); display: flex; align-items: center; gap: 8px; padding: 10px 24px; border-bottom: 1px solid transparent; }
.top .search { flex: 1; max-width: 460px; position: relative; }
.top .search input { padding-inline-start: 40px; border-radius: 999px; background: var(--surface); }
.top .search .ico { position: absolute; inset-inline-start: 12px; top: 12px; color: var(--faint); }
.search-pop { position: absolute; top: 50px; inset-inline: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 60vh; overflow: auto; z-index: 30; }
.search-pop button { display: flex; width: 100%; gap: 10px; align-items: center; border: 0; background: none; padding: 9px 10px; border-radius: 10px; text-align: start; }
.search-pop button:hover { background: var(--brand-soft); }
.view { padding: 8px 24px 120px; width: 100%; max-width: 1080px; margin: 0 auto; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 10px 0 18px; flex-wrap: wrap; }
.view-head h1 { font-size: 27px; } .view-head p { margin: 4px 0 0; color: var(--muted); }
.cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 960px) { .cols { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; } .stat span { color: var(--muted); font-size: 13.5px; }
.banner { display: flex; align-items: center; gap: 12px; background: var(--amber-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); border-radius: 14px; padding: 12px 14px; margin: 6px 0 14px; flex-wrap: wrap; }
.mobbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(86vw, 300px); transform: translateX(110%); transition: transform .2s; z-index: 60; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(7,13,31,.5); z-index: 50; }
  .top { padding: 10px 14px; } .view { padding: 4px 14px 120px; }
  .mobbar { display: inline-grid; }
  .view-head h1 { font-size: 23px; }
}

/* ---------- modal / toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(7,13,31,.55); z-index: 90; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); width: min(520px, 100%); max-height: 92vh; overflow: auto; padding: 22px; animation: pop .18s; }
.modal h2 { font-size: 20px; margin-bottom: 16px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0 } } @keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0 } }
.toasts { position: fixed; bottom: 22px; left: 12px; right: 12px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 18px; font-weight: 600; line-height: 1.4; text-align: center; max-width: min(100%, 460px); box-shadow: var(--shadow-lg); animation: pop .2s; pointer-events: auto; }
.toast.err { background: var(--red); color: #fff; }

/* ---------- chat ---------- */
.fab { position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 70; display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 999px; border: 0; background: linear-gradient(135deg, var(--brand), var(--sky)); color: #fff; font-weight: 800; box-shadow: 0 10px 30px rgba(15,111,212,.42); }
.fab:hover { transform: translateY(-2px); }
.chat { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(430px, 100vw); background: var(--surface); border-inline-start: 1px solid var(--line); box-shadow: var(--shadow-lg); z-index: 80; display: flex; flex-direction: column; transform: translateX(-110%); transition: transform .22s; }
.chat.open { transform: none; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.avatar { width: 40px; height: 40px; border-radius: 14px; background: linear-gradient(135deg, var(--brand), var(--sky)); color: #fff; display: grid; place-items: center; font-size: 19px; flex: none; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.msg.user { align-self: flex-start; background: var(--brand); color: var(--brand-ink); border-end-start-radius: 6px; }
.msg.danny { align-self: flex-end; background: var(--surface2); border-end-end-radius: 6px; }
.msg .time { display: block; font-size: 11px; opacity: .6; margin-top: 3px; }
.cards { align-self: flex-end; width: 86%; display: flex; flex-direction: column; gap: 6px; }
.acard { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 9px 12px; font-size: 14px; }
.acard .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--mint-soft); color: var(--mint); flex: none; }
.acard .ic svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.acard.deleted .ic { background: var(--red-soft); color: var(--red); }
.acard b { display: block; } .acard span { color: var(--muted); font-size: 12.5px; }
.acard .undo { margin-inline-start: auto; border: 0; background: none; color: var(--brand); font-weight: 700; font-size: 13px; }
.typing { align-self: flex-end; display: flex; gap: 4px; padding: 14px 16px; background: var(--surface2); border-radius: 18px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: bounce 1s infinite; } .typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: none } 30% { transform: translateY(-5px) } }
.chat-sugg { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 10px; }
.chat-sugg button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; color: var(--muted); }
.chat-sugg button:hover { border-color: var(--brand); color: var(--brand); }
.chat-form { display: flex; gap: 8px; padding: 12px 14px 16px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { flex: 1; border: 1.5px solid var(--line); border-radius: 22px; padding: 10px 16px; resize: none; max-height: 130px; min-height: 44px; background: var(--bg); }
.chat-form textarea:focus { outline: none; border-color: var(--brand); }
.chat-form .tool { width: 40px; height: 44px; border-radius: 50%; border: 0; background: none; color: var(--muted); display: grid; place-items: center; flex: none; cursor: pointer; }
.chat-form .tool:hover { color: var(--brand); background: var(--brand-soft); }
.chat-form .tool svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-form .tool.rec { color: #fff; background: var(--red); animation: recpulse 1.2s infinite; }
@keyframes recpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(216,58,82,.45); } 50% { box-shadow: 0 0 0 8px rgba(216,58,82,0); } }
.chat-attach { display: flex; align-items: center; gap: 10px; padding: 8px 14px 0; font-size: 13px; color: var(--muted); }
.chat-attach img { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.chat-attach .rm { border: 0; background: none; color: var(--brand); font-weight: 700; cursor: pointer; }
.msg img { display: block; max-width: 100%; max-height: 220px; border-radius: 12px; margin-bottom: 6px; }
.msg .vtag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; opacity: .8; margin-bottom: 3px; }
.send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; flex: none; }
.send svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: scaleX(-1); }

/* ---------- calendar ---------- */
.cal-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.cal-grid { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal-week { grid-template-columns: 52px repeat(7, 1fr); }
.cal-h { padding: 8px 4px; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; }
.cal-h.today b { background: var(--brand); color: var(--brand-ink); border-radius: 50%; padding: 1px 7px; }
.cal-hour { height: 48px; font-size: 11px; color: var(--faint); text-align: center; border-bottom: 1px solid var(--line); padding-top: 2px; }
.cal-col { position: relative; border-inline-start: 1px solid var(--line); }
.cal-slot { height: 48px; border-bottom: 1px solid var(--line); }
.cal-ev { position: absolute; inset-inline: 2px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); border-inline-start: 3px solid var(--brand); padding: 2px 6px; font-size: 12px; font-weight: 700; overflow: hidden; cursor: pointer; line-height: 1.3; }
.cal-ev.rem { background: var(--coral-soft); color: var(--coral); border-color: var(--coral); }
.cal-ev.tsk { background: var(--mint-soft); color: var(--mint); border-color: var(--mint); }
.cal-allday { grid-column: 1 / -1; display: grid; grid-template-columns: 52px repeat(7, 1fr); border-bottom: 1px solid var(--line); min-height: 26px; }
.cal-month { grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 96px; border-bottom: 1px solid var(--line); border-inline-start: 1px solid var(--line); padding: 4px; font-size: 12px; cursor: pointer; }
.cal-cell:hover { background: var(--surface2); } .cal-cell.other { opacity: .45; } .cal-cell .d { font-weight: 800; color: var(--muted); } .cal-cell.today .d { background: var(--brand); color: var(--brand-ink); border-radius: 50%; padding: 0 6px; }
.cal-pill { display: block; background: var(--brand-soft); color: var(--brand); border-radius: 6px; padding: 1px 6px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.cal-pill.rem { background: var(--coral-soft); color: var(--coral); } .cal-pill.tsk { background: var(--mint-soft); color: var(--mint); }
.cal-scroll { overflow: auto; max-height: 70vh; }

/* ---------- small pieces ---------- */
.dots { display: flex; gap: 4px; } .dots i { width: 12px; height: 12px; border-radius: 4px; background: var(--line); } .dots i.on { background: var(--mint); }
.progress { height: 8px; border-radius: 6px; background: var(--surface2); overflow: hidden; } .progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--sky)); border-radius: 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; } .set-row .d { font-size: 13px; color: var(--muted); } .set-row > div:first-child { min-width: 0; }
.set-row .input, .set-row .select { width: auto; min-width: 150px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest button { border: 1px dashed var(--line); background: transparent; border-radius: 999px; padding: 6px 14px; color: var(--muted); }
.suggest button:hover { border-color: var(--brand); color: var(--brand); }
.note-card { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 14px; cursor: pointer; transition: box-shadow .15s, transform .1s; }
.note-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.sk { background: linear-gradient(90deg, var(--surface2), var(--line), var(--surface2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; height: 18px; margin: 10px 0; }
@keyframes sk { to { background-position: -200% 0 } }
.demo-bar { background: var(--ink); color: var(--bg); text-align: center; padding: 8px 12px; font-weight: 700; font-size: 14px; }
.demo-bar a { color: var(--bg); text-decoration: underline; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 28px 22px; }
.auth-card { width: min(420px, 100%); }
.auth-card .logo { padding-inline: 0; }
.auth-card h1 { font-size: 28px; margin-bottom: 6px; } .auth-card .sub { color: var(--muted); margin-bottom: 20px; }
.auth-art { background: radial-gradient(1000px 520px at 85% 8%, rgba(31,165,255,.38), transparent 60%), linear-gradient(160deg, #0b1330, #0e2a63 58%, #0f6fd4); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 48px; gap: 18px; position: relative; overflow: hidden; }
.auth-art h2 { font-size: 34px; max-width: 440px; } .auth-art p { opacity: .88; max-width: 420px; font-size: 17px; }
.bubble { max-width: 340px; padding: 11px 16px; border-radius: 18px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.bubble.u { background: #fff; color: #0f172a; align-self: flex-start; border-end-start-radius: 6px; } .bubble.m { background: rgba(255,255,255,.18); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.28); align-self: flex-end; border-end-end-radius: 6px; }
.auth-tabs { display: flex; background: var(--surface2); border-radius: 14px; padding: 4px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; border: 0; background: none; border-radius: 11px; padding: 9px; font-weight: 800; color: var(--muted); }
.auth-tabs button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.btn.wa { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.btn.wa:hover { border-color: var(--brand); background: var(--brand-soft); }
.btn.wa .ico { stroke: #1fae5b; }
.btn.tg { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.btn.tg:hover { border-color: var(--brand); background: var(--brand-soft); }
.btn.tg .ico { stroke: #229ed9; }
.wa-box { background: var(--surface2); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.wa-code { font-size: 34px; font-weight: 800; letter-spacing: 8px; text-align: center; color: var(--brand); margin-bottom: 12px; }
.wa-msg { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 6px; font-weight: 600; user-select: all; }
.wa-state { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-weight: 600; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.turn { display: flex; align-items: baseline; gap: 10px; background: var(--surface2); border-radius: 12px; padding: 10px 14px; margin: 10px 0 4px; }
.turn b { font-size: 20px; } .turn.me { background: var(--brand-soft); color: var(--brand); }
.bar-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; } .bar-row > span { min-width: 82px; } .bar-row .num { min-width: 78px; text-align: end; }
.bar { flex: 1; height: 9px; background: var(--surface2); border-radius: 6px; overflow: hidden; } .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--sky)); border-radius: 6px; }
.err-box { background: var(--red-soft); color: var(--red); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; }
.ok-box { background: var(--mint-soft); color: var(--mint); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; }
.linkbtn { border: 0; background: none; color: var(--brand); font-weight: 700; padding: 4px 0; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); margin: 16px 0; font-size: 13px; } .or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
@media (max-width: 880px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .cols3 { grid-template-columns: 1fr; } }
.brandtile { width: 40px; height: 40px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; flex: none; }
.brandtile img { width: 32px; height: 32px; object-fit: contain; display: block; }
.brandname { display: flex; flex-direction: column; line-height: 1.05; }
.brandname small { font-size: 11px; font-weight: 600; color: var(--faint); letter-spacing: .02em; margin-top: 2px; }
.asm { display: inline-flex; align-items: center; gap: 12px; height: 76px; padding: 4px 16px 4px 12px; background: #fff; border: 1px solid var(--line); border-radius: 18px; flex: none; text-decoration: none; color: #0b1330; }
.asm img { height: 62px; width: auto; display: block; }
.asm-name { display: flex; flex-direction: column; line-height: 1.05; font-weight: 800; font-size: 25px; letter-spacing: -.01em; }
.asm-name small { font-size: 11px; font-weight: 700; color: #1fa5ff; letter-spacing: .03em; margin-top: 3px; }
.asm-fixed { position: absolute; top: 14px; inset-inline-start: 20px; z-index: 5; height: 124px; padding: 8px 22px 8px 16px; gap: 16px; border-radius: 22px; box-shadow: var(--shadow); }
.asm-fixed img { height: 106px; }
.asm-fixed .asm-name { font-size: 34px; } .asm-fixed .asm-name small { font-size: 13px; }
@media (max-width: 880px) { .asm-fixed { position: static; margin: 14px 0 0 14px; height: 92px; padding: 6px 16px 6px 12px; } .asm-fixed img { height: 78px; } .asm-fixed .asm-name { font-size: 27px; } .doc .asm-fixed { margin-inline: 0; } }
@media (max-width: 560px) { .top .asm { height: 56px; padding: 3px 10px 3px 8px; gap: 8px; } .top .asm img { height: 46px; } .top .asm-name { font-size: 19px; } .top .asm-name small { display: none; } }

/* calendar: external calendars (connect / show / hide) */
.cal-srcs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 14px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.cal-src { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 10px 4px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); }
.cal-src.off { opacity: .6; }
.cal-src .src-dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; flex: none; }
.cal-src .src-dot.g { background: #4285f4; }
.cal-src .src-dot.o { background: #0078d4; }
.cal-src .src-t { display: flex; flex-direction: column; line-height: 1.2; }
.cal-src .src-t small { color: var(--muted); font-size: 11.5px; }

/* app header: logo block at the top of the side menu, star tile + centred search in the top bar */
.side .side-asm { width: 100%; height: 66px; padding: 4px 12px 4px 10px; gap: 10px; margin-bottom: 8px; justify-content: flex-start; }
.side .side-asm img { height: 54px; }
.side .side-asm .asm-name { font-size: 22px; }
.top .topmid { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; }
.top .topmid .search { flex: 0 1 460px; }
.mark { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--sky)); display: grid; place-items: center; color: #fff; font-size: 20px; flex: none; text-decoration: none; }
.mark:hover { text-decoration: none; filter: brightness(1.06); }
.greet-ico { margin-inline-end: 8px; }

/* English (left to right): the panels that slide in from a side use physical directions */
.langbtn { font-weight: 800; font-size: 13px; letter-spacing: .02em; }
html[dir="ltr"] .chat { transform: translateX(110%); }
html[dir="ltr"] .chat.open { transform: none; }
/* phones: above the chat button and the home indicator */@media (max-width: 880px) { .toasts { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); } }
html[dir="ltr"] .switch input:checked + i::after { transform: translateX(19px); }
@media (max-width: 880px) { html[dir="ltr"] .side { transform: translateX(-110%); } html[dir="ltr"] .side.open { transform: none; } }

/* phones: no zoom (pinch, double tap, focusing a field), the page does not scroll sideways */
html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; }
@media (max-width: 880px) { input, textarea, select, .input, .select, .textarea { font-size: 16px; } }

/* the lists screen sets its own two-column grid inline: on phones and small tablets it stacks (list of lists above the list) */
@media (max-width: 960px) { .cols[style*="260px"] { grid-template-columns: 1fr !important; } }
