@import url("/brand.css");

* { box-sizing: border-box; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font: var(--type-title); font-size: 28px; line-height: 1.25; letter-spacing: -.035em; overflow-wrap: anywhere; }
h2, h3 { font: inherit; font-weight: 500; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; color: inherit; touch-action: manipulation; }
button:disabled { opacity: .5; cursor: wait; }
code, textarea { font: var(--type-code); }
code { overflow-wrap: anywhere; }
::selection { color: var(--paper); background: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
h1:focus { outline: none; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 14px; line-height: 1.6; }
.topbar { height: 64px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-mark { width: 22px; height: 22px; }
#menu-toggle { display: none; padding: 6px 12px; min-height: 36px; }
.text-button, .inline-link { background: none; border: 0; color: var(--muted); padding: 6px 0; }
.text-button:hover, .inline-link:hover { color: var(--ink); text-decoration: underline; }
.inline-link { color: var(--ink); text-decoration: underline; padding: 0; font: inherit; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--paper); font-size: 14px; line-height: 1.5; white-space: nowrap; }
.primary { background: var(--ink); color: var(--paper); }
.primary:hover { background: var(--muted); border-color: var(--muted); }
.secondary { border-color: var(--line); }
.secondary:hover { background: var(--surface); border-color: #aaa; }
label { display: block; margin-bottom: 8px; font-size: 14px; }
input, textarea { display: block; width: 100%; border: 1px solid #ccc; border-radius: var(--radius); background: var(--paper); color: var(--ink); padding: 10px 12px; min-width: 0; }
input::placeholder, textarea::placeholder { color: #767676; }
input:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
textarea { resize: vertical; }
#notice { position: fixed; z-index: 5; bottom: 24px; right: 24px; width: max-content; max-width: min(480px,calc(100vw - 48px)); padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 4px 24px #0001; font-size: 14px; }
#notice:empty { display: none; }
.loading { padding: 64px 28px; color: var(--muted); }
#auth { max-width: 1104px; margin: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 96px; align-items: start; padding: 96px 28px; }
#auth h1 { font-size: 40px; }
.intro p { color: var(--muted); margin-top: 24px; max-width: 360px; }
.auth-card { padding: 8px 0; max-width: 400px; width: 100%; }
.auth-card h2 { margin-bottom: 16px; }
.auth-card form { margin-top: 32px; }
.auth-card .primary { width: 100%; margin-top: 16px; justify-content: space-between; }
.auth-card .hint { margin-top: 16px; }
#change-email { margin-top: 16px; text-align: left; font-size: 14px; }
.code-input { font: var(--type-code); letter-spacing: .5em; }
/* Navigation is a rail, never a second page stacked above the content. */
.workspace-grid { display: grid; grid-template-columns: 208px minmax(0,1fr); min-height: calc(100dvh - 64px); }
#desktop-navigation { border-right: 1px solid var(--line); background: #fafafa; }
.sidebar { display: flex; flex-direction: column; padding: 24px 12px; position: sticky; top: 0; height: calc(100dvh - 64px); min-height: 320px; overflow-y: auto; }
.section-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; border-radius: var(--radius); padding: 9px 12px; text-align: left; font-size: 14px; color: var(--muted); }
.section-link:hover { background: #f0f0f0; color: var(--ink); }
.section-link[aria-current=page] { color: var(--ink); background: #ebebeb; }
#repository-nav { margin-top: 28px; }
.nav-caption { padding: 0 12px 10px; color: var(--ink); font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-link { margin-top: auto; }
.nav-count { font-size: 12px; min-width: 18px; text-align: center; background: #e8e8e8; border-radius: 4px; }
.page-content { min-width: 0; padding: 44px 48px; width: 100%; max-width: 1000px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 32px; min-height: 40px; }
.page-actions { display: flex; gap: 8px; }
.title-count { font-size: 14px; color: var(--muted); font-weight: 400; vertical-align: middle; margin-left: 8px; letter-spacing: 0; }
.breadcrumb { color: var(--muted); font-size: 14px; margin-bottom: 12px; overflow-wrap: anywhere; }
.repo-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.repo-item:hover .repo-label > span { text-decoration: underline; text-underline-offset: 4px; }
.repo-item > span:last-child { color: var(--muted); }
.repo-label { min-width: 0; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.repo-label small { font-size: 13px; color: var(--muted); }
.empty { border-top: 1px solid var(--line); padding-top: 32px; }
.empty .hint { margin-top: 8px; }
.section-heading { margin-bottom: 20px; }
.section-heading p { margin-top: 8px; font-size: 14px; }
.command { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; background: var(--surface); border-radius: var(--panel-radius); }
.command code { min-width: 0; }
.command .text-button { flex-shrink: 0; font-size: 13px; }
.command + .hint { margin-top: 16px; }
.session-help { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; }
.session-help summary { color: var(--muted); cursor: pointer; }
.session-help p { margin-top: 16px; color: var(--muted); }
.key-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 0; border-top: 1px solid var(--line); }
.key-row code { min-width: 0; overflow-wrap: anywhere; }
.key-row button { flex-shrink: 0; font-size: 14px; }
.list-summary { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.collaborator-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.collaborator-identity { min-width: 0; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.collaborator-identity small { font-size: 13px; color: var(--muted); }
.member-actions { display: flex; align-items: center; gap: 16px; font-size: 13px; flex-wrap: wrap; }
.settings-list > div { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 20px; padding: 20px 0; border-top: 1px solid var(--line); font-size: 14px; }
.settings-list dt { color: var(--muted); }
.settings-list dd { overflow-wrap: anywhere; }
#collaborator-access { margin-top: 40px; }
#collaborator-access p { margin: 8px 0 20px; font-size: 14px; }
#account-menu { margin-top: 24px; }
dialog { width: min(440px,calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 28px; border: 1px solid var(--line); border-radius: var(--panel-radius); background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #0004; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
dialog .muted { margin-bottom: 24px; font-size: 14px; }
dialog .hint { margin-top: 12px; }
dialog .primary { width: 100%; margin-top: 24px; justify-content: space-between; }
.form-footer { display: flex; flex-direction: column; }
.form-footer .hint { order: 0; }
.form-footer button { order: 1; }
.error { color: #a12622; font-size: 14px; margin-top: 16px; }
.error:empty { display: none; }
.import-help { margin-top: 24px; font-size: 14px; color: var(--muted); }
.import-help summary { cursor: pointer; }
.import-help .command { margin-top: 12px; padding: 12px; color: var(--ink); }
#change-import { margin-top: 12px; }
#navigation-dialog { margin: 0; height: 100dvh; max-height: none; width: min(280px,85vw); border: 0; border-right: 1px solid var(--line); border-radius: 0; padding: 16px 12px; }
#close-navigation { margin: 0 12px 16px; font-size: 14px; }
#navigation-dialog .sidebar { height: calc(100dvh - 88px); padding: 0; }
@media(max-width:900px) {
  .workspace-grid { grid-template-columns: 164px minmax(0,1fr); }
  .page-content { padding: 32px 24px; }
  .sidebar { padding: 20px 8px; }
  .section-link { padding-inline: 10px; }
  .nav-caption { padding-inline: 10px; }
  .page-heading { flex-wrap: wrap; gap: 16px; }
  .collaborator-row { flex-wrap: wrap; }
  #auth { gap: 40px; }
}
@media(max-width:559px) {
  .topbar { height: 56px; padding-inline: 20px; }
  #menu-toggle { display: inline-flex; }
  .workspace-grid { display: block; min-height: calc(100dvh - 56px); }
  #desktop-navigation { display: none; }
  .page-content { padding: 28px 20px; }
  h1 { font-size: 26px; }
  .page-heading { margin-bottom: 28px; }
  #auth { display: block; padding: 48px 24px; }
  .auth-card { margin-top: 48px; max-width: none; }
  .settings-list > div { grid-template-columns: 96px minmax(0,1fr); gap: 12px; }
}
@media(prefers-reduced-motion:no-preference) { button, a { transition: background-color .12s ease,color .12s ease; } }
