/* ============================================================
   Aproject — component styles (sidebar, palette, menus, chat)
   ============================================================ */

/* ---------------- SIDEBAR ---------------- */
.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: auto;
  width: 268px;
  margin: 10px;
  background: var(--sidebar);
  border: 1px solid var(--sidebar-border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.015);
  color: var(--sidebar-foreground);
  transition: width .22s cubic-bezier(.4,0,.2,1);
}
.sidebar.collapsed { width: 60px; }
.app-shell.dark .sidebar { box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 26px rgba(0,0,0,.34), 0 0 0 1px rgba(255,255,255,.04); }
/* pilot column-1 floats the same way */
.pilot-root > .sidebar { border-radius: 16px; }

/* header / wordmark */
.sb-header {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 56px;
  padding: 0 10px 0 14px;
  flex-shrink: 0;
}
.sb-logo {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  flex-shrink: 0;
  font-family: "Newsreader", serif;
  font-weight: 600;
  font-size: 17px;
  line-height: 1;
}
.sb-wordmark {
  font-family: "Newsreader", Georgia, serif;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: .2px;
  color: var(--foreground);
  white-space: nowrap;
}
.sb-collapse-btn {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border: none; background: transparent;
  color: var(--sidebar-muted);
  border-radius: 7px;
  cursor: pointer;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.sb-collapse-btn:hover { background: var(--sidebar-item-hover); color: var(--sidebar-foreground); }
.collapsed .sb-header { padding: 0; justify-content: center; }
.collapsed .sb-wordmark, .collapsed .sb-headeractions { display: none; }

/* body */
.sb-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 10px 8px; }
.collapsed .sb-body { padding: 4px 8px 8px; overflow: visible; }
.sb-section { margin-top: 14px; }
.sb-section:first-child { margin-top: 4px; }
.sb-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .055em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  padding: 6px 10px 4px;
  user-select: none;
}
.collapsed .sb-label { opacity: 0; height: 10px; padding: 0; overflow: hidden; }

/* nav item */
.sb-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: none;
  background: transparent;
  color: var(--sidebar-foreground);
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 450;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.sb-item .ico { flex-shrink: 0; color: var(--sidebar-muted); transition: color .12s; }
.sb-item:hover { background: var(--sidebar-item-hover); }
.sb-item:hover .ico { color: var(--sidebar-foreground); }
.sb-item.active { background: var(--sidebar-item-active); color: var(--foreground); font-weight: 550; }
.sb-item.active .ico { color: var(--primary); }
.sb-item .label { overflow: hidden; text-overflow: ellipsis; }
.sb-item .trail { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--sidebar-muted); }
.collapsed .sb-item { justify-content: center; padding: 0; width: 44px; height: 40px; margin: 0 auto; }
.collapsed .sb-item .label, .collapsed .sb-item .trail { display: none; }

/* new chat — primary affordance */
.sb-newchat {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 38px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 13.5px; font-weight: 550;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  transition: background .12s, transform .04s;
}
.sb-newchat:hover { background: var(--primary-hover); }
.sb-newchat:active { transform: translateY(.5px); }
.sb-newchat .ico { color: var(--primary-foreground); }
.collapsed .sb-newchat { justify-content: center; padding: 0; width: 44px; margin: 0 auto; }
.collapsed .sb-newchat .label { display: none; }

/* outlined new chat (variant C) */
.sb-newchat.ghost {
  background: var(--card); color: var(--foreground);
  border-color: var(--sidebar-border);
  box-shadow: 0 1px 1px rgba(0,0,0,.03);
}
.sb-newchat.ghost:hover { background: var(--sidebar-item-hover); }
.sb-newchat.ghost .ico { color: var(--primary); }

/* search trigger */
.sb-search {
  display: flex; align-items: center; gap: 9px;
  width: 100%; height: 34px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--sidebar-border);
  background: var(--card);
  color: var(--sidebar-muted);
  font-size: 13px; cursor: pointer; text-align: left;
  transition: border-color .12s, background .12s;
}
.dark .sb-search { background: rgba(255,255,255,.02); }
.sb-search:hover { border-color: var(--border-strong); }
.sb-search .label { flex: 1; }
.collapsed .sb-search { justify-content: center; padding: 0; width: 44px; height: 40px; margin: 0 auto; border-color: transparent; background: transparent; }
.collapsed .sb-search:hover { background: var(--sidebar-item-hover); }
.collapsed .sb-search .label, .collapsed .sb-search .kbd { display: none; }

.kbd {
  display: inline-flex; align-items: center; gap: 1px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; font-weight: 500;
  padding: 1px 5px; border-radius: 5px;
  background: var(--secondary);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
}

/* product item (variant A) — with leading icon chip */
.sb-product .chip {
  display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 6px;
  flex-shrink: 0; color: #fff;
}
.collapsed .sb-product .chip { width: 24px; height: 24px; }

/* workspace switcher (variant B) */
.sb-switcher {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 46px; padding: 0 8px 0 9px;
  border: 1px solid var(--sidebar-border);
  background: var(--card);
  border-radius: 10px; cursor: pointer; text-align: left;
  transition: background .12s, border-color .12s;
}
.dark .sb-switcher { background: rgba(255,255,255,.02); }
.sb-switcher:hover { border-color: var(--border-strong); background: var(--sidebar-item-hover); }
.sb-switcher .chip { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #fff; flex-shrink: 0; }
.sb-switcher .meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sb-switcher .meta .t { font-size: 13.5px; font-weight: 600; color: var(--foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-switcher .meta .s { font-size: 11.5px; color: var(--sidebar-muted); }
.sb-switcher .cv { margin-left: auto; color: var(--sidebar-muted); flex-shrink: 0; }
.collapsed .sb-switcher { justify-content: center; padding: 0; width: 44px; }
.collapsed .sb-switcher .meta, .collapsed .sb-switcher .cv { display: none; }

/* segmented products (variant C) */
.sb-seg { display: flex; gap: 3px; padding: 3px; background: var(--secondary); border-radius: 9px; }
.sb-seg button {
  flex: 1; min-width: 0; height: 32px; border: none; background: transparent;
  border-radius: 7px; font-size: 12px; font-weight: 550; cursor: pointer;
  color: var(--muted-foreground); display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: background .12s, color .12s;
}
.sb-seg button span.tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-seg button.on { background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.dark .sb-seg button.on { background: var(--accent); }
.collapsed .sb-seg { flex-direction: column; background: transparent; padding: 0; gap: 4px; }
.collapsed .sb-seg button { width: 44px; margin: 0 auto; height: 38px; }
.collapsed .sb-seg button span.tx { display: none; }

/* chat history rows (two-line) */
.sb-chat {
  display: flex; align-items: center; gap: 8px;
  width: 100%; min-height: 46px; padding: 6px 8px 6px 8px;
  border: none; background: transparent; border-radius: 8px;
  color: var(--sidebar-foreground);
  text-align: left; cursor: pointer;
  transition: background .12s;
}
.sb-chat .unread { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: transparent; margin: 0 1px; }
.sb-chat .unread.on { background: #ec7a2c; box-shadow: 0 0 0 3px rgba(236,122,44,.16); }
.sb-chat .ct { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sb-chat .label { font-size: 13px; font-weight: 450; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-chat .label.u { font-weight: 600; color: var(--foreground); }
.sb-chat .cmeta { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--sidebar-muted); white-space: nowrap; }
.sb-chat .cmeta .usr { display: inline-flex; align-items: center; gap: 3px; }
.sb-chat:hover { background: var(--sidebar-item-hover); }
.sb-chat.active { background: var(--sidebar-item-active); }
.sb-chat .dots { opacity: 0; flex-shrink: 0; color: var(--sidebar-muted); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; align-self: center; }
.sb-chat:hover .dots, .sb-chat .dots.open { opacity: 1; }
.sb-chat .dots:hover, .sb-chat .dots.open { background: var(--sidebar-item-active); color: var(--foreground); }

/* collapsible section header (Избранное / История) */
.sb-histhead { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 4px 8px 4px 8px; }
.sb-secttitle {
  display: flex; align-items: center; gap: 5px; flex: 1; min-width: 0;
  border: none; background: transparent; cursor: pointer; padding: 3px 2px; border-radius: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .055em; text-transform: uppercase; color: var(--sidebar-muted);
}
.sb-secttitle:hover { color: var(--sidebar-foreground); }
.sb-secttitle .chev { transition: transform .16s; color: var(--sidebar-muted); }
.sb-groupbtn { display: grid; place-items: center; width: 24px; height: 24px; border: none; background: transparent; color: var(--sidebar-muted); border-radius: 6px; cursor: pointer; flex-shrink: 0; }
.sb-groupbtn:hover, .sb-groupbtn.open { background: var(--sidebar-item-hover); color: var(--sidebar-foreground); }
.sb-sublabel { padding: 4px 10px 3px; }

/* header action cluster (search + collapse) */
.sb-headeractions { margin-left: auto; display: flex; align-items: center; gap: 1px; }

/* divider */
.sb-divider { height: 1px; background: var(--sidebar-border); margin: 12px 10px; }
.collapsed .sb-divider { margin: 10px 8px; }

/* ---------------- FOOTER / USER ---------------- */
.sb-footer { flex-shrink: 0; padding: 8px 10px 12px; border-top: 1px solid var(--sidebar-border); }
.sb-user {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 6px 8px; border: none; background: transparent;
  border-radius: 9px; cursor: pointer; text-align: left;
  transition: background .12s;
}
.sb-user:hover { background: var(--sidebar-item-hover); }
.sb-user .meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sb-user .meta .nm { font-size: 13px; font-weight: 600; color: var(--foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user .meta .pl { font-size: 11.5px; color: var(--sidebar-muted); }
.sb-user .cv { margin-left: auto; color: var(--sidebar-muted); }
.collapsed .sb-footer { padding: 8px 8px 12px; }
.collapsed .sb-user { justify-content: center; padding: 6px 0; }
.collapsed .sb-user .meta, .collapsed .sb-user .cv { display: none; }

.avatar {
  display: grid; place-items: center; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #d9683a, #b03c8f);
  color: #fff; font-size: 12px; font-weight: 600;
}

/* ---------------- TOOLTIP ---------------- */
.tip {
  position: absolute; z-index: 60;
  left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--border);
  padding: 5px 9px; border-radius: 7px; font-size: 12.5px; font-weight: 500;
  white-space: nowrap; pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
  opacity: 0; transition: opacity .12s;
}
.tip-wrap { position: relative; }
.tip-wrap:hover .tip { opacity: 1; }

/* ---------------- DROPDOWN MENU ---------------- */
.menu {
  position: absolute; z-index: 80;
  min-width: 256px;
  background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.10);
  animation: menuIn .12s ease;
}
@keyframes menuIn { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; }
.menu-head .meta { min-width: 0; }
.menu-head .meta .nm { font-size: 13.5px; font-weight: 600; }
.menu-head .meta .em { font-size: 12px; color: var(--muted-foreground); display: flex; align-items: center; gap: 7px; margin-top: 1px; }
.menu-head .meta .em .em-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.menu-head .meta .em .badge { flex-shrink: 0; }
.menu-sep { height: 1px; background: var(--border); margin: 5px -2px; }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 34px; padding: 0 9px;
  border: none; background: transparent; border-radius: 7px;
  color: var(--popover-foreground); font-size: 13px; font-weight: 450;
  text-align: left; cursor: pointer; transition: background .1s;
}
.menu-item .ico { color: var(--muted-foreground); flex-shrink: 0; }
.menu-item:hover { background: var(--accent); }
.menu-item.active { background: var(--accent); }
.menu-sub-wrap { position: relative; }
.menu-sub-wrap > .menu-item .trail { display: inline-flex; align-items: center; gap: 5px; }
.menu.lang-sub { position: absolute; left: calc(100% + 6px); bottom: -6px; min-width: 188px; z-index: 90; }
@media (max-width: 720px) {
  .menu.lang-sub { left: auto; right: calc(100% + 6px); }
}
.menu-item .trail { margin-left: auto; color: var(--muted-foreground); display: flex; align-items: center; gap: 6px; }
.menu-item.danger { color: var(--destructive); }
.menu-item.danger .ico { color: var(--destructive); }
.badge {
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  padding: 1.5px 7px; border-radius: 999px;
  background: var(--sidebar-accent-tint); color: var(--primary);
}
/* theme segmented inside menu */
.theme-seg { display: flex; gap: 3px; padding: 3px; background: var(--secondary); border-radius: 8px; margin: 4px 1px 2px; }
.theme-seg button {
  flex: 1; height: 28px; border: none; background: transparent; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 11.5px; font-weight: 550; color: var(--muted-foreground); cursor: pointer;
}
.theme-seg button.on { background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.dark .theme-seg button.on { background: var(--accent); }

/* ---------------- COMMAND PALETTE ---------------- */
.cmd-overlay {
  position: absolute; inset: 0; z-index: 100;
  background: rgba(20,18,14,.32);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12%;
  animation: fadeIn .12s ease;
}
.dark .cmd-overlay { background: rgba(0,0,0,.5); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.cmd {
  width: min(560px, 86%);
  background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.3);
  animation: cmdIn .14s cubic-bezier(.34,1.2,.64,1);
}
@keyframes cmdIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.cmd-input { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cmd-input input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 15.5px; color: var(--foreground); font-family: inherit;
}
.cmd-input input::placeholder { color: var(--muted-foreground); }
.cmd-list { max-height: 340px; overflow-y: auto; padding: 8px; }
.cmd-group-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); padding: 8px 9px 4px; }
.cmd-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 9px 9px; border: none; background: transparent;
  border-radius: 8px; color: var(--foreground); font-size: 13.5px; font-weight: 450;
  text-align: left; cursor: pointer;
}
.cmd-item .ico { color: var(--muted-foreground); flex-shrink: 0; }
.cmd-item.sel { background: var(--accent); }
.cmd-item.sel .ico { color: var(--primary); }
.cmd-item .sub { color: var(--muted-foreground); font-size: 12px; margin-left: 2px; }
.cmd-item .trail { margin-left: auto; color: var(--muted-foreground); font-size: 12px; }
.cmd-empty { padding: 36px 16px; text-align: center; color: var(--muted-foreground); font-size: 13.5px; }
.cmd-foot { display: flex; align-items: center; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted-foreground); }
.cmd-foot .hint { display: flex; align-items: center; gap: 5px; }

/* ---------------- MAIN / CHAT AREA ---------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--background); }
.main-top { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 18px; flex-shrink: 0; }
.main-top .title { font-size: 14px; font-weight: 600; }
.main-top .crumb { color: var(--muted-foreground); font-size: 13px; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border: none; background: transparent; color: var(--muted-foreground); border-radius: 7px; cursor: pointer; }
.icon-btn:hover { background: var(--secondary); color: var(--foreground); }
.main-body { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.hero-mark { width: 52px; height: 52px; border-radius: 14px; background: var(--primary); color: var(--primary-foreground); display: grid; place-items: center; font-family: "Newsreader", serif; font-size: 28px; font-weight: 600; margin-bottom: 18px; }
.hero-h { font-family: "Newsreader", Georgia, serif; font-size: 30px; font-weight: 500; margin: 0 0 6px; }
.hero-p { color: var(--muted-foreground); font-size: 14.5px; max-width: 380px; margin: 0 0 26px; }
.composer { width: min(620px, 100%); border: 1px solid var(--border-strong); background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: 0 4px 18px rgba(0,0,0,.05); text-align: left; }
.composer .ph { color: var(--muted-foreground); font-size: 15px; min-height: 44px; }
.composer .row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.composer .chipbtn, .pd-composer .chipbtn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border: 1px solid var(--border); background: transparent; border-radius: 8px; color: var(--muted-foreground); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.composer .chipbtn:hover, .pd-composer .chipbtn:hover { background: var(--secondary); color: var(--foreground); }
.composer .send, .pd-composer .send { margin-left: auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: none; background: var(--primary); color: var(--primary-foreground); cursor: pointer; }
.composer .send:hover, .pd-composer .send:hover { background: var(--primary-hover); }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.suggest button { height: 32px; padding: 0 13px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; font-size: 12.5px; color: var(--secondary-foreground); cursor: pointer; }
.suggest button:hover { background: var(--secondary); }

/* ---------------- PROJECTS PAGE ---------------- */
.proj-wrap { flex: 1; min-height: 0; overflow-y: auto; padding: 34px 40px 64px; }
.proj-inner { max-width: 940px; margin: 0 auto; }
.proj-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.proj-title { font-family: "Newsreader", Georgia, serif; font-size: 30px; font-weight: 500; margin: 0; }
.proj-sub { color: var(--muted-foreground); font-size: 13.5px; margin: 5px 0 0; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px;
  border: none; border-radius: 9px; background: var(--primary); color: var(--primary-foreground);
  font-size: 13.5px; font-weight: 550; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,.06); transition: background .12s;
}
.btn-primary:hover { background: var(--primary-hover); }

.proj-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.proj-searchbar { flex: 1; display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 12px; border: 1px solid var(--border); background: var(--card); border-radius: 9px; }
.proj-searchbar input { flex: 1; border: none; outline: none; background: transparent; font-family: inherit; font-size: 13.5px; color: var(--foreground); }
.proj-searchbar input::placeholder { color: var(--muted-foreground); }
.proj-sort {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px;
  border: 1px solid var(--border); background: var(--card); border-radius: 9px;
  color: var(--secondary-foreground); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.proj-sort:hover { background: var(--secondary); }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 12px; }
.proj-card {
  position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--border); background: var(--card); border-radius: 12px;
  cursor: pointer; transition: border-color .14s, box-shadow .14s, transform .14s;
}
.proj-card:hover { border-color: var(--border-strong); box-shadow: 0 6px 18px rgba(0,0,0,.06); transform: translateY(-1px); }
.pc-code { font-size: 15px; font-weight: 650; color: var(--foreground); letter-spacing: .01em; }
.pc-addr { font-size: 12.5px; color: var(--muted-foreground); line-height: 1.4; }

.pc-row1 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stbadge { display: inline-flex; align-items: center; gap: 6px; height: 23px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.stbadge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-active { background: rgba(47,111,79,.12); color: #2f6f4f; }
.st-design { background: rgba(76,110,245,.13); color: #3f5fd6; }
.st-hold   { background: rgba(192,138,30,.15); color: #a8740f; }
.st-done   { background: var(--secondary); color: var(--muted-foreground); }
.dark .st-active { background: rgba(86,170,124,.16); color: #74c79a; }
.dark .st-design { background: rgba(108,140,255,.16); color: #9bb0ff; }
.dark .st-hold   { background: rgba(214,164,60,.16); color: #e0b45a; }

.pc-star { opacity: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; border: none; background: transparent; color: var(--muted-foreground); cursor: pointer; flex-shrink: 0; }
.proj-card:hover .pc-star { opacity: 1; }
.pc-star:hover { background: var(--secondary); color: var(--primary); }

.pc-name { font-size: 15.5px; font-weight: 650; line-height: 1.3; color: var(--foreground); margin-bottom: 5px; text-wrap: pretty; }
.pc-addr { font-size: 12.5px; color: var(--muted-foreground); margin-bottom: 2px; }
.pc-type { font-size: 12px; color: var(--muted-foreground); margin-bottom: 15px; }

.pc-prog { display: flex; align-items: center; gap: 11px; margin-bottom: 9px; }
.pc-prog .bar { flex: 1; height: 6px; border-radius: 999px; background: var(--secondary); overflow: hidden; }
.pc-prog .bar span { display: block; height: 100%; border-radius: 999px; }
.pc-prog .pct { font-size: 12.5px; font-weight: 650; width: 36px; text-align: right; color: var(--foreground); }
.pc-stage { font-size: 12.5px; color: var(--secondary-foreground); margin-bottom: 15px; min-height: 17px; }

.pc-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pc-metric .k { font-size: 10.5px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted-foreground); }
.pc-metric .v { font-size: 12.5px; font-weight: 600; color: var(--foreground); margin-top: 3px; }

.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted-foreground); }
.pc-foot .mi { display: inline-flex; align-items: center; gap: 5px; }

.proj-create {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 74px; border: 1.5px dashed var(--border-strong); background: transparent; border-radius: 12px;
  color: var(--muted-foreground); font-size: 13px; font-weight: 550; cursor: pointer; transition: border-color .14s, color .14s, background .14s;
}
.proj-create:hover { border-color: var(--primary); color: var(--primary); background: var(--sidebar-accent-tint); }
.proj-create .pcr-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border-strong); }
.proj-create:hover .pcr-ic { border-color: var(--primary); }
.proj-empty { padding: 60px 20px; text-align: center; color: var(--muted-foreground); font-size: 14px; grid-column: 1 / -1; }

/* status filter chips */
.proj-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.proj-filter { height: 30px; padding: 0 13px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--secondary-foreground); cursor: pointer; transition: background .12s, border-color .12s; }
.proj-filter:hover { background: var(--secondary); }
.proj-filter.on { background: var(--foreground); color: var(--background); border-color: var(--foreground); }

/* ---------------- PROJECT DETAIL ---------------- */
.pd-wrap { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 40px 60px; }
.pd-inner { max-width: 980px; margin: 0 auto; }
.pd-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-foreground); font-size: 13px; background: none; border: none; cursor: pointer; padding: 4px 0; margin-bottom: 14px; }
.pd-back:hover { color: var(--foreground); }
.pd-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.pd-info { flex: 1; min-width: 0; }
.pd-name { font-family: "Newsreader", Georgia, serif; font-size: 26px; font-weight: 500; margin: 0 0 8px; text-wrap: pretty; }
.pd-metaline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 13px; color: var(--muted-foreground); font-size: 13px; }
.pd-metaline .sep { color: var(--border-strong); }
.pd-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-ghost { height: 36px; padding: 0 13px; border: 1px solid var(--border); background: var(--card); border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--secondary-foreground); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.btn-ghost:hover { background: var(--secondary); }

.pd-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding: 13px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.pd-progress .bar { flex: 1; height: 8px; border-radius: 999px; background: var(--secondary); overflow: hidden; }
.pd-progress .bar span { display: block; height: 100%; border-radius: 999px; }
.pd-progress .lab { font-size: 13px; color: var(--muted-foreground); white-space: nowrap; }
.pd-progress .pct { font-weight: 650; color: var(--foreground); }

.pd-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.pd-tab { height: 40px; padding: 0 15px; border: none; background: none; color: var(--muted-foreground); font-size: 13.5px; font-weight: 550; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; gap: 8px; }
.pd-tab:hover { color: var(--foreground); }
.pd-tab.on { color: var(--foreground); border-bottom-color: var(--primary); }
.pd-tab .cnt { font-size: 11px; font-weight: 600; background: var(--secondary); color: var(--muted-foreground); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center; }
.pd-tab.on .cnt { background: var(--sidebar-accent-tint); color: var(--primary); }

.pd-composer { border: 1px solid var(--border-strong); background: var(--card); border-radius: 14px; padding: 14px 16px; box-shadow: 0 2px 12px rgba(0,0,0,.04); margin-bottom: 26px; }
.pd-composer .ph { color: var(--muted-foreground); font-size: 14.5px; min-height: 24px; }
.pd-composer .row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.pd-section-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.pd-section-h h3 { font-size: 14px; font-weight: 600; margin: 0; }
.chatlist { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); }
.chatrow { display: flex; align-items: center; gap: 13px; padding: 13px 15px; border: none; border-bottom: 1px solid var(--border); cursor: pointer; text-align: left; background: none; width: 100%; }
.chatrow:last-child { border-bottom: none; }
.chatrow:hover { background: var(--secondary); }
.chatrow .ct { flex: 1; min-width: 0; }
.chatrow .ct .t { font-size: 13.5px; font-weight: 550; color: var(--foreground); }
.chatrow .ct .s { font-size: 12.5px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.chatrow .cm { color: var(--muted-foreground); font-size: 12px; white-space: nowrap; text-align: right; }

.pd-instr { max-width: 720px; }
.pd-instr label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.pd-instr .hint { font-size: 12.5px; color: var(--muted-foreground); margin: 0 0 16px; line-height: 1.5; }
.pd-textarea { width: 100%; min-height: 200px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); padding: 14px 15px; font-family: inherit; font-size: 13.5px; line-height: 1.6; color: var(--foreground); resize: vertical; outline: none; }
.pd-textarea:focus { border-color: var(--ring); box-shadow: 0 0 0 3px var(--sidebar-accent-tint); }
.pd-instr .save-row { display: flex; gap: 10px; margin-top: 14px; align-items: center; }

/* participants */
.pp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pp-head h3 { font-size: 14px; font-weight: 600; margin: 0; }
.pp-list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); }
.pp-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.pp-row:last-child { border-bottom: none; }
.uav { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12.5px; font-weight: 600; flex-shrink: 0; }
.pp-meta { flex: 1; min-width: 0; }
.pp-meta .n { font-size: 13.5px; font-weight: 600; color: var(--foreground); display: flex; align-items: center; gap: 7px; }
.pp-meta .n .me { font-size: 11px; font-weight: 600; color: var(--muted-foreground); background: var(--secondary); padding: 1px 6px; border-radius: 999px; }
.pp-meta .n .title { font-size: 11.5px; font-weight: 500; color: var(--primary); background: var(--sidebar-accent-tint); padding: 1px 7px; border-radius: 999px; }
.pp-meta .e { font-size: 12.5px; color: var(--muted-foreground); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-rolebtn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border); background: var(--card); border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--secondary-foreground); cursor: pointer; }
.pp-rolebtn:hover { background: var(--secondary); }
.pp-rolebtn.locked { border-color: transparent; background: transparent; color: var(--muted-foreground); cursor: default; }
.pp-rolewrap { position: relative; flex-shrink: 0; }

/* generic modal */
.modal-overlay { position: absolute; inset: 0; z-index: 100; background: rgba(20,18,14,.34); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding-top: 11%; animation: fadeIn .12s ease; }
.dark .modal-overlay { background: rgba(0,0,0,.52); }
.modal { width: min(470px, 88%); background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.3); animation: cmdIn .14s cubic-bezier(.34,1.2,.64,1); overflow: hidden; }
.modal-h { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 18px 4px; }
.modal-h .t { font-size: 16px; font-weight: 650; }
.modal-h .s { font-size: 12.5px; color: var(--muted-foreground); margin-top: 3px; }
.modal-x { display: grid; place-items: center; width: 30px; height: 30px; border: none; background: transparent; border-radius: 7px; color: var(--muted-foreground); cursor: pointer; }
.modal-x:hover { background: var(--secondary); color: var(--foreground); }
.modal-b { padding: 14px 18px 18px; }
.modal-field { display: flex; gap: 8px; margin-bottom: 12px; }
.modal-input { flex: 1; display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px; border: 1px solid var(--border); background: var(--card); border-radius: 9px; }
.modal-input input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-family: inherit; font-size: 13.5px; color: var(--foreground); }
.modal-input input::placeholder { color: var(--muted-foreground); }
.modal-input:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px var(--sidebar-accent-tint); }
.modal-rolesel { position: relative; }
.modal-rolesel > button { height: 40px; padding: 0 12px; border: 1px solid var(--border); background: var(--card); border-radius: 9px; font-family: inherit; font-size: 13px; font-weight: 500; color: var(--secondary-foreground); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.modal-rolesel > button:hover { background: var(--secondary); }
.modal-note { font-size: 12.5px; color: var(--muted-foreground); margin: 2px 0 4px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ---------------- FILE MANAGER ---------------- */
.fm-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.fm-crumbs { display: flex; align-items: center; gap: 4px; font-size: 13.5px; min-width: 0; flex-shrink: 1; overflow: hidden; }
.fm-crumb { color: var(--muted-foreground); background: none; border: none; cursor: pointer; padding: 3px 6px; border-radius: 6px; white-space: nowrap; }
.fm-crumb:hover { color: var(--foreground); background: var(--secondary); }
.fm-crumb.cur { color: var(--foreground); font-weight: 600; cursor: default; }
.fm-crumb.cur:hover { background: none; }
.fm-csep { color: var(--border-strong); }
.fm-spacer { flex: 1; }
.fm-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 11px; border: 1px solid var(--border); background: var(--card); border-radius: 9px; width: 200px; }
.fm-search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-family: inherit; font-size: 13px; color: var(--foreground); }
.fm-search input::placeholder { color: var(--muted-foreground); }
.fm-viewseg { display: flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; flex-shrink: 0; }
.fm-viewseg button { width: 36px; height: 36px; border: none; background: var(--card); color: var(--muted-foreground); cursor: pointer; display: grid; place-items: center; }
.fm-viewseg button.on { background: var(--secondary); color: var(--foreground); }
.fm-viewseg button + button { border-left: 1px solid var(--border); }

.fm-cap { display: flex; align-items: center; gap: 12px; padding: 12px 15px; border: 1px solid var(--border); border-radius: 11px; background: var(--card); margin-bottom: 14px; }
.fm-cap .meter { flex: 1; height: 7px; border-radius: 999px; background: var(--secondary); overflow: hidden; }
.fm-cap .meter span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.fm-cap .lab { font-size: 12.5px; color: var(--muted-foreground); white-space: nowrap; }
.fm-cap .lab b { color: var(--foreground); font-weight: 600; }

.fm-drop { border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted-foreground); font-size: 13px; margin-bottom: 16px; cursor: pointer; transition: border-color .14s, background .14s, color .14s; }
.fm-drop:hover, .fm-drop.drag { border-color: var(--primary); background: var(--sidebar-accent-tint); color: var(--primary); }
.fm-drop b { color: var(--foreground); font-weight: 600; }
.fm-drop:hover b { color: var(--primary); }

.fm-selbar { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; background: var(--sidebar-accent-tint); border: 1px solid rgba(189,75,30,.2); border-radius: 10px; margin-bottom: 12px; font-size: 13px; font-weight: 500; }
.fm-selbar .sp { flex: 1; }
.fm-selbar button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border: none; border-radius: 8px; background: transparent; color: var(--secondary-foreground); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.fm-selbar button:hover { background: rgba(0,0,0,.05); }
.dark .fm-selbar button:hover { background: rgba(255,255,255,.06); }
.fm-selbar button.danger { color: var(--destructive); }

.cbx { width: 17px; height: 17px; border: 1.5px solid var(--border-strong); border-radius: 5px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; background: var(--card); color: transparent; transition: background .1s, border-color .1s; }
.cbx.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.ftype { display: grid; place-items: center; border-radius: 8px; color: #fff; flex-shrink: 0; }

.fm-list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); }
.fm-row { display: grid; grid-template-columns: 26px 1fr 112px 150px 36px; align-items: center; gap: 12px; padding: 0 14px; height: 50px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13.5px; }
.fm-row:last-child { border-bottom: none; }
.fm-row.head { height: 38px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); font-weight: 600; cursor: default; background: var(--secondary); }
.fm-row:not(.head):hover { background: var(--secondary); }
.fm-row.sel { background: var(--sidebar-accent-tint); }
.fm-name { display: flex; align-items: center; gap: 11px; min-width: 0; }
.fm-name .ftype { width: 30px; height: 30px; }
.fm-name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--foreground); }
.fm-name .nm.folder { font-weight: 600; }
.fm-name input { font-family: inherit; font-size: 13.5px; border: 1px solid var(--ring); border-radius: 6px; padding: 3px 7px; outline: none; background: var(--background); color: var(--foreground); width: 100%; }
.fm-col { color: var(--muted-foreground); font-size: 12.5px; }
.fm-rowmenu { display: grid; place-items: center; width: 28px; height: 28px; border: none; background: transparent; border-radius: 7px; color: var(--muted-foreground); cursor: pointer; opacity: 0; }
.fm-row:hover .fm-rowmenu { opacity: 1; }
.fm-rowmenu:hover { background: rgba(0,0,0,.06); color: var(--foreground); }
.dark .fm-rowmenu:hover { background: rgba(255,255,255,.08); }

.fm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 12px; }
.fm-tile { position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 16px 12px; background: var(--card); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; transition: border-color .12s, box-shadow .12s; }
.fm-tile:hover { border-color: var(--border-strong); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.fm-tile.sel { border-color: var(--primary); background: var(--sidebar-accent-tint); }
.fm-tile .ftype { width: 46px; height: 46px; }
.fm-tile .nm { font-size: 12.5px; font-weight: 550; color: var(--foreground); word-break: break-word; line-height: 1.35; }
.fm-tile .sz { font-size: 11.5px; color: var(--muted-foreground); }
.fm-tile .tcb { position: absolute; top: 8px; left: 8px; opacity: 0; }
.fm-tile:hover .tcb, .fm-tile.sel .tcb { opacity: 1; }
.fm-tile .tmenu { position: absolute; top: 6px; right: 6px; opacity: 0; display: grid; place-items: center; width: 26px; height: 26px; border: none; background: transparent; border-radius: 7px; color: var(--muted-foreground); cursor: pointer; }
.fm-tile:hover .tmenu { opacity: 1; }
.fm-empty { padding: 50px 20px; text-align: center; color: var(--muted-foreground); font-size: 13.5px; border: 1px dashed var(--border); border-radius: 12px; }

/* ---------------- LIBRARY (Вложения / Документы / Чертежи) ---------------- */
.lib-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.lib-row { display: grid; grid-template-columns: minmax(0, 1fr) 88px 70px 96px 30px; align-items: center; gap: 10px; padding: 0 14px; height: 58px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13.5px; }
.lib-row:last-child { border-bottom: none; }
.lib-row.head { height: 36px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); font-weight: 600; cursor: default; background: var(--secondary); }
.lib-row:not(.head):hover { background: var(--secondary); }
.lib-namecol { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lib-namecol .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--foreground); }
.lib-sub { font-size: 11.5px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-row .fm-col { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-row .fm-name .ftype { width: 28px; height: 28px; }
.objchip { display: inline-flex; align-items: center; height: 21px; padding: 0 9px; border-radius: 999px; background: var(--secondary); color: var(--secondary-foreground); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.lib-row.head .objchip-h { color: inherit; }

/* ---------------- CHAT PAGE (conversation) ---------------- */
.chat-page { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.chat-thread { max-width: 744px; margin: 0 auto; padding: 28px 24px 28px; display: flex; flex-direction: column; gap: 24px; }

.msg { display: flex; gap: 13px; }
.msg.user { justify-content: flex-end; }
.msg .av { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center; }
.msg.assistant .av { background: var(--primary); color: var(--primary-foreground); font-family: "Newsreader", serif; font-weight: 600; font-size: 16px; }
.msg .body { min-width: 0; }
.msg.assistant .body { flex: 1; }
.msg.user .bubble { background: var(--sidebar-accent-tint); border: 1px solid transparent; color: var(--foreground); border-radius: 15px 15px 5px 15px; padding: 11px 15px; font-size: 14.5px; line-height: 1.6; max-width: 560px; }

.prose { font-size: 14.5px; line-height: 1.66; color: var(--foreground); }
.prose p { margin: 0 0 11px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 650; }
.prose ul { margin: 9px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.prose li { display: flex; gap: 10px; align-items: flex-start; }
.prose li::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); margin-top: 9px; flex-shrink: 0; }
.cite { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10.5px; font-weight: 650; border-radius: 5px; background: var(--secondary); color: var(--muted-foreground); border: 1px solid var(--border); vertical-align: super; margin: 0 1px; cursor: pointer; }
.cite:hover { background: var(--sidebar-accent-tint); color: var(--primary); border-color: transparent; }

/* tool block (web search) */
.tool { border: 1px solid var(--border); border-radius: 11px; background: var(--card); margin-bottom: 13px; overflow: hidden; }
.tool-h { display: flex; align-items: center; gap: 9px; padding: 9px 13px; font-size: 13px; font-weight: 550; color: var(--foreground); }
.tool-h .ico { color: var(--primary); }
.tool-h .q { font-weight: 450; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-h .st { margin-left: auto; font-size: 12px; color: var(--muted-foreground); display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tool-h .st.done { color: #2f6f4f; }
.sources { border-top: 1px solid var(--border); }
.src { display: flex; align-items: center; gap: 10px; padding: 9px 13px; font-size: 12.5px; border: none; background: transparent; width: 100%; text-align: left; cursor: pointer; }
.src + .src { border-top: 1px solid var(--border); }
.src .num { width: 18px; height: 18px; border-radius: 5px; background: var(--secondary); display: grid; place-items: center; font-size: 10.5px; font-weight: 650; color: var(--muted-foreground); flex-shrink: 0; }
.src .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--foreground); font-weight: 500; }
.src .d { color: var(--muted-foreground); font-size: 11.5px; flex-shrink: 0; }
.src .ex { color: var(--muted-foreground); flex-shrink: 0; }
.src:hover { background: var(--secondary); }

/* reasoning */
.reason { margin-bottom: 13px; }
.reason-h { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--muted-foreground); background: none; border: none; cursor: pointer; padding: 2px 0; }
.reason-h:hover { color: var(--foreground); }
.reason-h .chev { transition: transform .16s; }
.reason-b { margin-top: 8px; font-size: 13px; line-height: 1.6; color: var(--muted-foreground); border-left: 2px solid var(--border); padding: 1px 0 1px 13px; }

/* loader dots */
.loader { display: inline-flex; gap: 4px; align-items: center; }
.loader i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-foreground); animation: ld 1.1s infinite ease-in-out; }
.loader i:nth-child(2) { animation-delay: .15s; }
.loader i:nth-child(3) { animation-delay: .3s; }
@keyframes ld { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.spin { width: 13px; height: 13px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* actions */
.msg-actions { display: flex; gap: 2px; margin-top: 11px; }
.act { display: grid; place-items: center; width: 30px; height: 30px; border: none; background: transparent; border-radius: 7px; color: var(--muted-foreground); cursor: pointer; }
.act:hover { background: var(--secondary); color: var(--foreground); }
.act.on { color: var(--primary); }

/* prompt input */
.chat-composer { border-top: 1px solid var(--border); padding: 12px 24px 18px; flex-shrink: 0; }
.chat-composer-inner { max-width: 744px; margin: 0 auto; }
.csuggest { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 11px; }
.csuggest button { height: 30px; padding: 0 12px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; font-size: 12.5px; color: var(--secondary-foreground); cursor: pointer; }
.csuggest button:hover { background: var(--secondary); }
.cinput { border: 1px solid var(--border-strong); background: var(--card); border-radius: 16px; padding: 12px 14px 10px; box-shadow: 0 2px 14px rgba(0,0,0,.05); transition: border-color .12s, box-shadow .12s; }
.cinput:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px var(--sidebar-accent-tint); }
.cinput textarea { width: 100%; border: none; outline: none; resize: none; background: transparent; font-family: inherit; font-size: 15px; line-height: 1.5; color: var(--foreground); max-height: 150px; }
.cinput textarea::placeholder { color: var(--muted-foreground); }
.crow { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ws-toggle { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--border); background: transparent; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--muted-foreground); cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.ws-toggle:hover { background: var(--secondary); }
.ws-toggle.on { background: var(--sidebar-accent-tint); border-color: transparent; color: var(--primary); }
.cmodel { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border: none; background: transparent; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--muted-foreground); cursor: pointer; }
.cmodel:hover { background: var(--secondary); color: var(--foreground); }
.csend { margin-left: auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: none; background: var(--primary); color: var(--primary-foreground); cursor: pointer; transition: background .12s, opacity .12s; }
.csend:hover { background: var(--primary-hover); }
.csend:disabled { opacity: .4; cursor: default; }
.chat-hint { text-align: center; font-size: 11.5px; color: var(--muted-foreground); margin-top: 9px; }

/* chat top-bar: clickable title + participants indicator */
.crumb-title-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--foreground); padding: 4px 8px; border-radius: 7px; }
.crumb-title-btn:hover { background: var(--secondary); }
.crumb-title-btn .cv { color: var(--muted-foreground); }
.chat-people-btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 11px 0 6px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--secondary-foreground); }
.chat-people-btn:hover { background: var(--secondary); }
.avstack { display: flex; align-items: center; }
.uav-sm { border-radius: 50%; border: 2px solid var(--background); display: grid; place-items: center; color: #fff; font-size: 9.5px; font-weight: 600; flex-shrink: 0; }
.avstack .uav-sm { width: 24px; height: 24px; margin-left: -8px; }
.avstack .uav-sm:first-child { margin-left: 0; }

/* slide-over drawer */
.drawer-overlay { position: absolute; inset: 0; z-index: 100; background: rgba(20,18,14,.34); backdrop-filter: blur(2px); display: flex; justify-content: flex-end; animation: fadeIn .12s ease; }
.dark .drawer-overlay { background: rgba(0,0,0,.5); }
.drawer { width: min(430px, 94%); height: 100%; background: var(--popover); color: var(--popover-foreground); border-left: 1px solid var(--border); box-shadow: -14px 0 44px rgba(0,0,0,.22); display: flex; flex-direction: column; overflow: hidden; animation: drawerIn .22s cubic-bezier(.3,.8,.4,1); }
@keyframes drawerIn { from { transform: translateX(28px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-h { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px 15px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drawer-h .t { font-size: 15px; font-weight: 650; }
.drawer-b { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px 26px; }
.drawer-sec { margin-bottom: 24px; }
.drawer-sec:last-child { margin-bottom: 4px; }
.drawer-sec h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); font-weight: 600; margin: 0 0 11px; }
.field-input { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px; border: 1px solid var(--border); background: var(--card); border-radius: 9px; }
.field-input:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px var(--sidebar-accent-tint); }
.field-input input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-family: inherit; font-size: 14px; color: var(--foreground); }

.drow { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.drow .dl { flex: 1; min-width: 0; }
.drow .dl .dt { font-size: 13.5px; font-weight: 500; }
.drow .dl .ds { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; line-height: 1.4; }
.switch { width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); border: none; cursor: pointer; position: relative; transition: background .15s; flex-shrink: 0; }
.switch.on { background: var(--primary); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch.on::after { transform: translateX(16px); }

.radio-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; margin-bottom: 7px; font-size: 13px; }
.radio-row:hover { background: var(--secondary); }
.radio-row.on { border-color: var(--primary); background: var(--sidebar-accent-tint); }
.radio-dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex-shrink: 0; }
.radio-row.on .radio-dot { border-color: var(--primary); }
.radio-row.on .radio-dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }

.dtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.dtab { height: 34px; padding: 0 12px; border: none; background: none; color: var(--muted-foreground); font-size: 13px; font-weight: 550; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; gap: 7px; }
.dtab:hover { color: var(--foreground); }
.dtab.on { color: var(--foreground); border-bottom-color: var(--primary); }
.dtab .cnt { font-size: 10.5px; font-weight: 600; background: var(--secondary); color: var(--muted-foreground); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center; }

.dfile { display: flex; align-items: center; gap: 10px; padding: 9px 0; cursor: pointer; border-bottom: 1px solid var(--border); }
.dfile:last-child { border-bottom: none; }
.dfile:hover .dfn { color: var(--primary); }
.dfile .dfn { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dfile .dfm { font-size: 11.5px; color: var(--muted-foreground); flex-shrink: 0; }

.dpart { display: flex; align-items: center; gap: 11px; padding: 9px 0; }
.dpart .dl { flex: 1; min-width: 0; }
.dpart .dl .nm { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.dpart .dl .em { font-size: 12px; color: var(--muted-foreground); }
.dpart .role { font-size: 12px; color: var(--muted-foreground); }
.dpart .x { display: grid; place-items: center; width: 26px; height: 26px; border: none; background: transparent; border-radius: 6px; color: var(--muted-foreground); cursor: pointer; }
.dpart .x:hover { background: var(--secondary); color: var(--destructive); }
.link-box { display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 6px 0 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--secondary); }
.link-box .url { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, monospace; }

/* ---------------- USER SETTINGS DIALOG ---------------- */
.us-overlay { position: absolute; inset: 0; z-index: 130; background: rgba(20,18,14,.4); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadeIn .14s ease; }
.dark .us-overlay { background: rgba(0,0,0,.58); }
.us-dialog { position: relative; display: flex; width: min(880px, 100%); height: min(620px, 92vh); background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: 0 30px 90px rgba(0,0,0,.34); animation: cmdIn .16s cubic-bezier(.34,1.2,.64,1); }
.us-close { position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; place-items: center; width: 32px; height: 32px; border: none; background: transparent; border-radius: 8px; color: var(--muted-foreground); cursor: pointer; }
.us-close:hover { background: var(--secondary); color: var(--foreground); }

.us-nav { width: 244px; flex-shrink: 0; background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px 12px; }
.us-nav-user { display: flex; align-items: center; gap: 11px; padding: 6px 8px 14px; }
.us-nav-meta { min-width: 0; }
.us-nav-meta .nm { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.us-nav-meta .em { font-size: 12px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.us-nav-items { display: flex; flex-direction: column; gap: 2px; }
.us-nav-i { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 11px; border: none; background: transparent; border-radius: 9px; color: var(--sidebar-foreground); font-family: inherit; font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer; transition: background .12s; }
.us-nav-i svg { color: var(--muted-foreground); }
.us-nav-i:hover { background: var(--sidebar-item-hover); }
.us-nav-i.on { background: var(--sidebar-item-active); color: var(--foreground); font-weight: 600; }
.us-nav-i.on svg { color: var(--primary); }
.us-nav-i.danger { margin-top: auto; color: var(--destructive); }
.us-nav-i.danger svg { color: var(--destructive); }
.us-nav-i.danger:hover { background: rgba(192,57,43,.08); }

.us-main { flex: 1; min-width: 0; overflow-y: auto; padding: 30px 34px 36px; }
.us-title { font-family: "Newsreader", Georgia, serif; font-size: 25px; font-weight: 500; margin-bottom: 22px; }
.us-sec { margin-bottom: 26px; }
.us-sec-h h3 { font-size: 13px; font-weight: 650; margin: 0 0 3px; }
.us-sec-h p { font-size: 12.5px; color: var(--muted-foreground); margin: 0 0 12px; }
.us-sec-h h3 + * { margin-top: 12px; }
.us-hint { font-size: 12px; color: var(--muted-foreground); }

.us-profile { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.us-field { margin-bottom: 14px; }
.us-field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.us-field input { width: 100%; height: 40px; padding: 0 13px; border: 1px solid var(--input); border-radius: 9px; background: var(--card); font-family: inherit; font-size: 14px; color: var(--foreground); outline: none; }
.us-field input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px var(--sidebar-accent-tint); }
.us-readonly { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 13px; border: 1px solid var(--border); border-radius: 9px; background: var(--secondary); font-size: 13.5px; color: var(--secondary-foreground); }

.us-themegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.us-themecard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 16px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); cursor: pointer; font-size: 13px; font-weight: 550; color: var(--foreground); transition: border-color .12s, background .12s; }
.us-themecard:hover { background: var(--secondary); }
.us-themecard.on { border-color: var(--primary); background: var(--sidebar-accent-tint); }
.us-themeic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--secondary); color: var(--foreground); }
.us-themecard.on .us-themeic { background: var(--primary); color: var(--primary-foreground); }
.us-check { position: absolute; top: 9px; right: 9px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: #fff; }

.us-rows { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.us-row { display: flex; align-items: center; gap: 14px; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.us-row:last-child { border-bottom: none; }
.us-row-l { flex: 1; min-width: 0; }
.us-row-t { font-size: 13.5px; font-weight: 550; }
.us-row-d { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; }

.us-langs { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.us-lang { display: flex; align-items: center; gap: 12px; padding: 12px 15px; border: none; border-bottom: 1px solid var(--border); background: transparent; cursor: pointer; text-align: left; }
.us-lang:last-child { border-bottom: none; }
.us-lang:hover { background: var(--secondary); }
.us-lang.on { background: var(--sidebar-accent-tint); }
.us-lang-meta { flex: 1; display: flex; flex-direction: column; }
.us-lang-t { font-size: 13.5px; font-weight: 550; color: var(--foreground); }
.us-lang-s { font-size: 12px; color: var(--muted-foreground); }
.us-radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex-shrink: 0; display: grid; place-items: center; }
.us-radio.on { border-color: var(--primary); }
.us-radio.on::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }

.us-plan { display: flex; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--secondary); }
.us-plan-l { flex: 1; }
.us-plan-badge { display: inline-block; font-size: 13px; font-weight: 650; color: var(--primary); margin-bottom: 4px; }

.us-helpgrid { display: flex; flex-direction: column; gap: 8px; }
.us-help { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--card); cursor: pointer; text-align: left; transition: border-color .12s, background .12s; }
.us-help:hover { background: var(--secondary); border-color: var(--border-strong); }
.us-help-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--secondary); color: var(--primary); flex-shrink: 0; }
.us-help:hover .us-help-ic { background: var(--card); }
.us-help-meta { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.us-help-t { font-size: 13.5px; font-weight: 600; }
.us-help-d { font-size: 12px; color: var(--muted-foreground); }
.us-about { border: 1px solid var(--border); border-radius: 12px; padding: 4px 15px; }
.us-about-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted-foreground); }
.us-about-row b { color: var(--foreground); font-weight: 600; }
.us-about-links { display: flex; gap: 16px; padding: 12px 0; }
.us-about-links button { background: none; border: none; color: var(--primary); font-family: inherit; font-size: 12.5px; cursor: pointer; padding: 0; }
.us-about-links button:hover { text-decoration: underline; }

/* ---- settings nav: search + label ---- */
.us-nav-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 11px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); }
.us-nav-search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-family: inherit; font-size: 13px; color: var(--foreground); }
.us-nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); font-weight: 600; padding: 2px 10px 7px; }

/* ---- form rows in general ---- */
.us-frow { display: flex; align-items: flex-start; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.us-frow:last-child { border-bottom: none; }
.us-frow > label { width: 200px; flex-shrink: 0; font-size: 13.5px; font-weight: 500; padding-top: 9px; }
.us-fctl { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.us-inp { width: 100%; height: 40px; padding: 0 13px; border: 1px solid var(--input); border-radius: 9px; background: var(--card); font-family: inherit; font-size: 14px; color: var(--foreground); outline: none; }
.us-inp:focus { border-color: var(--ring); box-shadow: 0 0 0 3px var(--sidebar-accent-tint); }
.us-textarea { width: 100%; min-height: 120px; padding: 11px 13px; border: 1px solid var(--input); border-radius: 11px; background: var(--card); font-family: inherit; font-size: 14px; line-height: 1.55; color: var(--foreground); outline: none; resize: vertical; }
.us-textarea:focus { border-color: var(--ring); box-shadow: 0 0 0 3px var(--sidebar-accent-tint); }
.us-select { position: relative; display: inline-flex; align-items: center; }
.us-select select { appearance: none; height: 38px; padding: 0 34px 0 13px; border: 1px solid var(--input); border-radius: 9px; background: var(--card); font-family: inherit; font-size: 13.5px; color: var(--foreground); cursor: pointer; outline: none; }
.us-select svg { position: absolute; right: 11px; pointer-events: none; color: var(--muted-foreground); }

/* ---- theme inline ---- */
.us-theme-seg { display: inline-flex; gap: 3px; padding: 3px; background: var(--secondary); border-radius: 9px; }
.us-theme-ic { display: grid; place-items: center; width: 34px; height: 30px; border: none; background: transparent; border-radius: 7px; color: var(--muted-foreground); cursor: pointer; }
.us-theme-ic.on { background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.dark .us-theme-ic.on { background: var(--accent); }

/* ---- tables (sessions, invoices) ---- */
.us-table { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.us-tr { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; align-items: center; padding: 12px 15px; border-bottom: 1px solid var(--border); font-size: 13px; }
.us-tr:last-child { border-bottom: none; }
.us-tr.us-tr-inv { grid-template-columns: 1.2fr 1fr 1fr 70px; }
.us-th { background: var(--secondary); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); font-weight: 600; }
.us-td-dev { display: flex; align-items: center; gap: 8px; font-weight: 550; }
.us-cur { font-size: 10.5px; font-weight: 600; color: var(--primary); background: var(--sidebar-accent-tint); padding: 1px 7px; border-radius: 999px; }
.us-muted { color: var(--muted-foreground); }
.us-paid { color: #2f8a5b; font-weight: 550; }
.us-link { background: none; border: none; color: var(--primary); font-family: inherit; font-size: 13px; cursor: pointer; text-align: left; padding: 0; }
.us-link:hover { text-decoration: underline; }
.us-mono { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted-foreground); }

/* ---- privacy ---- */
.us-banner { font-size: 12.5px; line-height: 1.55; color: var(--muted-foreground); background: var(--secondary); border: 1px solid var(--border); border-radius: 11px; padding: 13px 15px; margin-bottom: 18px; }
.us-linklist { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.us-linkrow { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 13px 15px; border: none; border-bottom: 1px solid var(--border); background: transparent; font-family: inherit; font-size: 13.5px; font-weight: 500; color: var(--foreground); cursor: pointer; text-align: left; }
.us-linkrow:last-child { border-bottom: none; }
.us-linkrow:hover { background: var(--secondary); }
.us-linkrow svg { color: var(--muted-foreground); }
.danger-btn { color: var(--destructive); border-color: var(--destructive); }
.danger-btn:hover { background: rgba(192,57,43,.08); }

/* ---- usage ---- */
.us-usage { display: flex; flex-direction: column; gap: 18px; }
.us-ublock { }
.us-urow { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.us-ut { font-size: 13.5px; font-weight: 550; }
.us-up { font-size: 12.5px; font-family: ui-monospace, monospace; color: var(--muted-foreground); }
.us-meter { height: 8px; border-radius: 999px; background: var(--secondary); overflow: hidden; }
.us-meter span { display: block; height: 100%; border-radius: 999px; }

/* ---- connectors ---- */
.us-conn-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--secondary); color: var(--foreground); flex-shrink: 0; }
.btn-ghost.us-connected { color: #2f8a5b; border-color: rgba(47,138,91,.4); }

/* ---------------- PLANS / UPGRADE ---------------- */
.plans-overlay { position: absolute; inset: 0; z-index: 135; background: rgba(20,18,14,.42); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 24px; overflow-y: auto; animation: fadeIn .14s ease; }
.dark .plans-overlay { background: rgba(0,0,0,.6); }
.plans-dialog { position: relative; width: min(1000px, 100%); margin: auto; background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 30px 36px 30px; box-shadow: 0 30px 90px rgba(0,0,0,.36); animation: cmdIn .16s cubic-bezier(.34,1.2,.64,1); }
.plans-back { position: absolute; top: 20px; left: 20px; display: grid; place-items: center; width: 34px; height: 34px; border: none; background: transparent; border-radius: 9px; color: var(--muted-foreground); cursor: pointer; }
.plans-back:hover { background: var(--secondary); color: var(--foreground); }
.plans-dialog .us-close { top: 20px; right: 20px; }

.plans-head { text-align: center; margin-bottom: 26px; }
.plans-title { font-family: "Newsreader", Georgia, serif; font-size: 30px; font-weight: 500; margin: 4px 0 18px; }
.plans-scope { display: inline-flex; gap: 3px; padding: 3px; background: var(--secondary); border-radius: 10px; margin-bottom: 14px; }
.plans-scope button { height: 34px; padding: 0 16px; border: none; background: transparent; border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 550; color: var(--muted-foreground); cursor: pointer; }
.plans-scope button.on { background: var(--card); color: var(--foreground); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.dark .plans-scope button.on { background: var(--accent); }
.plans-bill { display: flex; align-items: center; justify-content: center; gap: 4px; }
.plans-bill button { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 14px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; font-family: inherit; font-size: 12.5px; font-weight: 500; color: var(--muted-foreground); cursor: pointer; }
.plans-bill button.on { background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.plans-save { font-size: 11px; font-weight: 700; color: #2f8a5b; }
.plans-bill button.on .plans-save { color: #8fe3b4; }

.plans-grid { display: grid; gap: 16px; }
.plans-grid.cols2 { grid-template-columns: repeat(2, 1fr); max-width: 680px; margin: 0 auto; }
.plans-grid.cols3 { grid-template-columns: repeat(3, 1fr); }
.plan-card { position: relative; display: flex; flex-direction: column; padding: 22px 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); }
.plan-card.featured { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 12px 34px rgba(189,75,30,.12); }
.plan-card.current { background: var(--secondary); }
.plan-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--secondary); color: var(--primary); margin-bottom: 14px; }
.plan-card.featured .plan-mark { background: var(--primary); color: var(--primary-foreground); }
.plan-badge-cur, .plan-badge-rec { position: absolute; top: 20px; right: 20px; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.plan-badge-cur { background: var(--border-strong); color: var(--foreground); }
.plan-badge-rec { background: var(--sidebar-accent-tint); color: var(--primary); }
.plan-name { font-size: 19px; font-weight: 700; }
.plan-tag { font-size: 12.5px; color: var(--muted-foreground); margin: 3px 0 16px; min-height: 32px; }
.plan-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; min-height: 42px; }
.plan-amt { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.plan-per { font-size: 11px; line-height: 1.3; color: var(--muted-foreground); }
.plan-cta { width: 100%; height: 42px; border-radius: 10px; border: 1px solid transparent; font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; margin-bottom: 18px; }
.plan-cta.is-primary { background: var(--primary); color: var(--primary-foreground); }
.plan-cta.is-primary:hover { background: var(--primary-hover); }
.plan-cta.is-ghost { background: var(--card); color: var(--foreground); border-color: var(--border-strong); }
.plan-cta.is-ghost:hover { background: var(--secondary); }
.plan-cta.is-current { background: transparent; color: var(--muted-foreground); border-color: var(--border); cursor: default; }
.plan-feats { display: flex; flex-direction: column; gap: 9px; padding-top: 16px; border-top: 1px solid var(--border); }
.plan-feat { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--secondary-foreground); line-height: 1.4; }
.plan-feat svg { color: #2f8a5b; flex-shrink: 0; margin-top: 1px; }
.plan-feat.head { font-weight: 650; color: var(--foreground); }
.plans-foot { text-align: center; font-size: 11.5px; color: var(--muted-foreground); margin-top: 22px; }

@media (max-width: 820px) {
  .plans-grid.cols3 { grid-template-columns: 1fr; }
  .plans-grid.cols2 { grid-template-columns: 1fr; }
  .plans-dialog { padding: 24px 18px; }
  .plans-title { font-size: 24px; }
}

@media (max-width: 720px) {
  .us-dialog { flex-direction: column; height: 92vh; }
  .us-nav { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; gap: 6px; border-right: none; border-bottom: 1px solid var(--border); }
  .us-nav-user { width: 100%; padding: 2px 4px 8px; }
  .us-nav-items { flex-direction: row; flex: 1; }
  .us-nav-i { height: 34px; }
  .us-nav-i span { display: none; }
  .us-nav-i.danger { margin-top: 0; margin-left: auto; }
  .us-nav-i.danger span { display: inline; }
  .us-main { padding: 22px 20px 30px; }
  .us-themegrid { grid-template-columns: 1fr 1fr 1fr; }
}