:root {
  color-scheme: light;
  --ink: #172927;
  --muted: #536964;
  --paper: #fff;
  --canvas: #f2f6f5;
  --line: #d7e3df;
  --nav: #152e2a;
  --nav-ink: #eaf5ee;
  --accent: #17644f;
  --accent-hover: #104f3d;
  --tint: #e4f1eb;
  font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #368b76; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.16; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.045em; }
h2 { font-size: 1.35rem; letter-spacing: -.02em; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.brand { display: inline-flex; align-items: center; gap: .75rem; font-size: 1.05rem; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: .7rem; background: #beedab; color: #1a3830; font: 700 .9rem ui-monospace, monospace; }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 16rem minmax(0, 1fr); }
.sidebar { min-height: 100vh; padding: 1.7rem 1.1rem 1.2rem; background: var(--nav); color: var(--nav-ink); display: flex; flex-direction: column; gap: 2.5rem; }
.sidebar .brand { margin-inline: .35rem; }
.sidebar-heading, .sidebar-footer { display: flex; justify-content: space-between; align-items: center; }
.sidebar-heading { margin: 0 .45rem .5rem; gap: .5rem; }
.sidebar h2 { font-size: .875rem; letter-spacing: normal; color: #b5cec5; }
.sidebar-add { display: grid; place-items: center; border: 1px solid #4c6860; border-radius: .5rem; width: 2rem; height: 2rem; font-size: 1.35rem; }
.sidebar-add:hover, .project-link:hover { background: #25483f; }
.sidebar nav { display: grid; gap: .25rem; }
.project-link { display: flex; justify-content: space-between; gap: .5rem; padding: .65rem .7rem; border-radius: .55rem; font-size: .94rem; overflow-wrap: anywhere; align-items: center; }
.project-link.active { background: #31554a; color: #fff; font-weight: 650; }
.count { color: #c1d8ce; font-size: .85rem; }
.sidebar-footer { margin-top: auto; padding: .6rem .5rem 0; border-top: 1px solid #3b5b51; gap: .5rem; flex-wrap: wrap; font-size: .875rem; }
.text-button { border: 0; background: transparent; color: inherit; padding: .25rem 0; }
.text-button:hover { text-decoration: underline; }
.main { width: 100%; max-width: 101rem; margin-inline: auto; padding: clamp(1.25rem, 4vw, 3.5rem); }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-bottom: 1.75rem; }
.context-label { color: var(--muted); font-size: .875rem; font-weight: 600; margin-bottom: .55rem; overflow-wrap: anywhere; }
.project-layout { display: grid; grid-template-columns: minmax(11.5rem, .64fr) minmax(0, 2fr); align-items: start; gap: 1.1rem; }
.patch-list, .patch, .empty, .form-sheet, .login-card { background: var(--paper); border: 1px solid var(--line); border-radius: 1rem; }
.patch-list { padding: 1.15rem .65rem .65rem; }
.patch-list h2, .patch-list .muted { margin: 0 .55rem .7rem; }
.patch-link { display: grid; gap: .25rem; padding: .65rem .7rem; border-radius: .6rem; }
.patch-link:hover { background: var(--canvas); }
.patch-link.active { background: var(--tint); }
.patch-link strong, .patch-link span { font-size: .9rem; overflow-wrap: anywhere; }
.patch-link span { color: var(--muted); font-family: ui-monospace, monospace; }
.patch { min-width: 0; padding: clamp(.9rem, 3vw, 1.55rem); }
.patch-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: .7rem; margin-bottom: 1.1rem; }
.patch-top h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
.button { display: inline-flex; align-items: center; justify-content: center; border-radius: .55rem; border: 1px solid transparent; font-weight: 650; min-height: 2.6rem; padding: .5rem .8rem; font-size: .9rem; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-hover); }
.secondary { border-color: var(--line); color: var(--ink); background: white; }
.secondary:hover { background: var(--canvas); }
.project-tabs { display: flex; gap: .5rem; border-bottom: 1px solid var(--line); margin-bottom: 1.1rem; }
.project-tabs a { color: var(--muted); border-bottom: 2px solid transparent; padding: .45rem .85rem .55rem; font-weight: 650; }
.project-tabs a:hover { color: var(--accent); background: var(--tint); }
.project-tabs a[aria-current="page"] { color: var(--accent); border-color: var(--accent); }
.files-panel { max-width: 52rem; padding: clamp(1rem, 3vw, 1.55rem); background: var(--paper); border: 1px solid var(--line); border-radius: 1rem; }
.files-panel > .muted { margin-top: .65rem; }
.file-list { list-style: none; padding: 0; margin: .75rem 0 0; }
.file-list li { display: flex; justify-content: space-between; gap: .9rem; align-items: center; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.file-details { min-width: 0; overflow-wrap: anywhere; }
.file-details p { color: var(--muted); font-size: .875rem; }
.upload-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .45rem .75rem; margin-top: 1.25rem; }
.upload-form p { grid-column: 1 / -1; font-size: .875rem; }
.upload-form button:disabled { opacity: .68; cursor: wait; }
.upload-status:empty { display: none; }
.upload-form input[type="file"] { padding: .45rem; }
.upload-form input::file-selector-button { color: var(--ink); background: var(--tint); border: 0; border-radius: .3rem; padding: .25rem .45rem; margin-right: .55rem; cursor: pointer; }
.code-panel { border-radius: .8rem; overflow: hidden; background: #132724; color: #e9f6f0; }
.code-bar { padding: .62rem .75rem; background: #213b35; border-bottom: 1px solid #3b554d; display: flex; gap: .5rem .9rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.file-path { color: #e6f4ed; font: .85rem ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.copy { background: #c1edb1; color: #17372a; padding: .35rem .65rem; min-height: 2.25rem; }
.copy:hover { background: #a9db99; }
pre { margin: 0; padding: 1rem; max-height: 33rem; overflow: auto; white-space: pre; tab-size: 4; }
pre code { font: .88rem/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; }
.copy-status { font-size: .875rem; color: var(--accent); min-height: .8rem; }
.copy-status:not(:empty) { padding-top: .35rem; }
.note { padding: .85rem 0; }
.note h3 { margin-bottom: .35rem; }
.note p { white-space: pre-wrap; overflow-wrap: anywhere; color: #36514a; }
.expected { margin-top: .45rem; padding: .85rem; border-radius: .6rem; background: var(--tint); }
.empty { padding: 1.5rem; }
.empty p { margin: .6rem 0 1rem; }
.login-page { min-height: 100vh; display: grid; align-items: center; justify-items: center; padding: 1rem; background: radial-gradient(ellipse at 15% 0%, #325c4d, #142c28 70%); }
.login-card { width: min(100%, 27rem); padding: clamp(1.25rem, 6vw, 2rem); box-shadow: 0 2rem 5rem #0a171463; }
.brand-login { margin-bottom: 1.65rem; }
.login-card h1, .form-sheet h1 { margin-bottom: 1rem; }
.stack { display: grid; gap: 1rem; }
label { display: grid; gap: .32rem; color: var(--ink); font-size: .95rem; font-weight: 600; }
input, textarea { background: #fbfdfc; color: var(--ink); border: 1px solid #b8ccc3; border-radius: .5rem; width: 100%; min-width: 0; padding: .65rem .75rem; font-weight: 400; }
textarea { resize: vertical; }
.code-input { font: .9rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.demo-access { border-top: 1px solid var(--line); margin-top: 1.15rem; padding-top: .75rem; color: var(--muted); font-size: .9rem; }
.demo-access button { color: var(--accent); font-weight: 650; }
.form-page { max-width: 57rem; margin-inline: auto; padding: clamp(1rem, 4vw, 2rem); }
.back { display: inline-block; color: var(--accent); font-weight: 650; margin-bottom: .75rem; }
.back:hover { text-decoration: underline; }
.form-sheet { padding: clamp(1rem, 4vw, 2rem); }
.form-columns { display: grid; gap: 1rem; grid-template-columns: 2fr 1fr; }
.message { border-radius: .6rem; padding: .65rem .8rem; }
.main > .message { margin-bottom: 1rem; }
.error { background: #fff0ed; color: #852e27; }
.form-sheet > .error { margin-bottom: 1rem; }
.saved { background: var(--tint); color: var(--accent); margin-bottom: 1rem; }
@media (max-width: 950px) {
  .workspace { grid-template-columns: 13rem minmax(0, 1fr); }
  .project-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .workspace { display: block; }
  .sidebar { min-height: 0; padding: 1rem; gap: 1rem; }
  .sidebar .brand { margin-inline: 0; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar-footer { justify-content: flex-start; }
  .main { padding: 1rem; }
  .upload-form { grid-template-columns: minmax(0, 1fr); }
  .upload-form button { justify-self: start; }
  .form-columns { grid-template-columns: 1fr; }
}
