:root {
  color-scheme: light;
  --background: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #d8dee8;
  --text: #172b4d;
  --muted: #5e6c84;
  --primary: #0c66e4;
  --primary-hover: #0055cc;
  --success: #216e4e;
  --danger: #ae2a19;
  --warning: #974f0c;
  --shadow: 0 10px 30px rgba(9, 30, 66, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(12, 102, 228, 0.09), transparent 28rem),
    var(--background);
  color: var(--text);
}

button, input, select { font: inherit; }

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 120px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.035em;
}

.subtitle { margin: 12px 0 0; color: var(--muted); }

.comparison-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.comparison-meta span { display: inline-flex; align-items: center; gap: 5px; }
.comparison-meta code { padding: 2px 6px; }

code {
  padding: 3px 7px;
  border-radius: 6px;
  background: #e9f2ff;
  color: #0747a6;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.summary article, .panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary article { padding: 18px 20px; }
.summary span { display: block; color: var(--muted); font-size: 13px; }
.summary strong { display: block; margin-top: 7px; font-size: 27px; }
.positive { color: var(--success); }
.negative { color: var(--danger); }

.controls {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 14px;
  padding: 18px;
  margin-bottom: 18px;
}

label > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input[type="text"], input[type="search"], input[type="password"], select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(12, 102, 228, 0.14);
}

.list-panel { overflow: hidden; }

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.check-label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check-label > span { margin: 0; color: var(--text); font-size: 14px; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }

.file-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 100px 86px 130px;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 11px 18px;
  border-bottom: 1px solid #ebecf0;
}

.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: #f7faff; }
.file-entry:last-child .file-row { border-bottom: 0; }
.file-path { min-width: 0; }
.file-name { display: block; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.file-directory { display: block; overflow: hidden; margin-top: 5px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.previous-path {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--warning);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diff-toggle {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.diff-toggle:hover { text-decoration: underline; }

.diff-details {
  max-height: 520px;
  overflow: auto;
  padding: 14px 18px 18px 62px;
  border-bottom: 1px solid var(--border);
  background: #0d1117;
  color: #c9d1d9;
  font-size: 12px;
}

.unified-diff {
  min-width: max-content;
  margin: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 1.55;
}

.diff-line { display: block; min-height: 1.55em; padding: 0 10px; white-space: pre; }
.diff-add { background: rgba(46, 160, 67, 0.2); color: #aff5b4; }
.diff-remove { background: rgba(248, 81, 73, 0.2); color: #ffdcd7; }
.diff-hunk { background: rgba(56, 139, 253, 0.18); color: #a5d6ff; }
.diff-header { color: #8b949e; font-weight: 700; }

.badge {
  display: inline-flex;
  justify-content: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e9f2ff;
  color: #0747a6;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge-added { background: #dcfff1; color: var(--success); }
.badge-removed { background: #ffebe6; color: var(--danger); }
.badge-renamed { background: #fff7d6; color: var(--warning); }
.line-stats { color: var(--muted); font-size: 13px; text-align: right; }
.line-stats .add { color: var(--success); }
.line-stats .remove { color: var(--danger); margin-left: 6px; }
.status-stack {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 5px;
}
.muted { color: var(--muted); font-size: 13px; }
.state-message { padding: 54px 20px; color: var(--muted); text-align: center; }
.hidden { display: none !important; }

.release-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(210px, 0.6fr) minmax(320px, 1.5fr) auto;
  align-items: end;
  gap: 22px;
  padding: 16px max(24px, calc((100vw - 1180px) / 2));
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 -8px 26px rgba(9, 30, 66, 0.1);
  backdrop-filter: blur(12px);
}

.release-bar strong { display: block; margin-top: 5px; }
.title-field span { margin-bottom: 6px; }

.button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
}

.button:disabled { cursor: not-allowed; opacity: 0.48; }
.button-primary { background: var(--primary); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--primary-hover); }
.button-secondary { border-color: var(--border); background: var(--surface); color: var(--text); }
.button-secondary:hover { background: #f1f2f4; }

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 30;
  width: min(620px, calc(100% - 32px));
  padding: 14px 18px;
  border-radius: 10px;
  background: #172b4d;
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.toast.error { background: #5d1f17; }
.toast a { color: #b3d4ff; }

dialog {
  width: min(430px, calc(100% - 32px));
  padding: 26px;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(9, 30, 66, 0.28);
}

dialog::backdrop { background: rgba(9, 30, 66, 0.56); }
dialog h2 { margin-top: 0; }
dialog p { color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

@media (max-width: 780px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 24px; }
  .page-header { align-items: stretch; flex-direction: column; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .controls { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .file-row { grid-template-columns: 30px minmax(0, 1fr) 84px; }
  .file-row .area, .file-row .extension { display: none; }
  .release-bar { grid-template-columns: 1fr; gap: 10px; padding: 12px; }
  .release-bar > div:first-child { display: none; }
  .shell { padding-bottom: 180px; }
}

.release-status { grid-column: 1 / -1; margin: 0; overflow-wrap: anywhere; }
