*{box-sizing:border-box}body{margin:0;background:#f5f5f5;color:#111;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.wrap{width:min(1180px,calc(100% - 32px));margin:auto}.top{background:#111;color:#fff}.topin{min-height:64px;display:flex;align-items:center;justify-content:space-between;gap:20px}.brand{color:#fff;text-decoration:none;font-size:22px;font-weight:800}.top nav{display:flex;align-items:center;gap:20px;flex-wrap:wrap}.top nav a,.who{color:#fff;text-decoration:none}.who{opacity:.8}.page-title{margin:42px 0 24px}.page-title h1{margin:0 0 6px;font-size:38px}.page-title p{margin:0;color:#666}.card{background:#fff;border:1px solid #ddd;border-radius:18px;padding:28px;margin:24px 0;box-shadow:0 2px 8px rgba(0,0,0,.03)}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:20px}.grid .card{margin:0}.two{grid-template-columns:repeat(2,minmax(0,1fr))}.folder{text-decoration:none;color:#111;transition:.15s}.folder:hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(0,0,0,.08)}.folder-icon{font-size:32px}.folder h3{font-size:22px;margin:10px 0}.folder p{color:#666}.badge{display:inline-block;background:#eee;border-radius:999px;padding:5px 10px;font-size:13px}.row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.grow{flex:1}.file{display:flex;align-items:center;gap:16px;padding:18px 0;border-bottom:1px solid #eee}.file:last-child{border-bottom:0}.muted,.empty{color:#777}.btn,button{display:inline-block;border:0;border-radius:10px;background:#111;color:#fff;text-decoration:none;padding:11px 16px;font-size:15px;cursor:pointer}button.secondary{background:#555}button.danger{background:#b00020}input,select,textarea{width:100%;border:1px solid #bbb;border-radius:10px;padding:12px 14px;font:inherit;background:#fff}select{width:auto;min-width:170px}textarea{min-height:90px;resize:vertical}label{display:block;margin:16px 0 6px;font-weight:600}label input,label textarea{margin-top:7px;font-weight:400}.auth{max-width:620px;margin:70px auto}.auth h1{font-size:36px}.alert{padding:14px 18px;border-radius:10px;margin:18px 0}.success{background:#e7f7e9}.error{background:#ffe7e7;color:#900}.tablewrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:14px;border-bottom:1px solid #eee;vertical-align:middle}.actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.actions form{margin:0}.pwform{display:flex;gap:8px}.pwform input{width:180px}.foot{padding:40px 0;color:#888;font-size:13px}@media(max-width:760px){.wrap{width:min(100% - 20px,1180px)}.topin{align-items:flex-start;padding:16px 0;flex-direction:column}.top nav{gap:12px}.page-title{margin:28px 0 18px}.page-title h1{font-size:30px}.two{grid-template-columns:1fr}.card{padding:20px;border-radius:14px}.file{align-items:flex-start;flex-direction:column}.file>.row{width:100%}.file .btn,.file button{width:100%;text-align:center}.auth{margin:30px auto}.actions{min-width:250px}.pwform{width:100%}.pwform input{width:100%}}

/* FolderShare Chat */
.folder-layout{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(330px,.65fr);gap:22px;align-items:start}.folder-main .card:first-child{margin-top:0}.chat-card{margin-top:0;position:sticky;top:20px;padding:20px}.chat-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.chat-head h2{margin:0 0 4px}.chat-head p{margin:0;font-size:13px}.chat-status{font-size:12px;background:#eee;padding:5px 9px;border-radius:999px;white-space:nowrap}.chat-status.online{background:#e6f7e9;color:#176b2c}.chat-messages{height:460px;overflow:auto;background:#f7f7f7;border:1px solid #e5e5e5;border-radius:14px;padding:14px;margin:16px 0;scroll-behavior:smooth}.chat-msg{max-width:88%;margin:0 0 12px}.chat-msg.mine{margin-left:auto}.chat-meta{display:flex;align-items:center;gap:7px;font-size:12px;color:#777;margin:0 4px 4px}.chat-msg.mine .chat-meta{justify-content:flex-end}.chat-meta strong{color:#333}.chat-text{background:#fff;border:1px solid #e3e3e3;border-radius:4px 14px 14px 14px;padding:10px 12px;line-height:1.5;overflow-wrap:anywhere;box-shadow:0 1px 3px rgba(0,0,0,.03)}.chat-msg.mine .chat-text{background:#111;color:#fff;border-color:#111;border-radius:14px 4px 14px 14px}.chat-delete{background:transparent;color:#999;padding:0 3px;font-size:17px;line-height:1}.chat-delete:hover{color:#b00020}.chat-form textarea{min-height:76px;max-height:180px;margin:0}.chat-form-bottom{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:10px}.chat-form-bottom .muted{font-size:11px}.chat-form button:disabled{opacity:.5;cursor:wait}@media(max-width:900px){.folder-layout{grid-template-columns:1fr}.chat-card{position:static}.chat-messages{height:400px}}@media(max-width:520px){.chat-card{padding:14px}.chat-messages{height:360px;padding:10px}.chat-msg{max-width:94%}.chat-form-bottom{align-items:flex-end}.chat-form-bottom .muted{max-width:180px}}
.secondary-link{background:#555}
\n\n/* Gold & Silver chat-first theme */\nbody{background:linear-gradient(135deg,#090909 0%,#181818 48%,#0d0d0d 100%);color:#ece8dc;min-height:100vh}.top{background:#070707;border-bottom:1px solid #b99b52}.brand{color:#d8bd72}.top nav a{color:#eee}.top nav a:hover{color:#d8bd72}.who{color:#bfc1c4}.page-title h1{color:#f1f1ef}.page-title p{color:#aaa}.card{background:linear-gradient(145deg,#1b1b1b,#111);border:1px solid #5f5f5f;box-shadow:0 16px 36px rgba(0,0,0,.25)}.btn,button{background:linear-gradient(135deg,#c7a34d,#8e6c27);color:#0b0b0b;font-weight:800;border:1px solid #e0c77d}.btn:hover,button:hover{filter:brightness(1.08)}button.danger{background:#2b2b2b;color:#ddd;border-color:#666}.muted,.empty{color:#a9aaad}input,select,textarea{background:#101010;color:#eee;border-color:#656565}input::file-selector-button{background:#c3c5c7;color:#111;border:0;border-radius:8px;padding:9px 12px;margin-right:10px;font-weight:700}.section-kicker{font-size:11px;letter-spacing:.2em;font-weight:800;color:#d2b35f;margin-bottom:7px}.chat-first-layout{grid-template-columns:minmax(0,2.15fr) minmax(300px,.85fr);gap:24px;align-items:start}.chat-primary{grid-column:1;margin-top:0;position:sticky;top:18px;padding:24px;border-color:#a88a45}.files-side{grid-column:2}.files-side .card{margin-top:0;margin-bottom:20px}.chat-head{border-bottom:1px solid #4d4d4d;padding-bottom:14px}.chat-head h2{font-size:30px;color:#eee}.chat-status{background:#242424;color:#c4c7ca;border:1px solid #555}.chat-status.online{background:#292513;color:#e0c36d;border-color:#8c7338}.chat-messages{height:60vh;min-height:520px;max-height:720px;background:linear-gradient(180deg,#0d0d0d,#151515);border-color:#454545;padding:18px}.chat-meta{color:#929292}.chat-meta strong{color:#c8c9cb}.chat-text{background:linear-gradient(145deg,#d9dbdd,#aeb1b4);color:#111;border:1px solid #e7e8e9;box-shadow:0 4px 12px rgba(0,0,0,.22)}.chat-msg.mine .chat-text{background:linear-gradient(135deg,#e0c36d,#a78032);color:#0a0a0a;border-color:#efd98d}.chat-delete{color:#aaa}.chat-form{border-top:1px solid #4d4d4d;padding-top:14px}.chat-form textarea{background:#0b0b0b;border:1px solid #777;min-height:88px}.chat-form textarea:focus{outline:2px solid #b89545;border-color:#d8bd72}.upload-form{display:grid;gap:12px}.files-card h2,.upload-card h2{margin-top:0;color:#e7e7e7}.file{border-bottom-color:#444;display:block}.file .row{margin-top:12px}.file strong{color:#ddd;overflow-wrap:anywhere}.foot{color:#777}.secondary-link{background:#303030;color:#ddd;border-color:#777}\n@media(max-width:900px){.chat-first-layout{grid-template-columns:1fr}.chat-primary{grid-column:1;position:static;order:1}.files-side{grid-column:1;order:2}.chat-messages{height:58vh;min-height:440px;max-height:none}}\n@media(max-width:520px){.chat-primary{padding:14px}.chat-head h2{font-size:25px}.chat-messages{height:55vh;min-height:380px}.page-title .btn{width:100%;text-align:center}.chat-form-bottom{flex-wrap:wrap}.chat-form-bottom button{min-width:96px}.files-side .card{padding:16px}}\n

/* 2026-09-22 compact files + content-sized chat bubbles */
.files-side{font-size:13px}
.files-side .card{padding:18px;border-radius:14px}
.files-side .section-kicker{font-size:9px;margin-bottom:4px}
.files-side h2{font-size:18px;margin-bottom:12px}
.files-side .muted{font-size:11px;line-height:1.45}
.files-side input,.files-side textarea,.files-side select{font-size:12px;padding:9px 10px}
.files-side .btn,.files-side button{font-size:11px;padding:8px 10px;border-radius:8px}
.files-side .file{padding:12px 0}
.files-side .file strong{font-size:12px;line-height:1.35}
.files-side .file .row{gap:6px;margin-top:8px;flex-wrap:nowrap}
.files-side .upload-form{gap:8px}
.files-side input::file-selector-button{font-size:11px;padding:7px 9px}
.chat-msg{display:flex;flex-direction:column;align-items:flex-start;width:fit-content;max-width:82%}
.chat-msg.mine{align-items:flex-end;margin-left:auto}
.chat-meta{width:100%}
.chat-text{display:inline-block;width:fit-content;max-width:100%;min-width:0;padding:9px 12px}
@media(max-width:900px){.files-side{font-size:14px}.files-side .card{padding:18px}.chat-msg{max-width:88%}}
@media(max-width:520px){.chat-msg{max-width:92%}.files-side .file .row{flex-wrap:wrap}.files-side .file .row .btn,.files-side .file .row button{width:auto}}


/* ===== Team UI + mobile stabilization 2026-09-22 ===== */
html,body{max-width:100%;overflow-x:hidden}
.team-page-title{display:flex;align-items:flex-end;justify-content:space-between}
.team-page-title h1{color:#f4f1e8!important}
.team-page-title p{color:#b8b8b8!important}
.team-grid{grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.team-card{
  position:relative;display:block;min-width:0;overflow:hidden;
  color:#f5f5f3!important;border-color:#8d753b!important;
  background:linear-gradient(145deg,#1b1b1b,#0d0d0d)!important
}
.team-card *{color:inherit}
.team-card:hover{border-color:#d7b95e!important;box-shadow:0 12px 32px rgba(0,0,0,.34)}
.team-card-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.team-icon{color:#d7b95e!important;font-size:27px;line-height:1}
.team-open{color:#aeb1b4!important;font-size:10px;font-weight:800;letter-spacing:.12em}
.team-card h3{color:#f4f1e8!important;font-size:22px;margin:16px 0 10px;overflow-wrap:anywhere}
.team-feature{color:#d0d1d2!important;font-size:13px;margin:0 0 16px}
.team-feature span{color:#d7b95e!important}
.team-stats{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}
.team-stats span{
  color:#c8c9cb!important;border:1px solid #4f4f4f;background:#121212;
  border-radius:999px;padding:5px 9px;font-size:11px
}
.team-badge{background:linear-gradient(135deg,#d7b95e,#9b772e)!important;color:#080808!important;font-weight:800}
.team-empty{color:#c8c9cb!important}

/* Keep chat bubbles content-sized while safely wrapping long strings */
.chat-text{
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.chat-msg{min-width:0}
.chat-meta{min-width:0;flex-wrap:wrap}

/* Tablet / phone: force a single clean column */
@media(max-width:900px){
  .wrap{width:calc(100% - 24px);max-width:100%;margin:0 12px}
  .chat-first-layout,.folder-layout{
    display:flex!important;flex-direction:column!important;
    width:100%!important;gap:14px!important
  }
  .chat-primary,.files-side{
    width:100%!important;max-width:100%!important;min-width:0!important;
    grid-column:auto!important
  }
  .chat-primary{order:1!important;position:static!important}
  .files-side{order:2!important;display:block!important}
  .files-side .card{width:100%!important;max-width:100%!important}
  .chat-messages{width:100%!important;max-width:100%!important}
  .chat-msg{max-width:86%!important}
  .file,.file .grow,.file strong,.file .muted{min-width:0;max-width:100%}
  .file strong,.file .muted{overflow-wrap:anywhere;word-break:break-word}
}

/* Phone-specific layout */
@media(max-width:600px){
  body{font-size:14px}
  .wrap{width:calc(100% - 16px);margin:0 8px}
  .topin{padding:12px 0;gap:10px}
  .brand{font-size:19px}
  .top nav{width:100%;gap:8px 12px;font-size:12px}
  .page-title{margin:20px 0 14px}
  .page-title h1{font-size:26px;line-height:1.2}
  .page-title p{font-size:13px;line-height:1.5}
  .page-title.row{display:flex;align-items:flex-start;gap:10px}
  .page-title.row .grow{min-width:0}
  .page-title.row .btn{width:auto!important;flex:0 0 auto;padding:8px 10px;font-size:11px}

  .chat-primary{padding:12px!important;border-radius:14px}
  .chat-head{gap:8px;padding-bottom:10px}
  .chat-head h2{font-size:23px;margin-bottom:2px}
  .chat-head p{font-size:11px;line-height:1.4}
  .chat-status{font-size:10px;padding:4px 7px}
  .section-kicker{font-size:9px;letter-spacing:.16em}
  .chat-messages{
    box-sizing:border-box!important;
    height:52vh!important;min-height:340px!important;max-height:520px!important;
    margin:12px 0!important;padding:10px!important;border-radius:12px
  }
  .chat-msg{width:fit-content!important;max-width:82%!important;margin-bottom:10px}
  .chat-msg.mine{margin-left:auto!important}
  .chat-meta{font-size:10px;gap:5px;margin:0 3px 3px}
  .chat-text{font-size:14px;line-height:1.45;padding:8px 10px;max-width:100%!important}
  .chat-form textarea{min-height:70px;font-size:16px;padding:10px}
  .chat-form-bottom{display:flex!important;flex-wrap:nowrap!important;align-items:center!important;gap:8px}
  .chat-form-bottom .muted{font-size:9px;line-height:1.3;flex:1;min-width:0}
  .chat-form-bottom button{width:auto!important;min-width:70px!important;padding:9px 12px;font-size:12px}

  .files-side{font-size:12px!important}
  .files-side .card{padding:14px!important;margin:0 0 12px!important;border-radius:13px}
  .files-side h2{font-size:17px!important;margin:0 0 10px!important}
  .files-side input[type=file]{width:100%;min-width:0;font-size:11px}
  .files-side input::file-selector-button{font-size:10px;padding:7px 8px;margin-right:6px}
  .files-side .upload-form button{width:100%}
  .files-side .file{display:block!important;padding:11px 0!important}
  .files-side .file strong{display:block;font-size:12px!important}
  .files-side .file .muted{font-size:10px!important;line-height:1.45;margin-top:4px}
  .files-side .file .row{display:flex!important;gap:6px!important;flex-wrap:wrap!important;margin-top:8px!important}
  .files-side .file .row .btn,.files-side .file .row button{
    width:auto!important;display:inline-block!important;font-size:10px!important;padding:7px 9px!important
  }

  .team-grid{display:grid!important;grid-template-columns:1fr!important;gap:12px}
  .team-card{padding:18px!important;border-radius:14px}
  .team-card h3{font-size:20px!important}
  .team-feature{font-size:12px!important}
}


/* ===== Team title visibility + direct chat ===== */
.team-card h3,
.team-card .team-feature,
.team-card .team-stats,
.team-card .team-badge{opacity:1!important;visibility:visible!important}
.team-card h3{color:#fff!important;text-shadow:0 1px 1px rgba(0,0,0,.35)!important}
.team-icon{font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif!important;font-size:30px!important}

/* Folder/team page: chat remains dominant; member list and files stay compact */
@media(min-width:901px){
  .chat-first-layout,.folder-layout{
    display:grid!important;
    grid-template-columns:minmax(0,2.25fr) minmax(180px,.55fr) minmax(260px,.85fr)!important;
    align-items:start!important;
    gap:18px!important
  }
  .chat-primary{grid-column:1!important;grid-row:1 / span 3!important}
  .team-members-card{grid-column:2!important;grid-row:1!important}
  .files-side{grid-column:3!important;grid-row:1 / span 3!important}
}
.team-members-card{
  background:linear-gradient(145deg,#181818,#0d0d0d)!important;
  border:1px solid #6f5b2d!important;color:#f2f2f0!important
}
.team-members-card h2{color:#f4f1e8!important;margin:4px 0 5px;font-size:18px}
.team-members-card .muted{color:#aeb0b3!important;font-size:10px}
.direct-member-list{display:flex;flex-direction:column;gap:6px;margin-top:12px}
.direct-member{
  width:100%;border:1px solid #3d3d3d;background:#111;color:#f1f1ef;
  border-radius:10px;padding:8px;display:flex;align-items:center;gap:7px;
  cursor:pointer;text-align:left
}
.direct-member:hover{border-color:#c9a84a;background:#181818}
.member-avatar{font-size:15px}.member-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:700}
.member-arrow{color:#d7b95e;font-size:18px}.member-me{color:#999;font-size:9px}

/* Direct chat modal */
.direct-modal[hidden]{display:none!important}
.direct-modal{position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,.72);display:flex;align-items:center;justify-content:center;padding:18px}
.direct-dialog{
  width:min(680px,100%);height:min(720px,88vh);display:flex;flex-direction:column;
  background:linear-gradient(145deg,#171717,#080808);border:1px solid #b18c37;border-radius:18px;
  box-shadow:0 24px 70px rgba(0,0,0,.55);padding:18px;color:#f4f1e8
}
.direct-head{display:flex;align-items:flex-start;justify-content:space-between;border-bottom:1px solid #353535;padding-bottom:12px}
.direct-head h2{margin:3px 0 0;color:#fff;font-size:22px}
.direct-close{border:1px solid #8d753b;background:#111;color:#d7b95e;width:34px;height:34px;border-radius:50%;font-size:20px;cursor:pointer}
.direct-messages{flex:1;overflow:auto;padding:14px 5px}
.direct-msg{width:fit-content;max-width:78%;margin:0 0 12px}
.direct-msg.mine{margin-left:auto}
.direct-meta{font-size:10px;color:#9fa1a4;margin:0 5px 4px}.direct-meta span{margin-left:5px}
.direct-bubble{width:fit-content;max-width:100%;overflow-wrap:anywhere;word-break:break-word;padding:9px 12px;border-radius:15px;background:#d5d7d9;color:#111}
.direct-msg.mine .direct-bubble{background:linear-gradient(135deg,#d9bb63,#b78e36);color:#111}
.direct-form{display:flex;gap:8px;border-top:1px solid #353535;padding-top:12px}
.direct-form textarea{flex:1;min-width:0;min-height:58px;resize:none;background:#101010;color:#fff;border:1px solid #4a4a4a;border-radius:11px;padding:10px;font:inherit}
.direct-form button{width:auto!important;min-width:72px}
body.modal-open{overflow:hidden}

@media(max-width:900px){
  .team-members-card{order:2!important;width:100%!important}
  .files-side{order:3!important}
}
@media(max-width:600px){
  .team-card h3{color:#fff!important;font-size:20px!important}
  .team-card .team-feature{color:#d7d7d7!important}
  .team-card .team-stats span{color:#ddd!important}
  .team-members-card{padding:13px!important}
  .direct-member{padding:9px}
  .direct-modal{padding:8px}
  .direct-dialog{height:92vh;border-radius:14px;padding:12px}
  .direct-head h2{font-size:18px}
  .direct-msg{max-width:84%}
  .direct-form textarea{font-size:16px}
}


/* ===== Visibility + direct-chat panel hotfix ===== */
.page-title,
.page-title h1,
.page-title h2,
.page-title h3,
.page-title strong{
  color:#171717!important;
  text-shadow:none!important;
}
.page-title p,.page-title .muted{color:#666!important}
.team-title-icon,.folder-icon{
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif!important;
  filter:none!important;
}

/* All text inside dark panels must stay readable */
.chat-primary,.files-side .card,.team-members-card,
.chat-primary h1,.chat-primary h2,.chat-primary h3,
.files-side .card h1,.files-side .card h2,.files-side .card h3,
.team-members-card h1,.team-members-card h2,.team-members-card h3{
  color:#f5f3ed!important;
}
.chat-primary p,.chat-primary .muted,
.files-side .card p,.files-side .card .muted,
.team-members-card p,.team-members-card .muted{
  color:#bfc1c4!important;
}

/* Admin dark cards */
.admin-grid .card,.admin-card,.card.admin{
  color:#f5f3ed!important;
}
.admin-grid .card h1,.admin-grid .card h2,.admin-grid .card h3,
.admin-grid .card label,.admin-card h1,.admin-card h2,.admin-card h3,.admin-card label{
  color:#f5f3ed!important;
}
.admin-grid .card p,.admin-grid .card .muted,.admin-card p,.admin-card .muted{
  color:#bfc1c4!important;
}

/* Make direct-chat panel unmistakable */
.team-members-card{
  display:block!important;
  min-width:0!important;
  padding:16px!important;
}
.team-members-card .section-kicker{color:#d8b653!important}
.team-members-card h2{color:#fff!important;font-size:20px!important}
.direct-member-list{display:flex!important;flex-direction:column!important;gap:7px!important}
.direct-member{display:flex!important;color:#f5f3ed!important}
.member-name{color:#f5f3ed!important}
.member-arrow{color:#d8b653!important}

/* Desktop: chat / direct chat / files */
@media(min-width:901px){
  .chat-first-layout.folder-layout{
    display:grid!important;
    grid-template-columns:minmax(0,2.2fr) minmax(210px,.62fr) minmax(285px,.9fr)!important;
    gap:18px!important;
    align-items:start!important;
  }
  .chat-first-layout .chat-primary{grid-column:1!important;grid-row:1 / span 4!important}
  .chat-first-layout .team-members-card{grid-column:2!important;grid-row:1!important}
  .chat-first-layout .files-side{grid-column:3!important;grid-row:1 / span 4!important}
}

/* Mobile order */
@media(max-width:900px){
  .chat-first-layout.folder-layout{display:flex!important;flex-direction:column!important}
  .chat-first-layout .chat-primary{order:1!important}
  .chat-first-layout .team-members-card{order:2!important}
  .chat-first-layout .files-side{order:3!important}
}


/* =========================================================
   ShareRoom 2026-09-22
   GOLD / SILVER / BRONZE THEME — NO BLACK SURFACES
   ========================================================= */
:root{
  --gsb-gold:#c89b36;
  --gsb-gold-light:#efd27a;
  --gsb-silver:#d8d8d4;
  --gsb-silver-dark:#a7a8a6;
  --gsb-bronze:#a96732;
  --gsb-bronze-light:#d69a61;
  --gsb-cream:#f5efe3;
  --gsb-ink:#493722;
  --gsb-line:#b9914a;
}

/* page */
html,body{background:linear-gradient(135deg,#eee7da 0%,#d8d8d4 52%,#ead8c2 100%)!important;color:var(--gsb-ink)!important}
body{min-height:100vh}

/* header */
.top,header.top{
  background:linear-gradient(100deg,#b67d2e 0%,#d5b45b 28%,#c9c9c6 58%,#a96732 100%)!important;
  border-bottom:2px solid #8f642d!important;
  box-shadow:0 4px 18px rgba(105,72,34,.18)!important;
}
.brand,.brand *,header nav a,header nav span,.nav-user{
  color:#4b351d!important;-webkit-text-fill-color:#4b351d!important;
}
header nav a:hover{background:rgba(255,255,255,.28)!important}

/* titles on the light page */
.page-title,.page-title *{color:#6d4b24!important;-webkit-text-fill-color:#6d4b24!important}
.page-title h1{color:#9b6727!important;-webkit-text-fill-color:#9b6727!important}

/* all cards: metallic light surfaces instead of black */
.card,.chat-card,.chat-primary,.member-side,.team-members-card,
.upload-card,.files-card,.admin-grid .card{
  background:linear-gradient(145deg,#f7f3ea 0%,#dededb 52%,#e3c69c 100%)!important;
  border:1px solid var(--gsb-gold)!important;
  color:var(--gsb-ink)!important;
  box-shadow:0 12px 30px rgba(92,65,34,.14)!important;
}
.card *,.chat-primary *,.team-members-card *,.files-side .card *,
.admin-grid .card *{
  color:var(--gsb-ink);
  -webkit-text-fill-color:var(--gsb-ink);
}
.card h1,.card h2,.card h3,.chat-primary h2,.team-members-card h2,
.files-side h2,.admin-grid h2,.admin-grid h3{
  color:#9a6425!important;-webkit-text-fill-color:#9a6425!important;
}
.section-kicker{
  color:var(--gsb-bronze)!important;-webkit-text-fill-color:var(--gsb-bronze)!important;
}
.muted,.card .muted,.chat-primary .muted,.files-side .muted{
  color:#705f4e!important;-webkit-text-fill-color:#705f4e!important;
}

/* team chat */
.chat-head{border-bottom-color:#bca77f!important}
.chat-messages{
  background:linear-gradient(160deg,#eee9df,#d3d3d0)!important;
  border:1px solid #bda26d!important;
}
.chat-msg .chat-text{
  background:linear-gradient(135deg,#c7c9ca,#ececeb)!important;
  color:#3d3429!important;-webkit-text-fill-color:#3d3429!important;
  border:1px solid #aaa9a4!important;
}
.chat-msg.mine .chat-text{
  background:linear-gradient(135deg,#d8b34e,#b98232)!important;
  color:#33220f!important;-webkit-text-fill-color:#33220f!important;
  border-color:#a77628!important;
}
.chat-meta,.chat-meta *{color:#6b5d4d!important;-webkit-text-fill-color:#6b5d4d!important}
.chat-status{
  background:#e4d2aa!important;color:#79511d!important;-webkit-text-fill-color:#79511d!important;
  border-color:#b68936!important;
}

/* direct members */
.direct-member{
  background:linear-gradient(135deg,#ecebe7,#d2c6b5)!important;
  border:1px solid #b58a48!important;
}
.direct-member:hover{background:linear-gradient(135deg,#f0d883,#c98c50)!important}
.direct-member,.direct-member *{color:#4d3924!important;-webkit-text-fill-color:#4d3924!important}
.member-avatar{filter:sepia(.8) saturate(1.2)}
.member-arrow{color:#9b632d!important;-webkit-text-fill-color:#9b632d!important}

/* direct modal */
.direct-modal{background:rgba(88,67,44,.42)!important}
.direct-dialog{
  background:linear-gradient(145deg,#f5efe3 0%,#d8d8d4 55%,#d8ad76 100%)!important;
  border:1px solid #b48739!important;
  box-shadow:0 20px 60px rgba(78,55,30,.28)!important;
}
.direct-head{border-bottom-color:#b9a17b!important}
.direct-dialog h2{color:#9a6425!important;-webkit-text-fill-color:#9a6425!important}
.direct-messages{background:rgba(255,255,255,.22)!important}
.direct-bubble{
  background:linear-gradient(135deg,#d2d3d2,#f1f0ec)!important;
  color:#3e3428!important;-webkit-text-fill-color:#3e3428!important;
}
.direct-msg.mine .direct-bubble{
  background:linear-gradient(135deg,#d6b04c,#b87834)!important;
  color:#32210f!important;-webkit-text-fill-color:#32210f!important;
}
.direct-meta,.direct-meta *{color:#665847!important;-webkit-text-fill-color:#665847!important}

/* forms */
input,textarea,select{
  background:#f7f4ed!important;
  color:#493722!important;-webkit-text-fill-color:#493722!important;
  border:1px solid #aa936f!important;
}
input::placeholder,textarea::placeholder{
  color:#8a7b68!important;-webkit-text-fill-color:#8a7b68!important;opacity:1!important;
}

/* buttons */
button,.btn{
  background:linear-gradient(135deg,#c89b36,#a96732)!important;
  color:#24170b!important;-webkit-text-fill-color:#24170b!important;
  border:1px solid #956326!important;
  font-weight:800!important;
}
button:hover,.btn:hover{filter:brightness(1.07)}
button.danger,.danger{
  background:linear-gradient(135deg,#b97a52,#8f5936)!important;
  color:#fff4e9!important;-webkit-text-fill-color:#fff4e9!important;
}
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button{
  background:linear-gradient(135deg,#d8b34e,#b87834)!important;
  color:#24170b!important;-webkit-text-fill-color:#24170b!important;
  border:1px solid #956326!important;font-weight:800!important;
}

/* files */
.file{border-bottom-color:#bca77f!important}
.file strong{color:#6f4820!important;-webkit-text-fill-color:#6f4820!important}

/* admin tables */
table{background:rgba(245,239,227,.72)!important;color:#493722!important}
table th{
  background:#c9c9c6!important;color:#68451e!important;-webkit-text-fill-color:#68451e!important;
}
table td,table td *,table a:not(.btn){
  color:#493722!important;-webkit-text-fill-color:#493722!important;
}
table tr{border-color:#bca77f!important}

/* close buttons — aligned and bronze/gold */
.chat-delete,.direct-close,#directClose{
  background:linear-gradient(135deg,#d7b24a,#a96732)!important;
  color:#fff7e8!important;-webkit-text-fill-color:#fff7e8!important;
  border:1px solid #8e632a!important;
}
#directChatModal .direct-dialog{position:relative!important}
#directChatModal .direct-head{position:relative!important;padding-right:62px!important}
#directChatModal #directClose.direct-close{
  position:absolute!important;top:14px!important;right:14px!important;left:auto!important;bottom:auto!important;
  transform:none!important;margin:0!important;width:42px!important;height:42px!important;min-width:42px!important;
  padding:0!important;display:flex!important;align-items:center!important;justify-content:center!important;
  box-sizing:border-box!important;border-radius:50%!important;line-height:1!important;z-index:5!important;
}

/* direct chat stays first and horizontal */
.team-members-card{grid-column:1/-1!important;grid-row:1!important}
.direct-member-list{
  display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;gap:8px!important;
}
.direct-member{width:auto!important;min-width:130px!important;flex:0 0 auto!important}

@media(max-width:900px){
  .direct-member-list{flex-wrap:nowrap!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch}
  .direct-member{min-width:135px!important}
}
