:root{
  --bg:#f6f8fb;
  --bgDeep:#eef2f6;
  --surface:#ffffff;
  --surfaceStrong:#ffffff;
  --surfaceMuted:#f7f9fc;
  --text:#0f172a;
  --muted:#64748b;
  --line:#d8e0ea;
  --lineStrong:#c6d1dd;
  --primary:#2563eb;
  --primaryStrong:#1d4ed8;
  --primarySoft:#eef4ff;
  --accent:#94a3b8;
  --danger:#dc2626;
  --dangerSoft:#fef2f2;
  --success:#059669;
  --shadowLg:none;
  --shadowMd:none;
  --shadowSm:none;
  --radiusXl:12px;
  --radiusLg:10px;
  --radiusMd:8px;
  --radiusSm:6px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--text);
  font-family:"SF Pro Display","Segoe UI",Tahoma,system-ui,-apple-system,sans-serif;
  background:var(--bg);
  overflow-x:hidden;
}
body::before,
body::after{
  display:none;
}

a{color:inherit; text-decoration:none}
button,input,textarea,select{font:inherit}
input,textarea,select{
  width:100%;
  padding:9px 11px;
  border-radius:8px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  outline:none;
  box-shadow:none;
  transition:border-color .18s ease, background .18s ease;
}
input::placeholder,textarea::placeholder{color:rgba(95,111,133,.72)}
textarea{
  resize:vertical;
  min-height:140px;
}
input:focus,textarea:focus,select:focus{
  border-color:#9db8f6;
  box-shadow:none;
  background:#fff;
}
select{
  appearance:auto;
  padding-left:11px;
}

.hidden{display:none !important}
.muted{color:var(--muted)}
.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  background:var(--primarySoft);
  border:1px solid #dbe8ff;
  font-size:12px;
  font-weight:700;
  letter-spacing:0;
  color:var(--primary);
}
.h1{
  margin:10px 0 10px;
  font-size:28px;
  line-height:1.2;
  font-weight:700;
}
.h2{
  margin:0;
  font-size:18px;
  line-height:1.3;
  font-weight:700;
}

.app{
  min-height:100%;
  display:flex;
  flex-direction:column;
  position:relative;
  z-index:1;
}
.topbar{
  position:sticky;
  top:0;
  z-index:40;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:calc(8px + env(safe-area-inset-top)) 18px 8px;
  background:#fff;
  border-bottom:1px solid var(--line);
  backdrop-filter:none;
}
.brand{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}
.logo{
  width:36px;
  height:36px;
  border-radius:8px;
  display:grid;
  place-items:center;
  background:#f8fbff;
  color:var(--primary);
  border:1px solid var(--line);
  box-shadow:none;
  font-weight:700;
  font-size:18px;
}
.brandText{min-width:0}
.brandTitle{
  font-size:28px;
  font-weight:700;
  line-height:1;
  letter-spacing:0;
}
.brandSub{
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
}
.topbarRight{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:wrap;
}
.topbarActions .btn.isActive{
  background:var(--primarySoft);
  border-color:#c9dcff;
  color:var(--primary);
}

.main{
  width:min(1180px, calc(100% - 24px));
  margin:0 auto;
  padding:12px 0 calc(18px + env(safe-area-inset-bottom));
}

.card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radiusLg);
  padding:12px;
  box-shadow:none;
  backdrop-filter:none;
}
.authCard{
  width:min(460px, 100%);
  margin:28px auto 0;
}
.authIntro{margin-bottom:10px}
.workspaceBar{
  padding:12px;
}
.workspaceHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}
.workspaceTitle{
  margin:0;
  font-size:24px;
  line-height:1.2;
  letter-spacing:0;
  font-weight:700;
}
.workspaceText{
  display:none;
}
.workspaceActions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.workspaceStats{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:6px;
}
.miniStat{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:0;
  padding:8px 10px;
  border-radius:8px;
  background:var(--surfaceMuted);
  border:1px solid var(--line);
  box-shadow:none;
}
.statLabel{
  color:var(--muted);
  font-size:12px;
}
.statValue{
  font-size:18px;
  font-weight:700;
  line-height:1;
  letter-spacing:0;
}

.tabs{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:8px;
  margin:10px 0;
}
.tab{
  padding:10px 12px;
  border-radius:8px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--muted);
  cursor:pointer;
  font-weight:700;
  transition:border-color .18s ease, background .18s ease, color .18s ease;
}
.tab:hover{transform:none}
.tab.isActive{
  background:var(--primarySoft);
  border-color:#c9dcff;
  color:var(--primary);
  box-shadow:none;
}

.panel{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.vaultTopCard{
  padding:10px;
}
.workspaceTabsHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.workspaceTabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.workspaceTabsActions{
  display:flex;
  gap:8px;
  flex:0 0 auto;
}
.workspaceTabChip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:38px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  color:var(--muted);
  cursor:pointer;
  font-weight:700;
}
.workspaceTabChip.isActive{
  border-color:#c9dcff;
  background:var(--primarySoft);
  color:var(--primary);
}
.workspaceTabPin,
.workspaceTabCount{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:999px;
  background:#fff;
  border:1px solid #dbe8ff;
  font-size:11px;
  color:var(--primary);
}
.workspaceTabNote{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
  padding:10px 12px;
  border-radius:12px;
  background:var(--surfaceMuted);
  border:1px solid var(--line);
}
.workspaceTabNoteText{
  color:var(--muted);
  font-size:13px;
  line-height:1.7;
}
.workspaceTabNoteActions{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}
.chatShell{
  display:grid;
  grid-template-columns:320px minmax(0, 1fr);
  gap:0;
  min-height:720px;
  padding:0;
  overflow:hidden;
}
.chatSidebar{
  display:flex;
  flex-direction:column;
  gap:14px;
  min-width:0;
  padding:20px 18px;
  background:#fbfcfe;
  border-left:1px solid var(--line);
}
.chatSidebarTop{
  display:grid;
  gap:12px;
}
.chatSidebarHead{
  margin-bottom:0;
}
.chatSidebarTools{
  display:flex;
  justify-content:flex-start;
}
.chatTopicsPanel{
  display:flex;
  flex-direction:column;
  min-height:0;
  flex:1 1 auto;
  padding:10px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
}
.chatTopicsToolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:6px 4px 12px;
}
.chatTopicsLabel{
  font-size:13px;
  font-weight:700;
  color:var(--muted);
}
.chatTopicsCount{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:32px;
  height:32px;
  padding:0 10px;
  border-radius:999px;
  background:var(--primarySoft);
  color:var(--primary);
  border:1px solid #dbe8ff;
  font-size:13px;
  font-weight:700;
}
.chatTopics{
  display:grid;
  gap:10px;
  overflow:auto;
  padding-left:4px;
  min-height:0;
  flex:1 1 auto;
}
.chatTopicCard{
  padding:14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  cursor:pointer;
  text-align:right;
  transition:border-color .18s ease, background .18s ease;
}
.chatTopicCard.isActive{
  border-color:#c9dcff;
  background:var(--primarySoft);
}
.chatTopicTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.chatTopicTitle{
  font-weight:700;
  line-height:1.4;
}
.chatTopicPreview,
.chatTopicMeta{
  margin-top:8px;
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
}
.chatMain{
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:720px;
  background:#fff;
}
.chatHeader{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:20px 22px 16px;
  border-bottom:1px solid var(--line);
  background:#fff;
}
.chatTitleRow{
  display:flex;
  align-items:center;
  gap:8px;
}
.chatHeaderActions,
.chatComposerActions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.chatMessages{
  display:grid;
  gap:12px;
  min-height:100%;
  overflow:auto;
  padding:20px 22px;
}
.chatStream{
  position:relative;
  flex:1 1 auto;
  min-height:360px;
  background:#f8fafc;
}
.chatMessage{
  display:flex;
  align-items:flex-start;
  gap:12px;
}
.chatMessage.isMine{
  flex-direction:row-reverse;
}
.chatMessageAvatar,
.avatarLarge{
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid var(--line);
  background:var(--surfaceMuted);
  display:grid;
  place-items:center;
  color:var(--primary);
  font-weight:700;
  flex:0 0 auto;
  overflow:hidden;
}
.avatarLarge{
  width:72px;
  height:72px;
  border-radius:18px;
}
.chatMessageAvatar img,
.avatarLarge img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.chatMessageCard{
  flex:1 1 auto;
  min-width:0;
  padding:14px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
}
.chatMessage.isMine .chatMessageCard{
  background:#f3f7ff;
  border-color:#d8e4ff;
}
.chatMessageHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.chatMessageWho{
  font-weight:700;
}
.chatMessageMeta{
  color:var(--muted);
  font-size:12px;
}
.chatMessageBody{
  margin-top:10px;
  white-space:pre-wrap;
  word-break:break-word;
  line-height:1.7;
}
.chatMessageBody.isCode{
  padding:12px;
  border-radius:12px;
  background:#0b1220;
  color:#dbe7ff;
  border:1px solid #1e293b;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  direction:ltr;
  text-align:left;
}
.chatComposer{
  display:grid;
  gap:12px;
  padding:16px 22px 22px;
  border-top:1px solid var(--line);
  background:#fff;
}
.chatComposerField{
  margin:0;
}
.chatComposer textarea{
  min-height:96px;
  background:#fbfcfe;
}
.chatEmpty{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  padding:24px 10px;
  text-align:center;
}
.avatarPanel{
  display:flex;
  align-items:flex-start;
  gap:16px;
}
.avatarPanelBody{
  flex:1 1 auto;
  display:grid;
  gap:10px;
}
.toolCardHead,
.sectionHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}
.toolCardHead p,
.sectionHead p{
  margin:8px 0 0;
  line-height:1.6;
}
.filtersGrid{
  display:grid;
  grid-template-columns:2fr minmax(220px, 1fr);
  gap:14px;
}
.form{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.formInline{
  display:grid;
  grid-template-columns:1fr 1fr auto;
  align-items:end;
  gap:14px;
}
.field span{
  display:block;
  margin:0 0 8px;
  font-size:13px;
  color:var(--muted);
}
.row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.btn{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px 15px;
  min-height:44px;
  background:#fff;
  color:var(--text);
  box-shadow:none;
  cursor:pointer;
  font-weight:700;
  transition:border-color .18s ease, background .18s ease, color .18s ease, opacity .18s ease;
}
.btn:hover{transform:none; box-shadow:none}
.btn:active{transform:none}
.btnPrimary{
  color:#fff;
  background:var(--primary);
  border-color:var(--primary);
}
.btnDanger{
  color:#fff;
  background:var(--danger);
  border-color:var(--danger);
}
.btnGhost{
  background:#fff;
}

.toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  box-shadow:none;
}
.toggle input{
  width:20px;
  height:20px;
  margin:0;
  padding:0;
  accent-color:var(--primary);
  box-shadow:none;
}
.compactToggle{
  min-width:178px;
}
.toggleText{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.toggleText strong{font-size:14px}
.toggleText small{font-size:11px; color:var(--muted)}
.toggleStack{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:10px;
}

.error{
  border:1px solid rgba(220,38,38,.14);
  background:var(--dangerSoft);
  color:#991b1b;
  padding:12px 14px;
  border-radius:16px;
  font-size:13px;
}

.list{
  display:grid;
  gap:10px;
}
.item{
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  padding:12px;
  box-shadow:none;
}
.item.isPinned{
  border-color:#c9dcff;
  box-shadow:none;
}
.itemHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}
.itemheadinner {
      display: flex;
    align-items: center;
    gap: 10px;
}
.itemHeadActions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.itemTitle{
  display:block;
  width:100%;
  padding:0;
  border:0;
  background:transparent;
  color:inherit;
  text-align:right;
  cursor:text;
  font-size:18px;
  font-weight:700;
  line-height:1.25;
  letter-spacing:0;
}
.itemTitle:hover{
  color:var(--primary);
}
.itemMeta{
  display:flex;
  gap:6px;
}
.metaBadge{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:5px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:600;
  background:#f6f8fb;
  color:var(--muted);
  width: max-content;
  
}
.metaBadge.isPublic{background:#ecfdf5; color:var(--success)}
.metaBadge.isPrivate{background:#fff7ed; color:#b45309}
.metaBadge.isDeleted{background:#fef2f2; color:#b91c1c}
.metaBadge.isFile{background:var(--primarySoft); color:var(--primary)}

.itemLabels{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}
.labelChip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 8px;
  border-radius:999px;
  border:1px solid #dbe8ff;
  background:var(--primarySoft);
  color:var(--primary);
  font-size:12px;
  font-weight:600;
}
.itemBody{
  margin:10px 0 0;
  padding:10px 12px;
  border-radius:8px;
  background:var(--surfaceMuted);
  border:1px solid var(--line);
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  font-size:13px;
  line-height:1.7;
  white-space:pre-wrap;
  word-break:break-word;
  max-height:180px;
  overflow:auto;
  direction:ltr;
  text-align:left;
}
.itemBody.isCode{
  background:#0b1220;
  border-color:#1e293b;
  color:#dbe7ff;
}
.itemActions{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:10px;
}
.checklistCard{
  margin-top:10px;
  display:grid;
  gap:0;
  padding:8px;
  border-radius:8px;
  border:1px solid var(--line);
  background:#fbfcfe;
}
.checklistHeader{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  align-items:center;
  gap:8px;
  width:100%;
  min-height:38px;
  padding:7px 9px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  color:inherit;
  text-align:right;
  cursor:pointer;
}
.checklistHeaderTitle{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:700;
}
.checklistHeaderMeta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:46px;
  height:24px;
  padding:0 7px;
  border-radius:999px;
  background:var(--primarySoft);
  color:var(--primary);
  font-size:12px;
  font-weight:700;
}
.checklistHeaderIcon{
  width:22px;
  text-align:center;
  color:var(--muted);
  font-weight:800;
}
.checklistPanel{
  display:grid;
  gap:8px;
  padding-top:8px;
}
.checklistItems{
  display:grid;
  gap:6px;
}
.checklistRow{
  display:grid;
  grid-template-columns:24px minmax(0,1fr) auto;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  text-align:right;
}
.checklistRow.isDone{
  color:var(--muted);
}
.checklistMark{
  width:18px;
  height:18px;
  padding:0;
  display:grid;
  place-items:center;
  border-radius:6px;
  border:1px solid #c9dcff;
  background:#fff;
  color:var(--primary);
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}
.checklistText{
  width:100%;
  min-width:0;
  padding:0;
  border:0;
  background:transparent;
  color:inherit;
  text-align:right;
  line-height:1.6;
  word-break:break-word;
  overflow-wrap:anywhere;
  white-space:pre-wrap;
  cursor:text;
}
.checklistRow.isDone .checklistText{
  text-decoration:line-through;
}
.isInlineEditing{
  display:none !important;
}
.inlineEditWrap{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:6px;
  width:100%;
  margin-top:6px;
}
.checklistRow .inlineEditWrap{
  grid-column:2 / -1;
  margin-top:0;
}
.inlineEditInput{
  min-height:36px;
  border-radius:8px;
}
textarea.inlineEditInput{
  min-height:74px;
  resize:vertical;
}
.inlineEditActions{
  display:flex;
  align-items:flex-start;
  gap:6px;
  grid-column:2;
  grid-row:1;
}
.inlineEditImagePending{
  grid-column:1 / -1;
  padding:7px 9px;
  border:1px solid #c9dcff;
  border-radius:8px;
  background:var(--primarySoft);
  color:var(--primary);
  font-size:12px;
  font-weight:700;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.checklistRowActions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
}
.checklistIconBtn{
  width:30px;
  height:30px;
  padding:0;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  color:var(--muted);
  cursor:pointer;
}
.checklistIconBtn:hover{
  border-color:#c9dcff;
  color:var(--primary);
  background:var(--primarySoft);
}
.checklistDeleteBtn{
  color:var(--danger);
  border-color:#fecaca;
}
.checklistDeleteBtn:hover{
  color:#b91c1c;
  border-color:#fca5a5;
  background:var(--dangerSoft);
}
.checklistEmpty{
  padding:6px 2px;
  color:var(--muted);
  font-size:13px;
}
.checklistAddForm{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:6px;
  align-items:center;
}
.checklistAddInput{
  min-height:36px;
  border-radius:8px;
}
.checklistImagePending{
  max-width:180px;
  padding:7px 9px;
  border:1px solid #c9dcff;
  border-radius:8px;
  background:var(--primarySoft);
  color:var(--primary);
  font-size:12px;
  font-weight:700;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.chip{
  /* padding:8px 10px; */
  border-radius:8px;
  border:unset;
  background:#fff;
  box-shadow:none;
  cursor:pointer;
  font-weight:600;
  font-size: 12px;
}
.chipPrimary{border-color:#c9dcff; color:var(--primary)}
.chipDanger{border-color:#fecaca; color:#b91c1c}

.imagePreviewOverlay{
  position:fixed;
  inset:0;
  z-index:200;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(15,23,42,.66);
}
.imagePreviewSheet{
  width:min(980px,100%);
  max-height:calc(100dvh - 36px);
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  gap:10px;
  padding:12px;
  border-radius:10px;
  background:#fff;
  border:1px solid var(--line);
}
.imagePreviewHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.imagePreviewTitle{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:700;
}
.imagePreviewImg{
  max-width:100%;
  max-height:calc(100dvh - 130px);
  object-fit:contain;
  border-radius:12px;
  background:#f8fafc;
}

.empty{
  text-align:center;
  padding:30px 20px;
}
.emptyTitle{
  font-size:18px;
  font-weight:700;
  margin-bottom:8px;
}

.adminGrid,
.accountGrid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:16px;
}
.adminSpan,
.accountSpan{
  grid-column:1 / -1;
}
.users{
  display:grid;
  gap:10px;
}
.userRow{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
}
.userMain{
  min-width:0;
}
.userRow .who{
  font-weight:700;
  font-size:15px;
}
.userRow .role{
  margin-top:6px;
  color:var(--muted);
  font-size:12px;
  line-height:1.7;
}
.userActions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
.userAvatarRow{
  display:flex;
  align-items:flex-start;
  gap:12px;
  min-width:0;
}
.userAvatar{
  width:40px;
  height:40px;
  border-radius:12px;
  background:var(--surfaceMuted);
  border:1px solid var(--line);
  color:var(--primary);
  display:grid;
  place-items:center;
  font-size:12px;
  font-weight:700;
  overflow:hidden;
  flex:0 0 auto;
}
.userAvatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.logList{
  gap:12px;
}
.logRow{
  align-items:stretch;
}
.logMeta{
  display:grid;
  gap:6px;
  min-width:0;
}
.logMetaRow{
  font-size:12px;
  color:var(--muted);
  line-height:1.7;
  word-break:break-word;
}
.logMetaRow code{
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  font-size:12px;
}
.actionStack{
  display:grid;
  gap:10px;
}
.tipsGrid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:12px;
}
.accountToolsGrid{
  grid-template-columns:repeat(2, minmax(0,1fr));
}
.tipCard{
  padding:10px;
  border-radius:8px;
  border:1px solid var(--line);
  background:#fff;
}
.tipCard strong{
  display:block;
  font-size:15px;
  margin-bottom:8px;
  font-weight:700;
}
.tipCard p{
  margin:0;
  font-size:13px;
  line-height:1.8;
  color:var(--muted);
}

.modal{
  position:fixed;
  inset:0;
  z-index:70;
  display:grid;
  place-items:center;
  padding:12px;
  background:rgba(15,23,42,.16);
  backdrop-filter:none;
}
.sheet{
  width:min(860px, 100%);
  max-height:min(calc(100vh - 28px), 760px);
  display:flex;
  flex-direction:column;
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  box-shadow:none;
  overflow:hidden;
}
.sheetCompact{
  width:min(560px, 100%);
  max-height:min(calc(100vh - 48px), 560px);
}
.sheetHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:12px;
  border-bottom:1px solid var(--line);
  background:#fff;
}
.sheetEyebrow{
  font-size:12px;
  font-weight:700;
  color:var(--primary);
  letter-spacing:0;
  text-transform:none;
}
.sheetTitle{
  margin-top:4px;
  font-size:19px;
  font-weight:700;
  line-height:1.15;
}
.sheetSub{
  margin-top:4px;
  max-width:44rem;
  color:var(--muted);
  line-height:1.6;
}
.sheetHeadActions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
}
.sheetForm{
  display:flex;
  flex-direction:column;
  min-height:0;
  flex:1;
}
.sheetBody{
  display:block;
  padding:12px;
  overflow:auto;
}
.sheetSection{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:0;
  border-radius:0;
  border:0;
  background:#fff;
  box-shadow:none;
}
.compactFields{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(260px,.85fr);
  gap:8px;
  align-items:start;
}
.compactFieldsTop{
  grid-template-columns:minmax(0,1.3fr) minmax(200px,.7fr);
}
.noteTypeSwitch{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:3px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
}
.noteTypeSwitchHead{
  flex:0 0 auto;
}
.switchBtn{
  min-width:34px;
  min-height:34px;
  padding:0 10px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  font-weight:700;
  font-size:13px;
}
.switchBtn.isActive{
  background:#fff;
  color:var(--primary);
  box-shadow:none;
  outline:1px solid #dbe8ff;
}
.compactTool{
  min-height:40px;
  padding:0 10px;
}
.compactTool span{
  font-size:12px;
  font-weight:700;
}
.compactTool input{
  width:14px;
  height:14px;
}
.iconBtn{
  min-width:40px;
  min-height:40px;
  padding:0;
  border-radius:12px;
  font-size:20px;
  line-height:1;
}
.tagEditor{
  display:grid;
  gap:6px;
}
.tagChips{
  min-height:36px;
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  padding:6px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
}
.tagPill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  max-width:100%;
  min-height:26px;
  padding:4px 9px;
  border:1px solid #c9dcff;
  border-radius:999px;
  background:#f7fbff;
  color:var(--primary);
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}
.tagPill span:first-child{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.tagEmpty{
  color:var(--muted);
  font-size:12px;
  padding-inline:4px;
}
.tagAddRow{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:6px;
}
.tagAddRow input{
  min-height:36px;
  border-radius:12px;
}
.tagAddBtn{
  min-width:36px;
  min-height:36px;
  padding:0;
  border-radius:12px;
  border:1px solid #c9dcff;
  background:#fff;
  color:var(--primary);
  font-weight:800;
  cursor:pointer;
}
.tagAddBtn:hover,
.tagPill:hover{
  border-color:#8fb8ff;
}
.editorField{
  margin-top:2px;
}
.noteBodyField{
  margin-top:0;
}
.inlineToggle{
  width:auto;
  min-width:0;
  padding:8px 10px;
  gap:10px;
}
.inlineToggle input{
  width:16px;
  height:16px;
}
.editorInput{
  min-height:164px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  direction:ltr;
  text-align:left;
}
.editorInput.isCode{
  background:#0b1220;
  border-color:#1e293b;
  color:#dbe7ff;
  caret-color:#93c5fd;
}
.editorInput.isCode::placeholder{
  color:#7c8aa5;
}
.pasteHint{
  margin-top:6px;
  color:var(--muted);
  font-size:11px;
  line-height:1.4;
}
.moreOptions{
  border:1px solid var(--line);
  border-radius:14px;
  background:#fbfcfe;
}
.moreOptions summary{
  cursor:pointer;
  padding:10px 12px;
  font-weight:700;
  color:var(--text);
  font-size:13px;
}
.moreOptionsGrid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
  padding:0 14px 14px;
}
.uploadField{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px;
  border-radius:14px;
  border:1px dashed #c9d7e6;
  background:#fbfcfe;
  cursor:pointer;
}
.inputFile{
  position:absolute;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}
.uploadMain{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.uploadMain strong{
  font-size:14px;
}
.uploadMain small{
  color:var(--muted);
  line-height:1.6;
}
.uploadAction{
  flex:0 0 auto;
  padding:9px 12px;
  border-radius:999px;
  background:#fff;
  border:1px solid #dbe8ff;
  color:var(--primary);
  font-weight:700;
}
.inlineNote{
  padding:12px 14px;
  border-radius:14px;
  background:var(--surfaceMuted);
  color:var(--muted);
  font-size:13px;
}
.sheetFooter{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 18px calc(14px + env(safe-area-inset-bottom));
  border-top:1px solid var(--line);
  background:#fff;
}
.sheetFooterMeta{
  color:var(--muted);
  font-size:13px;
  line-height:1.7;
}
.sheetFooterActions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.toast{
  position:fixed;
  left:50%;
  bottom:calc(18px + env(safe-area-inset-bottom));
  transform:translateX(-50%);
  z-index:90;
  max-width:min(600px, calc(100% - 24px));
  padding:13px 16px;
  border-radius:14px;
  background:rgba(15,23,42,.92);
  color:#fff;
  box-shadow:none;
}

.kv{
  display:grid;
  grid-template-columns:120px 1fr;
  gap:12px 14px;
  margin-top:10px;
}
.kv .k{
  color:var(--muted);
  font-size:12px;
}
.kv .v{
  font-size:16px;
  font-weight:700;
}

.publicLayout{
  display:grid;
  gap:18px;
}
.publicLayout .main,
.publicLayout{
  justify-items:center;
}
.publicHero{
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr);
  gap:18px;
}
.publicFormCard{
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:none;
}
.publicUnlockCard{
  width:min(560px, 100%);
  margin:18px auto 0;
  padding:14px;
}
.publicUnlockForm{
  display:grid;
  gap:12px;
}
.publicUnlockFields{
  display:grid;
  gap:12px;
}
.publicUnlockInput{
  min-height:44px;
  border-radius:8px;
  background:#fff;
  text-align:center;
  font-size:18px;
  font-weight:600;
  letter-spacing:0;
}
.publicUnlockButton{
  min-height:44px;
  border-radius:8px;
}
.resultCard{
  margin-top:18px;
}
.publicChecklist{
  display:grid;
  gap:8px;
  margin-top:14px;
}
.publicChecklistRow{
  display:grid;
  grid-template-columns:24px minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
}
.publicChecklistRow.isDone{
  color:var(--muted);
}
.publicChecklistRow.isDone .publicChecklistText{
  text-decoration:line-through;
}
.publicChecklistImageLink{
  color:var(--primary);
  font-size:12px;
  font-weight:700;
}
.publicChecklistMark{
  width:18px;
  height:18px;
  display:grid;
  place-items:center;
  border-radius:6px;
  border:1px solid #c9dcff;
  color:var(--primary);
  font-size:12px;
  font-weight:800;
}

@media (max-width: 980px){
  .main{width:min(100% - 24px, 100%)}
  .workspaceHead,
  .chatShell,
  .publicHero,
  .sheetBody,
  .adminGrid,
  .accountGrid{
    grid-template-columns:1fr;
  }
  .workspaceHead{
    flex-direction:column;
    align-items:stretch;
  }
  .chatShell{
    min-height:0;
  }
  .sheetSection:first-child{grid-column:auto}
  .workspaceStats{grid-template-columns:repeat(2, minmax(0,1fr))}
  .tipsGrid,
  .accountToolsGrid{grid-template-columns:1fr}
}

@media (max-width: 760px){
  .topbar{
    flex-direction:column;
    align-items:stretch;
    padding-inline:14px;
  }
  .topbarRight{
    justify-content:stretch;
  }
  .topbarRight > *{
    flex:1 1 calc(50% - 10px);
    text-align:center;
  }
  .main{
    width:min(100% - 16px, 100%);
    padding-top:12px;
  }
  .publicUnlockCard{
    width:100%;
    padding:18px;
  }
  .card{
    padding:12px;
    border-radius:10px;
  }
  .toolCardActions,
  .workspaceTabsHead,
  .workspaceTabNote,
  .chatHeader,
  .sectionHead,
  .toolCardHead,
  .row,
  .sheetFooter{
    flex-direction:column;
    align-items:stretch;
  }
  .filtersGrid,
  .formInline,
  .compactFields,
  .moreOptionsGrid,
  .tagAddRow,
  .checklistAddForm,
  .toggleStack{
    grid-template-columns:1fr;
  }
  .itemHead{
    flex-direction:column;
    align-items:stretch;
  }
  .itemHeadActions{
    justify-content:flex-start;
  }
  .checklistRow{
    grid-template-columns:24px minmax(0,1fr);
    align-items:start;
  }
  .checklistRowActions{
    grid-column:2;
    justify-content:flex-start;
  }
  .userRow{
    flex-direction:column;
  }
  .userActions{
    justify-content:flex-start;
  }
  .avatarPanel{
    flex-direction:column;
  }
  .chatSidebar,
  .chatHeader,
  .chatMessages,
  .chatComposer{
    padding-inline:16px;
  }
  .chatSidebar{
    border-left:none;
    border-bottom:1px solid var(--line);
  }
  .modal{
    padding:0;
    align-items:end;
  }
  .sheet{
    width:100%;
    max-height:100vh;
    border-radius:12px 12px 0 0;
  }
  .sheetHead{
    padding:12px;
  }
  .sheetBody{
    padding:12px;
  }
  .sheetFooter{
    padding:12px 12px calc(12px + env(safe-area-inset-bottom));
  }
  .sheetFooterActions > *{
    flex:1 1 auto;
  }
  .uploadField{
    flex-direction:column;
    align-items:flex-start;
  }
  .uploadAction{
    width:100%;
    text-align:center;
  }
}

@media (max-width: 520px){
  .brandTitle{font-size:26px}
  .brandSub{font-size:12px}
  .workspaceTitle{font-size:24px}
  .workspaceText{font-size:13px}
  .publicUnlockInput{
    font-size:16px;
  }
  .tabs{grid-template-columns:1fr 1fr}
  .workspaceStats{grid-template-columns:1fr 1fr}
  .statValue{font-size:18px}
  .itemTitle{font-size:18px}
  .chatMessages{max-height:none}
  .kv{grid-template-columns:1fr}
  .kv .k{font-size:11px}
}

@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after{
    animation:none !important;
    transition:none !important;
    scroll-behavior:auto !important;
  }
}
