:root{
  --bg:#eef2ef;
  --panel:#ffffff;
  --panel-2:#f7faf8;
  --ink:#12201b;
  --muted:#65736d;
  --line:#dbe4df;
  --green:#0e6b4d;
  --green-2:#0a523b;
  --green-soft:#e3f1eb;
  --gold:#a57c37;
  --gold-soft:#f5ecd9;
  --red:#b6453c;
  --red-soft:#fae7e5;
  --blue:#325c86;
  --blue-soft:#e8eef6;
  --shadow:0 16px 40px rgba(18,32,27,.08);
  --radius:14px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--ink);
  background:var(--bg);
  font:15px/1.55 Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
a{color:inherit;text-decoration:none}

.shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:260px minmax(0,1fr);
}

.auth-page{
  min-height:100vh;
  display:grid;
  place-items:center;
  gap:18px;
  padding:36px 16px;
  position:relative;
  overflow:hidden;
  align-content:center;
  background:
    linear-gradient(180deg, rgba(255,255,255,.22), rgba(248,245,240,.28)),
    url("./assets/auth-login-bg.png") center center/cover no-repeat;
}
.auth-notice{
  width:min(420px,100%);
  padding:12px 16px;
  border:1px solid transparent;
  border-radius:14px;
  display:grid;
  gap:6px;
  text-align:center;
  font-size:13px;
  font-weight:700;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.auth-notice-head{
  font-size:13px;
  line-height:1.45;
}
.auth-notice .auth-code-value{
  margin-top:2px;
  font-family:ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size:30px;
  letter-spacing:4px;
}
.auth-notice-sub{
  font-size:12px;
  font-weight:600;
  line-height:1.45;
  opacity:.92;
}
.auth-notice.success{
  color:#effaf3;
  background:rgba(14,107,77,.72);
  border-color:rgba(255,255,255,.12);
}
.auth-notice.error{
  color:#fff;
  background:rgba(182,69,60,.82);
  border-color:rgba(255,255,255,.12);
}
.auth-notice.warn{
  color:#fff;
  background:rgba(155,106,36,.82);
  border-color:rgba(255,255,255,.12);
}
.auth-page::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:0;
  background:linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,.38));
  pointer-events:none;
}
.auth-page > *{
  position:relative;
  z-index:1;
}
.auth-shell{
  width:min(980px,100%);
  display:grid;
  grid-template-columns:340px minmax(0,1fr);
  overflow:hidden;
  padding:0;
  background:#fff;
  box-shadow:0 20px 55px rgba(18,32,27,.08);
}
.auth-aside{
  display:flex;
  flex-direction:column;
  gap:18px;
  padding:30px 28px;
  color:#e7f1ec;
  background:
    radial-gradient(circle at top left, rgba(103,180,142,.24), transparent 34%),
    linear-gradient(180deg, #0d2a23 0%, #10251f 100%);
}
.auth-brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.auth-brand strong{display:block;font-size:18px;color:#fff}
.auth-brand small{display:block;margin-top:2px;color:#9ab0a6;font-size:12px}
.auth-aside-copy{margin-top:auto}
.auth-kicker{
  margin:0 0 8px;
  color:#d9bf8a;
  font-size:11px;
  letter-spacing:1.4px;
  text-transform:uppercase;
}
.auth-aside-copy h2{
  margin:0 0 10px;
  color:#fff;
  font-size:28px;
  line-height:1.25;
}
.auth-aside-copy p{
  margin:0;
  color:#b7c7c0;
}
.auth-points{
  display:grid;
  gap:10px;
  margin:0;
  padding:0;
  list-style:none;
}
.auth-points li{
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  background:rgba(255,255,255,.04);
  color:#d7e3de;
}
.auth-visual{
  margin-top:auto;
  padding:12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  background:rgba(255,255,255,.04);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}
.auth-visual img{
  display:block;
  width:100%;
  height:auto;
  border-radius:12px;
}
.auth-visual-caption{
  margin-top:10px;
  color:#c6d4cf;
  font-size:12px;
  line-height:1.55;
}
.auth-panel{
  padding:30px 32px;
  background:linear-gradient(180deg,#fff 0%,#fbfcfb 100%);
}
.auth-panel h1{
  margin:0 0 10px;
  font-size:28px;
}
.auth-lead{
  max-width:620px;
  margin:0 0 18px;
  color:var(--muted);
}
.auth-stack{
  display:grid;
  gap:14px;
}
.auth-foot{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:18px;
  padding-top:14px;
  border-top:1px solid #e7ece9;
}
.auth-foot-copy{
  color:var(--muted);
  font-size:12px;
}
.auth-status{
  margin-top:14px;
  padding:12px 14px;
  border:1px solid #d7e5dc;
  border-radius:12px;
  background:#f7fbf8;
  color:var(--green-2);
  font-size:13px;
}
.auth-code-card{
  margin-top:14px;
  padding:14px;
  border:1px solid #dbe4df;
  border-radius:12px;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbf9 100%);
}
.auth-code-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}
.auth-code-value{
  font-size:28px;
  line-height:1;
  letter-spacing:2px;
  font-weight:800;
  color:var(--green-2);
}
.auth-code-meta{
  margin-top:10px;
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
}

.auth-card{
  width:min(420px,100%);
  padding:28px 24px 22px;
  display:grid;
  gap:16px;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(255,255,255,.58);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  box-shadow:0 18px 45px rgba(12,22,19,.14);
}
.auth-page .auth-brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.auth-page .brand-mark{
  width:36px;
  height:36px;
  border-radius:10px;
}
.auth-page .auth-brand strong{
  color:var(--ink);
  font-size:17px;
}
.auth-page .auth-brand small{
  color:var(--muted);
  font-size:12px;
}
.auth-head h1{
  margin:0;
  font-size:22px;
  line-height:1.2;
}
.auth-head p{
  margin:6px 0 0;
  color:var(--muted);
  font-size:13px;
}
.auth-switch{
  margin-bottom:0;
}
.auth-switch button{
  flex:1;
  justify-content:center;
}
.auth-form{
  display:grid;
  gap:12px;
}
.auth-form .field label{
  color:var(--muted);
  font-size:12px;
  font-weight:600;
  letter-spacing:0;
  text-transform:none;
}
.auth-mode-switch{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.auth-mode-switch button{
  min-height:36px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  color:var(--muted);
  font-weight:700;
}
.auth-mode-switch button.active{
  border-color:rgba(14,107,77,.2);
  color:var(--green-2);
  background:var(--green-soft);
}
.auth-mode-switch button:disabled,
.input-row button:disabled,
.auth-submit:disabled{
  opacity:.72;
  cursor:not-allowed;
}
.auth-submit{
  width:100%;
}
.auth-links{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:12px;
}
.link-button{
  border:0;
  padding:0;
  color:var(--green-2);
  background:transparent;
  font-weight:700;
}
.privacy-line{
  display:flex;
  align-items:flex-start;
  gap:8px;
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}
.privacy-line input{
  margin-top:2px;
}
.input-row{
  display:flex;
  align-items:center;
  gap:8px;
}
.input-row input{
  flex:1;
  min-width:0;
}

.entry-page{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:28px 16px;
  background:
    radial-gradient(circle at top, rgba(14,107,77,.09), transparent 28%),
    var(--bg);
}
.entry-shell{
  width:min(1180px,100%);
  padding:24px;
  display:grid;
  gap:18px;
  background:#fff;
  box-shadow:0 20px 55px rgba(18,32,27,.08);
}
.entry-hero{
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(260px,.85fr);
  gap:18px;
  align-items:center;
}
.entry-hero-copy h1{
  margin:6px 0 10px;
  font-size:38px;
  line-height:1.15;
}
.entry-hero-visual{
  padding:10px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#f9fbfa;
}
.entry-hero-visual img{
  display:block;
  width:100%;
  height:auto;
  border-radius:12px;
}
.entry-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}
.entry-card{
  padding:16px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  text-align:left;
  display:grid;
  gap:10px;
  box-shadow:0 8px 18px rgba(18,32,27,.04);
}
.entry-card.active{
  border-color:rgba(14,107,77,.25);
  background:linear-gradient(180deg,#f6fbf8 0%,#eef7f2 100%);
}
.entry-card-index{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:10px;
  color:var(--green-2);
  background:var(--green-soft);
  font-size:12px;
  font-weight:800;
}
.entry-card strong{
  font-size:18px;
  color:var(--ink);
}
.entry-card p{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.55;
}
.entry-card small{
  color:var(--green-2);
  font-size:12px;
  font-weight:800;
}
.entry-stage{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:16px 18px;
  border:1px solid #dbe4df;
  border-radius:16px;
  background:#f8fbf9;
}
.entry-stage-label{
  display:block;
  margin-bottom:6px;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  letter-spacing:.4px;
  text-transform:uppercase;
}
.entry-stage-copy strong{
  display:block;
  margin-bottom:6px;
  font-size:20px;
}
.entry-stage-copy p{
  margin:0;
  color:var(--muted);
}
.entry-auth{
  padding:18px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
}
.entry-auth-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}
.entry-auth-head h2{
  margin:0 0 6px;
  font-size:20px;
}
.entry-auth-head p{
  margin:0;
  color:var(--muted);
}
.entry-mode{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.materials-grid{
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(300px,.9fr);
  gap:16px;
}
.materials-drop,.materials-note,.contact-card{
  padding:16px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
}
.materials-drop strong,.contact-card strong{
  display:block;
  margin-bottom:8px;
  font-size:16px;
}
.materials-drop p,.contact-card p{
  margin:0 0 12px;
  color:var(--muted);
}
.contact-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.contact-actions{margin-top:16px}

.sidebar{
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:20px 18px;
  color:#d8e4de;
  background:
    radial-gradient(circle at 0 0, rgba(62,130,97,.22), transparent 30%),
    linear-gradient(180deg, #102a23 0%, #0a1f1a 100%);
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:72px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  background:rgba(255,255,255,.03);
}
.brand-mark{
  width:40px;height:40px;border-radius:12px;
  display:grid;place-items:center;
  color:#183d31;
  background:linear-gradient(135deg,#f2e0b8,#c8a15b);
  font-weight:800;
}
.brand strong{display:block;color:#fff;font-size:15px}
.brand small{display:block;margin-top:2px;color:#8ea69b;font-size:11px}

.sidebar-section{
  padding:14px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  background:rgba(255,255,255,.03);
}
.settings-fold{
  padding:0;
  overflow:hidden;
}
.settings-fold summary{
  list-style:none;
  padding:14px;
  color:#fff;
  font-size:12px;
  font-weight:800;
  letter-spacing:.6px;
  text-transform:uppercase;
  cursor:pointer;
}
.settings-fold summary::-webkit-details-marker{display:none}
.settings-fold-body{
  margin:0;
  padding:0 14px 14px;
  border-top:1px solid rgba(255,255,255,.08);
}
.sidebar-section h3{
  margin:0 0 10px;
  color:#fff;
  font-size:12px;
  letter-spacing:.8px;
  text-transform:uppercase;
}
.nav{
  display:grid;
  gap:6px;
}
.nav button{
  width:100%;
  border:0;
  border-radius:10px;
  padding:10px 12px;
  text-align:left;
  color:#bfd0c8;
  background:transparent;
}
.nav button.active,.nav button:hover{
  color:#fff;
  background:rgba(255,255,255,.08);
}
.nav small{display:block;color:#7f978d;margin-top:3px}

.status-card,.mini-card{
  display:grid;
  gap:10px;
}
.status-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.field{
  display:grid;
  gap:6px;
}
.field label{
  color:#c7d6d0;
  font-size:11px;
  font-weight:700;
  letter-spacing:.4px;
  text-transform:uppercase;
}
.field input,.field select,.field textarea{
  width:100%;
  border:1px solid rgba(255,255,255,.1);
  border-radius:10px;
  padding:10px 11px;
  color:#eff6f2;
  background:rgba(255,255,255,.05);
  outline:none;
}
.field input::placeholder,.field textarea::placeholder{color:#87a098}
.field input:focus,.field select:focus,.field textarea:focus{
  border-color:#6fc09a;
  box-shadow:0 0 0 3px rgba(15,107,79,.14);
}
.field.light label{color:var(--muted)}
.field.light input,.field.light select,.field.light textarea{
  border-color:var(--line);
  color:var(--ink);
  background:rgba(255,255,255,.82);
}

.btn-row{display:flex;gap:10px;flex-wrap:wrap}
.btn{
  min-height:40px;
  padding:0 14px;
  border:1px solid transparent;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-weight:700;
}
.btn.primary{color:#fff;background:var(--green)}
.btn.primary:hover{background:var(--green-2)}
.btn.secondary{color:var(--ink);background:#fff;border-color:var(--line)}
.btn.ghost{color:#fff;background:rgba(255,255,255,.04);border-color:rgba(255,255,255,.1)}
.btn.small{min-height:34px;padding:0 12px;font-size:13px}

.main{
  min-width:0;
  display:flex;
  flex-direction:column;
}
.topbar{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-height:76px;
  padding:14px 24px;
  border-bottom:1px solid var(--line);
  background:rgba(255,255,255,.9);
  backdrop-filter:blur(16px);
}
.topbar h1{margin:0;font-size:24px;letter-spacing:0}
.crumb{margin:0 0 4px;color:var(--muted);font-size:13px}
.topbar-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.status-pill{
  display:inline-flex;
  align-items:center;
  min-height:34px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:var(--green-2);
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}
.user-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  font-size:12px;
}
.avatar{
  width:28px;height:28px;border-radius:50%;
  display:grid;place-items:center;
  color:#fff;background:linear-gradient(135deg,var(--green),#183e33);
  font-size:12px;font-weight:800;
}

.content{
  padding:22px 24px 36px;
  display:grid;
  gap:18px;
}
.workspace-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 340px;
  gap:16px;
  align-items:start;
}
.workspace-main{
  display:grid;
  gap:16px;
  min-width:0;
  align-content:start;
  justify-items:center;
}
.workspace-main > *{
  width:min(860px,100%);
}
.workflow-hero{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:18px 20px;
  border-color:#dbe4df;
  background:linear-gradient(180deg,#f9fbfa 0%,#eff6f1 100%);
}
.workflow-hero-copy{
  min-width:0;
}
.workflow-hero-copy h2{
  margin:4px 0 8px;
  font-size:26px;
}
.workflow-hero-copy p{
  margin:0;
  color:var(--muted);
}
.workflow-hero-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
  align-items:center;
}
.workflow-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.workflow-card{
  display:grid;
  gap:12px;
  align-content:start;
}
.workflow-card-title{
  font-size:20px;
  line-height:1.25;
}
.workflow-card-copy{
  color:var(--muted);
  line-height:1.6;
}
.workflow-card-meta{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding-top:6px;
  border-top:1px solid #edf1ef;
  color:var(--muted);
  font-size:12px;
}
.workflow-card-meta strong{
  color:var(--ink);
  font-size:13px;
}
.workflow-card-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.workflow-checklist{
  margin:0;
  padding:0;
  list-style:none;
  display:grid;
  gap:10px;
}
.workflow-checklist li{
  padding:12px 12px 12px 14px;
  border:1px solid #e3eae5;
  border-radius:12px;
  background:#f8fbf9;
  color:var(--ink);
}
.workflow-checklist li::before{
  content:"";
  display:inline-block;
  width:8px;
  height:8px;
  margin-right:10px;
  border-radius:50%;
  background:var(--green);
  vertical-align:middle;
}
.workflow-compose{
  display:grid;
  gap:12px;
}
.workflow-feed{
  display:grid;
  gap:12px;
}
.workflow-history{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:8px;
  padding:12px;
  border-radius:18px;
  background:linear-gradient(180deg,#f7faf8 0%,#f2f7f4 100%);
  border:1px solid #e1e8e3;
  min-height:260px;
  overflow:auto;
}
.workspace-strip{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:16px 18px;
  border-color:#dbe4df;
  background:linear-gradient(180deg,#f8fbf9 0%,#eef6f1 100%);
}
.workspace-strip-copy{min-width:0}
.workspace-label{
  margin:0 0 6px;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  letter-spacing:.6px;
  text-transform:uppercase;
}
.workspace-strip strong{
  display:block;
  margin-bottom:6px;
  font-size:20px;
  line-height:1.25;
}
.workspace-strip p{
  margin:0;
  color:var(--muted);
}
.workspace-strip-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.workspace-rail{
  display:grid;
  gap:14px;
  align-content:start;
  position:sticky;
  top:92px;
}
.rail-card{
  display:grid;
  gap:12px;
}
.rail-reply{
  padding:12px 14px;
  border:1px solid #e5ebe7;
  border-radius:12px;
  background:#f8fbf9;
  color:var(--ink);
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  line-height:1.55;
}
.progress-meta{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  color:var(--muted);
  font-size:12px;
}
.progress-meta strong{
  color:var(--ink);
  font-size:18px;
}
.progress-bar{
  height:10px;
  border-radius:999px;
  background:#e7ede9;
  overflow:hidden;
}
.progress-bar span{
  display:block;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,var(--green),#4aa37f);
}
.compact .detail-row{
  padding-bottom:8px;
}
.chat-panel{
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:18px;
  min-height:calc(100vh - 132px);
}
.chat-panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}
.chat-panel-head h2{
  margin:2px 0 6px;
  font-size:26px;
}
.chat-panel-head p{
  margin:0;
}
.chat-panel-head-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.chat-stage{
  display:flex;
  flex-direction:column;
  gap:14px;
  min-height:0;
  flex:1;
}
.panel{
  min-width:0;
  padding:18px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--panel);
  box-shadow:0 8px 26px rgba(18,32,27,.04);
}
.panel h2,.panel h3{margin:0 0 10px}
.panel p{margin:0;color:var(--muted)}
.panel .subtle{color:var(--muted);font-size:13px}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  white-space:nowrap;
}
.badge.green{color:var(--green-2);background:var(--green-soft)}
.badge.blue{color:var(--blue);background:var(--blue-soft)}
.badge.gold{color:#7d5a20;background:var(--gold-soft)}
.badge.red{color:var(--red);background:var(--red-soft)}
.badge.neutral{color:#4f5c58;background:#eef4f1}

.auth-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,.9fr);
  gap:18px;
  align-items:start;
}
.auth-tabs,.tabs{
  display:flex;
  gap:10px;
  margin-bottom:14px;
}
.auth-tabs button,.tabs button{
  border:1px solid var(--line);
  border-radius:999px;
  padding:8px 12px;
  background:#fff;
  color:var(--muted);
}
.auth-tabs button.active,.tabs button.active{
  border-color:rgba(14,107,77,.2);
  background:var(--green-soft);
  color:var(--green-2);
}

.stack{display:grid;gap:12px}
.form-grid{display:grid;gap:12px}
.two-col{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.three-col{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.separator{height:1px;background:var(--line);margin:4px 0}

.chat-list{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:6px;
  padding:10px 10px 14px;
  border-radius:18px;
  background:linear-gradient(180deg,#f7faf8 0%,#f2f7f4 100%);
  border:1px solid #e1e8e3;
  min-height:380px;
  flex:1;
  overflow:auto;
}
.chat-empty{
  min-height:180px;
  display:grid;
  place-items:center;
}
.message{
  display:flex;
  gap:8px;
  width:auto;
  max-width:100%;
  align-items:flex-end;
}
.message.user{
  align-self:flex-end;
  flex-direction:row-reverse;
  justify-content:flex-start;
}
.message.assistant{align-self:flex-start}
.message.human{align-self:flex-start}
.message.human .bubble{
  border-color:#e0d0a8;
  background:#fbf3de;
  border-radius:14px 14px 14px 6px;
}
.message .avatar{
  flex:none;
  width:22px;
  height:22px;
  border-radius:50%;
  font-size:11px;
}
.bubble{
  display:inline-flex;
  flex-direction:column;
  align-items:flex-start;
  width:auto;
  max-width:min(72ch,78%);
  padding:7px 10px;
  border:1px solid #e0e7e2;
  border-radius:14px 14px 14px 6px;
  background:#fff;
  box-shadow:none;
  white-space:pre-wrap;
  line-height:1.55;
  font-size:14px;
  word-break:break-word;
  overflow-wrap:anywhere;
}
.message.user .bubble{
  border-color:#c6e2d5;
  background:#e8f6ef;
  border-radius:14px 14px 6px 14px;
}
.bubble small{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:12px;
}
.message.user .bubble small{
  color:#618275;
}

.composer{
  padding:12px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  box-shadow:0 8px 20px rgba(18,32,27,.04);
}
.composer-input textarea{
  min-height:76px;
  max-height:120px;
  resize:vertical;
  font-size:15px;
  line-height:1.6;
}
.composer-actions{
  margin-top:12px;
}
.composer-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:10px;
  flex-wrap:wrap;
}
.composer-tip{
  color:var(--muted);
  font-size:13px;
}

.timeline{
  display:grid;
  gap:10px;
}
.timeline-item{
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
}
.timeline-item strong{display:block;margin-bottom:4px}
.timeline-item small{display:block;color:var(--muted)}

.table-wrap{overflow:auto}
table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
th,td{padding:12px 10px;text-align:left;border-bottom:1px solid #ebefed;vertical-align:top}
th{color:var(--muted);font-size:12px;letter-spacing:.3px;text-transform:uppercase;background:#fafcfb}
tr:hover td{background:#fbfdfc}

.detail-grid{
  display:grid;
  gap:12px;
}
.detail-row{
  display:flex;
  justify-content:space-between;
  gap:20px;
  padding-bottom:10px;
  border-bottom:1px solid #edf1ef;
}
.detail-row span:first-child{color:var(--muted)}
.detail-row span:last-child{text-align:right;font-weight:600}

.cell-sub{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:12px;
}
.user-filter-grid{
  display:grid;
  grid-template-columns:minmax(220px,1.3fr) repeat(3,minmax(140px,.8fr)) minmax(96px,.4fr);
  gap:12px;
  align-items:end;
}
.inline-editor{
  margin:14px 0;
  background:#f8fbf9;
  box-shadow:none;
}
.compact-editor{
  max-width:720px;
}
.user-form-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.editor-actions{
  margin-top:14px;
}
.check-line{
  min-height:40px;
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
  font-size:13px;
}
.pager{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding-top:14px;
  color:var(--muted);
  font-size:13px;
}
.profile-page-container {
  max-width: 900px;
  margin: 0 auto;
}
.profile-tabs {
  margin-bottom: 20px;
}
.profile-avatar-field .avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}
.avatar.large {
  width: 64px;
  height: 64px;
  font-size: 24px;
}
.avatar-input-group {
  display: grid;
  gap: 4px;
}
.avatar-input-group .subtle {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.profile-layout{
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr);
  gap:16px;
  align-items:start;
}
.profile-summary{
  margin-bottom:12px;
}

.empty,.error{
  padding:42px 18px;
  text-align:center;
  color:var(--muted);
}
.error{color:var(--red)}

.toast-wrap{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:100;
  display:grid;
  gap:10px;
}
.toast{
  max-width:360px;
  padding:12px 14px;
  border-radius:12px;
  color:#fff;
  box-shadow:var(--shadow);
}
.toast.info{background:#2d5b87}
.toast.success{background:var(--green)}
.toast.warn{background:#9b6a24}
.toast.error{background:var(--red)}

.hint{
  padding:10px 12px;
  border-radius:12px;
  border:1px dashed #bdd3c7;
  background:#f6fbf8;
  color:#507163;
  font-size:12px;
}

.workspace-empty{
  display:grid;
  gap:14px;
  min-height:320px;
  padding:18px;
  border:1px dashed #d8e4de;
  border-radius:16px;
  background:linear-gradient(180deg,#f8fbf9 0%,#eef6f1 100%);
}
.workspace-empty-copy strong{
  display:block;
  margin-bottom:6px;
  font-size:18px;
}
.workspace-empty-copy p{
  margin:0;
  color:var(--muted);
}
.workspace-empty-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.workspace-empty-card{
  padding:14px;
  border:1px solid #dee6e1;
  border-radius:12px;
  background:#fff;
}
.workspace-empty-card span{
  display:block;
  margin-bottom:6px;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  letter-spacing:.4px;
  text-transform:uppercase;
}
.workspace-empty-card strong{
  display:block;
  font-size:14px;
  line-height:1.45;
}

@media (max-width: 900px){
  .shell{grid-template-columns:1fr}
  .sidebar{position:static}
  .workspace-layout,.auth-grid{grid-template-columns:1fr}
  .auth-shell{grid-template-columns:1fr}
  .entry-hero,.entry-grid,.materials-grid,.contact-grid{grid-template-columns:1fr 1fr}
  .user-filter-grid,.user-form-grid,.profile-layout{grid-template-columns:1fr}
  .workspace-rail{position:static}
}

@media (max-width: 760px){
  .topbar,.content{padding-left:14px;padding-right:14px}
  .two-col,.three-col{grid-template-columns:1fr}
  .user-pill{width:100%;justify-content:space-between}
  .topbar{align-items:flex-start;flex-direction:column}
  .auth-panel{padding:22px}
  .auth-panel h1{font-size:24px}
  .auth-aside{padding:22px}
  .auth-aside-copy h2{font-size:22px}
  .chat-panel{min-height:auto}
  .chat-panel-head{flex-direction:column}
  .chat-panel-head-actions{justify-content:flex-start}
  .workspace-empty-grid{grid-template-columns:1fr}
  .bubble{max-width:86%}
  .entry-shell{padding:16px}
  .entry-hero,.entry-grid,.materials-grid,.contact-grid{grid-template-columns:1fr}
  .entry-hero-copy h1{font-size:30px}
  .entry-stage,.entry-auth-head{flex-direction:column}
  .entry-mode{justify-content:flex-start}
  .auth-page{padding:24px 14px}
}
