:root {
  color-scheme: light;
  --ink: #14213d;
  --muted: #667085;
  --line: #d8dee9;
  --panel: #ffffff;
  --canvas: #f4f7fb;
  --blue: #1357d6;
  --blue-dark: #0d3f9d;
  --orange: #f15a24;
  --green: #177245;
  --danger: #b42318;
  --warning: #9a6700;
  --shadow: 0 12px 30px rgba(20, 33, 61, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.66; }
.shell { width: min(1440px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 48px; }
.topbar { display: flex; align-items: center; min-height: 42px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 760; letter-spacing: 0; }
.brand-mark { display: grid; width: 32px; height: 32px; place-items: center; color: #fff; background: var(--ink); font-size: 11px; font-weight: 800; }
.lookup { display: grid; grid-template-columns: minmax(220px, 0.76fr) minmax(440px, 1.24fr); gap: 18px 32px; align-items: end; padding: 50px 0 34px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 12px; font-weight: 760; letter-spacing: 0; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.08; }
h2 { font-size: clamp(24px, 3vw, 36px); line-height: 1.1; }
.repository-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
input { min-width: 0; height: 46px; border: 1px solid #b8c3d4; border-radius: 4px; padding: 0 14px; color: var(--ink); background: #fff; outline: none; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(19, 87, 214, 0.14); }
button { min-height: 40px; border: 1px solid var(--blue); border-radius: 4px; padding: 0 15px; color: #fff; background: var(--blue); font-weight: 700; }
button:hover:not(:disabled) { border-color: var(--blue-dark); background: var(--blue-dark); }
.icon-button { min-width: 36px; padding: 0; border-color: #b8c3d4; color: var(--ink); background: #fff; font-size: 18px; }
.icon-button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); background: #fff; }
.status-region { min-height: 0; }
.status { display: flex; align-items: center; gap: 9px; margin: 18px 0; border: 1px solid var(--line); border-left-width: 4px; padding: 12px 14px; color: var(--ink); background: #fff; font-size: 14px; }
.status[data-kind="loading"] { border-left-color: var(--blue); }
.status[data-kind="success"] { border-left-color: var(--green); }
.status[data-kind="warning"] { border-left-color: var(--warning); }
.status[data-kind="error"] { border-left-color: var(--danger); }
.workspace { margin-top: 24px; }
.repository-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 0 18px; }
.repository-description { max-width: 780px; margin: 12px 0 0; color: #344054; line-height: 1.55; }
.repository-actions { display: flex; flex: 0 0 auto; gap: 8px; align-items: center; }
.repository-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 16px; border: 1px solid var(--line); background: var(--panel); }
.repository-meta div { min-width: 0; padding: 13px 16px; border-right: 1px solid var(--line); }
.repository-meta div:last-child { border-right: 0; }
.repository-meta dt { margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 720; text-transform: uppercase; }
.repository-meta dd { overflow: hidden; margin: 0; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.browser-grid { display: grid; min-height: 560px; grid-template-columns: minmax(230px, 0.28fr) minmax(0, 0.72fr); border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.file-panel { min-width: 0; border-right: 1px solid var(--line); }
.panel-heading, .content-heading { display: flex; align-items: center; justify-content: space-between; min-height: 48px; border-bottom: 1px solid var(--line); padding: 0 15px; font-size: 13px; font-weight: 760; }
.muted { color: var(--muted); font-size: 13px; }
.file-tree { max-height: 720px; overflow: auto; padding: 8px; }
.tree-list { margin: 0; padding: 0 0 0 12px; list-style: none; }
.tree-list.root { padding: 0; }
.tree-folder > summary, .tree-file { display: flex; width: 100%; align-items: center; gap: 8px; border: 0; border-radius: 3px; padding: 6px 7px; color: #344054; background: transparent; font-size: 13px; text-align: left; }
.tree-folder > summary { cursor: pointer; list-style: none; }
.tree-folder > summary::-webkit-details-marker { display: none; }
.tree-folder > summary::before { content: "›"; color: var(--muted); font-size: 16px; line-height: 10px; transform: rotate(0deg); }
.tree-folder[open] > summary::before { transform: rotate(90deg); }
.tree-file { font-family: inherit; font-weight: 500; }
.tree-file::before { content: "·"; color: var(--orange); font-size: 20px; line-height: 8px; }
.tree-file:hover, .tree-file[aria-current="true"], .tree-folder > summary:hover { color: var(--blue); background: #edf4ff; }
.content-panel { min-width: 0; }
.content-actions { display: flex; align-items: center; gap: 8px; }
.language-badge { border: 1px solid var(--line); padding: 3px 7px; color: var(--muted); background: #f9fafb; font-size: 11px; font-weight: 680; }
.content-view { min-height: 511px; overflow: auto; padding: 24px 28px; }
.markdown { max-width: 900px; color: #25324a; line-height: 1.68; }
.markdown h1, .markdown h2, .markdown h3 { margin: 28px 0 12px; color: var(--ink); }
.markdown h1 { font-size: 28px; }.markdown h2 { font-size: 22px; }.markdown h3 { font-size: 18px; }
.markdown h1:first-child, .markdown h2:first-child, .markdown h3:first-child { margin-top: 0; }
.markdown p { margin: 0 0 14px; }.markdown ul, .markdown ol { margin: 0 0 14px; padding-left: 22px; }
.markdown blockquote { margin: 16px 0; border-left: 3px solid var(--blue); padding: 4px 14px; color: var(--muted); }
.markdown code { border-radius: 3px; padding: 2px 4px; background: #edf1f7; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
.markdown pre { overflow: auto; margin: 16px 0; padding: 14px; color: #e8eefc; background: #17213a; }
.markdown pre code { padding: 0; background: none; }
.markdown hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.markdown-link { color: var(--blue); text-decoration: underline; }
.code-view { margin: 0; overflow: auto; border: 1px solid var(--line); background: #fbfcfe; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 13px; line-height: 1.6; }
.code-line { display: grid; grid-template-columns: 48px minmax(0, 1fr); min-width: max-content; }
.code-number { border-right: 1px solid var(--line); padding: 0 10px; color: #98a2b3; text-align: right; user-select: none; }
.code-text { padding: 0 14px; white-space: pre; }
.empty-content { display: grid; min-height: 300px; place-items: center; color: var(--muted); text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.download-frame { position: fixed; width: 1px; height: 1px; bottom: 0; left: -9999px; border: 0; opacity: 0; pointer-events: none; }

@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 1440px); padding-top: 12px; }
  .lookup { grid-template-columns: 1fr; padding: 34px 0 24px; }
  .repository-header { display: grid; }
  .repository-actions { width: 100%; }
  .repository-actions #download-button { flex: 1; }
  .repository-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .repository-meta div:nth-child(2) { border-right: 0; }
  .repository-meta div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .browser-grid { grid-template-columns: 1fr; }
  .file-panel { max-height: 300px; border-right: 0; border-bottom: 1px solid var(--line); }
  .file-tree { max-height: 250px; }
  .content-view { padding: 18px; }
}
