:root {
  color-scheme: dark;
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.09);
  --panel-strong: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f7fbff;
  --muted: #a8b3c7;
  --blue: #65d4ff;
  --green: #75f0b2;
  --pink: #ff86c8;
  --danger: #ff6d7a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at 12% 14%, rgba(101, 212, 255, 0.22), transparent 32rem),
    radial-gradient(circle at 88% 8%, rgba(255, 134, 200, 0.2), transparent 26rem),
    linear-gradient(135deg, #0b1020 0%, #11182a 44%, #10131c 100%);
}

button,
input,
a {
  font: inherit;
}

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

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

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

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

h1 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: clamp(34px, 6vw, 72px);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.subtitle {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
}

.status-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  color: var(--muted);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px var(--green);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr);
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.drop-panel {
  padding: 18px;
}

.drop-zone {
  position: relative;
  display: grid;
  min-height: 340px;
  place-items: center;
  align-content: center;
  padding: 28px;
  border: 1px dashed rgba(255, 255, 255, 0.34);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(101, 212, 255, 0.12), rgba(117, 240, 178, 0.05)),
    rgba(255, 255, 255, 0.05);
  text-align: center;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.drop-zone.active {
  transform: translateY(-2px);
  border-color: var(--green);
  background:
    linear-gradient(135deg, rgba(117, 240, 178, 0.18), rgba(101, 212, 255, 0.12)),
    rgba(255, 255, 255, 0.09);
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: grid;
  width: 76px;
  height: 76px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #06111b;
  font-size: 40px;
  font-weight: 900;
}

.drop-zone p {
  color: var(--muted);
}

.primary,
.ghost,
.install,
.preview,
.qr-button,
.note-save,
.cert-button,
.danger,
.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
}

.device-card,
.cert-card,
.qr-card {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.device-card span,
.cert-card span,
.qr-card span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.device-card strong,
.cert-card strong,
.qr-card strong {
  display: block;
  font-size: 18px;
}

.qr-card {
  justify-items: stretch;
}

.qr-box,
.qr-preview {
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
}

.qr-box {
  width: fit-content;
  max-width: 100%;
}

.qr-svg {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.qr-error {
  max-width: 210px;
  color: #6a0b12;
  font-size: 13px;
  text-align: center;
}

.cert-card {
  display: none;
  background: linear-gradient(135deg, rgba(117, 240, 178, 0.13), rgba(101, 212, 255, 0.08));
}

.cert-card.show {
  display: grid;
}

.cert-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.cert-button {
  min-height: 52px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #06111b;
  font-size: 17px;
  font-weight: 900;
}

.cert-steps {
  padding-top: 2px;
}

.primary {
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #05111d;
  font-weight: 800;
}

.ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.danger {
  background: rgba(255, 109, 122, 0.13);
  color: #ffd7dc;
}

.install {
  min-height: 52px;
  padding: 0 20px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #06111b;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 12px 34px rgba(117, 240, 178, 0.2);
}

.install.apk-install {
  background: linear-gradient(135deg, #a8ff78, #78ffd6);
}

.download {
  background: rgba(101, 212, 255, 0.16);
  color: #d9f6ff;
}

.preview {
  background: rgba(255, 255, 255, 0.11);
  color: #eef5ff;
}

.qr-button,
.note-save {
  border: 1px solid var(--line);
  background: rgba(117, 240, 178, 0.14);
  color: #d6ffe9;
  font-weight: 800;
}

.qr-hover-wrap {
  position: relative;
  display: inline-flex;
  width: 100%;
  min-width: 0;
}

.qr-hover-wrap .qr-button {
  width: 100%;
}

.qr-hover-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 12;
  display: grid;
  width: 224px;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.34);
  color: #101827;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px) scale(0.98);
  transform-origin: bottom right;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.qr-hover-wrap:hover .qr-hover-panel,
.qr-hover-wrap:focus-within .qr-hover-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.qr-hover-box {
  display: grid;
  place-items: center;
}

.qr-hover-label {
  color: #101827;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.note-save:disabled {
  cursor: wait;
  opacity: 0.72;
}

.queue {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.task {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  color: var(--muted);
  font-size: 13px;
}

.bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.side-panel {
  padding: 18px;
}

.section-head,
.files-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.url-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.url-chip {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  word-break: break-all;
}

.hint {
  margin-top: 14px;
  padding: 13px;
  border-radius: 14px;
  background: rgba(117, 240, 178, 0.1);
  color: #c7f9df;
  font-size: 13px;
  line-height: 1.5;
}

.files-panel {
  grid-column: 1 / -1;
  padding: 18px;
}

.files-toolbar h2 {
  margin-bottom: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.search,
.date-control {
  width: min(320px, 100%);
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.date-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: 168px;
  cursor: pointer;
}

.date-control span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.date-input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  color-scheme: dark;
}

.date-input::-webkit-calendar-picker-indicator {
  width: 20px;
  height: 20px;
  cursor: pointer;
  opacity: 0.9;
  filter: invert(1);
}

.search::placeholder {
  color: rgba(168, 179, 199, 0.8);
}

.files {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.file-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
}

.file-type {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 134, 200, 0.9), rgba(101, 212, 255, 0.92));
  color: #06111b;
  font-size: 13px;
  font-weight: 900;
}

.file-main {
  min-width: 0;
}

.file-main h3 {
  overflow: hidden;
  margin-bottom: 5px;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-main p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.file-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.file-details span {
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #dbe7ff;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.file-details .note-chip {
  border-color: rgba(117, 240, 178, 0.3);
  background: rgba(117, 240, 178, 0.1);
  color: #d8ffe9;
}

.file-details .warn-chip {
  border-color: rgba(255, 109, 122, 0.34);
  background: rgba(255, 109, 122, 0.12);
  color: #ffd7dc;
}

.file-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  gap: 8px;
}

.file-note {
  display: grid;
  grid-column: 2 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.note-input {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  resize: vertical;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.note-input::placeholder {
  color: rgba(168, 179, 199, 0.82);
}

.empty {
  display: none;
  margin-top: 16px;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.empty.show {
  display: block;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.modal-panel {
  position: relative;
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #111827;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.modal-head h2 {
  overflow-wrap: anywhere;
}

.qr-target {
  max-height: 90px;
  margin-bottom: 0;
  padding: 10px;
  overflow: auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 18px, 1180px);
    padding: 18px 0 28px;
  }

  h1 {
    font-size: 38px;
    line-height: 1;
  }

  .subtitle {
    font-size: 15px;
  }

  .panel {
    border-radius: 18px;
  }

  .drop-panel,
  .side-panel,
  .files-panel {
    padding: 13px;
  }

  .hero,
  .section-head,
  .files-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    min-height: 248px;
    padding: 22px 16px;
  }

  .drop-icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    font-size: 32px;
  }

  .file-card {
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
  }

  .file-main h3 {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .file-note {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }

  .file-actions {
    grid-column: 1 / -1;
  }

  .download,
  .preview,
  .install,
  .cert-button,
  .qr-hover-wrap,
  .danger {
    flex: 1;
  }

  .file-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .file-actions .install {
    grid-column: 1 / -1;
  }

  .qr-hover-panel {
    display: none;
  }

  .filters {
    justify-content: stretch;
  }

  .search,
  .date-control,
  .filters .ghost {
    width: 100%;
  }

  .date-input {
    flex: 1;
  }

  .modal-panel {
    width: min(100%, 380px);
    max-height: calc(100vh - 32px);
    overflow: auto;
  }

  .qr-preview .qr-svg {
    width: min(320px, 82vw);
    height: auto;
  }
}
