:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: #ecf4ee;
  background: #0d1712;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  padding-bottom: 2.75rem;
  background-image:
    radial-gradient(ellipse at center, transparent 15%, rgb(5 9 6 / 45%) 55%, rgb(3 6 4 / 95%) 100%),
    linear-gradient(rgb(7 18 11 / 38%), rgb(7 18 11 / 38%)),
    url("assets/mine-blocks-dirt.png");
  background-position: center, center, top left;
  background-size: cover, cover, 256px 256px;
  background-attachment: fixed;
}

button,
input {
  font: inherit;
}

.shell {
  display: flex;
  flex-direction: column;
  width: min(92rem, calc(100% - 2rem));
  height: calc(100dvh - 2.75rem);
  min-height: calc(100vh - 2.75rem);
  margin: 0 auto;
  padding: 1.25rem 0 0.5rem;
}

.site-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0.35rem 1rem;
  border-top: 1px solid #294234;
  color: #9cac9f;
  background: rgb(13 23 18 / 96%);
  font-size: 0.68rem;
  line-height: 1.3;
  text-align: center;
  backdrop-filter: blur(0.35rem);
}

.site-footer a {
  color: #76d497;
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  color: #a9efbf;
  text-decoration: underline;
}

.site-footer a:focus-visible {
  outline: 2px solid #ecf4ee;
  outline-offset: 2px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  max-width: 58rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.25rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.eyebrow {
  margin-bottom: 0.25rem;
  color: #76d497;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.intro,
.status,
.support-message,
.manifest-note,
.actions-note {
  color: #9cac9f;
  font-size: 0.82rem;
  line-height: 1.45;
}

.action-heading-tools,
.select-all {
  display: flex;
  align-items: center;
}

.action-heading-tools {
  gap: 0.8rem;
}

.select-all {
  gap: 0.35rem;
  color: #b8c4bb;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.select-all input {
  width: 0.9rem;
  height: 0.9rem;
  margin: 0;
  accent-color: #83e3a4;
}

.intro {
  margin-bottom: 0;
}

.intro code,
.manifest-note code {
  color: #cce8d5;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 0.55rem;
}

.pack-picker {
  display: grid;
  gap: 0.2rem;
  color: #9cac9f;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pack-picker select {
  padding: 0.4rem 1.8rem 0.4rem 0.55rem;
  border: 1px solid #496052;
  border-radius: 0.45rem;
  color: #d8e4dc;
  background: #1a2b21;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: none;
  cursor: pointer;
}

.choose-button {
  flex: 0 0 auto;
  width: auto;
  padding: 0.42rem 0.65rem;
  border: 1px solid #5fb77c;
  border-radius: 0.45rem;
  color: #c9f5d7;
  background: #173522;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}

.choose-button:hover {
  background: #214a30;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid #ecf4ee;
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2rem;
  margin-top: 0.8rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid #22382b;
  border-radius: 0.45rem;
  background: rgb(16 29 22 / 70%);
}

.status-line p {
  margin-bottom: 0;
}

.status.error {
  color: #ffaaa1;
}

.support-message {
  text-align: right;
}

.manifest-note {
  margin: 0.45rem 0 0;
}

.workspace {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1.25fr) minmax(22rem, 0.75fr);
  align-items: stretch;
  gap: 0.75rem;
  min-height: 0;
  margin-top: 0.75rem;
}

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  max-height: none;
  overflow: hidden;
  border: 1px solid #294234;
  border-radius: 0.6rem;
  background: #101d16;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #294234;
  background: #14251b;
}

.panel-count {
  flex: 0 0 auto;
  margin-bottom: 0;
  color: #9cac9f;
  font-size: 0.75rem;
  font-weight: 700;
}

.table-wrap,
.action-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

th,
td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #21362a;
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #9cac9f;
  background: #17291e;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tree-toggle {
  width: 100%;
  padding: 0.08rem 0.15rem 0.08rem calc(0.15rem + var(--depth) * 0.9rem);
  border: 0;
  border-radius: 0.2rem;
  color: #cce8d5;
  background: transparent;
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.tree-toggle:hover {
  color: #ecf4ee;
  background: #243a2d;
}

.file-path {
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

.tree-file {
  padding-left: calc(0.5rem + var(--depth) * 0.9rem);
}

.group-row td {
  background: #132219;
}

.group-toml td {
  background: #17231c;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.badge,
.action-kind {
  display: inline-flex;
  padding: 0.12rem 0.35rem;
  border: 1px solid #3a5142;
  border-radius: 999px;
  color: #b8c4bb;
  background: #19271f;
  font-size: 0.62rem;
  font-weight: 750;
  white-space: nowrap;
}

.badge-current {
  border-color: #3f8d5a;
  color: #a9efbf;
  background: #173522;
}

.badge-hash-mismatch {
  border-color: #ae645d;
  color: #ffc0b9;
  background: #3b211e;
}

.badge-not-in-manifest {
  border-color: #9b7c3d;
  color: #f6d790;
  background: #332a18;
}

.badge-not-a-mod,
.badge-unavailable {
  color: #94a299;
}

.actions-note {
  margin: 0;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid #21362a;
}

.action-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.action {
  border-bottom: 1px solid #21362a;
}

.action:last-child {
  border-bottom: 0;
}

.action label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.55rem;
  padding: 0.48rem 0.65rem;
  cursor: pointer;
}

.action label:hover {
  background: #14251b;
}

.action input {
  width: 0.9rem;
  height: 0.9rem;
  margin: 0.12rem 0 0;
  accent-color: #83e3a4;
}

.action-body {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.action-title {
  overflow-wrap: anywhere;
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.action-detail {
  color: #829187;
  font-size: 0.68rem;
  line-height: 1.3;
}

.action-kind {
  border: 0;
  color: #a9efbf;
  background: #173522;
  font-size: 0.56rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.action-replace .action-kind {
  color: #ffc0b9;
  background: #3b211e;
}

.action-disable .action-kind {
  color: #f6d790;
  background: #332a18;
}

.action-enable .action-kind {
  color: #c5d2ff;
  background: #202a48;
}

.badge-disabled {
  border-color: #3a4740;
  color: #7f8b83;
  background: #151d18;
}

.no-actions {
  padding: 0.75rem;
  color: #a9efbf;
  font-size: 0.78rem;
}

.actions-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid #294234;
  background: #14251b;
}

.apply-button,
.guide-button,
.download-button,
.danger-button {
  padding: 0.42rem 0.7rem;
  border: 1px solid #5fb77c;
  border-radius: 0.45rem;
  color: #c9f5d7;
  background: #173522;
  font-size: 0.75rem;
  font-weight: 750;
  cursor: pointer;
}

.actions-footer .danger-button {
  margin-right: auto;
}

.danger-button {
  border-color: #ae645d;
  color: #ffc0b9;
  background: #3b211e;
}

.danger-button:hover:not(:disabled) {
  background: #512923;
}

.danger-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.apply-button:hover:not(:disabled),
.guide-button:hover:not(:disabled),
.download-button:hover:not(:disabled) {
  background: #214a30;
}

.apply-button:disabled,
.guide-button:disabled,
.download-button:disabled {
  cursor: not-allowed;
}

.guide-button {
  color: #d8e4dc;
  border-color: #496052;
  background: #1a2b21;
}

.guide-modal {
  width: min(54rem, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  overflow: hidden;
  border: 1px solid #4b7259;
  border-radius: 0.7rem;
  color: #ecf4ee;
  background: #101d16;
}

.welcome-modal {
  width: min(68rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  overflow: auto;
  border: 1px solid #5f8f6c;
  border-radius: 0.85rem;
  color: #ecf4ee;
  background: #101d16;
  box-shadow: 0 2rem 7rem rgb(0 0 0 / 62%);
}

.welcome-close {
  position: absolute;
  top: 0.65rem;
  right: 0.7rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border: 1px solid #496052;
  border-radius: 50%;
  color: #b9c7bd;
  background: rgb(16 29 22 / 82%);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.welcome-close:hover {
  border-color: #76d497;
  color: #fff;
  background: #1d3626;
}

.welcome-modal::backdrop {
  background: rgb(2 7 4 / 82%);
  backdrop-filter: blur(0.35rem);
}

body.dragging .welcome-modal {
  border-color: #83e3a4;
  box-shadow: 0 0 0 0.25rem rgb(131 227 164 / 20%), 0 2rem 7rem rgb(0 0 0 / 62%);
}

body.dragging .welcome-footer {
  background: #1a3825;
}

.welcome-hero,
.welcome-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.15rem 1.25rem;
  background: #14251b;
}

.welcome-hero {
  padding-right: 3.4rem;
  border-bottom: 1px solid #365640;
}

.welcome-hero h2 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.welcome-summary {
  max-width: 48rem;
  margin-bottom: 0;
  color: #b8c7bd;
  font-size: 0.9rem;
  line-height: 1.55;
}

.welcome-local-badge {
  flex: 0 0 auto;
  padding: 0.35rem 0.6rem;
  border: 1px solid #4d8b60;
  border-radius: 999px;
  color: #b8f4ca;
  background: #173522;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.welcome-content {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.welcome-section,
.welcome-safety {
  min-width: 0;
}

.welcome-section h3,
.welcome-safety h3 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
}

.welcome-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.welcome-steps li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.6rem;
  padding: 0.7rem;
  border: 1px solid #294234;
  border-radius: 0.55rem;
  background: #0d1912;
}

.welcome-step-number {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border: 1px solid #4d8b60;
  border-radius: 50%;
  color: #b8f4ca;
  background: #173522;
  font-size: 0.7rem;
  font-weight: 800;
}

.welcome-steps strong,
.welcome-browser-note strong {
  font-size: 0.78rem;
}

.welcome-steps p,
.welcome-safety li,
.welcome-browser-note p,
.welcome-footer p {
  color: #9cac9f;
  font-size: 0.74rem;
  line-height: 1.45;
}

.welcome-steps p,
.welcome-browser-note p,
.welcome-footer p {
  margin: 0.2rem 0 0;
}

.welcome-steps code {
  color: #c9f5d7;
}

.welcome-safety {
  padding: 0.8rem;
  border: 1px solid #365640;
  border-radius: 0.55rem;
  background: #14251b;
}

.welcome-safety ul {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.15rem;
}

.welcome-safety li::marker {
  color: #76d497;
}

.welcome-browser-note {
  margin-top: 0.8rem;
  padding: 0.65rem;
  border: 1px solid #4b5d50;
  border-radius: 0.45rem;
  background: #101d16;
}

.welcome-footer {
  border-top: 1px solid #365640;
}

.welcome-footer p {
  margin: 0;
}

.welcome-start-button {
  flex: 0 0 auto;
  padding: 0.6rem 0.9rem;
  border: 1px solid #70cd8e;
  border-radius: 0.5rem;
  color: #092011;
  background: #83e3a4;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.welcome-start-button:hover {
  background: #a0edb9;
}

.apply-modal {
  width: min(46rem, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  overflow: hidden;
  border: 1px solid #5fb77c;
  border-radius: 0.7rem;
  color: #ecf4ee;
  background: #101d16;
}

.guide-modal::backdrop,
.apply-modal::backdrop {
  background: rgb(4 10 6 / 75%);
}

.guide-heading,
.guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.8rem;
  background: #14251b;
}

.guide-heading {
  border-bottom: 1px solid #294234;
}

.guide-footer {
  justify-content: flex-end;
  border-top: 1px solid #294234;
}

.modal-close {
  padding: 0.1rem 0.45rem;
  border: 0;
  color: #aebdb3;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

.secondary-button {
  padding: 0.42rem 0.7rem;
  border: 1px solid #496052;
  border-radius: 0.45rem;
  color: #d8e4dc;
  background: #1a2b21;
  font-size: 0.75rem;
  font-weight: 750;
  cursor: pointer;
}

.secondary-button:hover {
  background: #24382b;
}

.apply-content {
  max-height: min(62vh, 36rem);
  padding: 0.9rem;
  overflow: auto;
}

.apply-intro,
.apply-message,
.apply-warning,
.apply-progress-label {
  color: #aebdb3;
  font-size: 0.8rem;
}

.apply-warning {
  margin-top: 0.9rem;
  padding: 0.65rem;
  border: 1px solid #715d2d;
  border-radius: 0.4rem;
  color: #f6d790;
  background: #2b2415;
}

.apply-error {
  color: #ffaaa1;
}

.cleanup-warning {
  margin-top: 0;
}

.cleanup-file-list {
  display: grid;
  gap: 0.3rem;
  max-height: 16rem;
  margin: 0.8rem 0;
  padding-left: 1.4rem;
  overflow: auto;
  color: #d8e4dc;
  font-size: 0.72rem;
}

.cleanup-file-list code {
  overflow-wrap: anywhere;
}

.cleanup-acknowledgement {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem;
  border: 1px solid #715d2d;
  border-radius: 0.4rem;
  color: #f6d790;
  background: #211d13;
  font-size: 0.78rem;
  line-height: 1.4;
  cursor: pointer;
}

.cleanup-acknowledgement input {
  margin-top: 0.15rem;
  accent-color: #ae645d;
}

.apply-operation-list {
  display: grid;
  gap: 0.55rem;
  margin: 0.85rem 0 0;
  padding-left: 1.5rem;
}

.apply-operation-list li {
  padding-left: 0.15rem;
}

.apply-operation-list strong,
.apply-operation-list code {
  display: block;
}

.apply-operation-list strong {
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
}

.apply-operation-list code {
  padding: 0.4rem 0.5rem;
  overflow-wrap: anywhere;
  border: 1px solid #294234;
  border-radius: 0.35rem;
  color: #c9f5d7;
  background: #0b1510;
  font-size: 0.68rem;
}

.apply-loading {
  min-height: 15rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.9rem;
  text-align: center;
}

.apply-loading progress {
  width: min(24rem, 100%);
  accent-color: #5fb77c;
}

.apply-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 0.25rem solid #294234;
  border-top-color: #83e3a4;
  border-radius: 50%;
  animation: apply-spin 750ms linear infinite;
}

@keyframes apply-spin {
  to {
    transform: rotate(1turn);
  }
}

.guide-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.55rem 0.8rem 0;
  border-bottom: 1px solid #294234;
}

.guide-tab {
  margin-bottom: -1px;
  padding: 0.45rem 0.8rem;
  border: 1px solid transparent;
  border-bottom-color: #294234;
  border-radius: 0.4rem 0.4rem 0 0;
  color: #9cac9f;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 750;
  cursor: pointer;
}

.guide-tab[aria-selected="true"] {
  border-color: #294234;
  border-bottom-color: #101d16;
  color: #c9f5d7;
  background: #101d16;
}

.guide-content {
  max-height: min(60vh, 38rem);
  padding: 0.8rem;
  overflow: auto;
}

.guide-intro,
.guide-message {
  margin-bottom: 0.75rem;
  color: #aebdb3;
  font-size: 0.8rem;
}

.guide-error {
  color: #ffaaa1;
}

.guide-permission-warning {
  padding: 0.55rem 0.65rem;
  border: 1px solid #715d2d;
  border-radius: 0.4rem;
  color: #f6d790;
  background: #2b2415;
}

.guide-command-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding-left: 1.5rem;
}

.guide-command-list li {
  padding-left: 0.2rem;
}

.guide-command-list strong,
.guide-command-list code {
  display: block;
}

.guide-command-list strong {
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
}

.guide-command-list code {
  padding: 0.55rem;
  overflow-x: auto;
  border: 1px solid #294234;
  border-radius: 0.35rem;
  color: #d8e4dc;
  background: #0b1510;
  font-size: 0.68rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.drop-overlay {
  position: fixed;
  inset: 0.75rem;
  z-index: 20;
  display: grid;
  place-items: center;
  border: 2px dashed #83e3a4;
  border-radius: 0.8rem;
  color: #d9f8e3;
  background: rgb(9 25 15 / 88%);
  font-size: clamp(1.2rem, 4vw, 2rem);
  font-weight: 800;
  pointer-events: none;
  opacity: 0;
  transition: opacity 100ms ease;
}

body.dragging .drop-overlay {
  opacity: 1;
}

@media (max-width: 58rem) {
  .shell {
    height: auto;
  }

  .workspace {
    flex: none;
    grid-template-columns: 1fr;
  }

  .panel {
    height: auto;
    max-height: min(36rem, calc(100dvh - 8rem));
  }

  .welcome-content,
  .welcome-steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 38rem) {
  body {
    padding-bottom: 4rem;
  }

  .shell {
    width: min(100% - 1rem, 92rem);
    height: auto;
    min-height: calc(100vh - 4rem);
    padding-top: 0.75rem;
  }

  .topbar,
  .status-line {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
  }

  .support-message {
    display: none;
  }

  .action label {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .action-kind {
    grid-column: 2;
    justify-self: start;
  }

  .welcome-hero,
  .welcome-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .welcome-start-button {
    width: 100%;
  }
}
