:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --bd: #e0e3e7;
  --fg: #1f1f1f;
  --fg-mut: #5f6368;
  --ac: #1a73e8;
  --ac-hover: #1765cc;
  --ac-soft: rgba(26, 115, 232, 0.08);
  --gr: #188038;
  --gr-hover: #146c2e;
  --err: #d93025;
  --hd: #1a73e8;
  --shadow-1: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  --shadow-2: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
  --shadow-3: 0 4px 8px rgba(60,64,67,.3), 0 8px 24px 4px rgba(60,64,67,.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --surface: #1e1e1e;
    --surface-2: #2a2a2a;
    --bd: #3c4043;
    --fg: #e8eaed;
    --fg-mut: #9aa0a6;
    --ac: #8ab4f8;
    --ac-hover: #aecbfa;
    --ac-soft: rgba(138, 180, 248, 0.12);
    --gr: #81c995;
    --gr-hover: #a8dab5;
    --err: #f28b82;
    --hd: #202124;
    --shadow-1: 0 1px 2px rgba(0,0,0,.5), 0 1px 3px 1px rgba(0,0,0,.3);
    --shadow-2: 0 1px 3px rgba(0,0,0,.5), 0 4px 8px 3px rgba(0,0,0,.3);
    --shadow-3: 0 4px 8px rgba(0,0,0,.5), 0 8px 24px 4px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 "Roboto", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ac); text-decoration: none; transition: color .15s; }
a:hover { color: var(--ac-hover); text-decoration: none; }

header {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  color: var(--fg);
  box-shadow: var(--shadow-1);
  position: sticky;
  top: 0;
  z-index: 10;
}

header a, header span { color: var(--fg); }

.logo {
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

nav { display: flex; gap: 8px; align-items: center; }

main { max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; }

h2 { font-weight: 400; font-size: 22px; margin: 0 0 16px; letter-spacing: -.2px; }
h3 { font-weight: 500; font-size: 16px; margin: 0 0 12px; }

button, .btn {
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--bd);
  border-radius: var(--radius-pill);
  padding: 7px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, box-shadow .15s, border-color .15s, transform .05s;
  text-decoration: none;
}

button:hover, .btn:hover {
  background: var(--surface-2);
  box-shadow: var(--shadow-1);
  text-decoration: none;
}

button:active, .btn:active { transform: translateY(1px); }

form .btn, .btn.g {
  background: var(--ac);
  color: #fff;
  border-color: transparent;
}

form .btn:hover, .btn.g:hover { background: var(--ac-hover); }

@media (prefers-color-scheme: dark) {
  form .btn, .btn.g { color: #121212; }
}

label.btn[data-upload] { position: relative; }
label.btn input[type="file"] { display: none; }

input, textarea {
  width: 100%;
  font: inherit;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--bd);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--ac);
  box-shadow: 0 0 0 2px var(--ac-soft);
}

textarea {
  font: 13px/22px ui-monospace, Menlo, Consolas, monospace;
  margin: 8px 0;
  resize: vertical;
}

label {
  display: block;
  margin: 12px 0;
  font-weight: 500;
  font-size: 13px;
  color: var(--fg);
}

label input { font-weight: 400; margin-top: 6px; }

.box {
  background: var(--surface);
  border-radius: var(--radius);
  margin: 16px 0;
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.pad { padding: 20px; }
.narrow { max-width: 380px; margin: 32px auto; }

.hd, .row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

.hd { background: var(--surface-2); border-bottom: 1px solid var(--bd); font-size: 13px; color: var(--fg-mut); }

.row { border-top: 1px solid var(--bd); justify-content: flex-start; transition: background .12s; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--surface-2); }
.row a { color: var(--fg); font-weight: 500; }
.row a:hover { color: var(--ac); }
.row.col { flex-direction: column; align-items: flex-start; gap: 4px; }

.repo {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 12px 0;
  box-shadow: var(--shadow-1);
  transition: box-shadow .2s, transform .15s;
}

.repo:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.repo a { font-size: 18px; font-weight: 500; color: var(--fg); }
.repo a:hover { color: var(--ac); }

.mut { color: var(--fg-mut); font-size: 13px; }
.err { color: var(--err); margin: 10px 0; font-size: 13px; }
.empty { padding: 40px 20px; text-align: center; color: var(--fg-mut); font-size: 14px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--bd); margin-bottom: 16px; }
.tabs a { color: var(--fg-mut); padding: 12px 16px; border-bottom: 3px solid transparent; font-weight: 500; font-size: 14px; transition: color .15s, border-color .15s; }
.tabs a:hover { color: var(--fg); text-decoration: none; }
.tabs a.on { color: var(--ac); border-color: var(--ac); }

pre { margin: 0; overflow-x: auto; }
.txt { white-space: pre-wrap; font: inherit; padding-top: 8px; }
.code { font: 13px/22px ui-monospace, Menlo, Consolas, monospace; padding: 14px 0; background: var(--surface-2); }
.code span { display: block; padding: 0 20px; white-space: pre; }
.code i { display: inline-block; width: 40px; color: var(--fg-mut); font-style: normal; user-select: none; }

.pic { max-width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }

.tag {
  font-size: 11px;
  background: var(--ac-soft);
  color: var(--ac);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  margin-left: 8px;
  vertical-align: middle;
  font-weight: 500;
}

label.cb { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-top: 10px; cursor: pointer; }
label.cb input { width: auto; margin: 0; accent-color: var(--ac); }

.row2 { display: grid; grid-template-columns: 1fr 2fr auto; gap: 10px; margin-top: 10px; align-items: center; }
@media (max-width: 600px) { .row2 { grid-template-columns: 1fr; } }

.raw-url { display: flex; gap: 10px; margin-top: 12px; }
.raw-url input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--surface-2); }
.raw-url button { white-space: nowrap; }

#upload-progress { padding: 14px 20px; background: var(--surface-2); border-bottom: 1px solid var(--bd); }
#upload-progress.hidden { display: none; }
.up-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.up-cancel { color: var(--ac); cursor: pointer; font-size: 13px; font-weight: 500; }
.up-cancel:hover { color: var(--ac-hover); text-decoration: underline; }
.up-bar { height: 6px; background: var(--bd); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.up-bar span { display: block; height: 100%; width: 0; background: var(--ac); border-radius: 3px; transition: width .15s linear; }
.up-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.up-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--fg-mut); padding: 4px 0; }
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.up-row.ok .up-state { color: var(--gr); font-weight: 500; }
.up-row.bad .up-state { color: var(--err); font-weight: 500; }
.up-row.skip .up-state { color: var(--fg-mut); font-style: italic; }
.up-state.ok { color: var(--gr); }
.up-state.bad { color: var(--err); }
.up-state.skip { color: var(--fg-mut); font-style: italic; }