:root {
  --win-h: 84%;
  --panel: #ece9d8;
  --panel-2: #f3f0e0;
  --border: #7a7971;
  --border-hi: #ffffff;
  --border-lo: #0a0a0a;
  --btn: #ece9d8;
  --accent: #3757d6;
  --accent-2: #2a4494;
  --text: #1a1a1a;
  --shadow: 4px 4px 0 rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, #5b6ee0 0%, #27409b 45%, #0e1a4d 100%);
  overflow: hidden;
}

body {
  display: grid;
  place-items: center;
  user-select: none;
  -webkit-user-select: none;
}

.window {
  width: min(640px, 94vw);  height: var(--win-h);
  min-height: 460px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border-lo);
  outline: 1px solid var(--border-hi);
  outline-offset: -3px;
  box-shadow: var(--shadow);
  animation: pop .18s ease-out;
}

@keyframes pop {
  from { transform: scale(.94) translateY(10px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.titlebar {
  display: flex;
  align-items: center;  justify-content: space-between;
  padding: 5px 6px 5px 10px;
  color: #fff;
  background: linear-gradient(180deg, #0a5fe0, #06368f);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .2px;
}

.title { text-shadow: 0 1px 1px rgba(0,0,0,.4); }

.buttons { display: flex; gap: 2px; }

.win-btn {
  width: 22px; height: 20px;
  border: 1px solid #fff;
  color: #fff;
  background: rgba(255,255,255,.15);
  font-size: 13px; line-height: 1;
  cursor: default;
  opacity: .7;
}
.win-btn[data-close]:hover { background: #c81e1e; opacity: 1; }

/* ---- body layout ---- */
.body { flex: 1; display: flex; min-height: 0; }

.sidebar {
  width: 150px;
  background: linear-gradient(180deg, var(--panel), #d8d5c6);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.logo {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
  background: linear-gradient(180deg, #6b84f0, #23347c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.steps { display: flex; flex-direction: column; gap: 2px; }

.step {
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid transparent;
  color: #3a3a3a;
  display: flex; align-items: center; gap: 7px;
}
.step .dot {
  width: 12px; height: 12px; flex: none;
  border: 1px solid var(--border-lo);
  background: #fff;
  font-size: 9px; line-height: 12px; text-align: center;
}
.step.active {
  background: var(--accent);
  border-color: var(--accent-2);
  color: #fff;
}
.step.active .dot { border-color: #fff; background: #fff; color: var(--accent); font-weight: 700; }
.step.done .dot { background: #5aa02c; border-color: #3d6f1c; color: #fff; }

/* ---- content ---- */
.content {
  flex: 1;
  padding: 26px 26px 18px;
  overflow-y: auto;
  background:
    linear-gradient(rgba(0,0,0,.02), rgba(0,0,0,.02)),
    var(--panel-2);
}

.content h1 {
  margin: 0 0 4px;
  font-size: 22px;
  color: var(--accent-2);
}
.content .sub { margin: 0 0 18px; font-size: 12px; color: #666; }
.content p { font-size: 13px; line-height: 1.5; }
.content .faint { color: #666; font-size: 11px; }

/* ---- widgets ---- */
.field { margin: 16px 0; }
.field label { display: block; font-size: 12px; margin-bottom: 4px; }
.field .pathbox {
  display: flex; gap: 6px; align-items: center;
}
.pathbox input {
  flex: 1;
  font-family: "Consolas", monospace;
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  background: #fff;
}

.radio-list {
  border: 1px solid var(--border);
  background: #fff;
  padding: 6px;
}
.radio-list label {
  display: block; padding: 7px 8px; font-size: 13px;
}
.radio-list label:hover { background: #dbe4f7; }
.radio-list input { margin-right: 8px; }

.check {
  display: block; margin: 10px 0; font-size: 13px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.app-chip {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px;
  font-size: 13px;
  cursor: pointer;
}
.app-chip input { margin: 0; }

.tabs { display: flex; gap: 4px; margin: 8px 0 14px; }
.tab {
  flex: 1;
  padding: 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-bottom: none;
  background: #d8d5c6;
  cursor: pointer;
}
.tab.active {
  background: #fff;
  border-top: 2px solid var(--accent);
  font-weight: 600;
}
.btn.block { display: block; width: 100%; margin: 6px 0; }
.tab-pane { min-height: 150px; }

/* license */
.license {
  border: 1px solid var(--border);
  background: #fff;
  padding: 12px;
  height: 170px;
  overflow: auto;
  font-family: "Consolas", monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #222;
  white-space: pre-wrap;
}

.bone-logo {
  text-align: center;
  margin: 6px 0 20px;
}
.bone-logo .glyph {
  font-size: 58px;
  line-height: 1;
  font-weight: 800;
  color: var(--accent);
  filter: drop-shadow(2px 3px 0 rgba(0,0,0,.25));
}
.bone-logo .name { font-size: 12px; color: #666; letter-spacing: 2px; }

/* progress */
.progress-wrap { text-align: center; }
.progress-label { font-size: 12px; color: #666; margin-bottom: 8px; }
.bar {
  width: 100%;
  height: 20px;
  border: 1px solid var(--border);
  background: #fff;
  position: relative;
}
.bar > div {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(90deg, var(--accent), var(--accent) 8px, var(--accent-2) 8px, var(--accent-2) 16px);
  transition: width .2s linear;
}
.bar .pct {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  color: var(--text);
}
.file-line {
  font-family: "Consolas", monospace;
  font-size: 11px;
  color: #333;
  text-align: left;
  margin: 10px 0 0;
  min-height: 30px;
}

.done-mark { text-align: center; margin: 24px 0; }
.done-mark .glyph { font-size: 46px; color: #5aa02c; font-weight: 800; }

.badge-chip {
  display: inline-block;
  border: 1px solid var(--border-lo);
  background: linear-gradient(180deg, #fff, #dfd9c8);
  padding: 3px 10px;
  font-family: "Consolas", monospace;
  font-size: 12px;
  margin-top: 6px;
}
#dockStatus.ok { color: #2e6b18; font-weight: 600; }
#dlStatus.ok { color: #2e6b18; font-weight: 600; }

.dock-slot {
  border: 2px dashed var(--border);
  background: #fff;
  padding: 18px;
  text-align: center;
  margin: 14px 0;
}
.zip-note {
  background: #fff;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 12px;
  color: #333;
  margin: 12px 0 4px;
}
.dock-slot .slot-label {
  font-family: "Consolas", monospace;
  font-size: 13px;
  color: #555;
}
.dock-slot.ok {
  border-style: solid;
  border-color: #3d6f1c;
  background: #eef7e6;
}
.dock-slot.ok .slot-label { color: #2e6b18; font-weight: 700; }

.boot-screen { text-align: center; padding: 40px 0 24px; }
.boot-screen .boot-glyph { font-size: 64px; font-weight: 800; color: var(--accent); }
.boot-screen .boot-name { font-size: 34px; font-weight: 800; letter-spacing: 3px; margin-top: 6px; }
.boot-screen .boot-credit { font-size: 13px; color: #555; margin-top: 14px; letter-spacing: 1px; }
.boot-caret {
  display: inline-block;
  width: 10px; height: 14px;
  background: var(--text);
  margin-top: 18px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---- footer ---- */
.footbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--border-hi);
  background: var(--panel);
}
.status { font-size: 11px; color: #555; }

.actions { display: flex; gap: 6px; }

.btn {
  min-width: 86px;
  padding: 5px 14px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-top-color: var(--border-hi);
  border-left-color: var(--border-hi);
  background: var(--btn);
  cursor: pointer;
}
.btn:active { border: 1px solid var(--border); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: linear-gradient(180deg, #f7f7f7, #e0e0d6); font-weight: 600; }

.screen { display: none; }
.screen.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

@media (max-width: 520px) {
  .sidebar { width: 110px; }
  .logo { font-size: 20px; }
}
