/* ───────────────────────── sign-in ───────────────────────── */
#gate, #pair {
  position: fixed; inset: 0; z-index: 45; display: flex; gap: 22px;
  flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg); padding: 32px;
}
.mark { font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
        color: var(--accent); font-weight: 650; }
.lede { color: var(--dim); text-align: center; max-width: 24rem;
        font-size: 15px; line-height: 1.6; }
.btn {
  background: var(--accent); color: var(--accent-ink); border: 0;
  border-radius: var(--r-pill); padding: 15px 28px; font-size: 15px;
  font-weight: 600; width: min(340px, 90vw); cursor: pointer;
  transition: filter var(--ease);
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .45; }
.note { color: var(--bad); font-size: 14px; min-height: 1.3em; text-align: center; }
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: min(340px, 90vw); padding: 14px; border-radius: var(--r-pill);
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  font-size: 15px; font-weight: 550; cursor: pointer; box-shadow: var(--shadow);
  transition: transform var(--ease);
}
.oauth-btn:hover { transform: translateY(-1px); }
.oauth-btn:disabled { opacity: .5; }
.field-label { color: var(--muted); font-size: 13px; align-self: center;
               width: min(340px, 90vw); margin: 4px auto -12px; }
.pwfield {
  width: min(340px, 90vw); padding: 14px 16px; text-align: center;
  font-size: 16px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color var(--ease);
}
.pwfield:focus { outline: none; border-color: var(--accent); }

/* ───────────────────────── frame ───────────────────────── */
#shell { display: flex; height: 100%; }

/* The rail is told apart from the workspace by tone alone. No border: a
   hairline down the full height of the screen is the single most
   terminal-looking thing a layout can do. */
#side {
  flex: 0 0 var(--side-w); width: var(--side-w); display: flex;
  flex-direction: column; min-height: 0; background: var(--surface);
}
#brand {
  display: flex; align-items: center; gap: 10px; flex: 0 0 auto;
  padding: max(18px, calc(var(--safe-t) + 8px)) 18px 14px;
}
#brand .mark { font-size: 12px; }
#dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
       flex: 0 0 auto; transition: background var(--ease); }
#dot.on { background: var(--ok); } #dot.off { background: var(--bad); }
#who { font-size: 12px; color: var(--muted); margin-left: auto;
       white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#projects { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding: 4px 10px; }
.proj {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; background: none; border: 0; border-radius: var(--r-md);
  text-align: left; cursor: pointer; margin-bottom: 2px;
  transition: background var(--ease);
}
.proj:hover { background: var(--wash); }
.proj.on { background: var(--wash-2); }
.proj .chip { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.proj .txt { flex: 1 1 auto; min-width: 0; }
.proj .nm { font-size: 14px; font-weight: 550; color: var(--text);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            line-height: 1.35; }
.proj .meta { font-size: 12px; color: var(--muted); white-space: nowrap;
              overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.proj .meta.gone { color: var(--bad); }
.proj .bell { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.side-empty { color: var(--muted); font-size: 14px; padding: 28px 14px;
              text-align: center; line-height: 1.6; }

#usage { flex: 0 0 auto; padding: 14px 18px calc(16px + var(--safe-b)); }
#acct-name { font-size: 13px; font-weight: 550; color: var(--text); }
#acct-mail { font-size: 12px; color: var(--muted); margin-bottom: 14px;
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usage-title { color: var(--muted); font-size: 10px; font-weight: 650;
               letter-spacing: .1em; margin-bottom: 8px; text-transform: uppercase; }
.lim { margin-bottom: 10px; }
.lim-top { display: flex; align-items: baseline; gap: 6px; }
.lim-tag { font-size: 12px; font-weight: 550; color: var(--dim); width: 28px; }
.lim-pct { font-size: 12px; font-weight: 550; color: var(--dim);
           margin-left: auto; }
.track { height: 5px; border-radius: 999px; background: var(--wash-2);
         margin: 5px 0 3px; overflow: hidden; }
.fill { height: 100%; background: var(--accent); border-radius: 999px;
        width: 0; transition: width .4s var(--ease); }
.lim-reset { font-size: 11px; color: var(--muted); }
.usage-empty { font-size: 12px; color: var(--muted); }
#side-tools { display: flex; gap: 4px; margin-top: 14px; }

/* ───────────────────────── workspace ───────────────────────── */
#work { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0;
        min-height: 0; background: var(--bg); }
#phdr {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  height: 52px; padding-top: var(--safe-t);
  padding-left: max(14px, var(--safe-l)); padding-right: max(12px, var(--safe-r));
  box-sizing: content-box;
}
#phdr-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
            background: var(--muted); }
#phdr-name { font-size: 15px; font-weight: 600; white-space: nowrap;
             overflow: hidden; text-overflow: ellipsis;
             flex: 0 1 auto; min-width: 2.5em; letter-spacing: -.01em; }
#phdr-git { font-size: 12.5px; color: var(--muted); white-space: nowrap;
            flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }

/* Ghost buttons: no chrome until you reach for them. */
.icon {
  flex: 0 0 auto; background: transparent; border: 0; color: var(--dim);
  border-radius: var(--r-pill); min-width: 34px; height: 34px;
  padding: 0 10px; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--ease), color var(--ease);
}
.icon:hover { background: var(--wash-2); color: var(--text); }
.icon.on { color: var(--accent); background: var(--wash-2); }
.icon:disabled { opacity: .35; }
#burger { display: none; }

/* A segmented control that sits *in* the surface rather than in a box. */
#views { display: flex; margin-left: auto; flex: 0 0 auto; gap: 2px;
         background: var(--wash); border-radius: var(--r-pill); padding: 3px; }
.vtab { background: transparent; border: 0; padding: 6px 14px; font-size: 13px;
        font-weight: 500; color: var(--muted); cursor: pointer;
        white-space: nowrap; border-radius: var(--r-pill);
        transition: background var(--ease), color var(--ease); }
.vtab:hover { color: var(--text); }
.vtab.on { background: var(--surface); color: var(--text);
           box-shadow: var(--shadow); }
#views, .vtab, .icon { flex-shrink: 0; }

/* The groups, under the project they belong to. A row that scrolls sideways
   rather than one that wraps: a window with six groups should not push the
   conversation down the screen. */
#groups { flex: 0 0 auto; display: flex; gap: 5px; overflow-x: auto;
          padding: 2px max(12px, var(--safe-r)) 8px max(14px, var(--safe-l));
          scrollbar-width: none; }
#groups::-webkit-scrollbar { display: none; }
#groups:empty { display: none; }
.gtab {
  flex: 0 0 auto; cursor: pointer; background: var(--wash);
  border: 0; border-radius: var(--r-pill); padding: 5px 12px;
  font-size: 12px; font-weight: 550; color: var(--dim);
  max-width: 18ch; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; transition: background var(--ease), color var(--ease);
}
.gtab:hover { background: var(--wash-2); }
.gtab.on { background: var(--accent); color: var(--accent-ink); }
.gtab .gn { opacity: .65; margin-left: 5px; font-weight: 500; }

main { flex: 1 1 auto; position: relative; min-height: 0; }
.view { position: absolute; inset: 0; display: none;
        flex-direction: column; min-height: 0; }
.view.on { display: flex; }
