:root {
  color-scheme: light;
  --ground:#f4f7f5;
  --paper:#fff;
  --ink:#10261f;
  --muted:#52665d;
  --line:#d8e3dc;
  --accent:#0b684c;
  --strong:#064c37;
  --tint:#e9f5ee;
  --focus:#157b78;
  --danger:#a52a35;
  --radius:12px;
  font:16px/1.5 "Segoe UI",system-ui,sans-serif;
}
*,*::before,*::after { box-sizing:border-box; }
body { margin:0; background:var(--ground); color:var(--ink); }
h1,h2,p { margin:0; }
h1 { font-size:clamp(1.65rem,3.4vw,2.45rem); line-height:1.15; letter-spacing:-.044em; }
h2 { font-size:1.08rem; font-weight:680; letter-spacing:-.016em; }
p,code { overflow-wrap:anywhere; }
a { color:var(--strong); text-underline-offset:3px; }
a:hover { color:var(--accent); }
:focus-visible { outline:3px solid var(--focus); outline-offset:3px; }
button,input,select,textarea { font:inherit; }
button { display:inline-flex; justify-content:center; align-items:center; min-height:44px; padding:8px 16px; border:1px solid transparent; border-radius:8px; background:var(--accent); color:white; font-size:.9rem; font-weight:650; cursor:pointer; transition:background-color .16s,transform .16s; }
button:hover { background:var(--strong); transform:translateY(-1px); }
button:active { transform:translateY(1px); }
button.secondary { background:var(--paper); border-color:var(--line); color:var(--ink); }
button.secondary:hover { background:var(--tint); border-color:#a2c5b1; }
button.danger { background:var(--danger); }
button.danger:hover { background:#7c1722; }
input:not([type=checkbox]),select,textarea { width:100%; min-width:0; min-height:44px; padding:8px 11px; color:var(--ink); background:var(--paper); border:1px solid #c8d8cd; border-radius:8px; }
input[type=checkbox] { accent-color:var(--accent); width:18px; height:18px; }
label { display:grid; gap:5px; min-width:0; }
label > span { font-size:.84rem; font-weight:650; color:#31473c; }
textarea { resize:vertical; }
code { font-size:.82rem; }
summary { cursor:pointer; }
.skip,.visually-hidden { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.skip:focus { width:auto; height:auto; padding:10px 15px; clip-path:none; z-index:2; background:white; top:10px; left:10px; }
.brand { display:inline-flex; align-items:center; gap:10px; white-space:nowrap; letter-spacing:.035em; font-weight:760; font-size:.93rem; }
.brand span { padding:3px 8px; color:var(--strong); background:var(--tint); border-radius:6px; font-size:.7rem; letter-spacing:.07em; }
.muted { color:var(--muted); font-size:.9rem; }
.notice { padding:12px 15px; border:1px solid #a6cfb7; border-radius:8px; background:var(--tint); color:var(--strong); font-weight:620; }
.auth main { width:min(100% - 32px,480px); margin:clamp(32px,11vh,115px) auto; }
.auth-header { display:grid; gap:24px; margin-bottom:18px; }
.box,.auth .narrow { display:grid; gap:14px; padding:clamp(16px,3vw,24px); background:var(--paper); border:1px solid var(--line); border-radius:var(--radius); }
.auth section + section { margin-top:12px; }
.auth form { display:grid; gap:14px; }
.auth img { max-width:100%; }
.auth form button { justify-self:start; }
.auth dl { display:grid; grid-template-columns:auto minmax(0,1fr); gap:6px 12px; margin:0; }
.auth dd { margin:0; overflow-wrap:anywhere; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:66px; padding:9px max(24px, calc((100vw - 1370px) / 2)); background:var(--paper); border-bottom:1px solid var(--line); }
.workspace { width:min(100% - 48px,1370px); margin:0 auto; display:grid; grid-template-columns:210px minmax(0,1fr); gap:30px; padding:32px 0 44px; }
.sidebar { align-self:start; display:grid; gap:12px; }
.sidebar h2 { font-size:.82rem; color:var(--muted); }
.profiles { display:grid; gap:4px; }
.profiles a { display:flex; align-items:center; gap:11px; color:var(--ink); padding:7px 10px; min-height:46px; border:1px solid transparent; border-radius:8px; font-size:.91rem; font-weight:640; text-decoration:none; transition:background-color .16s,border-color .16s; }
.profiles a:hover { background:#ecf4ef; }
.profiles a[aria-current] { background:var(--tint); border-color:#badac7; color:var(--strong); }
.profile-mark { width:27px; height:27px; flex:none; display:grid; place-items:center; border-radius:6px; background:var(--paper); border:1px solid var(--line); font-size:.77rem; }
.connection { display:grid; gap:5px; padding-top:16px; margin-top:6px; border-top:1px solid var(--line); }
.connection code { color:var(--strong); }
.workspace-main { display:grid; gap:20px; min-width:0; }
.workspace-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:12px 24px; flex-wrap:wrap; }
.workspace-heading p { color:var(--muted); margin-top:7px; }
.status-chip { padding:6px 10px; border:1px solid var(--line); border-radius:999px; color:#305145; background:#fafffb; font-size:.78rem; font-weight:650; }
.projects { min-width:0; background:var(--paper); border:1px solid var(--line); border-radius:var(--radius); }
.section-title { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:12px; padding:14px 18px; }
.section-title h2 span { margin-left:4px; color:var(--muted); font-size:.84rem; font-weight:540; }
.search { display:flex; gap:8px; align-items:center; max-width:100%; width:min(100%,360px); }
.search input { flex:1; }
.search a { min-height:44px; display:flex; align-items:center; font-size:.82rem; }
.project-list { border-top:1px solid var(--line); }
.project + .project { border-top:1px solid var(--line); }
.project summary,.settings summary { display:flex; align-items:center; gap:12px; padding:14px 18px; min-height:55px; list-style:none; }
.project summary::-webkit-details-marker,.settings summary::-webkit-details-marker { display:none; }
.project summary::before,.settings summary::before { content:""; width:8px; height:8px; flex:none; transform:rotate(-45deg); border-right:2px solid #4e7161; border-bottom:2px solid #4e7161; transition:transform .16s; }
.project[open] > summary::before,.settings[open] > summary::before { transform:rotate(45deg); }
.project summary:hover,.settings summary:hover { background:#f2f8f4; }
.project[open] > summary { background:#edf6ef; }
.project-name { font-weight:690; overflow-wrap:anywhere; }
.project-summary { display:flex; flex-wrap:wrap; gap:5px; margin-left:auto; justify-content:flex-end; min-width:0; }
.permission-chip { color:var(--strong); background:#eef7f0; border:1px solid #c6decf; border-radius:6px; padding:2px 7px; font-size:.73rem; font-weight:650; }
.closed { color:var(--muted); font-size:.8rem; }
.permission { padding:16px 18px 18px; border-top:1px solid var(--line); }
.control-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; }
.project-actions { display:flex; justify-content:flex-end; margin-top:16px; }
.empty { padding:20px; color:var(--muted); }
.profile-settings { display:grid; gap:10px; align-items:start; }
.profile-settings form,.settings-content { display:grid; gap:10px; justify-items:start; }
.profile-settings .settings { background:var(--paper); border:1px solid var(--line); border-radius:var(--radius); }
.settings summary { font-weight:650; }
.settings-content { padding:0 18px 16px; }
.host-option { display:flex; align-items:center; gap:8px; min-height:34px; }
@media (max-width:1024px) {
  .workspace { grid-template-columns:160px minmax(0,1fr); gap:20px; }
  .control-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:720px) {
  .topbar { padding-inline:16px; }
  .workspace { width:calc(100% - 32px); display:block; padding-top:14px; }
  .sidebar { margin-bottom:18px; gap:8px; }
  .profiles { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .profiles a { justify-content:center; gap:4px; padding-inline:3px; font-size:.83rem; }
  .profile-mark { display:none; }
  .connection { padding-top:7px; margin-top:1px; }
  .connection h2 { display:none; }
  .workspace-main { gap:14px; }
  .project-summary { max-width:55%; }
}
@media (max-width:480px) {
  .control-grid { grid-template-columns:minmax(0,1fr); }
  .project summary,.settings summary,.section-title { padding-inline:12px; }
  .permission,.settings-content { padding-inline:12px; }
  .project-actions button { width:100%; }
  .workspace-heading p { font-size:.88rem; }
  .project-summary { max-width:48%; }
  .permission-chip { font-size:.68rem; padding:2px 5px; }
  .search { width:100%; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none!important; } }
