/* ---------- Theme ----------
   Brand values (--brand-*, --page-bg, --font) are set from Settings › Branding by app.js; the defaults here
   match leeejeffries.com so the first paint is already on-brand. Light and dark palettes use the same greys
   as the site (Tailwind gray). The theme is chosen by data-theme on <html>. */
:root {
  --brand-accent: #f97316; --brand-highlight: #ec4899; --brand-secondary: #3b82f6;
  --page-bg: linear-gradient(135deg, #f97316 0%, #ec4899 50%, #3b82f6 100%);
  --page-dim: rgba(0,0,0,0);
  --brand-line: linear-gradient(90deg, #f97316, #ec4899, #3b82f6);
  --font: "Trade Gothic LT", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --surface: rgba(249,250,251,.95); --side: rgba(249,250,251,.92); --panel: #ffffff; --bg: #f3f4f6;
  --text: #1f2937; --muted: #6b7280; --line: #e5e7eb;
  --accent: var(--brand-accent);
  --accent-ink: color-mix(in srgb, var(--brand-accent) 78%, #000);   /* readable on light backgrounds */
  --accent-soft: color-mix(in srgb, var(--brand-accent) 12%, #fff);
  --hover-ink: color-mix(in srgb, var(--brand-highlight) 85%, #000);
  --frame: var(--brand-secondary);
  --btn-grad: linear-gradient(135deg, color-mix(in srgb, var(--brand-accent) 88%, #000), color-mix(in srgb, var(--brand-highlight) 88%, #000));
  --danger: #dc2626; --danger-soft: #fdecec;
  --now: #e11d48; --now-soft: #ffe4ea; --next: #d97706; --next-soft: #fff3dc; --later: #64748b; --later-soft: #eef1f5;
  --ok: #059669; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --radius: 12px; --sidebar: 256px;
  font-family: var(--font);
  color-scheme: light;
}
:root[data-theme=dark] {
  --page-dim: rgba(3,7,18,.35);
  --surface: rgba(17,24,39,.95); --side: rgba(17,24,39,.92); --panel: #1f2937; --bg: #273142;
  --text: #e5e7eb; --muted: #9ca3af; --line: #374151;
  --accent-ink: color-mix(in srgb, var(--brand-accent) 75%, #fff);
  --accent-soft: color-mix(in srgb, var(--brand-accent) 20%, #1f2937);
  --hover-ink: color-mix(in srgb, var(--brand-highlight) 75%, #fff);
  --frame: color-mix(in srgb, var(--brand-secondary) 75%, #fff);
  --danger: #f87171; --danger-soft: #3a1f22;
  --now: #fb7185; --now-soft: #3b1d27; --next: #fbbf24; --next-soft: #3a2e14; --later: #94a3b8; --later-soft: #232836;
  --ok: #34d399; --shadow: 0 1px 2px rgba(0,0,0,.4);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; color: var(--text); font-size: 15px; -webkit-tap-highlight-color: transparent; }
html { background: #111827; }
/* The brand background sits on a fixed layer: background-attachment: fixed is unreliable on phones (iOS Safari). */
body { position: relative; z-index: 0; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--page-dim), var(--page-dim)), var(--page-bg); background-size: cover; background-position: center; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, .brand-name { font-family: var(--font); }
a { color: var(--accent-ink); transition: color .15s; }
a:hover { color: var(--hover-ink); }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; padding: 16px; gap: 16px; align-items: flex-start; }
.sidebar { width: var(--sidebar); flex-shrink: 0; background: var(--side); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 24px; padding: 14px 12px 18px; position: sticky; top: 16px; height: calc(100vh - 32px); overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,.25); display: flex; flex-direction: column; }
.main-wrap { flex: 1; min-width: 0; min-height: calc(100vh - 32px); background: var(--surface); border: 4px solid var(--frame);
  border-radius: 24px; box-shadow: 0 25px 50px -12px rgba(0,0,0,.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
/* The brand block echoes the site's dark frosted header. */
.brand { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 10px; border-radius: 16px;
  background: rgba(17,24,39,.85); color: #fff; text-decoration: none; }
.brand-logo { width: 44px; height: 44px; object-fit: cover; flex-shrink: 0; border: 2px solid var(--brand-accent); box-shadow: 0 4px 10px rgba(0,0,0,.3);
  border-radius: 12px; background: #fff; }
.brand-logo.circle { border-radius: 50%; }
.brand-text { min-width: 0; }
.brand-name { display: block; font-weight: 800; font-size: 17px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-tag { display: block; font-size: 12px; color: #d1d5db; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text);
  text-decoration: none; font-weight: 500; }
.nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav a:hover { background: var(--bg); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.nav .count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.nav .count.alert { color: #fff; background: var(--danger); border-radius: 999px; padding: 0 7px; }
.nav-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 18px 10px 6px; font-weight: 700; }
.side-foot { margin-top: auto; padding: 14px 4px 0; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.theme-btn { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 6px 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.theme-btn svg { width: 16px; height: 16px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.main { padding: 26px 34px 120px; max-width: 1000px; }
.topbar { display: none; }
.bottomnav { display: none; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; margin: 0; letter-spacing: -.01em; font-weight: 800; color: var(--accent-ink); }
.page-head .sub { color: var(--muted); font-size: 14px; }
.spacer { flex: 1; }

@media (max-width: 820px) {
  .shell { padding: 0; gap: 0; display: block; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; height: 100vh; border-radius: 0 24px 24px 0; transform: translateX(-110%); transition: transform .2s;
    padding-top: calc(env(safe-area-inset-top) + 14px); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 30; }
  .main-wrap { min-height: 100vh; border: 0; border-radius: 0; }
  .main { padding: 14px 14px 140px; }
  /* Dark frosted header with the brand gradient underline, like the site's header bar. */
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20; background: rgba(31,41,55,.92); color: #fff;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: calc(env(safe-area-inset-top) + 8px) 10px 8px;
    border-bottom: 2px solid; border-image: var(--brand-line) 1; }
  .topbar .icon-btn { color: #e5e7eb; }
  .topbar .icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
  .topbar .top-logo { width: 28px; height: 28px; object-fit: cover; border: 2px solid var(--brand-accent); border-radius: 8px; }
  .topbar .top-logo.circle { border-radius: 50%; }
  .topbar .title { font-weight: 800; font-size: 17px; }
  .page-head h1 { font-size: 22px; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: rgba(17,24,39,.95);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid #374151; padding: 6px 4px calc(env(safe-area-inset-bottom) + 6px); }
  .bottomnav a { flex: 1; text-align: center; font-size: 11px; color: #9ca3af; text-decoration: none; padding: 4px 0; font-weight: 600; position: relative; }
  .bottomnav a svg { display: block; margin: 0 auto 2px; width: 22px; height: 22px; }
  .bottomnav a.active { color: var(--brand-accent); }
  .bottomnav .bn-count { position: absolute; top: 0; left: 55%; background: var(--danger); color: #fff; border-radius: 999px; font-size: 10px; padding: 0 5px; line-height: 16px; }
  .fab { display: flex !important; }
}

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--panel);
  padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; color: var(--text); }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--btn-grad); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.08); border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: transparent; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--muted); display: inline-flex; }
.icon-btn:hover { background: var(--line); color: var(--text); }
.icon-btn svg, .btn svg { width: 18px; height: 18px; }
input[type=text], input[type=password], input[type=date], input[type=datetime-local], input[type=time], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 9px 11px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
label.field { display: block; margin-bottom: 14px; }
label.field > span, .field-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.seg button.on.p1 { color: var(--now); } .seg button.on.p2 { color: var(--next); } .seg button.on.p3 { color: var(--later); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip-btn { border: 1px dashed var(--line); background: transparent; border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--muted); font-weight: 600; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { padding: 12px 14px; }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat.alert b { color: var(--danger); }
@media (max-width: 520px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.summary { margin-bottom: 18px; border-left: 4px solid var(--accent); }
.summary-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 0 16px; }
.summary-head h2 { font-size: 15px; margin: 0; }
.summary-body { padding: 4px 18px 14px; line-height: 1.5; }
.summary-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin: 14px 0 4px; }
.summary-body ul { margin: 4px 0; padding-left: 20px; }
.summary-body li { margin: 3px 0; }
.summary-body p { margin: 6px 0; }
.summary.collapsed .summary-body { display: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Quick add ---------- */
.quickadd { display: flex; gap: 8px; align-items: center; padding: 8px 8px 8px 14px; margin-bottom: 16px; }
.quickadd input { border: 0; padding: 6px 0; box-shadow: none !important; background: transparent; }
.quickadd .seg { flex-shrink: 0; }

/* ---------- Task list ---------- */
.group { margin-bottom: 22px; }
.group-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 4px 8px; }
.group-title .n { background: var(--line); color: var(--muted); border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.tasks { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.task { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .1s; }
.task:last-child { border-bottom: 0; }
.task:hover { background: var(--bg); }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); flex-shrink: 0; margin-top: 1px; background: transparent;
  cursor: pointer; display: grid; place-items: center; padding: 0; }
.check.p1 { border-color: var(--now); } .check.p2 { border-color: var(--next); }
.check:hover { background: var(--accent-soft); }
.check.done { background: var(--ok); border-color: var(--ok); }
.check svg { width: 14px; height: 14px; color: #fff; display: none; }
.check.done svg, .check:hover svg { display: block; }
.check:hover:not(.done) svg { color: var(--muted); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; line-height: 1.35; word-wrap: break-word; }
.task.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; font-size: 12.5px; color: var(--muted); align-items: center; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta svg { width: 13px; height: 13px; }
.meta .overdue { color: var(--danger); font-weight: 700; }
.meta .today { color: var(--accent); font-weight: 700; }
.pill { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; flex-shrink: 0; border: 0; cursor: pointer; text-transform: uppercase; letter-spacing: .04em; }
.pill.p1 { background: var(--now-soft); color: var(--now); }
.pill.p2 { background: var(--next-soft); color: var(--next); }
.pill.p3 { background: var(--later-soft); color: var(--later); }
.status-tag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); text-transform: uppercase; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-width: 140px; padding: 7px 10px; font-size: 14px; }
.filters input[type=search] { flex: 1; min-width: 160px; }

/* ---------- Sheet (task detail) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; background: rgba(15,17,23,.35); animation: fade .15s; }
.sheet { width: min(560px, 100%); height: 100%; background: var(--panel); overflow-y: auto; box-shadow: -10px 0 40px rgba(0,0,0,.15); animation: slide .2s ease-out;
  padding-bottom: calc(env(safe-area-inset-bottom) + 40px); }
.sheet-head { position: sticky; top: 0; background: var(--panel); z-index: 2; display: flex; align-items: center; gap: 6px;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 10px; border-bottom: 1px solid var(--line); }
.sheet-body { padding: 18px 20px; }
.sheet .title-input { font-size: 20px; font-weight: 700; border: 0; padding: 4px 0; box-shadow: none !important; background: transparent; }
.section { border-top: 1px solid var(--line); margin: 18px -20px 0; padding: 16px 20px 0; }
.section-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 12px; }
.section-title svg { width: 18px; height: 18px; color: var(--muted); }
.saved { font-size: 12px; color: var(--muted); }
@keyframes slide { from { transform: translateX(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
@media (max-width: 820px) { .sheet { width: 100%; } }

.links { list-style: none; padding: 0; margin: 0 0 10px; }
.links li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; }
.links li svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.links li a { flex: 1; min-width: 0; text-decoration: none; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links li .lmeta { font-size: 12px; color: var(--muted); font-weight: 400; display: block; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.slot { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-weight: 600; margin-bottom: 10px; }
.events { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; }
.events li { display: flex; gap: 10px; padding: 5px 0; color: var(--muted); border-bottom: 1px dashed var(--line); }
.events li b { color: var(--text); font-weight: 600; min-width: 92px; }

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(15,17,23,.45); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: min(560px, 100%); max-height: 86vh; overflow-y: auto; background: var(--panel); border-radius: 14px; padding: 18px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h2 { margin: 0 0 14px; font-size: 18px; }
.results { list-style: none; padding: 0; margin: 12px 0 0; }
.results li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; cursor: pointer; }
.results li:hover { border-color: var(--accent); background: var(--accent-soft); }
.results li b { display: block; }
.results li span { font-size: 12.5px; color: var(--muted); }

/* ---------- Customers ---------- */
.cust { margin-bottom: 14px; }
.cust-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.cust-head h3 { margin: 0; font-size: 16px; flex: 1; }
.cust-head h3 a { color: var(--text); text-decoration: none; }
.proj { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 36px; border-top: 1px solid var(--line); }
.proj a { flex: 1; color: var(--text); text-decoration: none; font-weight: 500; }
.badge { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 2px 9px; }
input[type=color] { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 3px; background: var(--panel); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(400px, 100%); padding: 28px; text-align: center; background: var(--surface); border: 4px solid var(--frame);
  border-radius: 24px; box-shadow: 0 25px 50px -12px rgba(0,0,0,.4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.login .login-logo { width: 72px; height: 72px; object-fit: cover; margin-bottom: 10px; border: 3px solid var(--brand-accent); border-radius: 18px; box-shadow: 0 6px 16px rgba(0,0,0,.25); background: #fff; }
.login .login-logo.circle { border-radius: 50%; }
.login .login-tag { color: var(--muted); font-size: 13px; margin: -12px 0 18px; }
.login h1 { margin: 0 0 18px; font-size: 22px; }
.login .err { color: var(--danger); font-size: 14px; margin-top: 10px; min-height: 20px; }

.setting { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .txt { flex: 1; }
.setting .txt b { display: block; }
.setting .txt span { font-size: 13px; color: var(--muted); }
.setting input[type=time] { width: 120px; }
.toggle { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; cursor: pointer; transition: .15s; }
.toggle span::after { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(18px); }
h2.settings-h { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 24px 4px 8px; }
code.inline { background: var(--bg); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; font-size: 12.5px; word-break: break-all; }

.fab { display: none; position: fixed; right: 18px; bottom: calc(env(safe-area-inset-bottom) + 78px); z-index: 25; width: 56px; height: 56px; border-radius: 18px;
  background: var(--btn-grad); color: #fff; border: 0; box-shadow: 0 8px 24px color-mix(in srgb, var(--brand-accent) 45%, transparent); align-items: center; justify-content: center; cursor: pointer; }
.fab svg { width: 26px; height: 26px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 90px); z-index: 100;
  background: #1f2333; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  display: flex; gap: 12px; align-items: center; max-width: calc(100% - 32px); }
.toast button { background: transparent; border: 0; color: #a5b4fc; font-weight: 700; cursor: pointer; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Sign-in, setup and settings forms ---------- */
.login .card.wide { width: min(640px, 100%); text-align: left; }
.login .card.wide h1 { text-align: left; }
.login .left { text-align: left; }
.login p { line-height: 1.5; }
.login .small { font-size: 13px; }
.ms-btn { width: 100%; padding: 11px 14px; font-size: 15px; }
.ms-btn svg { width: 18px; height: 18px; background: #fff; border-radius: 2px; padding: 1px; }
.steps { padding-left: 20px; margin: 18px 0; }
.steps > li { margin-bottom: 20px; line-height: 1.5; }
.steps > li > b { display: block; margin-bottom: 6px; }
.steps p { margin: 4px 0 8px; }
.steps ul { margin: 4px 0; padding-left: 18px; }
.steps ul li { margin-bottom: 4px; }
.steps label.field { margin: 8px 0 10px; }
.copy { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.row-end { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 8px; }
.note { background: var(--accent-soft); border-radius: 9px; padding: 10px 12px; font-size: 13px; line-height: 1.45; }
.form-card { padding: 16px 18px; }
.form-card label.field { margin-bottom: 14px; }
.form-card .setting.tight { padding: 4px 0 14px; border: 0; }
small.help { display: block; color: var(--muted); font-size: 12.5px; margin-top: 5px; line-height: 1.4; }
input:disabled, select:disabled { opacity: .65; }
.link-btn { float: right; border: 0; background: none; color: var(--danger); font: inherit; font-size: 12px; text-transform: none; letter-spacing: 0; cursor: pointer; padding: 0; }
details.adv > summary { cursor: pointer; font-weight: 600; }
details.adv[open] > summary { margin-bottom: 12px; }

.steps .seg { margin: 4px 0 12px; }
.cmd { display: flex; gap: 8px; align-items: flex-start; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px; }
.cmd code { flex: 1; font-size: 12.5px; word-break: break-all; line-height: 1.5; }
.wait { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 9px; background: var(--bg); font-size: 14px; margin-top: 6px; }
.wait.ok { background: var(--accent-soft); }
.wait svg { width: 18px; height: 18px; color: var(--ok); flex-shrink: 0; }
.ms-btn:disabled { opacity: .45; }
.steps p code.inline { word-break: normal; white-space: nowrap; }

/* Test results in Settings */
.test-result { margin: 4px 0 10px; padding: 10px 12px; border-radius: 9px; background: var(--bg); font-size: 13.5px; line-height: 1.45; }
.test-result.ok { background: color-mix(in srgb, var(--ok) 10%, var(--panel)); }
.test-result.fail { background: var(--danger-soft); }
.test-result > div { display: flex; gap: 8px; align-items: flex-start; padding: 2px 0; }
.test-result svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.test-result .pass svg { color: var(--ok); }
.test-result .bad svg { color: var(--danger); }
.test-result .unsaved { margin-top: 4px; padding-left: 24px; }
.form-card > small.help { margin: -4px 0 10px; }

/* ---------- Catch up ---------- */
a.stat { text-decoration: none; color: inherit; }
a.stat:hover { border-color: var(--brand-accent); }
.meta .missed { color: var(--next); font-weight: 700; }
.replan { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.replan .chip-btn { border-style: solid; background: var(--panel); }
.group-title .chip-btn { margin-left: auto; text-transform: none; letter-spacing: 0; }

/* ---------- Branding editor ---------- */
.brand-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .brand-grid { grid-template-columns: 1fr; } }
.brand-sub { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.brand-sub:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.asset-row { display: flex; gap: 8px; align-items: center; }
.asset-row input[type=url], .asset-row input[type=text] { flex: 1; min-width: 0; }
.asset-prev { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; border: 2px solid var(--brand-accent); flex-shrink: 0; background: var(--bg); }
.asset-prev.circle { border-radius: 50%; }
.color-row { display: flex; gap: 10px; flex-wrap: wrap; }
.color-field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px 4px 4px; background: var(--panel); }
.color-field input[type=color] { width: 32px; height: 32px; border: 0; padding: 0; background: none; cursor: pointer; }
.color-field span { font-size: 13px; font-weight: 600; }
.color-field small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.bg-swatch { height: 56px; border-radius: 12px; margin-top: 10px; border: 1px solid var(--line); background-size: cover; background-position: center; }
.font-sample { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 17px; }
.unsaved-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-top: 12px;
  background: rgba(17,24,39,.95); color: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.unsaved-bar .btn.ghost { color: #e5e7eb; }

/* ---------- Browsing (mail, OneDrive, Podio, Krisp) ---------- */
.modal.wide { width: min(720px, 100%); max-height: 88vh; display: flex; flex-direction: column; }
.browse-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.browse-head h2 { margin: 0; flex: 1; }
.browse-roots { margin-bottom: 10px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; margin-bottom: 8px; color: var(--muted); }
.crumbs button { border: 0; background: none; padding: 2px 4px; color: var(--accent-ink); font-weight: 600; cursor: pointer; border-radius: 6px; }
.crumbs button:disabled { color: var(--text); cursor: default; }
.results.browse { flex: 1; overflow-y: auto; min-height: 200px; max-height: 55vh; margin-top: 10px; }
.results.browse li { display: flex; align-items: flex-start; gap: 10px; }
.results.browse li > svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--muted); }
.results.browse li.is-folder > svg { color: var(--brand-accent); }
.results.browse li > div { flex: 1; min-width: 0; }
.results.browse li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results.browse li span { display: block; }
.results.browse li .pv { opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results.browse li .go { font-size: 20px; color: var(--muted); align-self: center; }
.results.browse li.empty-row { justify-content: center; cursor: default; border-style: dashed; }
.results.browse li.empty-row:hover { background: none; border-color: var(--line); }

/* ---------- Integrations and customers in Settings ---------- */
.int-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px 4px; }
.int-head.flush { padding: 0 0 10px; }
.int-head svg { width: 18px; height: 18px; color: var(--brand-accent); }
.int-head .muted { margin-left: 4px; }
.err-note { background: var(--danger-soft); color: var(--danger); }
.podio-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pa-space { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--panel); }
.pa-name { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.pa-app { display: flex; align-items: center; gap: 6px; font-size: 14px; padding: 2px 0; cursor: pointer; }
.remembered { list-style: none; margin: 0; padding: 0; }
.remembered li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.remembered li a { font-weight: 600; color: var(--text); text-decoration: none; }
.remembered li .link-btn { margin-left: auto; float: none; }
.proj-chip { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; background: var(--bg); border-radius: 999px; padding: 1px 4px 1px 9px; }
.proj-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px; }
.proj-chip button:hover { color: var(--danger); }
