:root{
  color-scheme: dark;
  --bg:#05070a;
  --text:#e7eef8;
  --muted:#98a6b7;
  --border:rgba(255,255,255,.10);
  --shadow: 0 18px 40px rgba(0,0,0,.55);

  --col-todo:#6d5efc;
  --col-progress:#f59e0b;
  --col-done:#22c55e;
  --col-archived:#6b7280;

  /* Color-blind friendly semantic palette (Okabe–Ito inspired) */
  --ok-rgb: 0 158 115;      /* green */
  --warn-rgb: 230 159 0;    /* orange */
  --bad-rgb: 213 94 0;      /* vermillion */
  --info-rgb: 0 114 178;    /* blue */
  --neutral-rgb: 107 114 128;
}

:root[data-theme="light"]{
  color-scheme: light;
  --bg:#f7fafc;
  --text:#0b1220;
  --muted:#475569;
  --border:rgba(15,23,42,.12);
  --shadow: 0 18px 40px rgba(2,6,23,.14);
}

:root[data-weekend-theme="usta"]{
  /* Weekend “USTA” accent (subtle): blue for info, red for critical */
  --info-rgb: 0 62 126;   /* USTA-ish navy */
  --bad-rgb: 213 0 50;    /* USTA-ish red */
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:
    radial-gradient(1000px 520px at 20% -10%, rgba(109,94,252,.24), transparent 55%),
    radial-gradient(900px 520px at 85% -15%, rgba(245,158,11,.16), transparent 55%),
    radial-gradient(900px 520px at 70% 110%, rgba(34,197,94,.10), transparent 55%),
    var(--bg);
  color:var(--text);
}

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* layout */
.app{display:flex; height:100vh;}
.sidebar{
  width:320px;
  padding:18px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02) 35%, transparent 70%), rgba(8,10,13,.92);
  border-right:1px solid rgba(255,255,255,.08);
  display:flex;
  flex-direction:column;
  gap:14px;
}

/* profile */
.profile{
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  background: rgba(255,255,255,.03);
  padding:16px 14px;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:10px;
}
.avatar-wrap{
  width:96px;
  height:96px;
  border-radius:999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.10), rgba(255,255,255,.02));
  border:1px solid rgba(255,255,255,.12);
  display:grid;
  place-items:center;
}
.avatar{
  width:78px;
  height:78px;
  border-radius:999px;
  display:grid;
  place-items:center;
  font-size:40px;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.16), rgba(255,255,255,.06));
  border:1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 30px rgba(0,0,0,.45);
}
.profile-name{font-weight:800; font-size:18px}
.profile-status{display:flex; gap:8px; align-items:center; justify-content:center; color:var(--muted); font-size:13px; flex-wrap:wrap}
.profile-sub{color:rgba(255,255,255,.45); font-size:12px; display:flex; gap:8px; align-items:center; justify-content:center; flex-wrap:wrap}

.subagents{width:100%; margin-top:4px; display:flex; flex-direction:column; gap:6px; text-align:left}
.subagents-head{font-size:11px; font-weight:900; color:rgba(255,255,255,.55); letter-spacing:.08em; text-transform:uppercase; display:flex; justify-content:space-between; align-items:center}
.subagent-row{border:1px solid rgba(255,255,255,.10); border-radius:12px; background:rgba(0,0,0,.18); padding:8px 10px}

.systems{margin-top:10px}
.systems-title{font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:rgba(255,255,255,.55)}
.system-row{margin-top:8px; border:1px solid rgba(255,255,255,.10); border-radius:14px; padding:10px; background: rgba(0,0,0,.18); display:flex; justify-content:space-between; gap:10px}
.system-name{font-weight:900; font-size:12px}
.system-meta{font-size:11px; color:rgba(255,255,255,.55)}
.system-pill{padding:4px 8px; border-radius:999px; border:1px solid rgba(255,255,255,.10); font-size:11px; height:fit-content}
.system-pill.ok{border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.10)}
.system-pill.bad{border-color: rgba(255,136,124,.40); background: rgba(255,136,124,.10)}
.subagent-top{display:flex; justify-content:space-between; gap:10px; align-items:flex-start}
.subagent-name{font-weight:900; font-size:12px; line-height:1.2}
.subagent-state{font-size:11px; color:rgba(255,255,255,.55)}
.subagent-detail{margin-top:6px; font-size:11px; color:rgba(255,255,255,.55); white-space:pre-wrap}

.pill{padding:2px 8px; border-radius:999px; border:1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.03); font-size:11px; color:rgba(255,255,255,.70)}
.state-badge{padding:2px 8px; border-radius:999px; font-weight:800; font-size:11px; border:1px solid rgba(255,255,255,.10); background: rgba(0,0,0,.18)}
.state-idle{border-color: rgba(107,114,128,.30); background: rgba(107,114,128,.10)}
.state-thinking{border-color: rgba(245,158,11,.32); background: rgba(245,158,11,.10)}
.state-working{border-color: rgba(34,197,94,.30); background: rgba(34,197,94,.10)}
.dot{width:8px; height:8px; border-radius:999px; display:inline-block}
.dot.online{background:#22c55e}

.sidebar-actions{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.sidebar-actions .btn{width:100%; display:flex; align-items:center; justify-content:center; text-align:center}
.sidebar-actions .btn.full{grid-column:1 / -1}

.btn{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:900;
  letter-spacing:.01em;
}
.btn:hover{background:rgba(255,255,255,.06)}
.btn.ghost{border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.03)}
.btn.file{position:relative; overflow:hidden}
.btn.file input{position:absolute; inset:0; opacity:0; cursor:pointer}

/* button color accents (subtle, board-friendly) */
.btn.primary{border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.10)}
.btn.primary:hover{background: rgba(34,197,94,.14)}
.btn.info{border-color: rgba(59,130,246,.35); background: rgba(59,130,246,.10)}
.btn.info:hover{background: rgba(59,130,246,.14)}
.btn.accent{border-color: rgba(245,158,11,.38); background: rgba(245,158,11,.10)}
.btn.accent:hover{background: rgba(245,158,11,.14)}
.btn.purple{border-color: rgba(168,85,247,.38); background: rgba(168,85,247,.10)}
.btn.purple:hover{background: rgba(168,85,247,.14)}

.section{border:1px solid rgba(255,255,255,.10); border-radius:18px; background:rgba(255,255,255,.03); padding:12px}
.section-title{font-weight:800; font-size:12px; color:rgba(255,255,255,.55); margin-bottom:10px; letter-spacing:.08em; text-transform:uppercase}
#notes{width:100%; min-height:140px; resize:vertical; padding:10px; border-radius:12px; border:1px solid rgba(255,255,255,.10); background:rgba(0,0,0,.22); color:var(--text)}
#capabilities,#permissions,#schedules{width:100%; min-height:92px; resize:vertical; padding:10px; border-radius:12px; border:1px solid rgba(255,255,255,.10); background:rgba(0,0,0,.22); color:var(--text); margin-top:10px}
.projects{display:flex; flex-direction:column; gap:10px}
.project{
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  background: rgba(0,0,0,.18);
  padding:10px 10px;
}
.project:hover{filter:brightness(1.05)}
.project-top{display:flex; justify-content:space-between; gap:10px; align-items:flex-start}
.project-title{font-weight:900; font-size:12.5px; line-height:1.25}
.project-status{font-size:11px; color:rgba(255,255,255,.55)}
.project-meta{margin-top:8px; display:flex; gap:8px; flex-wrap:wrap; color:rgba(255,255,255,.55); font-size:11px}
.project-pill{padding:2px 8px; border-radius:999px; border:1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.03)}

/* semantic pill palette (used by Safe Play columns) */
.project-pill.pill-ok{border-color: rgb(var(--ok-rgb) / .35); background: rgb(var(--ok-rgb) / .10)}
.project-pill.pill-warn{border-color: rgb(var(--warn-rgb) / .40); background: rgb(var(--warn-rgb) / .10)}
.project-pill.pill-bad{border-color: rgb(var(--bad-rgb) / .42); background: rgb(var(--bad-rgb) / .12)}
.project-pill.pill-info{border-color: rgb(var(--info-rgb) / .42); background: rgb(var(--info-rgb) / .12)}
.project-pill.pill-neutral{border-color: rgb(var(--neutral-rgb) / .30); background: rgb(var(--neutral-rgb) / .10)}

/* Back-compat */
.project-pill.todo{border-color: rgba(109,94,252,.35); background: rgba(109,94,252,.10)}
.project-pill.progress{border-color: rgba(245,158,11,.32); background: rgba(245,158,11,.10)}
.project-pill.done{border-color: rgba(34,197,94,.30); background: rgba(34,197,94,.10)}
.project-pill.archived{border-color: rgba(107,114,128,.30); background: rgba(107,114,128,.10)}

/* Safe Play: extra chips */
.project-pill.danger{border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.12); color: rgba(255,190,190,.95)}
.project-pill.notice-pill{border-color: rgba(59,130,246,.35); background: rgba(59,130,246,.10); color: rgba(185,220,255,.95)}
.project-pill.notice-pill.notice-2{border-color: rgba(99,102,241,.40); background: rgba(99,102,241,.12)}
.project-pill.notice-pill.notice-3{border-color: rgba(168,85,247,.40); background: rgba(168,85,247,.12)}
.project-pill.notice-pill.notice-4{border-color: rgba(236,72,153,.42); background: rgba(236,72,153,.12)}
.project-pill.warn-pill{border-color: rgba(245,158,11,.40); background: rgba(245,158,11,.12); color: rgba(255,230,185,.95)}

.pill-icon{margin-right:6px; opacity:.9}

.progress-ring{
  --p: 0;
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 900;
  color: rgba(255,255,255,.82);
}
.progress-ring::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: inherit;
  background: conic-gradient(
    rgb(var(--info-rgb) / .85) calc(var(--p) * 1%),
    rgba(255,255,255,.14) 0
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
}

@keyframes pillPulseWarn{
  0%,100%{box-shadow:0 0 0 rgb(var(--warn-rgb) / 0)}
  50%{box-shadow:0 0 0 4px rgb(var(--warn-rgb) / .12)}
}
@keyframes pillPulseBad{
  0%,100%{box-shadow:0 0 0 rgb(var(--bad-rgb) / 0)}
  50%{box-shadow:0 0 0 4px rgb(var(--bad-rgb) / .14)}
}

/* micro-animations (board-friendly, subtle) */
.card-expiring .pill-warn{animation: pillPulseWarn 2.8s ease-in-out infinite}
.card-expired .pill-bad{animation: pillPulseBad 2.4s ease-in-out infinite}

.card-labels{display:inline-flex; gap:6px; flex-wrap:wrap; justify-content:flex-end}

.log{max-height:220px; overflow:auto; display:flex; flex-direction:column; gap:8px}
.log-item{font-size:12px; color:rgba(255,255,255,.55); padding:8px; border:1px solid rgba(255,255,255,.10); border-radius:12px; background:rgba(0,0,0,.18)}
.footer{margin-top:auto; color:rgba(255,255,255,.45); font-size:12px}

.main{flex:1; display:flex; flex-direction:column; padding:18px; gap:14px}
.topbar{
  display:flex;
  justify-content:center;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  background: rgba(0,0,0,.10);
  backdrop-filter: blur(10px);
}
.tabs{display:flex; gap:8px; align-items:center}
.tab{border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.03); color:rgba(255,255,255,.75); padding:8px 10px; border-radius:999px; cursor:pointer; font-weight:900; font-size:12px}
.tab.active{background:rgba(255,255,255,.07); color:var(--text)}
.view.hidden{display:none}

.filters{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.filters select{height:36px; padding:7px 12px; border-radius:999px; border:1px solid rgba(255,255,255,.10); background:rgba(0,0,0,.30); color:var(--text); font-weight:800; font-size:12px}

/* Quick queues */
.queuebar{display:flex; gap:6px; align-items:center; flex-wrap:wrap}
.qbtn{height:32px; padding:6px 10px; border-radius:999px; border:1px solid rgba(255,255,255,.10); background:rgba(0,0,0,.22); color:rgba(255,255,255,.78); font-weight:900; font-size:12px; cursor:pointer}
.qbtn:hover{filter:brightness(1.06)}
.qbtn.active{background:rgba(255,255,255,.08); color:var(--text); border-color: rgba(109,94,252,.35)}

.search{width:min(860px, 100%)}
.search input{width:100%; padding:12px 16px; border-radius:999px; border:1px solid rgba(255,255,255,.10); background:rgba(0,0,0,.30); color:var(--text)}
.refreshline{margin-top:6px; padding-left:8px; font-size:11px; color:rgba(255,255,255,.55)}

.top-create{border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.04); color:var(--text); padding:10px 14px; border-radius:999px; cursor:pointer; font-weight:800}
.top-create:hover{background:rgba(255,255,255,.06)}

.insights{border:1px solid rgba(255,255,255,.10); border-radius:18px; background:rgba(255,255,255,.03); padding:12px}
.insights-title{font-weight:1000; margin-bottom:10px; letter-spacing:.01em}
.insights-grid{display:grid; grid-template-columns:repeat(4, minmax(220px, 1fr)); gap:10px}
@media (max-width: 1180px){.insights-grid{grid-template-columns:repeat(2, minmax(220px, 1fr));}}
@media (max-width: 640px){.insights-grid{grid-template-columns:1fr;}}

/* Today's Moves (actionable daily brief) */
.moves{border:1px solid rgba(255,255,255,.10); border-radius:16px; background: rgba(0,0,0,.18); padding:10px; margin-bottom:10px}
.moves-head{display:flex; justify-content:space-between; align-items:center; gap:10px}
.moves-title{font-weight:900; font-size:12.5px}
.moves-sub{font-size:11px; color:rgba(255,255,255,.55)}
.moves-list{margin-top:10px; display:flex; flex-direction:column; gap:8px}
.move-row{display:flex; justify-content:space-between; align-items:flex-start; gap:10px; border:1px solid rgba(255,255,255,.10); border-radius:14px; padding:10px; background: rgba(0,0,0,.18)}
.move-text{font-size:12px; line-height:1.25; font-weight:800}
.move-meta{margin-top:4px; font-size:11px; color:rgba(255,255,255,.55)}
.move-actions{display:flex; gap:8px; align-items:center}

.insight{border:1px solid rgba(255,255,255,.10); border-radius:16px; background: rgba(0,0,0,.18); padding:12px; position:relative; overflow:hidden}
.insight::before{content:""; position:absolute; inset:0; background: radial-gradient(600px 180px at 10% 0%, rgba(109,94,252,.14), transparent 60%); pointer-events:none}
.insight[data-kind="signals"]::before{background: radial-gradient(600px 180px at 10% 0%, rgba(239,68,68,.12), transparent 60%)}
.insight[data-kind="ideas"]::before{background: radial-gradient(600px 180px at 10% 0%, rgba(168,85,247,.14), transparent 60%)}
.insight-head{display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:10px; position:relative}
.insight-head-left{display:flex; flex-direction:column; gap:2px}
.insight-title{font-weight:1000; font-size:12.5px; display:flex; align-items:center; gap:8px}
.insight-icon{opacity:.95}
.insight-sub{font-size:11px; color:rgba(255,255,255,.58)}
.insight-chip{font-size:11px; font-weight:1000; letter-spacing:.08em; text-transform:uppercase; padding:5px 10px; border-radius:999px; border:1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: rgba(255,255,255,.75)}
.insight textarea{
  width:100%;
  min-height:96px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.22));
  color:rgba(255,255,255,.90);
  line-height:1.5;
  font-size:12.5px;
  font-family: inherit;
  letter-spacing: .01em;
}
.insight textarea[readonly]{cursor:default; resize:none;}
.insight textarea:focus{outline: none; border-color: rgba(109,94,252,.35); box-shadow: 0 0 0 3px rgba(109,94,252,.12)}
.insight-help{margin-top:8px; font-size:11px; color:rgba(255,255,255,.50)}

.board{display:grid; grid-template-columns:repeat(4, minmax(240px, 1fr)); gap:14px; align-items:start}
.column{
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.02) 35%, rgba(0,0,0,.12));
  padding:12px;
  box-shadow: var(--shadow);
}
.column-header{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px}
.column-header-left{display:flex; gap:10px; align-items:center}
.col-icon{width:20px; text-align:center; opacity:.9}
.column-title{font-weight:900; letter-spacing:.02em}
.count{font-size:12px; color:rgba(255,255,255,.55)}
.cardlist{display:flex; flex-direction:column; gap:10px; min-height:36px}
.show-more{
  width:100%;
  margin-top:2px;
  padding:10px 12px;
  border-radius:12px;
  border:1px dashed rgba(255,255,255,.18);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.78);
  cursor:pointer;
}
.show-more:hover{background: rgba(255,255,255,.06)}
.show-more:active{transform: translateY(1px)}

/* cards */
.card{
  position:relative;
  border-radius:14px;
  padding:12px 12px;
  cursor:grab;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  transition: transform .14s ease, filter .14s ease;
}
.card:hover{filter:brightness(1.06); transform: translateY(-1px)}

/* Hover previews (desktop only). Keeps compact mode usable. */
@media (hover:hover) and (pointer:fine){
  .card[data-preview]:hover::after{
    content: attr(data-preview);
    position:absolute;
    left:10px;
    right:10px;
    top: calc(100% + 8px);
    padding:10px 10px;
    border-radius:12px;
    border:1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.86);
    color: rgba(255,255,255,.90);
    font-size:12px;
    line-height:1.35;
    z-index: 20;
    box-shadow: var(--shadow);
    pointer-events:none;
  }
}

.card-actions{margin-top:10px; display:flex; gap:8px; flex-wrap:wrap}
.card-actions .btn{padding:6px 10px; border-radius:10px; font-size:12px}
.card-actions .btn.tiny{padding:5px 8px; font-size:11px}
.card-actions .btn.blocked{border-color: rgba(255,136,124,.40); background: rgba(255,136,124,.10)}
.card-actions .btn.progress{border-color: rgba(245,158,11,.38); background: rgba(245,158,11,.10)}
.card-actions .btn.done{border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.10)}
.card-actions .btn:active{transform: translateY(1px)}
.blocked-pill{border-color: rgba(255,136,124,.40); background: rgba(255,136,124,.10)}
.card-title{font-weight:900; font-size:13px; line-height:1.25}
.card-meta{margin-top:8px; display:flex; justify-content:flex-start; gap:10px; color:rgba(255,255,255,.55); font-size:11px}

.card-body{margin-top:8px; opacity:.88; font-size:12px; color:rgba(255,255,255,.78); white-space:pre-wrap; display:block}

/* Compact mode: keep the board blunt. Show details only when expanded. */
body.compact .card-body{display:none}
body.compact .card.expanded .card-body{display:block}

/* status-based gradients (Safe Play columns) */
.card-approved{background: linear-gradient(180deg, rgb(var(--ok-rgb) / .16), rgba(0,0,0,.22)); border-color: rgb(var(--ok-rgb) / .35)}
.card-expiring{background: linear-gradient(180deg, rgb(var(--warn-rgb) / .18), rgba(0,0,0,.22)); border-color: rgb(var(--warn-rgb) / .40)}
.card-expired{background: linear-gradient(180deg, rgb(var(--bad-rgb) / .18), rgba(0,0,0,.22)); border-color: rgb(var(--bad-rgb) / .40)}
.card-not-approved{background: linear-gradient(180deg, rgb(var(--info-rgb) / .18), rgba(0,0,0,.22)); border-color: rgb(var(--info-rgb) / .40)}
.card-exception{background: linear-gradient(180deg, rgba(204,121,167,.18), rgba(0,0,0,.22)); border-color: rgba(204,121,167,.40)}
.card-neutral{background: linear-gradient(180deg, rgb(var(--neutral-rgb) / .16), rgba(0,0,0,.22)); border-color: rgb(var(--neutral-rgb) / .30)}

/* Back-compat for older classes (other dashboards / older state) */
.card-todo{background: linear-gradient(180deg, rgba(109,94,252,.20), rgba(0,0,0,.22)); border-color: rgba(109,94,252,.35)}
.card-progress{background: linear-gradient(180deg, rgba(245,158,11,.18), rgba(0,0,0,.22)); border-color: rgba(245,158,11,.32)}
.card-done{background: linear-gradient(180deg, rgba(34,197,94,.16), rgba(0,0,0,.22)); border-color: rgba(34,197,94,.30)}
.card-archived{background: linear-gradient(180deg, rgba(107,114,128,.16), rgba(0,0,0,.22)); border-color: rgba(107,114,128,.30)}

.deliverables{border:1px solid rgba(255,255,255,.10); border-radius:18px; background:rgba(255,255,255,.03); padding:12px}

.inbox{display:grid; grid-template-columns:420px 1fr; gap:12px; align-items:start}
.inbox-left,.inbox-right{border:1px solid rgba(255,255,255,.10); border-radius:18px; background:rgba(255,255,255,.03); padding:12px}
.inbox-title{font-weight:900}
.inbox-sub{font-size:12px; color:rgba(255,255,255,.55); margin-top:4px}
.inbox-form{margin-top:10px; display:flex; flex-direction:column; gap:10px}
#inboxText{width:100%; min-height:92px; resize:vertical; padding:10px; border-radius:12px; border:1px solid rgba(255,255,255,.10); background:rgba(0,0,0,.22); color:var(--text)}
.inbox-form-actions{display:flex; justify-content:flex-end}
.inbox-list{margin-top:10px; display:flex; flex-direction:column; gap:8px; max-height:70vh; overflow:auto}
.inbox-item{border:1px solid rgba(255,255,255,.10); border-radius:12px; padding:10px; background:rgba(0,0,0,.18)}
.inbox-item-top{display:flex; justify-content:space-between; gap:10px; align-items:flex-start}
.inbox-item-text{font-weight:800; font-size:12.5px; line-height:1.35; white-space:pre-wrap}
.inbox-item-meta{margin-top:8px; display:flex; gap:8px; flex-wrap:wrap; font-size:11px; color:rgba(255,255,255,.55)}
.inbox-actions{margin-top:10px; display:flex; gap:8px; flex-wrap:wrap}
.btn.small{padding:6px 10px; border-radius:10px; font-size:12px}

.docs{display:grid; grid-template-columns:320px 1fr; gap:12px; align-items:start}

/* Activity view: make the log area larger than the composer */
#viewActivity .docs{grid-template-columns: 1.35fr 1fr;}
#viewActivity #activityComposer{min-height: 30vh;}
#viewActivity .docs-list{max-height: 78vh;}
.docs-left{border:1px solid rgba(255,255,255,.10); border-radius:18px; background:rgba(255,255,255,.03); padding:12px}
.docs-title{font-weight:900}
.docs-sub{font-size:12px; color:rgba(255,255,255,.55); margin-top:4px}
.docs-list{margin-top:10px; display:flex; flex-direction:column; gap:8px; max-height:70vh; overflow:auto}
.doc-item{border:1px solid rgba(255,255,255,.10); border-radius:12px; padding:10px; background:rgba(0,0,0,.18); cursor:pointer}
.doc-item:hover{filter:brightness(1.06)}
.doc-item.active{border-color: rgba(109,94,252,.35); background: rgba(109,94,252,.10)}
.doc-item-name{font-weight:900; font-size:12px}
.doc-item-meta{font-size:11px; color:rgba(255,255,255,.55); margin-top:6px}
.docs-right{border:1px solid rgba(255,255,255,.10); border-radius:18px; background:rgba(255,255,255,.03); padding:12px}
.docs-editor-head{display:flex; justify-content:space-between; gap:10px; align-items:center; margin-bottom:10px}
.docs-filename{font-weight:900; color:rgba(255,255,255,.75)}
.doc-editor{width:100%; min-height:70vh; resize:vertical; padding:10px; border-radius:12px; border:1px solid rgba(255,255,255,.10); background:rgba(0,0,0,.22); color:var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}
.deliverables-title{font-weight:900; margin-bottom:10px}
.tiles{display:grid; grid-template-columns:repeat(6, minmax(140px, 1fr)); gap:10px}

/* Masonry mode: better for variable-height tiles (status lists, exports, etc.) */
.tiles.masonry{
  display:block;
  column-count:4;
  column-gap:10px;
}
.tiles.masonry .tile{
  break-inside:avoid;
  margin:0 0 10px;
}
@media (max-width: 1200px){
  .tiles.masonry{column-count:3;}
}
@media (max-width: 900px){
  .tiles.masonry{column-count:2;}
}
@media (max-width: 560px){
  .tiles.masonry{column-count:1;}
}

.tile{border:1px solid rgba(255,255,255,.10); border-radius:14px; padding:12px; background:rgba(0,0,0,.18)}
.tile-title{font-weight:800; font-size:13px}
.tile-sub{font-size:11px; color:rgba(255,255,255,.55); margin-top:6px}

/* Committees view */
.committee-grid{display:grid; grid-template-columns:repeat(3, minmax(260px, 1fr)); gap:12px}
@media (max-width: 1200px){.committee-grid{grid-template-columns:repeat(2, minmax(260px, 1fr))}}
@media (max-width: 860px){.committee-grid{grid-template-columns:1fr}}

.committee-card{border:1px solid rgba(255,255,255,.10); border-radius:18px; background: rgba(255,255,255,.03); padding:12px}
.committee-head{display:flex; justify-content:space-between; align-items:flex-start; gap:10px}
.committee-title{font-weight:950}
.committee-meta{display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end}
.committee-list{margin-top:10px; display:flex; flex-direction:column; gap:8px; max-height:52vh; overflow:auto; padding-right:4px}
.member-row{display:flex; align-items:center; justify-content:space-between; gap:10px; border:1px solid rgba(255,255,255,.10); border-radius:12px; padding:8px 10px; background: rgba(0,0,0,.18)}
.member-left{display:flex; flex-direction:column; gap:2px; min-width:0}
.member-name{font-weight:850; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.member-role{font-size:11px; color:rgba(255,255,255,.55); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.member-right{display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end}

dialog{border:1px solid rgba(255,255,255,.10); border-radius:18px; background: #070a10; color:var(--text); padding:14px; width:min(720px, 92vw)}

.checklist{border:1px solid rgba(255,255,255,.10); border-radius:14px; background: rgba(0,0,0,.18); padding:10px}
.checklist-head{display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:8px}
.checklist-title{font-weight:900; font-size:12px; color:rgba(255,255,255,.75)}
.checklist-meta{font-size:11px; color:rgba(255,255,255,.55)}
.checklist-items{display:flex; flex-direction:column; gap:8px; max-height:220px; overflow:auto; padding-right:4px}
.checklist-row{display:flex; gap:10px; align-items:flex-start; border:1px solid rgba(255,255,255,.10); border-radius:12px; padding:8px 10px; background: rgba(0,0,0,.18)}
.checklist-row.done{opacity:.75}
.checklist-row input[type="checkbox"]{margin-top:2px}
.checklist-text{flex:1; font-size:12px; line-height:1.25; white-space:pre-wrap}
.checklist-text.done{text-decoration:line-through; color:rgba(255,255,255,.55)}
.checklist-del{border:none; background:transparent; color:rgba(255,255,255,.45); cursor:pointer; font-size:14px; padding:0 4px}
.checklist-del:hover{color:rgba(255,255,255,.75)}
.checklist-add{display:flex; gap:8px; align-items:center; margin-top:10px}
.checklist-add input{flex:1}

form{display:flex; flex-direction:column; gap:10px}
label{display:flex; flex-direction:column; gap:6px; color:rgba(255,255,255,.55); font-size:12px}
input, textarea, select{padding:10px; border-radius:12px; border:1px solid rgba(255,255,255,.10); background:rgba(0,0,0,.28); color:var(--text)}
.row{display:grid; grid-template-columns:1fr 1fr; gap:10px}
menu{display:flex; gap:10px; justify-content:flex-end; padding:0; margin:8px 0 0}

@media (max-width: 1200px){
  .insights-grid{grid-template-columns:repeat(2, minmax(220px, 1fr))}
  .board{grid-template-columns:repeat(2, minmax(240px, 1fr))}
  .tiles{grid-template-columns:repeat(3, minmax(140px, 1fr))}
}
@media (max-width: 860px){
  .app{flex-direction:column}
  .sidebar{width:auto}
  .insights-grid{grid-template-columns:1fr}
  .board{grid-template-columns:1fr}
  .docs{grid-template-columns:1fr}
  .inbox{grid-template-columns:1fr}
  .tiles{grid-template-columns:repeat(2, minmax(140px, 1fr))}
}
