:root {
  color-scheme: dark light;
  --background: #181818;
  --surface: #222222;
  --foreground: #eeeeec;
  --muted: #b8b8b3;
  --border: #484846;
  --button: #30302f;
  --button-hover: #414140;
  --focus: #a9caff;
  --error: #ffb4a9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  font-size: 16px;
  line-height: 1.55;
  background: var(--background);
  color: var(--foreground);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--button);
  color: var(--foreground);
  cursor: pointer;
}
button:hover:not(:disabled) { background: var(--button-hover); }
button:disabled { opacity: .6; cursor: not-allowed; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}
a { color: var(--foreground); text-underline-offset: 4px; }
p { margin: 0; }
h1, h2 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.4; }
.page-header, main { width: min(100% - 48px, 1120px); margin-inline: auto; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 24px;
  border-bottom: 1px solid var(--border);
}
.project-path { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.identity { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: end; }
#member-name { overflow-wrap: anywhere; }
.text-button { background: transparent; border-color: transparent; padding-inline: 8px; }
main { padding-block: 24px 28px; }
.notice { color: var(--muted); margin-bottom: 20px; overflow-wrap: anywhere; }
.notice.error { color: var(--error); }
.notice:empty { display: none; }
.entry { max-width: 560px; padding-top: 36px; }
.entry h2 { font-size: 24px; }
.entry > p { margin-top: 12px; color: var(--muted); }
details { margin-top: 28px; }
summary { min-height: 44px; display: list-item; cursor: pointer; padding-block: 9px; }
#access-form { margin-top: 16px; }
label { display: block; margin-bottom: 8px; }
.access-row { display: flex; gap: 10px; }
input {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--foreground);
  padding: 8px 12px;
}
.muted { color: var(--muted); }
#access-hint { margin-top: 8px; font-size: 14px; }
.workspace-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
#connection-status { margin-top: 4px; font-size: 14px; }
.actions { display: flex; gap: 8px; flex-shrink: 0; }
.primary-button { background: var(--foreground); color: var(--background); border-color: var(--foreground); font-weight: 600; }
.primary-button:hover:not(:disabled) { background: var(--foreground); opacity: .88; }
.first-use { max-width: 760px; margin-top: 28px; }
.first-use p { color: var(--muted); }
.first-use strong { color: var(--foreground); font-weight: 600; }
.external-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; }
.first-use .login-hint { font-size: 13px; margin-top: 6px; }
.terminal-shell { margin-top: 20px; padding: 12px; background: #111111; border: 1px solid var(--border); border-radius: 6px; }
#terminal { width: 100%; height: max(360px, 58dvh); min-width: 0; }
.terminal-help, .session-note { font-size: 13px; color: var(--muted); margin-top: 12px; }
.session-note { max-width: 780px; }
.skip-link { position: fixed; top: 8px; left: 16px; padding: 10px 16px; background: var(--foreground); color: var(--background); z-index: 5; transform: translateY(-180%); }
.skip-link:focus { transform: none; }

@media (prefers-color-scheme: light) {
  :root {
    --background: #ffffff;
    --surface: #f5f5f3;
    --foreground: #252523;
    --muted: #62625e;
    --border: #c5c5bf;
    --button: #f2f2ef;
    --button-hover: #e5e5e0;
    --focus: #205fb8;
    --error: #ae2618;
  }
}

@media (max-width: 650px) {
  .page-header, main { width: calc(100% - 28px); }
  .page-header { align-items: start; padding-block: 16px; flex-direction: column; gap: 8px; }
  .identity { width: 100%; justify-content: space-between; gap: 4px; font-size: 14px; }
  main { padding-top: 16px; }
  .workspace-heading { align-items: start; flex-direction: column; gap: 12px; }
  .actions { width: 100%; }
  .actions button { flex: 1; }
  .first-use { margin-top: 20px; font-size: 14px; }
  .external-link { overflow-wrap: anywhere; }
  .terminal-shell { margin-inline: -6px; padding: 6px; }
  #terminal { height: max(320px, 56dvh); }
  .entry { padding-top: 12px; }
  .entry h2 { font-size: 21px; }
  .access-row { flex-direction: column; }
}

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