:root {
  --bg: #f6f7f9;
  --fg: #111111;
  --card: #ffffff;
  --line: #e7e8ec;
  --muted: #6b6e76;
  --soft: #f1f2f4;
  --accent: #111111;
  --on-accent: #ffffff;
  --danger: #9f2d20;
  --shadow: 0 1px 2px rgba(17, 17, 17, 0.04);
  color-scheme: light;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

html.dark {
  --bg: #101012;
  --fg: #f4f4f5;
  --card: #18181b;
  --line: #2a2a2e;
  --muted: #a1a1aa;
  --soft: #232328;
  --accent: #f4f4f5;
  --on-accent: #111111;
  --danger: #f0a8a2;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); overflow-x: clip; }
img, video, svg.chart, svg.gauge { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; font-weight: 650; letter-spacing: -0.035em; }
h2 { font-size: 16px; font-weight: 650; letter-spacing: -0.02em; }
h3 { font-size: 15px; font-weight: 650; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(720px 360px at 50% 0%, #ffffff 0%, transparent 70%),
    var(--bg);
}
.login-card {
  width: min(100%, 420px);
  background: var(--card);
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 28px;
  box-shadow: 0 30px 70px rgba(17, 17, 17, 0.08), 0 2px 8px rgba(17, 17, 17, 0.04);
  padding: 40px 36px 32px;
}
.login h1 { margin: 28px 0 22px; font-size: 32px; letter-spacing: -0.045em; }
.login .form { gap: 16px; }
.login .field-label { gap: 8px; font-size: 13px; font-weight: 560; }
.login .field {
  height: 48px;
  border-radius: 14px;
  border-color: transparent;
  background: #f4f5f7;
  padding: 0 16px;
}
.login .field:focus {
  outline: none;
  background: var(--card);
  border-color: var(--fg);
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}
.login .field:-webkit-autofill,
.login .field:-webkit-autofill:hover,
.login .field:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--fg);
  caret-color: var(--fg);
  box-shadow: 0 0 0 1000px #f4f5f7 inset;
}
.login .btn { width: 100%; height: 48px; border-radius: 14px; margin-top: 4px; font-size: 15px; }
html.dark .login {
  background:
    radial-gradient(720px 360px at 50% 0%, #1c1c20 0%, transparent 70%),
    var(--bg);
}
html.dark .login-card { border-color: var(--line); box-shadow: none; }
html.dark .login .field { background: var(--soft); }
html.dark .login .field:focus { box-shadow: 0 0 0 4px rgba(244, 244, 245, 0.08); }
.logo { display: flex; align-items: center; min-width: 0; }
.wordmark { height: 18px; width: auto; max-width: 100%; display: block; }
.login .wordmark { height: 26px; }
html.dark .wordmark { filter: invert(1); }
.lede { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.people { display: grid; gap: 8px; margin-top: 22px; }
.person {
  display: flex; align-items: center; gap: 12px;
  text-align: left; width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.person:hover { background: var(--soft); }
.person strong { display: block; font-weight: 640; }
.person span span { color: var(--muted); font-size: 13px; }

.app { min-height: 100vh; }
.side {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transform: translateX(-105%);
  transition: transform 0.18s ease;
}
.nav-open .side { transform: none; }
.side-head { padding: 16px 14px 8px; display: grid; gap: 12px; }
.workspace-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 12px;
  background: var(--soft);
}
.chip-mark {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); color: var(--fg);
}
.chip-mark svg { width: 16px; height: 16px; }
.workspace-chip strong { display: block; font-size: 13px; font-weight: 650; }
.workspace-chip span { font-size: 12px; color: var(--muted); }
.side nav { padding: 8px 10px; display: grid; align-content: start; gap: 2px; overflow: auto; }
.nav-label {
  margin: 14px 10px 4px;
  font-size: 12px;
  color: var(--muted);
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  border-radius: 8px;
  padding: 8px 10px;
  color: #3f3f46;
  font-size: 14px;
}
html.dark .nav-link { color: var(--muted); }
.nav-link.active, .nav-link:hover { background: var(--soft); color: var(--fg); }
.nav-link.active { font-weight: 640; }
.ico { width: 16px; height: 16px; flex: 0 0 16px; }
.side-foot {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}
.who-copy { min-width: 0; flex: 1; }
.who-copy strong { display: block; font-size: 13px; font-weight: 650; }
.avatar {
  width: 32px; height: 32px; border-radius: 99px;
  display: grid; place-items: center;
  background: var(--soft); color: var(--fg);
  font-size: 11px; font-weight: 700; flex: 0 0 32px;
}
.avatar.lg { width: 44px; height: 44px; font-size: 14px; }
.scrim { position: fixed; inset: 0; background: rgba(17, 17, 17, 0.35); z-index: 15; border: 0; }

.workspace { min-height: 100vh; min-width: 0; overflow-x: clip; }
.top {
  position: sticky; top: 0; z-index: 10;
  height: 64px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
}
.crumb { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb b { color: var(--fg); font-weight: 640; }
.crumb span { margin: 0 6px; }
.search {
  width: min(280px, 42vw);
  height: 38px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  color: var(--muted);
}
.search input {
  border: 0; outline: 0; background: transparent;
  width: 100%; min-width: 0; height: 100%; color: var(--fg);
}
.search kbd {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  white-space: nowrap;
}
.icon-btn, .btn, .btn-ghost, .btn-danger {
  height: 36px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 620;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.icon-btn, .btn-ghost {
  background: var(--card);
  color: var(--fg);
  border-color: var(--line);
  font-weight: 550;
}
.icon-btn { width: 36px; padding: 0; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--line); }
.page { padding: 8px 16px 56px; max-width: 1240px; min-width: 0; }
.head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.stat { padding: 16px; }
.stat b { display: block; margin-top: 8px; font-size: 28px; font-weight: 650; letter-spacing: -0.04em; }
.grid-2 { display: grid; gap: 12px; margin-top: 12px; }
.panel { padding: 16px 18px; }
.panel h3 { margin-bottom: 8px; }
.panel.flat { display: block; }
.row-link, .task {
  display: block; width: 100%;
  text-align: left; background: transparent;
  border: 0; border-bottom: 1px solid var(--line);
  padding: 12px 0; text-decoration: none;
}
.row-link:last-child { border-bottom: 0; }
.task:disabled { color: var(--muted); cursor: default; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pill {
  display: inline-flex; align-items: center;
  border-radius: 999px; padding: 2px 8px;
  font-size: 12px; background: var(--soft); color: var(--fg);
  white-space: nowrap; font-weight: 560;
}
.pill.high, .pill.urgent, .pill.revision_required { background: #f3e8e4; color: #6d2b22; }
html.dark .pill.high, html.dark .pill.urgent, html.dark .pill.revision_required { background: #3a2422; color: #f0c7c0; }
.pill.completed, .pill.approved { background: #e7f0e8; color: #24533a; }
html.dark .pill.completed, html.dark .pill.approved { background: #1d2e24; color: #c9ead4; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.seg .btn-ghost { border: 0; height: 30px; background: transparent; }
.seg .is-on { background: var(--accent); color: var(--on-accent); }
select.field, input.field, textarea.field {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 9px 11px;
}
textarea.field { min-height: 96px; resize: vertical; }
label.field-label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.form { display: grid; gap: 12px; }
.form.tight { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.form.tight .field { flex: 1; min-width: 160px; }
.form.panel { max-width: 640px; }
.cards { display: grid; gap: 12px; }
.table-wrap { overflow-x: auto; padding: 4px 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 560; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--soft); }
.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.column { width: 250px; flex: 0 0 250px; background: var(--soft); border-radius: 14px; padding: 10px; }
.card-link {
  display: block; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; margin-top: 8px;
}
.split { display: grid; gap: 14px; }
.thread, .chat { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.chat { background: var(--soft); border-radius: 20px; padding: 14px; }
.chat.flat { background: transparent; padding: 0; margin-top: 8px; }
.bubble { max-width: min(100%, 540px); border-radius: 18px; padding: 12px 14px; background: var(--card); box-shadow: var(--shadow); }
.bubble.mine { margin-left: auto; background: var(--fg); color: var(--card); }
.bubble.mine .muted { color: color-mix(in srgb, var(--card) 70%, transparent); }
.bubble.internal { max-width: 100%; margin-left: 0; background: #f8f1dc; color: var(--fg); border: 1px solid #e2c98a; box-shadow: none; }
.bubble.request { max-width: 100%; background: transparent; box-shadow: none; padding: 0 4px 8px; }
.bubble header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bubble header .avatar { width: 28px; height: 28px; font-size: 11px; }
.bubble header strong, .bubble header .small { display: block; }
.bubble p { margin: 0; line-height: 1.45; white-space: pre-wrap; }
.shots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; min-width: 0; max-width: 100%; }
.shot { display: block; flex: 0 0 112px; width: 112px; min-width: 0; max-width: min(112px, 100%); overflow: hidden; border-radius: 10px; }
.shot img, .file-thumb, .poster {
  width: 100%; max-width: 100%; height: 76px; max-height: 76px; object-fit: cover;
  border-radius: 10px; display: block; background: var(--soft);
}
.file-card .file-thumb { height: 72px; max-height: 72px; }
.file-chip { display: inline-flex; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--soft); font-size: 13px; text-decoration: none; }
.bubble.mine .file-chip { background: color-mix(in srgb, var(--card) 16%, transparent); color: inherit; }
.composer { display: grid; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px; }
.composer textarea.field { min-height: 56px; border: 0; background: transparent; padding: 8px 8px 0; }
.composer textarea.field:focus { outline: none; box-shadow: none; }
.composer-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clip { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; font-size: 13px; font-weight: 560; }
.clip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.picks { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.pick { font-size: 12px; background: var(--soft); border-radius: 999px; padding: 4px 8px; }
.composer .btn { margin-left: auto; }
html.dark .bubble.internal { background: #3a321c; color: var(--fg); border-color: #6b5a2e; }
.poster { border: 1px solid var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { padding: 28px 8px; text-align: center; color: var(--muted); }
.bar { display: block; width: 100%; height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 6px; width: 0; background: var(--fg); border-radius: 99px; }
.team-layout { display: grid; gap: 28px; align-items: start; min-width: 0; }
.team-layout > section { min-width: 0; }
.section-title { font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 4px 0 10px; }
.company-card { display: grid; gap: 14px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-head h3 { margin: 0; }
.member-copy { min-width: 0; }
.member-copy strong, .member-copy .small { display: block; overflow: hidden; text-overflow: ellipsis; }
.login-list { display: grid; }
.member {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.member .tight, .member .btn-danger { grid-column: 1 / -1; }
.row { display: grid; gap: 10px; min-width: 0; }
.checks { display: grid; gap: 6px; }
.person-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 8px; }
.toast {
  position: fixed; bottom: 16px; right: 16px;
  background: var(--accent); color: var(--on-accent);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; z-index: 50;
}
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.error { color: var(--danger); font-size: 13px; }

.settings { display: grid; gap: 8px; }
.subnav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.subnav button {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; background: transparent; color: var(--muted);
  border-radius: 8px; padding: 8px 10px; white-space: nowrap; font-weight: 550;
}
.subnav button.active { background: var(--soft); color: var(--fg); font-weight: 650; }
.settings-card { padding: 6px 18px 18px; }
.note-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.note-row strong { display: block; font-size: 14px; }
.note-row p { margin-top: 2px; }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 42px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i {
  position: absolute; inset: 0; border-radius: 99px;
  background: #d7d8dd; pointer-events: none; transition: background 0.15s ease;
}
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 99px; background: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease;
}
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }
html.dark .switch input:checked + i::after { background: #111; }
.profile-row, .who { display: flex; align-items: center; gap: 10px; }
.profile-row { padding: 16px 0; }
.who strong, .who .small { display: block; }
.hero-row, .stack, .metrics, .filterbar, .inbox, .kb { display: grid; gap: 12px; }
.hero {
  display: block; color: #f5f5f4; background: #111; border-radius: 18px;
  padding: 28px; min-height: 180px;
}
.hero h2 { color: white; font-size: 28px; letter-spacing: -0.04em; line-height: 1.15; }
.hero p { color: #c8c8c6; margin: 10px 0 18px; max-width: 360px; }
.hero span { font-weight: 650; }
.side-card, .convo, .article {
  display: flex; align-items: center; gap: 10px; width: 100%;
  text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px;
}
.side-card strong, .convo strong, .article strong { display: block; }
.stack .side-card { border-radius: 14px; }
.metrics { grid-template-columns: repeat(2, 1fr); }
.metric {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; box-shadow: var(--shadow); text-align: left;
}
button.metric { width: 100%; font-weight: 450; }
.metric b { display: block; margin: 8px 0 4px; font-size: 28px; font-weight: 680; letter-spacing: -0.04em; }
.metric.on { border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
.panel-top, .filterbar, .banner, .bar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-top { margin-bottom: 8px; }
.panel-top h3 { margin: 0; }
.chart, .gauge { width: 100%; height: auto; display: block; }
.gauge { max-width: 220px; margin: 8px auto; }
.banner { background: var(--soft); border-radius: 16px; padding: 18px; margin-bottom: 12px; }
.banner-copy { display: flex; align-items: center; gap: 12px; }
.filterbar { flex-wrap: wrap; align-items: center; }
.filterbar .search { height: 38px; }
.search.grow { flex: 1; width: auto; min-width: 180px; }
.field.slim { width: auto; min-width: 150px; height: 38px; }
.dot { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; text-transform: capitalize; }
.dot::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: #111; }
.dot.pending::before, .dot.high::before { background: #b7791f; }
.dot.done::before, .dot.completed::before { background: #2f6b45; }
.dot.urgent::before, .dot.revision_required::before { background: #9f2d20; }
.dot.low::before, .dot.normal::before { background: #8a8a90; }
.inbox, .kb { align-items: start; }
.convo { background: transparent; border-color: transparent; }
.convo.active { background: var(--soft); border-color: transparent; }
.convo .small, .article .small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.inbox-thread .thread { max-height: 360px; overflow: auto; margin: 8px 0 12px; }
.ico-box { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--soft); }
.bar-row { padding: 8px 0; }
.bar-row span:first-child { width: 140px; font-size: 13px; }
.track { flex: 1; height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.track span { display: block; height: 100%; background: var(--fg); }
.article { margin-top: 8px; }
.file-card { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.file-card:last-child { border-bottom: 0; }
.file-card a { font-size: 13px; text-decoration: none; }
.split, .chat, .bubble, .panel, .cards, .grid-2, .inbox, .metrics, .hero-row, .settings { min-width: 0; max-width: 100%; }
.bubble { overflow-wrap: anywhere; }
.table-wrap { max-width: 100%; -webkit-overflow-scrolling: touch; }
.bar-row span:first-child { min-width: 0; }

@media (max-width: 720px) {
  .search kbd, .crumb-root { display: none; }
  .search { width: auto; flex: 1; min-width: 0; }
  .top { height: 56px; padding: 0 10px; gap: 6px; }
  h1 { font-size: 24px; }
  .page { padding: 4px 12px 64px; }
  .login-card { padding: 28px 18px 22px; border-radius: 22px; }
  .hero { padding: 20px; min-height: 0; }
  .hero h2 { font-size: 22px; }
  .panel { padding: 14px; }
  .note-row { align-items: flex-start; gap: 12px; }
  .note-row > span:first-child, .note-row > div { min-width: 0; }
  .inbox-list { max-height: 240px; overflow: auto; }
  .composer .btn { margin-left: 0; }
  .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap tr, .table-wrap td, .table-wrap th { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { padding: 8px 0; }
  .table-wrap td, .table-wrap th { border-bottom: 0; padding: 4px 8px; }
  .table-wrap tr.click { border-bottom: 1px solid var(--line); }
  .head .actions { width: 100%; }
  .head .actions .btn, .head .actions .btn-ghost { flex: 1; }
}

@media (min-width: 720px) {
  .member { grid-template-columns: auto minmax(0, 0.8fr) minmax(160px, 1.2fr) auto; }
  .member .tight, .member .btn-danger { grid-column: auto; }
}

@media (min-width: 880px) {
  .side { transform: none; }
  .scrim { display: none; }
  .workspace { margin-left: 248px; }
  .page { padding: 8px 32px 72px; }
  .hide-desktop { display: none; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .grid-2 { grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); }
  .cards { grid-template-columns: 1fr 1fr; }
  .settings { grid-template-columns: 210px minmax(0, 680px); align-items: start; gap: 18px; }
  .subnav { display: grid; position: sticky; top: 80px; }
  .hero-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr); }
  .metrics { grid-template-columns: repeat(4, 1fr); }
  .row.two { grid-template-columns: 1fr 1fr; }
  .row.three { grid-template-columns: 1fr 1fr 1fr; }
}

@media (min-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr) 280px; }
  .inbox { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); }
}

@media (min-width: 1180px) {
  .team-layout { grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr); }
}
.team-layout .form.panel, .team-layout .panel { max-width: none; }
