@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@500;600;700;800&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ----------------------------------------------------------------------------
   Aurora design language: deep-space navy chrome, an indigo→violet→magenta
   brand gradient, cyan/pink accents used sparingly, soft tinted shadows.
   Every selector here predates the restyle — class names are load-bearing
   (app.js queries them), so this file changes how things look, never what
   they are called. The annotated traps from the old sheet are preserved
   where they stood.
---------------------------------------------------------------------------- */
:root {
  --bg: #f5f6fd;
  --panel: #ffffff;
  --panel-soft: #fafbff;
  --dark: #0b0e23;
  --dark-2: #171a3f;
  --accent: #6366f1;
  --accent-dark: #4f46e5;
  --accent-soft: #eef0ff;
  --violet: #8b5cf6;
  --magenta: #d946ef;
  --cyan: #06b6d4;
  --pink: #ec4899;
  --text: #14182e;
  --muted: #666f8c;
  --border: #e4e7f4;
  --border-strong: #cdd3ec;
  --green: #0e9f6e;
  --green-soft: #e6f8f0;
  --amber: #b45309;
  --amber-soft: #fdf3e0;
  --red: #dc2626;
  --grad-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #d946ef 115%);
  --grad-cool: linear-gradient(135deg, #6366f1, #06b6d4);
  --grad-aurora: linear-gradient(90deg, #06b6d4, #6366f1 35%, #8b5cf6 65%, #ec4899);
  --shadow-sm: 0 1px 2px rgba(20, 24, 46, 0.05), 0 2px 10px rgba(83, 91, 200, 0.06);
  --shadow-md: 0 8px 28px rgba(78, 86, 190, 0.14);
  --shadow-lg: 0 28px 70px rgba(11, 14, 35, 0.35);
  --glow-accent: 0 4px 18px rgba(99, 102, 241, 0.35);
  --r-card: 18px;
  --r-btn: 11px;
  --font-display: "Manrope", "Inter", sans-serif;
}

::selection { background: rgba(139, 92, 246, 0.25); }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* Slim, tinted scrollbars — the default grey bars read as unstyled. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccd2ea; border-radius: 999px; border: 2.5px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aeb6dd; border: 2.5px solid transparent; background-clip: content-box; }

/* Keyboard focus stays visible on the new palette. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Login ---------- */
.login-screen {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1100px 560px at 12% -12%, rgba(99, 102, 241, 0.5), transparent 60%),
    radial-gradient(900px 560px at 92% 112%, rgba(6, 182, 212, 0.32), transparent 62%),
    radial-gradient(700px 420px at 75% -8%, rgba(217, 70, 239, 0.24), transparent 60%),
    linear-gradient(155deg, #0b0e23 0%, #171a3f 55%, #1b1046 100%);
}
.login-card {
  background: rgba(255, 255, 255, 0.97); border-radius: 26px; padding: 54px 62px; text-align: center;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.12);
  position: relative; overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--grad-aurora);
}
.login-logo { font-size: 54px; filter: drop-shadow(0 6px 14px rgba(99, 102, 241, 0.35)); }
.login-card h1 {
  margin: 10px 0 4px; font-size: 28px; font-weight: 700; letter-spacing: -0.02em;
  font-family: var(--font-display);
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-card p { color: var(--muted); margin-bottom: 26px; }
.login-error { color: var(--red); margin-top: 16px; max-width: 340px; font-size: 14px; }

/* ---------- App shell ---------- */
.app { display: flex; flex-direction: column; height: 100vh; }

/* Wraps rather than pushing the page sideways: with an org label, three
   dialogs, Hire, the signed-in address, Help and Sign out, the row runs past a
   ~1000px window and used to force horizontal scroll on the whole app. */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background:
    radial-gradient(700px 200px at 8% 0%, rgba(99, 102, 241, 0.35), transparent 65%),
    radial-gradient(600px 180px at 85% 100%, rgba(217, 70, 239, 0.16), transparent 60%),
    linear-gradient(110deg, var(--dark) 0%, var(--dark-2) 70%, #1b1046 100%);
  color: #fff; padding: 13px 30px; flex-shrink: 0;
  flex-wrap: wrap; row-gap: 10px; column-gap: 16px;
  position: relative;
}
/* The aurora hairline — the one loud brand stroke on every screen. */
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--grad-aurora); opacity: 0.9;
}
.topbar-brand {
  font-size: 17px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
}
.topbar-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.topbar-user { font-size: 12px; color: #8b95ba; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .topbar { padding: 11px 16px; }
  .topbar-user { max-width: 150px; }
}
.topbar-org {
  font-size: 12px; font-weight: 700; color: #cdd5f0; letter-spacing: 0.04em; text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(139, 146, 255, 0.28);
  padding: 5px 13px; border-radius: 999px;
}
.topbar .btn:not(.btn-primary):not(.btn-link) {
  background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.16); color: #eaedfb;
}
.topbar .btn:not(.btn-primary):not(.btn-link):hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(139, 146, 255, 0.5); }

.team-main { flex: 1; overflow-y: auto; padding: 36px 32px; }

/* A whisper of aurora on the working background, fixed so it never scrolls. */
.team-main, .desk-main {
  background:
    radial-gradient(900px 480px at 90% -10%, rgba(99, 102, 241, 0.07), transparent 60%),
    radial-gradient(800px 480px at -10% 110%, rgba(6, 182, 212, 0.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- My Desk ---------- */
.desk-main { flex: 1; overflow-y: auto; padding: 32px; }
.desk-header { max-width: 1220px; margin: 0 auto 22px; display: flex; align-items: baseline; gap: 14px; }
.desk-header h1 { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; font-family: var(--font-display); }
.desk-date { color: var(--muted); font-size: 14px; }
.desk-grid {
  max-width: 1220px; margin: 0 auto; display: grid;
  grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: start;
}
@media (max-width: 900px) { .desk-grid { grid-template-columns: 1fr; } }
.desk-col { display: flex; flex-direction: column; gap: 20px; }
.desk-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 18px 20px 16px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
/* Each desk card carries a quiet gradient signature along its top edge. */
.desk-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2.5px;
  background: var(--grad-cool); opacity: 0.55;
}
.desk-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.desk-card-head h2 { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; font-family: var(--font-display); }
.desk-filters { display: flex; gap: 3px; }
.filter-btn {
  background: none; border: none; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--muted);
  padding: 4px 9px; border-radius: 7px; cursor: pointer;
}
.filter-btn:hover { background: #f0f2fb; color: var(--text); }
.filter-btn.active { background: var(--accent-soft); color: var(--accent-dark); box-shadow: inset 0 0 0 1px #dcdffc; }

.todo-form { display: flex; gap: 7px; margin-bottom: 12px; }
.todo-form input[type="text"], .todo-form input:not([type]) {
  flex: 1; border: 1px solid var(--border); border-radius: var(--r-btn); padding: 8px 12px;
  font: inherit; font-size: 13.5px; outline: none; background: var(--panel-soft);
}
.todo-form input[type="date"] {
  border: 1px solid var(--border); border-radius: var(--r-btn); padding: 8px 10px;
  font: inherit; font-size: 12.5px; background: var(--panel-soft); color: var(--muted); outline: none;
}
.todo-form input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,0.14); }

.desk-list { display: flex; flex-direction: column; gap: 8px; }
.desk-empty { color: #9aa2c0; font-size: 13px; padding: 14px 2px; }

.desk-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.desk-item:hover { border-color: #cfd4f6; box-shadow: 0 2px 10px rgba(83, 91, 200, 0.08); }
.desk-item.done { opacity: 0.5; }
.desk-item.done .desk-item-title { text-decoration: line-through; }
.desk-check {
  width: 18px; height: 18px; border: 1.5px solid #c3cade; border-radius: 6px; flex-shrink: 0;
  cursor: pointer; background: #fff; margin-top: 1px; display: flex; align-items: center;
  justify-content: center; font-size: 11px; color: #fff; line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.desk-check.checked { background: var(--green); border-color: var(--green); }
.desk-item-main { flex: 1; min-width: 0; }
.desk-item-title { font-size: 13.5px; font-weight: 600; }
.desk-item-body { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; white-space: pre-wrap; }
.desk-item-body.clamped {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden; cursor: pointer;
}
.desk-more {
  background: none; border: none; padding: 0; margin-top: 4px; cursor: pointer;
  font: inherit; font-size: 11.5px; font-weight: 600; color: var(--accent);
}
.desk-item-meta { font-size: 11.5px; color: #9aa2c0; margin-top: 5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.desk-due { font-weight: 700; }
.desk-due.overdue { color: var(--red); }
.desk-due.today { color: var(--amber); }
.desk-from { background: var(--accent-soft); color: var(--accent-dark); border-radius: 999px; padding: 2px 8px; font-weight: 600; }
.desk-item-x { border: none; background: none; color: #b9c0d6; cursor: pointer; font-size: 14px; padding: 2px; line-height: 1; border-radius: 6px; transition: color 0.15s ease, background 0.15s ease; }
.desk-item-x:hover { color: var(--red); background: #fdf0ee; }
.desk-item a.desk-link { color: var(--accent); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.desk-item a.desk-link:hover { text-decoration: underline; }

.desk-approval { border-left: 3px solid #edb95e; cursor: pointer; }
.desk-approval:hover { background: #fffaf0; }
.desk-note { border-left: 3px solid var(--accent); }
.desk-doc { border-left: 3px solid var(--green); }
.desk-run { border-left: 3px solid var(--cyan); }
.mailbox-note { font-size: 12.5px; line-height: 1.5; margin-bottom: 10px; color: var(--muted); }
#mailbox-agent { flex: 1; }
.mailbox-ok { color: var(--green); font-weight: 700; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: var(--muted); padding: 90px 40px;
}
.empty-icon { font-size: 46px; margin-bottom: 14px; filter: drop-shadow(0 8px 18px rgba(99, 102, 241, 0.25)); }
.empty-state h2 { color: var(--text); margin-bottom: 8px; font-weight: 700; font-family: var(--font-display); }
.empty-state p { max-width: 420px; line-height: 1.6; }

/* ---------- Team cards ---------- */
.team-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 22px; max-width: 1220px; margin: 0 auto;
}
.agent-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 27px 20px 14px; text-align: center; position: relative;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
  overflow: hidden;
}
/* The card's brand stroke: a gradient crest that brightens on hover. */
.agent-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-brand); opacity: 0.65; transition: opacity 0.2s ease;
}
.agent-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: #cfd4f6; }
.agent-card:hover::before { opacity: 1; }
/* The whole card opens the agent's window, so it has to read as one target.
   The action buttons sit on top of it and keep their own pointer. */
.agent-card.clickable { cursor: pointer; }
.agent-card.clickable .card-actions button { cursor: pointer; }

.card-avatar {
  width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 26px; letter-spacing: 0.02em;
  box-shadow:
    inset 0 -3px 8px rgba(0, 0, 0, 0.14),
    0 6px 18px rgba(99, 102, 241, 0.32),
    0 0 0 3px #fff,
    0 0 0 4.5px rgba(139, 92, 246, 0.35);
}
.card-avatar.small {
  width: 44px; height: 44px; font-size: 17px; margin: 0; flex-shrink: 0;
  box-shadow: inset 0 -2px 6px rgba(0,0,0,0.12), 0 0 0 2px #fff, 0 0 0 3.5px rgba(139, 92, 246, 0.3);
}

.card-name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; font-family: var(--font-display); }
.card-role { font-size: 13px; color: var(--muted); margin-top: 3px; font-weight: 500; }
.card-email { font-size: 11.5px; color: #98a0bb; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-phone { font-size: 11.5px; color: #98a0bb; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card-stats {
  display: flex; justify-content: center; gap: 16px; margin-top: 14px; font-size: 12.5px; color: var(--muted);
  align-items: center; font-weight: 500;
}
.card-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.card-status-dot.idle { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16); }
.card-status-dot.working { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.card-pending {
  position: absolute; top: 14px; right: 14px;
  background: var(--amber-soft); color: var(--amber); border: 1px solid #f0dcae;
  font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  cursor: pointer;
}
.card-pending:hover { filter: brightness(0.97); }

.card-actions {
  display: flex; justify-content: center; gap: 6px; margin-top: 18px;
  border-top: 1px solid var(--border); padding-top: 10px;
}
.card-actions button {
  flex: 1; border: none; background: none; cursor: pointer; border-radius: 12px;
  font-size: 18px; padding: 9px 0 7px; line-height: 1;
  transition: background 0.15s ease, transform 0.15s ease;
}
.card-actions button:hover { background: var(--accent-soft); transform: translateY(-1px); }
.card-actions button span { display: block; font-size: 10px; color: var(--muted); margin-top: 5px; font-weight: 600; }

/* ---------- Dialogs (shared) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(11, 14, 35, 0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: var(--panel); border-radius: 20px; padding: 30px 34px; width: 540px; max-width: 92vw;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.08);
  animation: modal-in 0.22s cubic-bezier(0.21, 0.9, 0.35, 1);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }
.modal h2 { margin-bottom: 18px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; font-family: var(--font-display); }

/* ---------- Tabbed dialog (Manage) ---------- */
/* The modal itself stops scrolling; only .modal-body does, so the tab bar and
   the Save/Cancel footer stay put no matter how long a panel is. */
.modal-tabbed {
  display: flex; flex-direction: column; overflow: hidden;
  padding: 0; width: 620px; height: min(88vh, 760px);
}
.modal-tabbed .modal-head { padding: 26px 30px 0; flex: none; }
.modal-tabbed .modal-head h2 { margin-bottom: 14px; }
.modal-tabbed form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal-body { flex: 1; overflow-y: auto; padding: 22px 30px 26px; }
.modal-foot {
  flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 15px 30px; border-top: 1px solid var(--border); background: var(--panel-soft);
}
.foot-note { margin-right: auto; font-size: 12px; }

/* Same head/body/foot chrome as Manage, without a tab bar — a form you are
   filling in for the first time should not hide required fields behind tabs. */
/* Manage is always tall, so it pins its height. This dialog has a long first
   screen and a short second one — size to content, cap at the same ceiling. */
.modal-headed { height: auto; max-height: min(88vh, 760px); }
.modal-headed .modal-head { padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.modal-headed .modal-head h2 { margin-bottom: 6px; }
.head-note { font-size: 12.5px; line-height: 1.5; }
/* The second screen needs the same column layout `form` gets. */
.hire-step { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.opt-tag {
  margin-left: auto; font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--muted); background: #eef0f9; border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.hire-done {
  display: flex; align-items: center; gap: 9px; margin-bottom: 16px;
  font-size: 14px; color: #2b3253;
}
.hire-done span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 13px;
}
.hire-connect-error { color: var(--red); margin-top: 8px; }

.modal-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.mtab {
  background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600; padding: 9px 13px; cursor: pointer;
  white-space: nowrap; transition: color 0.15s, border-color 0.15s;
}
.mtab:hover { color: #2b3253; }
.mtab.active {
  color: var(--accent-dark);
  border-image: var(--grad-cool) 1; border-bottom: 2px solid var(--accent);
}

/* Panels + the sub-sections inside them */
.tab-panel > *:last-child { margin-bottom: 0; }
.section-block {
  border: 1px solid var(--border); border-radius: 14px; padding: 16px 17px;
  margin-bottom: 16px; background: var(--panel-soft);
}
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.section-head h3 { font-size: 13px; font-weight: 700; color: #2b3253; letter-spacing: -0.005em; font-family: var(--font-display); }
.section-head .danger-head { margin: 0; }
.section-note { margin-bottom: 12px; font-size: 12.5px; line-height: 1.5; }
/* Marks the controls that act the moment you click, rather than on Save. */
.now-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
  color: #8a6d1f; background: #fdf4dc; border: 1px solid #f0e2b4;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap; cursor: help;
}
/* Marks text this agent wrote about itself, as against its supervisor's. */
.agent-written {
  margin-left: auto; font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--accent-dark); background: var(--accent-soft); border: 1px solid #dcdffc;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap; cursor: help;
}
.learned-foot { display: flex; align-items: center; gap: 10px; margin-top: -6px; }
.learned-foot .opt { font-size: 12px; margin-right: auto; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.add-toggle { margin-top: 4px; }
.inline-input {
  width: 100%; margin-bottom: 9px; border: 1px solid var(--border); border-radius: var(--r-btn);
  padding: 9px 12px; font: inherit; font-size: 13.5px; background: #fff; outline: none;
}
.inline-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14); }
textarea.inline-input { display: block; resize: vertical; line-height: 1.55; }
.kv-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 14px; margin-bottom: 15px; border: 1px solid var(--border);
  border-radius: var(--r-btn); background: var(--panel-soft); font-size: 13px; color: var(--muted);
}
.kv-row b { color: #2b3253; font-weight: 600; }
.visibility-hint { font-size: 12.5px; line-height: 1.5; margin: -9px 0 15px; }

/* ---------- Token pricing (platform dialog) ---------- */
.rates-table { border: 1px solid var(--border); border-radius: var(--r-btn); overflow: hidden; background: #fff; }
.rate-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; font-size: 12.5px; }
.rate-row + .rate-row { border-top: 1px solid var(--border); }
.rate-model { color: #2b3253; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.rate-price { color: var(--muted); text-align: right; }
.rate-proposal {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid #f0e2b4; background: #fdf9ee; border-radius: var(--r-btn);
  padding: 10px 12px; margin-bottom: 10px;
}
.rate-proposal-main { flex: 1; min-width: 200px; font-size: 12.5px; line-height: 1.5; }
.rate-proposal-main b { display: block; color: #2b3253; }

.cap-chip { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.cap-chip.warn { color: #8a6d1f; background: #fdf4dc; border: 1px solid #f0e2b4; }
.cap-chip.over { color: #9b2c2c; background: #fdeaea; border: 1px solid #f5c6c6; }

@media (max-width: 680px) {
  .modal-tabbed { width: 96vw; height: 92vh; }
  .modal-tabs { overflow-x: auto; }
  /* Re-assert this after .modal-tabbed's height above, or the short second
     screen of Hire gets stretched to a near-full-height dialog. */
  .modal-headed { height: auto; }
}
.dialog-titlebar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dialog-titlebar h2 { margin-bottom: 0; }
.modal-wide { width: 800px; }

:is(.modal, .meetings-card) label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 15px; color: #2b3253; }
.modal .opt { color: var(--muted); font-weight: 400; }
:is(.modal, .meetings-card) label input, :is(.modal, .meetings-card) label textarea, :is(.modal, .meetings-card) label select {
  display: block; width: 100%; margin-top: 6px; border: 1px solid var(--border);
  border-radius: var(--r-btn); padding: 10px 13px; font: inherit; font-size: 14px; outline: none; background: var(--panel-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
:is(.modal, .meetings-card) label input:focus, :is(.modal, .meetings-card) label textarea:focus, :is(.modal, .meetings-card) label select:focus {
  border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}
/* Checkbox rows opt out of the full-width block styling above. */
:is(.modal, .meetings-card) label.check-row { display: flex; align-items: flex-start; gap: 9px; line-height: 1.45; }
:is(.modal, .meetings-card) label.check-row input[type="checkbox"] {
  display: inline-block; width: auto; margin: 2px 0 0; padding: 0; flex: none;
  accent-color: var(--accent); cursor: pointer;
}
#file-input { display: none !important; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.form-row { display: flex; gap: 12px; }
.form-row label { flex: 1; }

/* ---------- Chat dialog ---------- */
.modal-chat {
  width: 880px; height: 88vh; max-height: 88vh; padding: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 26px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  background: linear-gradient(180deg, #fdfdff, var(--panel));
  position: relative;
}
.chat-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px;
  background: var(--grad-aurora); opacity: 0.35;
}
.chat-header-id { display: flex; align-items: center; gap: 14px; }
.chat-header h2 { font-size: 17px; margin: 0; font-weight: 700; font-family: var(--font-display); }
.agent-role { color: var(--muted); font-size: 12.5px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.badge { font-size: 12px; font-weight: 700; padding: 5px 13px; border-radius: 999px; }
.badge.idle { background: var(--green-soft); color: var(--green); }
.badge.working { background: var(--amber-soft); color: var(--amber); }

.feed {
  flex: 1; overflow-y: auto; padding: 22px 26px; display: flex; flex-direction: column; gap: 12px;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(99, 102, 241, 0.05), transparent 60%),
    var(--bg);
}
.msg {
  max-width: 76%; padding: 12px 16px; border-radius: 16px; line-height: 1.55; font-size: 14px;
  white-space: pre-wrap; word-wrap: break-word;
}
.msg.user {
  align-self: flex-end; color: #fff; border-bottom-right-radius: 5px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6 75%, #a855f7);
  box-shadow: 0 3px 14px rgba(124, 91, 246, 0.32);
}
.msg.agent {
  align-self: flex-start; background: var(--panel); border: 1px solid var(--border);
  border-bottom-left-radius: 5px; box-shadow: var(--shadow-sm); white-space: normal;
}
.msg.agent p { margin: 0 0 10px; }
.msg.agent p:last-child, .msg.agent ul:last-child, .msg.agent ol:last-child { margin-bottom: 0; }
.msg.agent ul, .msg.agent ol { margin: 0 0 10px; padding-left: 22px; }
.msg.agent li { margin-bottom: 4px; }
.msg.agent h1, .msg.agent h2, .msg.agent h3, .msg.agent h4 { font-size: 14.5px; font-weight: 700; margin: 12px 0 6px; }
.msg.agent h1:first-child, .msg.agent h2:first-child, .msg.agent h3:first-child { margin-top: 0; }
.msg.agent code {
  background: #eef0f9; border-radius: 5px; padding: 1px 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px;
}
.msg.agent pre {
  background: #f4f6fc; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 13px; overflow-x: auto; margin: 0 0 10px;
}
.msg.agent pre code { background: none; padding: 0; }
.msg.agent a { color: var(--accent); }
.msg.agent blockquote { border-left: 3px solid var(--border-strong); padding-left: 12px; color: var(--muted); margin: 0 0 10px; }
.msg.agent table { border-collapse: collapse; margin: 0 0 10px; font-size: 13px; }
.msg.agent th, .msg.agent td { border: 1px solid var(--border); padding: 5px 10px; }
.msg.agent hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
/* Phone-width guards: a scope name, a long URL, or a markdown table must not
   burst the bubble. Tables scroll inside their own box; unbreakable tokens
   are allowed to break anywhere rather than push the layout sideways. */
.msg.agent .msg-body { overflow-wrap: anywhere; }
.msg.agent code { overflow-wrap: anywhere; }
.msg.agent table { display: block; overflow-x: auto; max-width: 100%; }
.approval-body, .approval-meta { overflow-wrap: anywhere; }
/* Long messages are folded to a readable height rather than pushing the rest of
   the conversation off-screen. The fade signals there is more without needing a
   second affordance beyond the button. */
.msg.collapsed .msg-body {
  max-height: 210px; overflow: hidden; cursor: pointer;
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 62%, transparent 100%);
}
.msg-chat-tag { margin-top: 7px; font-size: 11px; font-weight: 600; color: #9aa2c0; letter-spacing: 0.01em; }
/* Your message, shown before the backend has recorded it. Faded rather than
   greyed: it should read as "on its way", not as an error or a draft. */
.msg.user.pending { opacity: 0.72; box-shadow: none; }
.msg-pending-tag {
  margin-top: 7px; font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.85);
  display: flex; align-items: center; gap: 6px;
}
.msg-pending-tag::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.5); border-top-color: #fff;
  animation: pending-spin 0.7s linear infinite;
}
@keyframes pending-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .msg-pending-tag::before { animation: none; } }
.msg-more {
  background: none; border: none; padding: 0; margin-top: 8px; cursor: pointer;
  font: inherit; font-size: 11.5px; font-weight: 700;
}
.msg.agent .msg-more { color: var(--accent); }
.msg.user .msg-more { color: #fff; opacity: 0.85; text-decoration: underline; }
.msg.user .msg-more:hover { opacity: 1; }

.msg.tool { align-self: flex-start; background: none; color: #98a0bb; font-size: 12px; padding: 0 16px; font-style: italic; }
.msg.status { align-self: center; background: none; color: var(--muted); font-size: 12px; text-align: center; }

.msg.deliverable {
  align-self: flex-start; background: var(--green-soft); border: 1px solid #c4e8d6;
  display: flex; align-items: center; gap: 9px; max-width: 92%;
  padding: 8px 12px; border-radius: 12px;
  box-shadow: 0 2px 10px rgba(14, 159, 110, 0.1);
}
.msg.deliverable .file-ico { font-size: 16px; line-height: 1; flex-shrink: 0; }
.msg.deliverable .file-name {
  font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msg.deliverable .file-size { color: var(--muted); font-size: 11.5px; flex-shrink: 0; }
.msg.deliverable .file-acts { display: flex; gap: 6px; margin-left: auto; flex-shrink: 0; }
.btn-file { padding: 4px 11px; font-size: 12px; border-radius: 8px; }

.msg.actionRequest { border-left: 3px solid var(--red); }
.action-shot { margin-top: 10px; }
.action-shot-img {
  max-width: 100%; border-radius: 10px; border: 1px solid var(--border); display: block;
}

.msg.calendarRequest { border-left: 3px solid var(--cyan); }

.msg.approval, .msg.taskRequest, .msg.budgetHold, .msg.actionRequest, .msg.calendarRequest {
  align-self: flex-start; background: #fffaf1; border: 1px solid #eeddb6;
  max-width: 80%; display: block; box-shadow: var(--shadow-sm);
}
.msg.budgetHold { background: #fef5f4; border-color: #f0cdc7; }
.approval-head { font-size: 14px; margin-bottom: 6px; font-weight: 500; }
.approval-status { color: var(--muted); font-weight: 400; font-size: 12px; }
.approval-meta { white-space: pre-wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.approval-body {
  white-space: pre-wrap; font-size: 13px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 13px; max-height: 220px; overflow-y: auto;
}
.approval-actions { display: flex; gap: 10px; margin-top: 12px; }
.btn-approve {
  background: linear-gradient(135deg, #0e9f6e, #0d9488); border-color: var(--green); color: #fff;
  font-size: 13px; padding: 8px 15px; box-shadow: 0 2px 10px rgba(14, 159, 110, 0.3);
}
.btn-approve:hover { background: #0b8459; box-shadow: 0 3px 14px rgba(14, 159, 110, 0.4); }
.btn-reject { font-size: 13px; padding: 8px 15px; }

.cabinet-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 9px 26px; background: #fafbff; border-bottom: 1px solid var(--border);
  font-size: 12px; flex-shrink: 0;
}
.cabinet-label { color: var(--muted); font-weight: 600; }

.view-only-note {
  text-align: center; font-size: 13px; color: var(--muted);
  padding: 13px; background: var(--panel); border-top: 1px solid var(--border); flex-shrink: 0;
}

/* `:is(.modal, .meetings-card) label { display: block }` and `:is(.modal, .meetings-card) label input { width: 100% }`
   both out-specify a bare class, so this control has to be scoped to .modal
   too — otherwise the checkbox renders full-width above its own text. Same
   specificity trap as the modal height media query. */
.modal .keep-files {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px;
  color: var(--muted); cursor: pointer; padding: 4px 10px; user-select: none;
  border: 1px solid var(--border); border-radius: 999px; background: var(--panel-soft);
  white-space: nowrap;
}
.modal .keep-files:hover { border-color: var(--border-strong); }
.modal .keep-files input { width: auto; cursor: pointer; margin: 0; flex: none; }
.modal .keep-files.keeping { color: var(--accent); font-weight: 600; border-color: var(--accent); background: rgba(99,102,241,0.07); }
.keep-note { color: var(--muted); font-weight: 400; }
.attach-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 26px; background: var(--panel); flex-shrink: 0; }
.attach-chips:not(:empty) { padding-top: 10px; border-top: 1px solid var(--border); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent-dark);
  border: 1px solid #dcdffc; border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 600;
}
.chip button { border: none; background: none; cursor: pointer; color: inherit; font-size: 13px; padding: 0; }

.task-form {
  display: flex; gap: 10px; padding: 14px 26px 20px; background: var(--panel);
  border-top: 1px solid var(--border); align-items: flex-end; flex-shrink: 0;
}
.task-form textarea {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 15px; font: inherit; font-size: 14px; outline: none; background: var(--panel-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.task-form textarea:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14); }
/* Task vs Chat changes what Send *means*, so unlike the tier picker it stays
   spelled out rather than hiding behind an icon. */
.send-mode {
  display: flex; flex-shrink: 0; border: 1px solid var(--border);
  border-radius: 999px; background: var(--panel-soft); padding: 2px; gap: 2px;
}
.send-mode-btn {
  border: none; background: none; border-radius: 999px; cursor: pointer;
  padding: 7px 13px; font: inherit; font-size: 12px; font-weight: 700; color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.send-mode-btn:hover { color: var(--accent-dark); }
.send-mode-btn.active { background: var(--grad-cool); color: #fff; box-shadow: 0 1px 6px rgba(99, 102, 241, 0.3); }

/* Collapsed to an icon: on Auto (almost always) this is a control nobody needs
   to read, so it should cost about as much room as the paperclip. */
.tier-picker { position: relative; flex-shrink: 0; }
.tier-btn {
  border: 1px solid var(--border); border-radius: 999px; background: var(--panel-soft);
  padding: 9px 13px; font: inherit; font-size: 15px; line-height: 1; color: var(--muted);
  cursor: pointer; white-space: nowrap; transition: border-color 0.15s ease, background 0.15s ease;
}
.tier-btn:hover { border-color: #cfd4f6; }
/* An explicit tier is a spending decision — name it and colour it. */
.tier-btn.chosen {
  color: var(--accent-dark); border-color: #dcdffc; background: var(--accent-soft);
  font-size: 12px; font-weight: 700; padding: 11px 14px;
}
.tier-menu {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 30; width: 252px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 36px rgba(21, 26, 58, 0.2); padding: 6px; overflow: hidden;
}
.tier-opt {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 8px 11px; border-radius: 10px; cursor: pointer; font: inherit; color: inherit;
}
.tier-opt:hover { background: var(--accent-soft); }
.tier-opt b { display: block; font-size: 13px; font-weight: 600; }
.tier-opt span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tier-opt.current b::after { content: " ✓"; color: var(--accent); }
.tier-opt.current b { color: var(--accent-dark); }
.tier-note { padding: 8px 26px 0; font-size: 12px; color: var(--muted); background: var(--panel); flex-shrink: 0; }
/* Four controls on one narrow row leaves the textarea a few pixels wide once
   the tier picker is among them. Give the box its own row, rest underneath.
   Must sit after `.task-form textarea { flex: 1 }` — equal specificity. */
@media (max-width: 680px) {
  .task-form { flex-wrap: wrap; padding-left: 14px; padding-right: 14px; gap: 6px; }
  .task-form textarea { order: -1; flex: 1 0 100%; }
  /* Four controls plus a chosen tier ("Maximum") is the widest this row gets,
     and at 375px it lands within a few pixels of the edge. Tighten here rather
     than let Send wrap onto a row of its own. */
  .send-mode-btn { padding: 7px 9px; font-size: 11px; }
  .attach-chips, .tier-note { padding-left: 14px; padding-right: 14px; }
  #send-btn { margin-left: auto; } /* keeps attach · tier · Send on one row */
}

/* ---------- Jobs dialog ---------- */
.jobs-list { display: flex; flex-direction: column; gap: 10px; }
.job-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 17px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--panel-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.job-row:hover { border-color: #cfd4f6; box-shadow: 0 2px 10px rgba(83, 91, 200, 0.08); }
.job-info { flex: 1; min-width: 0; }
.job-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.job-desc { font-size: 13px; color: var(--text); margin-top: 3px; overflow-wrap: anywhere; }
.desk-meeting-bar { display: flex; align-items: center; gap: 12px; padding: 12px 2px 0; margin-top: 14px; border-top: 1px solid var(--border); }
.desk-meeting-bar .opt { font-size: 12px; }
.meeting-history { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.mh-del { border: none; background: none; color: var(--red); cursor: pointer; padding: 4px 6px; line-height: 1; border-radius: 6px; transition: color 0.15s ease, background 0.15s ease; }
.mh-del .ico-svg { width: 15px; height: 15px; display: block; }
.mh-del:hover { background: #fdf0ee; }

#snackbar { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(16px); max-width: min(520px, calc(100vw - 40px)); background: #14182e; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; box-shadow: 0 12px 32px rgba(10, 14, 40, 0.35); opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; z-index: 300; white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; }
#snackbar.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
#snackbar.error { background: #b3453a; }
.modal-confirm { max-width: 420px; }
.modal-confirm p { white-space: pre-wrap; font-size: 14px; line-height: 1.5; margin-bottom: 14px; overflow-wrap: anywhere; }
.mtg-controls { display: flex; gap: 8px; margin: 10px 0; }
.mtg-controls input[type="search"] { flex: 1; min-width: 0; }
.mtg-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.mtg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mtg-table th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mtg-table th.sortable { cursor: pointer; user-select: none; }
.mtg-table th.sortable:hover { color: var(--text); }
.mtg-table th.sorted[data-dir="asc"]::after { content: " ↑"; }
.mtg-table th.sorted[data-dir="desc"]::after { content: " ↓"; }
.mtg-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.mtg-table tbody tr:last-child td { border-bottom: none; }
.mtg-table td.mtg-title { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mtg-table td.mtg-who { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); cursor: default; }
.mtg-table td.mtg-actions { white-space: nowrap; text-align: right; }
.mtg-status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.mtg-done { background: var(--green-soft); color: var(--green); }
.mtg-processing { background: var(--amber-soft); color: var(--amber); }
.mtg-failed, .mtg-abandoned { background: #fef5f4; color: #b3453a; }
.mtg-pager { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.meeting-detail-minutes { font-size: 14px; overflow-wrap: anywhere; }
.meeting-transcript { font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel-soft, #f6f7fb); border: 1px solid var(--border); border-radius: 10px; padding: 12px; max-height: 320px; overflow-y: auto; }
.job-chip { font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px; flex-shrink: 0; }
.job-chip.done { background: var(--green-soft); color: var(--green); }
.job-chip.working { background: var(--amber-soft); color: var(--amber); }
.job-chip.paused { background: #fef5f4; color: #b3453a; }
.jobs-empty { color: var(--muted); text-align: center; padding: 32px 0; }

/* ---------- Members / schedules / platform lists ---------- */
.member-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.member-row {
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--panel-soft);
}
.member-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.member-role { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.member-row > button { border: none; background: none; cursor: pointer; color: #a3aac4; font-size: 13px; padding: 2px 4px; border-radius: 6px; }
.member-row > button:hover { color: var(--red); background: #fdf0ee; }
.add-member-row { display: flex; gap: 8px; }
.add-member-row input {
  flex: 1; border: 1px solid var(--border); border-radius: var(--r-btn); padding: 9px 13px;
  font: inherit; font-size: 13px; outline: none; background: var(--panel-soft);
}
.add-member-row input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14); }
.add-member-row select {
  border: 1px solid var(--border); border-radius: var(--r-btn); padding: 9px 9px;
  font: inherit; font-size: 13px; background: #fff;
}

.google-connect {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 13px; margin: -6px 0 15px; color: var(--muted);
}
.connect-link-box { margin: -6px 0 15px; }
.connect-link-box input {
  width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 8px 11px;
  font-size: 12px; font-family: ui-monospace, "SF Mono", Menlo, monospace; margin-bottom: 6px; background: var(--panel-soft);
}
.connect-link-box p { font-size: 12px; margin-top: 6px; color: var(--muted); }
.connect-link-box a { color: var(--accent); }
.google-ok { color: var(--green); font-weight: 700; }

/* ---------- Web accounts ---------- */
.web-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 16px; }
.web-add-grid input {
  border: 1px solid var(--border); border-radius: var(--r-btn); padding: 9px 12px;
  font: inherit; font-size: 13px; outline: none; background: var(--panel-soft);
}
.web-add-grid input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,0.14); }
.web-add-grid #wa-notes { grid-column: 1 / -1; }
.web-add-grid #ph-number { grid-column: 1 / -1; }
.web-add-grid select, .web-add-grid textarea {
  border: 1px solid var(--border); border-radius: var(--r-btn); padding: 9px 12px;
  font: inherit; font-size: 13px; outline: none; background: var(--panel-soft); color: var(--text);
}
.web-add-grid select:focus, .web-add-grid textarea:focus {
  border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,0.14);
}
.web-add-grid textarea { grid-column: 1 / -1; resize: vertical; }
/* Hidden fields must not leave a gap in the grid. */
.web-add-grid .hidden { display: none; }
.web-add-grid button { grid-column: 1 / -1; justify-self: start; }
/* Two columns do not fit a phone — a server URL overflowed the panel and gave
   the modal body a horizontal scrollbar. Must stay AFTER the rule above: equal
   specificity, so source order decides. */
@media (max-width: 680px) {
  .web-add-grid { grid-template-columns: 1fr; }
}
/* Preset picker above the MCP fields — a shortcut, not a gate: every preset
   only fills in the name and URL, which stay editable. */
.mcp-oauth-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mcp-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.mcp-chip {
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px;
  font: inherit; font-size: 12px; cursor: pointer; background: var(--panel-soft); color: var(--text);
}
.mcp-chip:hover { border-color: var(--border-strong); background: #fff; }
.mcp-chip.on { border-color: var(--accent); background: rgba(99,102,241,0.09); color: var(--accent); font-weight: 600; }
.mcp-hint { font-size: 11.5px; line-height: 1.5; margin: 0 0 10px; color: var(--muted); }
.mcp-hint a { color: var(--accent); }

.web-acct-main { flex: 1; min-width: 0; }
.web-acct-site { font-weight: 600; font-size: 13px; }
.web-acct-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Portrait generator ---------- */
.portrait-row { display: flex; gap: 16px; align-items: center; margin: -4px 0 16px; }
.portrait-preview {
  width: 76px; height: 76px; border-radius: 50%; flex-shrink: 0;
  background: #f1f3fb; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: #b3bad4; font-size: 12px; overflow: hidden;
}
.portrait-preview img { width: 100%; height: 100%; object-fit: cover; }
.portrait-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.portrait-note { font-size: 11.5px; width: 100%; margin: 0; }
.card-avatar img, .card-avatar.small img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.card-avatar.has-photo { background: none !important; }

/* ---------- Archive ---------- */
.archived-section { max-width: 1220px; margin: 30px auto 0; }
.archived-toggle {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 0; margin-bottom: 12px;
}
.archived-toggle:hover { color: var(--text); }
.agent-card.archived { opacity: 0.72; background: #fafbfe; }
.agent-card.archived::before { opacity: 0.2; }
.agent-card.archived:hover { opacity: 1; }
.card-archived-badge {
  position: absolute; top: 14px; left: 14px;
  background: #eef0f8; color: var(--muted); border: 1px solid var(--border);
  font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* Now lives in its own dialog tab, so it no longer needs a separating rule. */
.danger-zone { margin-top: 0; padding-top: 0; }
.danger-head { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.danger-zone p { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; line-height: 1.5; }
.danger-zone .btn-row .btn { margin-right: 0; }
.btn-danger { background: #fff; border-color: #f0cdc7; color: #b3453a; }
.btn-danger:hover { background: #fdf0ee; }
.btn-danger-solid { background: linear-gradient(135deg, #dc2626, #b91c1c); border-color: #b91c1c; color: #fff; }
.btn-danger-solid:hover { background: #a51d1d; }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: var(--r-btn); padding: 9px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; white-space: nowrap;
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: #f5f6fd; border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn-primary {
  background: var(--grad-brand); border-color: transparent; color: #fff;
  box-shadow: var(--glow-accent);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #575af0 0%, #7c4ef4 55%, #cb32e8 115%);
  box-shadow: 0 6px 24px rgba(124, 91, 246, 0.45); border-color: transparent;
}
.btn-link { background: none; border: none; color: #8b95ba; padding: 0; font-size: 12px; font-weight: 600; text-decoration: none; }
.btn-link:hover { color: #fff; background: none; }
.btn-icon { padding: 9px 12px; font-size: 16px; line-height: 1; }
.btn-small-light { padding: 5px 13px; font-size: 12px; }

/* ---------- Listening mode ---------- */
.listen-consent {
  background: #fdf9ee; border: 1px solid #f0e2b4; color: #6b5a2a;
  border-radius: var(--r-btn); padding: 10px 13px; font-size: 12.5px; line-height: 1.5; margin-bottom: 16px;
}
.listen-modes { display: flex; gap: 6px; margin-bottom: 10px; }
.listen-mode {
  flex: 1; border: 1px solid var(--border); background: var(--panel-soft); border-radius: var(--r-btn);
  padding: 9px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.listen-mode:hover { border-color: #cfd4f6; }
.listen-mode.active { background: var(--accent-soft); border-color: #dcdffc; color: var(--accent-dark); }
.listen-mode-note { font-size: 12.5px; line-height: 1.5; margin-bottom: 14px; }

/* Recording panel: the meter is the honest control here — the cap is a hard
   byte limit from the transcription API, not a preference. */
.listen-record-panel { padding: 4px 0 2px; }
.rec-meter { height: 8px; border-radius: 999px; background: #eef0f9; overflow: hidden; }
.rec-meter-fill { height: 100%; width: 0; border-radius: 999px; background: var(--grad-cool); transition: width 0.3s linear; }
.rec-meter-fill.near { background: linear-gradient(90deg, #f59e0b, #f97316); }
.rec-meter-fill.full { background: linear-gradient(90deg, #ef4444, #dc2626); }
.rec-stats {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin-top: 7px; font-size: 13px; font-weight: 600; color: #2b3253;
  font-variant-numeric: tabular-nums;
}
.rec-explain { font-size: 12.5px; line-height: 1.55; margin-top: 12px; }
.listen-bar { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: #2b3253; margin-bottom: 10px; }
.listen-bar .grow { flex: 1; }
.listen-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.listen-dot.live { background: #ef4444; animation: listen-pulse 1.4s ease-in-out infinite; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }
@keyframes listen-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.listen-timer { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.listen-transcript {
  width: 100%; border: 1px solid var(--border); border-radius: var(--r-btn); padding: 12px 14px;
  font: inherit; font-size: 14px; line-height: 1.6; background: var(--panel-soft); outline: none; resize: vertical;
}
.listen-transcript:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14); }
.listen-interim { min-height: 22px; padding: 5px 2px 0; font-size: 13.5px; color: var(--muted); font-style: italic; }
.listen-note {
  background: #fdeaea; border: 1px solid #f5c6c6; color: #9b2c2c;
  border-radius: var(--r-btn); padding: 9px 12px; font-size: 12.5px; margin-bottom: 10px;
}
.listen-actions { align-items: center; }
.listen-actions .grow { flex: 1; }
@media (prefers-reduced-motion: reduce) { .listen-dot.live { animation: none; } }
.listen-explainer { font-size: 12.5px; line-height: 1.55; margin-bottom: 16px; }

/* The agent's offer to promote a chat question into real work. Deliberately a
   button rather than a link: it spends money and starts a job. */
.btn-escalate {
  margin-top: 10px; padding: 7px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid #dcdffc; background: var(--accent-soft); color: var(--accent-dark);
  font: inherit; font-size: 12px; font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-escalate:hover:not(:disabled) { background: #e3e6fe; border-color: var(--accent); }
.btn-escalate:disabled { opacity: 0.65; cursor: default; }

/* Deep link from a Connections section to its guide. The guides existed but
   nobody found them from inside the app, which is where the question arises. */
.sec-help { color: var(--accent); text-decoration: none; white-space: nowrap; font-weight: 600; }
.sec-help:hover { text-decoration: underline; }

/* Author label on another member's message in a shared agent's feed. */
.msg-author { font-size: 11px; font-weight: 650; opacity: 0.75; margin-bottom: 3px; }

/* ---------- Inline SVG icon chrome ---------- */
.ico-svg { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex-shrink: 0; }
.logo-svg { width: 1.4em; height: 1.4em; vertical-align: -0.3em; }
.login-logo .logo-svg { width: 58px; height: 58px; }
.topbar-brand { gap: 8px; }
.desk-card-head h2 { display: flex; align-items: center; gap: 8px; }
.desk-card-head h2 .ico-svg { font-size: 16px; }
.card-actions button .ico-svg { display: block; margin: 0 auto; width: 18px; height: 18px; color: #7a84ab; transition: color 0.15s ease; }
.card-actions button:hover .ico-svg { color: var(--accent-dark); }
.card-pending .ico-svg { width: 12px; height: 12px; vertical-align: -0.16em; }
.card-stats .ico-svg { width: 14px; height: 14px; vertical-align: -0.2em; margin-right: 2px; }
.btn .ico-svg { margin-right: 3px; }
.tier-btn .ico-svg { display: block; width: 15px; height: 15px; }
.tier-opt b .ico-svg { vertical-align: -0.16em; color: var(--accent); }

/* A daily brief: the day's review, not a task. No checkbox, no dismiss —
   it simply is today's, and tomorrow it is gone. */
.desk-brief {
  border-left: 3px solid var(--accent);
  background: linear-gradient(180deg, #f5f6ff, var(--panel-soft));
}
.desk-brief .desk-item-title { color: var(--accent-dark); }

/* ---------- My Desk as a card + dialog ---------- */
.modal-desk { width: 1020px; max-width: 96vw; max-height: 92vh; }
.modal-desk .desk-grid { margin: 0; }
.desk-title-wrap { display: flex; align-items: baseline; gap: 12px; }
.desk-hub {
  background: linear-gradient(180deg, #f7f7ff, var(--panel));
}
.desk-hub::before { opacity: 1; height: 3.5px; background: var(--grad-aurora); }
.desk-hub-art {
  height: 74px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center;
}
.desk-hub-art svg { width: 108px; height: 72px; filter: drop-shadow(0 6px 14px rgba(99, 102, 241, 0.22)); }

/* The day's running/scheduled items, sitting under the to-dos in the merged
   Today-at-a-glance card. */
.desk-today-strip:not(:empty) { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }

/* Markdown inside agent-authored desk items — modest, list-friendly. */
.desk-item-body { white-space: normal; }
.desk-item-body p { margin: 0 0 6px; }
.desk-item-body p:last-child, .desk-item-body ul:last-child, .desk-item-body ol:last-child { margin-bottom: 0; }
.desk-item-body ul, .desk-item-body ol { margin: 0 0 6px 18px; }
.desk-item-body li { margin-bottom: 2px; }
.desk-item-body strong { color: var(--text); font-weight: 650; }
.desk-item-body a { color: var(--accent); }
.desk-item-body code { background: #eef0f9; border-radius: 4px; padding: 0 4px; font-size: 11.5px; }

/* A grid child's default min-width is its CONTENT's minimum — one unbreakable
   Google-Docs URL in a team note forced its whole column wider than the desk
   dialog and clipped everything at the modal edge. min-width: 0 lets columns
   actually shrink; anywhere-wrap lets the URL break instead of winning. */
.desk-col, .desk-card { min-width: 0; }
.desk-item-main { min-width: 0; }
.desk-item-title, .desk-item-body, .desk-item-meta { overflow-wrap: anywhere; }

/* Phones get full-screen dialogs — a floating window on a 375px screen is all
   chrome and no content. Placed LAST deliberately: same specificity as the
   per-dialog sizes above (.modal-tabbed, .modal-chat, .modal-desk), so source
   order lets these win on mobile, including stretching Hire's short second
   screen — intended here, unlike the desktop re-assert trap above. */
@media (max-width: 680px) {
  .modal, .modal-chat, .modal-tabbed, .modal-desk, .modal-headed, .modal-wide {
    width: 100vw; max-width: 100vw;
    height: 100dvh; max-height: 100dvh;
    border-radius: 0;
  }
  .modal { padding: 18px 14px; }
  .modal-chat, .modal-tabbed { padding: 0; }
}

/* Count badge on the desk card's bell — the number lives where the click goes. */
.card-actions button { position: relative; }
.act-badge {
  position: absolute; top: 1px; left: calc(50% + 4px);
  min-width: 17px; height: 17px; padding: 1px 4px 0; /* digits sit high in a tiny circle — nudge down */
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ef4444, #ec4899); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1; border-radius: 999px;
  border: 2px solid var(--panel); box-shadow: 0 2px 6px rgba(236, 72, 153, 0.35);
  font-variant-numeric: tabular-nums;
}

/* The confirm card is the one dialog that must NOT go full-screen on phones —
   three lines and two buttons; the full-screen rule above is for content
   dialogs. Double class outranks the .modal selector regardless of order. */
@media (max-width: 680px) {
  .modal.modal-confirm { width: calc(100vw - 36px); max-width: 420px; height: auto; max-height: 80dvh; border-radius: 16px; padding: 22px 20px; }
}

/* ---- meeting series ---- */
.series-add { display: flex; gap: 8px; margin: 4px 0 14px; }
.series-add input { flex: 1; }
.series-foot { margin-top: 12px; text-align: right; }
.series-context {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
#series-context-name { font-weight: 600; }
.series-table td { vertical-align: middle; }
.series-name { font-weight: 600; }
.series-sub { font-size: 12px; color: var(--muted); }
/* min-width:0 + wrap: grid/table children otherwise refuse to shrink and the
   dialog scrolls sideways on a long participant list. */
.series-table td { min-width: 0; overflow-wrap: anywhere; }
.doc-chips, .series-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.doc-chip, .series-act {
  font-size: 12px; padding: 3px 8px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  font-family: inherit; white-space: nowrap;
}
.doc-chip:hover, .series-act:hover { border-color: var(--accent); color: var(--accent); }
.doc-chip.missing { color: var(--muted); opacity: .6; }
.doc-chip.legacy { font-size: 11px; color: var(--muted); border-style: dashed; }
.series-act.primary { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.series-act.danger:hover { border-color: var(--danger); color: var(--danger); }
.series-zoom {
  font-size: 12px; padding: 3px 8px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--warn, #b4690e); color: var(--warn, #b4690e); white-space: nowrap;
  background: transparent; font-family: inherit;
}
.series-zoom:hover { background: color-mix(in srgb, var(--warn, #b4690e) 12%, transparent); }
.settings-access { margin-top: 18px; }
.settings-members { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; }
.settings-members label {
  display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 400;
}
.settings-members input { width: auto; margin: 0; }
.settings-members .owner { color: var(--muted); }

/* My Desk is the daily workspace; the roster remains one tab away. */
.desk-page-head { max-width: 1220px; margin: 0 auto 26px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.desk-page-head h1 { font-family: var(--font-display); font-size: 28px; margin: 6px 0; }
.eyebrow { color: var(--accent-dark); font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.desk-page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.count-pill { display: inline-block; padding: 2px 7px; margin-left: 6px; background: var(--accent-soft); color: var(--accent-dark); border-radius: 20px; font-size: 12px; }
.work-filters { display: flex; gap: 5px; margin-bottom: 12px; }
#desk-work { max-height: 390px; overflow: auto; }
#desk-approvals { max-height: 440px; overflow: auto; }
button.desk-approval { width: 100%; text-align: left; font: inherit; color: inherit; background: var(--panel-soft); }
.card-open { display: block; width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; color: inherit; }
button.card-pending { border: 0; font-family: inherit; cursor: pointer; }
.job-open { width: 100%; text-align: left; font: inherit; color: inherit; background: var(--panel-soft); cursor: pointer; }
.job-open:hover { background: var(--accent-soft); }
.job-open .job-title, .job-open .job-meta { display: block; overflow-wrap: anywhere; }
.job-open .job-info { min-width: 0; }
#job-detail-modal { z-index: 65; }
.modal-job-detail { width: 820px; }
.job-section { margin-top: 22px; }
.job-section h3, .job-section summary { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.job-section summary { cursor: pointer; }
.job-prose { overflow-wrap: anywhere; line-height: 1.65; }
#job-detail-request, .job-event { white-space: pre-wrap; }
.job-prose p { margin-bottom: 10px; }
.job-prose ul, .job-prose ol { padding-left: 24px; }
.job-prose pre { overflow: auto; }
.job-prose table { display: block; overflow: auto; }
.job-event { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13px; overflow-wrap: anywhere; }
.job-event strong { display: block; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.feed-latest { align-self: center; flex-shrink: 0; margin: 6px; background: var(--accent-soft); color: var(--accent-dark); }
@media (max-width: 680px) {
  .desk-main { padding: 22px 14px; }
  .desk-page-head { flex-direction: column; align-items: flex-start; }
  .desk-page-head h1 { font-size: 24px; }
  .desk-page-actions .opt { width: 100%; }
  .desk-card { padding: 16px; }
  .todo-form { flex-wrap: wrap; }
  .todo-form input:not([type]) { min-width: 140px; }
  .modal-job-detail { padding: 22px 18px; }
}

.feed { position: relative; overflow-anchor: none; }
.desk-main > .desk-meeting-bar { max-width: 1220px; margin-left: auto; margin-right: auto; }

@media (max-width: 680px) {
  .msg.deliverable { flex-wrap: wrap; }
  .msg.deliverable .file-name { flex: 1 1 65%; white-space: normal; overflow-wrap: anywhere; }
  .msg.deliverable .file-acts { flex-basis: 100%; margin-left: 0; }
  .desk-meeting-bar { flex-wrap: wrap; }
}

/* Staff stay alongside the desk, in compact, independently scrolling rows. */
.workspace-layout { display: flex; flex: 1; min-height: 0; }
.staff-sidebar { width: 264px; flex: 0 0 264px; padding: 24px 14px; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--border); }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.sidebar-heading h2 { font: 700 16px var(--font-display); }
.sidebar-hint { font-size: 12px; color: var(--muted); padding: 7px 6px 18px; }
.staff-sidebar .team-grid { display: flex; flex-direction: column; gap: 9px; }
.staff-sidebar .agent-card { padding: 0; text-align: left; border-radius: 12px; box-shadow: none; overflow: visible; }
.staff-sidebar .agent-card::before { display: none; }
.staff-sidebar .agent-card:hover { transform: none; box-shadow: none; }
.staff-primary { display: flex; align-items: center; gap: 10px; padding: 13px 32px 13px 11px; text-align: left; border-radius: 12px; }
.staff-primary:hover { background: var(--accent-soft); }
.staff-sidebar .card-avatar { width: 36px; height: 36px; flex: 0 0 36px; margin: 0; font-size: 13px; border-radius: 10px; }
.staff-identity { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.staff-sidebar .card-name { font-size: 13px; font-weight: 700; margin: 0; }
.staff-sidebar .card-role { font-size: 11px; margin: 0; min-height: 0; }
.staff-status { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.staff-sidebar .card-status-dot { width: 6px; height: 6px; margin: 0; }
.staff-options > summary { position: absolute; top: 8px; right: 5px; padding: 6px; cursor: pointer; list-style: none; color: var(--muted); border-radius: 6px; font-size: 12px; }
.staff-options > summary::-webkit-details-marker { display: none; }
.staff-options[open] > summary { background: var(--accent-soft); color: var(--accent-dark); }
.staff-contact { margin: 0 10px; padding: 10px 4px 8px; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.staff-contact-row { display: flex; align-items: center; gap: 8px; min-width: 0; color: #536b74; font-size: 10.5px; line-height: 1.3; text-decoration: none; border-radius: 7px; padding: 3px 5px; }
.staff-contact-row:hover { color: var(--accent-dark); background: var(--accent-soft); }
.staff-contact-row .ico-svg { width: 14px; height: 14px; flex: 0 0 14px; color: #71878e; }
.staff-contact-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-sidebar .card-actions { margin: 0; padding: 5px; display: flex; flex-wrap: wrap; }
.staff-sidebar .card-actions button { flex: 1 0 28%; padding: 8px 3px; font-size: 14px; }
.staff-sidebar .card-pending { position: static; margin: 0 10px 10px; display: inline-block; font-size: 10px; padding: 4px 7px; }
.staff-sidebar .cap-chip { margin: 0 10px 10px; display: inline-block; }
.staff-sidebar .empty-state { padding: 20px 8px; }
.staff-sidebar .empty-state h2 { font-size: 16px; }
.staff-sidebar .empty-state p { font-size: 12px; }
.workspace-layout > .desk-main { min-width: 0; }
@media (max-width: 1150px) { .workspace-layout .desk-grid { grid-template-columns: 1fr; } .desk-page-head { flex-wrap: wrap; } }
@media (max-width: 680px) {
  .workspace-layout { flex-direction: column; overflow-y: auto; }
  .staff-sidebar { width: 100%; flex: none; padding: 14px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar-hint { padding-bottom: 10px; }
  .staff-sidebar .team-grid { flex-direction: row; overflow-x: auto; align-items: flex-start; padding: 2px 2px 8px; }
  .staff-sidebar .agent-card { flex: 0 0 220px; }
  .workspace-layout > .desk-main { flex: none; overflow: visible; }
}

.staff-sidebar { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.staff-list-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 14px; }
.sidebar-footer { flex-shrink: 0; padding: 14px; border-top: 1px solid var(--border); background: var(--panel); }
.sidebar-footer .btn { width: 100%; text-align: left; }
.notification-button { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 38px; }
.notification-button .ico-svg { width: 19px; height: 19px; }
.notification-count { position: absolute; top: -6px; right: -6px; min-width: 19px; padding: 2px 5px; border-radius: 12px; color: white; background: var(--red); font-size: 10px; font-weight: 700; border: 2px solid var(--panel); }
#recent-work-modal .section-note { margin-bottom: 14px; }
#recent-work-modal #desk-work { max-height: 55vh; }
@media (max-width: 680px) {
  .staff-sidebar { overflow: visible; }
  .staff-list-scroll { flex: none; overflow: visible; padding: 14px 14px 0; }
  .sidebar-footer { padding: 8px 14px 12px; border-top: 0; }
  .sidebar-footer .btn { width: auto; }
}

.meetings-card { min-width: 0; }
.meetings-card .mtg-table { min-width: 570px; }
.meetings-card .series-add input { min-width: 0; }
.meetings-card .form-row { flex-direction: column; }
.meetings-card .modal-actions { flex-wrap: wrap; }
.meetings-card input:not([type="checkbox"]), .meetings-card select { max-width: 100%; }
.meetings-card .meeting-transcript { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Workspace palette and visual hierarchy. */
:root {
  --bg: #f3f5f5;
  --panel-soft: #f8faf9;
  --accent: #137c73;
  --accent-dark: #0c6059;
  --accent-soft: #e8f4f0;
  --text: #21343e;
  --muted: #61747e;
  --border: #e0e7e7;
  --border-strong: #bdcece;
  --grad-brand: linear-gradient(135deg, #16877d, #106c68);
  --grad-cool: linear-gradient(135deg, #1e9488, #83bcb1);
  --shadow-sm: 0 2px 3px #223e4610, 0 8px 24px #223e4605;
  --glow-accent: 0 3px 9px #137c7320;
  --r-card: 16px;
}
.topbar { background: #142c37; padding-top: 16px; padding-bottom: 16px; }
.topbar::after { background: #33515b; height: 1px; }
.topbar-brand { font-size: 19px; letter-spacing: -.6px; }
.topbar-org { background: #ffffff0a; border-color: #ffffff20; color: #d3e3e5; font-size: 10px; }
.topbar-user { color: #b0c3cc; }
.topbar-actions { gap: 10px; }
.topbar .btn { font-size: 12px; }
.topbar .btn-link { color: #d3e3e5; }
.workspace-layout > .desk-main { background: radial-gradient(ellipse at top right, #e7efeb 0, transparent 55%), var(--bg); padding: 36px; }
.staff-sidebar { background: #f9fbfa; width: 254px; flex-basis: 254px; }
.staff-list-scroll { padding: 30px 14px; }
.sidebar-heading h2 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #4b626b; }
.sidebar-hint { font-size: 11px; padding-top: 10px; padding-bottom: 24px; }
.staff-sidebar .agent-card { background: #fff; border-color: #e1e9e7; box-shadow: 0 2px 5px #203c4404; }
.staff-sidebar .agent-card:hover { border-color: #9abfb6; box-shadow: 0 3px 12px #203c4409; }
.staff-primary { padding-top: 16px; padding-bottom: 16px; }
.staff-sidebar .card-avatar { background: #e5f0ed; color: #1f6c60; border: 1px solid #d4e7e1; box-shadow: none; }
.staff-sidebar .agent-card:nth-child(3n+2) .card-avatar { background: #eeeaf5; color: #78619a; border-color: #e3dbed; }
.staff-sidebar .agent-card:nth-child(3n+3) .card-avatar { background: #f8efdf; color: #8c6c34; border-color: #eee0c6; }
.staff-sidebar .card-name { font-size: 12.5px; }
.staff-sidebar .card-role { color: #61747e; }
.staff-status { font-size: 10px; }
.sidebar-footer { background: #f9fbfa; padding: 18px 14px; }
.sidebar-footer .btn { display: flex; align-items: center; gap: 10px; padding: 12px; background: #edf3f0; border-color: #dfe8e3; color: #365d54; }
.desk-page-head { margin-bottom: 32px; }
.desk-page-head h1 { font-size: clamp(25px, 2.6vw, 34px); font-weight: 800; letter-spacing: -1.2px; margin: 10px 0; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: #287a6c; font-size: 10px; letter-spacing: .15em; font-weight: 700; }
.workspace-dot { width: 6px; height: 6px; background: #2d9782; border-radius: 50%; box-shadow: 0 0 0 4px #2d978212; }
.desk-date { font-size: 12px; }
.desk-page-actions { gap: 8px; }
#desk-spend { width: 100%; text-align: right; font-size: 11px; margin-bottom: 4px; color: #61747e; }
.desk-page-actions { justify-content: flex-end; }
#desk-settings, #meetings-refresh { display: inline-flex; align-items: center; gap: 7px; }
.desk-page-actions .btn { background: #ffffffb8; border-color: #d9e3df; font-size: 12px; }
.desk-grid { grid-template-columns: minmax(0, 1.85fr) minmax(260px, 1fr); gap: 24px; }
.desk-col { gap: 24px; }
.desk-card { padding: 24px; border-color: #e0e7e4; }
.desk-card::before { display: none; }
.desk-card-head { margin-bottom: 20px; }
.desk-card-head h2 { font-size: 15px; letter-spacing: -.3px; gap: 10px; }
.desk-card-head h2 > .ico-svg { box-sizing: content-box; width: 18px; height: 18px; padding: 9px; border-radius: 11px; background: #e9f3ed; color: #368169 !important; }
.meetings-card .desk-card-head h2 > .ico-svg { background: #eef0fa; color: #6576aa !important; }
.team-updates-card .desk-card-head h2 > .ico-svg { background: #fbf1df; color: #a27b37 !important; }
.desk-filters { background: #f1f5f3; border-radius: 9px; padding: 4px; flex-wrap: wrap; }
.filter-btn { padding: 6px 9px; font-size: 10px; }
.filter-btn.active { background: #fff; color: #1c6f60; box-shadow: 0 1px 4px #233d4217; }
.filter-btn:hover { background: #e3eee9; }
.todo-form { padding: 4px; background: #f6f8f7; border: 1px solid #e3eae6; border-radius: 12px; }
.todo-form input:not([type]), .todo-form input[type="date"] { background: transparent; border-color: transparent; font-size: 12px; }
.desk-empty { color: #6e8088; font-size: 12px; line-height: 1.8; padding: 22px 6px; }
.desk-today-strip:not(:empty) { border-top-style: dashed; }
.desk-item { border-radius: 10px; background: #f8faf9; }
.meetings-card .series-add { gap: 8px; }
.meetings-card .series-add input { background: #f8faf9; font-size: 12px; border-radius: 10px; }
.meetings-card .mtg-table-wrap { border: 1px solid #e4eae7; border-radius: 10px; }
.meetings-card .mtg-table th { background: #f4f7f5; color: #647a73; font-size: 9px; letter-spacing: .06em; padding: 12px 10px; }
.meetings-card .mtg-table td { padding: 14px 10px; font-size: 12px; }
.meetings-card .series-sub { font-size: 10px; }
.meetings-card .meeting-history { border-top: 1px solid #e4eae7; padding-top: 24px; margin-top: 24px; }
.meetings-card .meeting-history h2 { font-size: 12px; color: #526c62; }
.meetings-card .doc-chip { color: #416f60; background: #edf5ef; border-color: #dbe9df; }
.btn { transition: background .15s, border-color .15s, box-shadow .15s; }
.btn .ico-svg { width: 16px; height: 16px; flex-shrink: 0; }
@media (max-width: 1150px) { .workspace-layout .desk-grid { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  .topbar { padding: 14px 16px; }
  .staff-sidebar { width: 100%; flex-basis: auto; }
  .staff-list-scroll { padding: 18px 14px 0; }
  .sidebar-hint { padding-bottom: 12px; }
  .sidebar-footer { padding: 8px 14px 14px; }
  .workspace-layout > .desk-main { padding: 24px 16px; }
  .desk-page-head { gap: 16px; margin-bottom: 24px; }
  .desk-page-actions { justify-content: flex-start; }
  #desk-spend { text-align: left; }
  .desk-card { padding: 18px; }
  .desk-card-head { margin-bottom: 16px; }
  .todo-form { flex-wrap: wrap; }
  .todo-form input:not([type]) { flex-basis: 100%; }
}
.meetings-card .series-add input { flex: 1; border: 1px solid var(--border); padding: 11px 12px; font-family: inherit; color: var(--text); outline: none; }
.meetings-card .series-add input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #137c7314; }
#settings-zoom-legacy { margin-top: 18px; padding: 14px; background: var(--panel-soft); border: 1px solid var(--border); border-radius: 10px; }
#settings-zoom-legacy summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 600; }
#settings-zoom-legacy[open] summary { margin-bottom: 12px; }
#settings-calendar-note { line-height: 1.6; margin-top: 10px; }
.mtg-needs-assignment { color: #8c5b0c; background: #fff2d7; }
.mtg-actions select { max-width: 180px; font: inherit; padding: 6px; border: 1px solid var(--border); border-radius: 6px; }
