:root {
  color-scheme: dark;
  --bg: #0b1120;
  --panel: #111b2d;
  --panel-2: #152238;
  --border: #25344a;
  --text: #e7eef9;
  --muted: #91a1b8;
  --accent: #8b7cff;
  --accent-2: #a69aff;
  --green: #40c994;
  --yellow: #e5b75a;
  --red: #ff7777;
  --shadow: 0 18px 55px rgba(0, 0, 0, .22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(ellipse at 17% -8%, rgba(97, 83, 211, .17), transparent 38%), var(--bg); }
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.app-shell { width: min(1180px, calc(100% - 44px)); margin: 0 auto; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(142, 163, 194, .13); }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #9c8dff, #6355d8); color: white; font-weight: 800; font-size: 20px; box-shadow: 0 8px 22px rgba(119, 101, 243, .32); }
.brand strong { display: block; letter-spacing: -.3px; font-size: 15px; }
.brand small { display: block; margin-top: 1px; color: var(--muted); letter-spacing: 1.9px; font-size: 8px; font-weight: 700; }
.topbar-right, .user-area, .connection { display: flex; align-items: center; gap: 12px; }
.connection { font-size: 12px; color: var(--muted); }
.connection i, .dot-green { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #65758d; }
.connection.connected i, .dot-green { background: var(--green); box-shadow: 0 0 0 4px rgba(64, 201, 148, .1); }
.avatar { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); }
#user-login { font-size: 13px; color: #d5deec; }
main { padding: 42px 0 55px; }
.card { background: linear-gradient(155deg, rgba(21, 34, 56, .96), rgba(16, 27, 45, .96)); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 10px; padding: 10px 14px; font-weight: 650; font-size: 13px; color: white; transition: .18s ease; white-space: nowrap; }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button-primary { background: linear-gradient(135deg, #8575ff, #6657dd); box-shadow: 0 7px 20px rgba(105, 87, 221, .18); }
.button-primary:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.button-secondary { background: #1a2a43; border-color: #30435e; color: #dbe5f5; }
.button-secondary:hover:not(:disabled), .button-ghost:hover:not(:disabled) { background: #223650; }
.button-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.button-small { padding: 6px 9px; font-size: 11px; }
.button-large { padding: 13px 19px; font-size: 14px; }
.login-view { min-height: 560px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 70px; padding: 30px 4%; }
.eyebrow { color: #9e92ff; font-weight: 800; font-size: 10px; letter-spacing: 2px; margin-bottom: 14px; }
.login-copy h1, .page-heading h1 { margin: 0; font-size: clamp(36px, 5vw, 57px); line-height: 1.14; letter-spacing: -2px; }
.login-copy h1 span { color: #a79aff; }
.login-copy p { color: var(--muted); max-width: 490px; line-height: 1.8; font-size: 15px; margin: 22px 0 27px; }
.login-form { display: grid; gap: 10px; max-width: 420px; }
.field-label { color: #c8d5e8; font-size: 12px; font-weight: 650; }
.text-input { width: 100%; border: 1px solid #30435e; border-radius: 10px; padding: 13px 14px; color: var(--text); background: #0d1829; font: inherit; font-size: 14px; outline: none; }
.text-input:focus { border-color: #8b7cff; box-shadow: 0 0 0 3px rgba(139, 124, 255, .14); }
.text-input::placeholder { color: #63748d; }
.login-form .button { margin-top: 5px; justify-self: start; }
.login-footnote { display: flex; align-items: center; gap: 10px; margin-top: 19px; color: #8192aa; font-size: 11px; }
.login-preview { padding: 25px; transform: rotate(1deg); }
.preview-head, .section-heading, .page-heading, .heading-actions, .picker-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.preview-head { font-size: 13px; font-weight: 700; color: #cdd8e9; }
.live-pill { color: var(--green); border: 1px solid rgba(64, 201, 148, .3); background: rgba(64, 201, 148, .08); padding: 3px 7px; border-radius: 20px; font-size: 8px; letter-spacing: 1px; }
.preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 24px 0; }
.preview-stats div { padding: 14px 12px; background: #0e1929; border: 1px solid #23354d; border-radius: 11px; }
.preview-stats strong { display: block; font-size: 23px; letter-spacing: -1px; }
.preview-stats small, .preview-row small { display: block; color: var(--muted); font-size: 10px; margin-top: 5px; }
.preview-row { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-top: 1px solid rgba(142, 163, 194, .1); }
.preview-row span:nth-child(2) { flex: 1; min-width: 0; }
.preview-row b { display: block; font-size: 11px; }
.repo-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; color: #b9b0ff; background: rgba(139, 124, 255, .15); border: 1px solid rgba(139, 124, 255, .2); font-size: 9px; font-weight: 800; }
.preview-row em { font-size: 10px; font-style: normal; }
.status-ok { color: var(--green); }
.status-wait { color: var(--yellow); }
.preview-note { color: #6f8099; font-size: 10px; margin: 17px 0 0; }
.notice { border: 1px solid rgba(229, 183, 90, .28); background: rgba(229, 183, 90, .08); color: #f2d38c; padding: 12px 15px; border-radius: 10px; font-size: 12px; margin-bottom: 22px; }
.page-heading { margin-bottom: 26px; align-items: end; }
.page-heading h1 { font-size: 34px; letter-spacing: -1px; }
.page-heading p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.heading-actions { justify-content: end; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { padding: 19px 20px; }
.stat-label { color: var(--muted); font-size: 11px; }
.stat-value { font-size: 31px; font-weight: 750; letter-spacing: -1.5px; margin-top: 9px; }
.stat-foot { color: #70829a; font-size: 10px; margin-top: 4px; }
.section-card { padding: 22px; margin-top: 18px; }
.section-heading { margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.3px; }
.section-heading p { color: var(--muted); font-size: 11px; margin: 6px 0 0; }
.notification-content { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.notification-description { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.notification-footnote { margin-top: 13px; color: #73849a; font-size: 10px; line-height: 1.6; }
.repo-list, .fork-list, .log-list { display: flex; flex-direction: column; }
.repo-row { display: grid; grid-template-columns: minmax(190px, 1.4fr) minmax(165px, 1fr) 115px 48px auto; align-items: center; gap: 14px; padding: 15px 8px; border-top: 1px solid rgba(142, 163, 194, .1); }
.repo-main { min-width: 0; }
.repo-name { display: block; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.repo-upstream { display: block; margin-top: 5px; font-size: 10px; color: #8293aa; overflow-wrap: anywhere; }
.repo-branch { color: #9eacc0; font-size: 10px; background: #1b2a40; padding: 4px 7px; border-radius: 6px; justify-self: start; }
.badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 20px; padding: 5px 8px; font-size: 10px; border: 1px solid transparent; white-space: nowrap; }
.badge.success { color: var(--green); border-color: rgba(64, 201, 148, .22); background: rgba(64, 201, 148, .08); }
.badge.warning { color: var(--yellow); border-color: rgba(229, 183, 90, .22); background: rgba(229, 183, 90, .08); }
.badge.danger { color: var(--red); border-color: rgba(255, 119, 119, .22); background: rgba(255, 119, 119, .08); }
.badge.muted { color: #9aa9bd; border-color: #31445f; background: #192a41; }
.repo-controls { display: flex; align-items: center; gap: 7px; justify-content: end; }
.switch { position: relative; width: 34px; height: 19px; border: 0; border-radius: 20px; padding: 0; background: #34445a; transition: .2s; flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; width: 13px; height: 13px; top: 3px; left: 3px; border-radius: 50%; background: #dbe3ee; transition: .2s; }
.switch.on { background: #6d60dc; }
.switch.on::after { left: 18px; }
.repo-actions { display: flex; gap: 5px; justify-content: end; }
.icon-button { border: 1px solid #30435e; border-radius: 7px; background: #17263d; color: #b9c8dc; padding: 6px 8px; font-size: 10px; }
.icon-button:hover { background: #243853; }
.icon-button.danger-text { color: #ff9292; }
.empty-state { padding: 35px 14px; text-align: center; color: #71839b; font-size: 12px; }
.fork-row { display: flex; align-items: center; gap: 12px; padding: 12px 7px; border-top: 1px solid rgba(142, 163, 194, .1); }
.fork-row input { accent-color: #8b7cff; width: 15px; height: 15px; }
.fork-info { flex: 1; min-width: 0; }
.fork-info strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.fork-info small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.fork-row.disabled { opacity: .48; }
.incompatible-note { color: var(--yellow); font-size: 10px; }
.fork-diagnostics { margin: 0 0 14px; padding: 12px 14px; border: 1px solid rgba(229, 183, 90, .24); border-radius: 10px; background: rgba(229, 183, 90, .06); color: #c6d2e3; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.fork-diagnostics a { color: #b4aaff; text-decoration: underline; }
.diagnostic-help { margin-top: 7px; color: #8698b0; font-size: 10px; }

.picker-footer { padding-top: 16px; border-top: 1px solid rgba(142, 163, 194, .1); color: var(--muted); font-size: 11px; }
.log-row { display: grid; grid-template-columns: 150px 95px minmax(160px, 1fr) auto; align-items: center; gap: 13px; padding: 14px 5px; border-top: 1px solid rgba(142, 163, 194, .1); }
.log-time, .log-origin { color: #8192aa; font-size: 10px; }
.log-repo { font-size: 11px; font-weight: 700; overflow-wrap: anywhere; }
.log-message { color: var(--muted); font-size: 10px; margin-top: 4px; line-height: 1.5; }
.page-footer { display: flex; justify-content: space-between; gap: 20px; padding: 25px 3px 0; color: #657791; font-size: 10px; }
.toast { position: fixed; z-index: 10; bottom: 24px; left: 50%; transform: translateX(-50%); background: #e8edf6; color: #172238; border-radius: 9px; box-shadow: var(--shadow); padding: 11px 16px; font-size: 12px; max-width: min(90vw, 520px); }
@media (max-width: 960px) {
  .login-view { gap: 32px; padding-inline: 0; }
  .repo-row { grid-template-columns: minmax(150px, 1.2fr) minmax(130px, 1fr) 100px 48px; }
  .repo-actions { grid-column: 2 / -1; }
}
@media (max-width: 640px) {
  .app-shell { width: min(100% - 24px, 1180px); }
  .login-view { display: flex; flex-direction: column; align-items: stretch; gap: 35px; padding: 35px 0; }
  .login-copy h1 { font-size: 41px; }
  .login-preview { transform: none; }
  .page-heading { display: block; }
  .heading-actions { justify-content: start; margin-top: 18px; flex-wrap: wrap; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .section-card { padding: 16px 13px; }
  .section-heading { align-items: start; }
  .section-heading .button { font-size: 10px; padding: 8px 9px; }
  .repo-row { grid-template-columns: 1fr auto; gap: 8px 10px; padding: 14px 4px; }
  .repo-row .repo-controls { grid-column: 2; grid-row: 1 / span 2; flex-wrap: wrap; }
  .repo-row .repo-actions { grid-column: 1 / -1; justify-content: start; }
  .log-row { grid-template-columns: 1fr auto; gap: 5px 10px; }
  .log-time { grid-column: 1; }
  .log-row .badge { grid-column: 2; grid-row: 1; }
  .log-repo { grid-column: 1 / -1; }
  .log-message { grid-column: 1 / -1; }
  .log-origin { display: none; }
  .page-footer { flex-direction: column; }
  .user-area { gap: 7px; }
  #user-login { max-width: 82px; overflow: hidden; text-overflow: ellipsis; }
}
