:root {
  color-scheme: light;
  --navy: #112235;
  --navy-2: #1b3048;
  --blue: #2f6fed;
  --blue-soft: #e8f0ff;
  --ink: #152236;
  --muted: #6d7a8e;
  --line: #dfe5ee;
  --surface: #ffffff;
  --canvas: #f3f6fa;
  --green: #2f9d69;
  --amber: #b97522;
  --red: #c84652;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.35;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--ink); }
body { min-width: 280px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.is-hidden { display: none !important; }

.loading-screen { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; align-content: center; gap: 8px; background: var(--navy); color: white; transition: opacity .25s ease, visibility .25s ease; }
.loading-screen.is-ready { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-mark, .brand-mark { display: grid; place-items: center; font-weight: 800; color: white; background: var(--blue); }
.loading-mark { width: 68px; height: 68px; border-radius: 18px; font-size: 36px; box-shadow: 0 14px 34px rgba(14, 35, 62, .35); }
.loading-name { font-size: 19px; font-weight: 700; }
.loading-dots { display: flex; gap: 5px; margin-top: 4px; }
.loading-dots span { width: 5px; height: 5px; border-radius: 50%; background: #9abaf9; animation: dot 1s infinite ease-in-out; }
.loading-dots span:nth-child(2) { animation-delay: .15s; }.loading-dots span:nth-child(3) { animation-delay: .3s; }
.loading-credit { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); color: #a7b7ca; font-size: 11px; }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }

.auth-screen { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: linear-gradient(145deg, #eaf1fb, #f8fafc); overflow-y: auto; }
.auth-card { width: min(100%, 380px); padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(33, 51, 77, .10); }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; font-size: 22px; margin-bottom: 18px; }
.eyebrow { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
h1, h2, h3, p { margin: 0; }
.auth-card h1 { margin-top: 5px; font-size: 26px; line-height: 1.1; }
.auth-note { margin-top: 9px; color: var(--muted); }
.auth-form { display: grid; gap: 12px; margin-top: 20px; }
.auth-form label, .settings-label { display: grid; gap: 5px; color: #445168; font-weight: 600; }
input, textarea, select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #cdd6e3; border-radius: 8px; color: var(--ink); background: #fff; outline: none; }
input:focus, textarea:focus, select:focus, button:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,111,237,.17); outline: none; }
.primary-button { min-height: 44px; border: 0; border-radius: 8px; background: var(--blue); color: white; font-weight: 700; }
.text-button { border: 0; background: transparent; color: var(--blue); min-height: 32px; }
.form-error { min-height: 18px; color: var(--red); font-size: 12px; }

.app-shell { min-height: 100dvh; display: grid; grid-template-columns: 164px minmax(0, 1fr); background: var(--canvas); }
.sidebar { display: flex; min-height: 100dvh; flex-direction: column; padding: 10px 8px; background: var(--navy); color: #d8e5f5; }
.sidebar-brand { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 6px 10px; font-weight: 800; color: white; }
.sidebar-mark { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; background: var(--blue); color: white; font-size: 15px; }
.sidebar-label { margin: 10px 7px 7px; color: #8ea3bb; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.client-list { display: grid; gap: 4px; }
.client-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px; align-items: center; min-height: 36px; padding: 6px 7px; border: 0; border-radius: 8px; text-align: left; color: #d8e5f5; background: transparent; }
.client-item:hover, .client-item.is-active { background: var(--navy-2); color: white; }
.client-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-badges { display: flex; gap: 3px; }
.count-badge, .nav-badge, .client-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 10px; color: white; background: #ef9b3a; font-size: 10px; font-weight: 800; }
.message-badge { background: #5c9bf6; }
.sidebar-bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(219, 231, 245, .12); }
.sidebar-action { width: 100%; min-height: 30px; border: 0; border-radius: 7px; text-align: left; padding: 0 7px; color: #b8c9dd; background: transparent; }
.sidebar-action:hover { color: white; background: rgba(255,255,255,.08); }

.main-shell { min-width: 0; min-height: 100dvh; display: grid; grid-template-rows: 52px minmax(0, 1fr) 56px 22px; }
.topbar { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-title { display: grid; gap: 1px; min-width: 0; }.topbar-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }.topbar-kicker { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.topbar-actions { display: flex; gap: 4px; margin-left: auto; }.icon-button { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; color: #516078; background: transparent; font-size: 19px; }.icon-button:hover { background: var(--blue-soft); color: var(--blue); }.bell-icon { display: block; width: 20px; height: 20px; }.bell-button .count-badge { position: absolute; top: 1px; right: 0; }
.mobile-client-button { display: none; }
.workspace-scroll { min-height: 0; overflow: auto; padding: 20px 24px 24px; }
.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }.workspace-heading h1 { margin-top: 3px; font-size: 25px; line-height: 1.1; }.source-status { color: var(--muted); font-size: 12px; }
#workspace-content { max-width: 980px; }
.panel { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }.panel + .panel { margin-top: 12px; }
.section-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }.section-toolbar h2 { font-size: 17px; }.muted { color: var(--muted); }
.task-list { display: grid; gap: 8px; }.task-card { border: 1px solid var(--line); border-radius: 9px; background: #fff; overflow: hidden; }.task-card.is-complete { background: #f7faf8; }.task-main { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: 9px; padding: 11px 12px; cursor: pointer; }.task-check { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--green); }.task-title { font-size: 14px; font-weight: 700; }.task-card.is-complete .task-title { color: #718078; text-decoration: line-through; }.task-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 4px; color: var(--muted); font-size: 11px; }.task-status { align-self: start; padding: 4px 7px; border-radius: 999px; color: #546277; background: #eef2f7; font-size: 11px; white-space: nowrap; }.task-details { display: grid; gap: 10px; padding: 0 12px 12px 49px; border-top: 1px solid var(--line); }.task-details-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; padding-top: 10px; }.task-detail { display: grid; gap: 2px; }.task-detail span:first-child { color: var(--muted); font-size: 11px; }.task-detail span:last-child { font-weight: 600; }.checklist { display: grid; gap: 5px; }.checklist-title { font-weight: 700; font-size: 12px; }.check-item { display: flex; align-items: center; gap: 7px; color: #4d5d70; }.check-item input { width: 16px; min-height: 16px; }.empty-state { display: grid; gap: 6px; place-items: center; min-height: 180px; padding: 20px; color: var(--muted); text-align: center; }.empty-state strong { color: var(--ink); font-size: 15px; }
.task-editor { display: grid; grid-template-columns: minmax(0,2fr) minmax(120px,1fr) minmax(120px,1fr); gap: 8px; padding-top: 10px; }.task-actions { display: flex; gap: 6px; }
.message-list { display: grid; gap: 8px; }.message-card { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: white; }.message-head { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }.message-sender { color: var(--ink); font-weight: 700; }.message-text { margin-top: 7px; white-space: pre-wrap; word-break: break-word; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }.stat-card { padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: white; }.stat-value { font-size: 23px; font-weight: 800; }.stat-label { margin-top: 2px; color: var(--muted); font-size: 12px; }
.settings-grid { display: grid; gap: 10px; }.settings-card { display: grid; gap: 7px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: white; }.settings-card h3 { font-size: 14px; }.settings-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }.settings-row strong { color: var(--ink); text-align: right; font-weight: 600; }.status-pill { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-weight: 700; }.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.bell-panel { position: absolute; z-index: 5; top: 46px; right: 18px; width: min(390px, calc(100vw - 24px)); max-height: min(520px, calc(100dvh - 72px)); overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 18px 42px rgba(31, 49, 77, .18); }.bell-panel h2 { font-size: 15px; margin-bottom: 9px; }.change-item { display: grid; gap: 7px; padding: 10px 0; border-top: 1px solid var(--line); }.change-item:first-of-type { border-top: 0; }.change-item-title { font-weight: 700; }.change-fields { color: var(--muted); font-size: 12px; }.change-actions { display: flex; gap: 6px; }.small-button { min-height: 30px; padding: 0 9px; border: 1px solid #bfcce0; border-radius: 7px; color: var(--blue); background: #f8fbff; font-weight: 700; }.small-button:hover { background: var(--blue-soft); }.conflict-note { color: var(--red); font-size: 11px; }
.bottom-nav { display: flex; align-items: stretch; justify-content: center; gap: 5px; padding: 5px 10px; background: white; border-top: 1px solid var(--line); }.nav-item { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 104px; min-height: 44px; padding: 0 11px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 12px; }.nav-item:hover, .nav-item.is-active { color: var(--blue); background: var(--blue-soft); }.nav-icon { font-size: 18px; line-height: 1; }.nav-badge { position: absolute; top: 3px; right: 9px; background: #ef9b3a; }.developer-footer { display: flex; align-items: center; justify-content: center; min-height: 22px; color: var(--muted); background: white; font-size: 11px; }.developer-footer a { color: inherit; }

@media (max-width: 680px) {
  .app-shell { display: block; min-height: 100dvh; }.sidebar { display: none; }.main-shell { min-height: 100dvh; grid-template-rows: 48px minmax(0,1fr) 56px 22px; }.topbar { padding: 0 10px; padding-top: env(safe-area-inset-top); height: calc(48px + env(safe-area-inset-top)); }.mobile-client-button { display: block; max-width: 125px; min-height: 34px; padding: 0 8px; border: 0; border-radius: 8px; color: var(--ink); background: var(--blue-soft); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.topbar-title { display: none; }.topbar-actions { margin-left: auto; }.workspace-scroll { padding: 14px 10px 16px; }.workspace-heading { align-items: flex-start; flex-direction: column; gap: 4px; margin-bottom: 12px; }.workspace-heading h1 { font-size: 23px; }.source-status { font-size: 11px; }.panel { padding: 13px; border-radius: 12px; }.task-main { grid-template-columns: 28px minmax(0,1fr); padding: 11px 10px; }.task-status { grid-column: 2; justify-self: start; margin-top: -4px; }.task-details { padding-left: 47px; }.task-editor { grid-template-columns: 1fr; }.task-details-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }.stats-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }.stat-card { padding: 10px; }.stat-value { font-size: 20px; }.stat-label { font-size: 10px; }.bottom-nav { gap: 2px; padding: 4px 6px; padding-bottom: calc(4px + env(safe-area-inset-bottom)); height: calc(56px + env(safe-area-inset-bottom)); }.nav-item { min-width: 0; flex: 1; min-height: 44px; padding: 0 3px; flex-direction: column; gap: 2px; font-size: 11px; }.nav-icon { font-size: 19px; }.nav-badge { top: 1px; right: calc(50% - 19px); }.developer-footer { min-height: calc(22px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }.bell-panel { top: calc(44px + env(safe-area-inset-top)); right: 10px; }.client-switcher { position: absolute; z-index: 6; top: calc(44px + env(safe-area-inset-top)); left: 10px; right: 10px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: 0 14px 30px rgba(31,49,77,.16); }.client-switcher .client-item { color: var(--ink); }.auth-card { padding: 22px; }.auth-screen { align-items: start; padding-top: max(20px, env(safe-area-inset-top)); }
}

@media (min-width: 681px) { .client-switcher { display: none !important; } }
