:root {
  color-scheme: light;
  --bg: #eef4f7;
  --ink: #17202a;
  --muted: #65758b;
  --line: #d9e2ec;
  --line-strong: #c8d5e2;
  --panel: #ffffff;
  --panel-soft: #f8fbfd;
  --sidebar: #101820;
  --sidebar-soft: #172331;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #e7f7f4;
  --blue: #2563eb;
  --danger: #b42318;
  --danger-bg: #fee4e2;
  --shadow: 0 18px 50px rgba(30, 41, 59, 0.1);
  --shadow-soft: 0 8px 24px rgba(30, 41, 59, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #e6f2f1 0, #eef4f7 300px, #eef4f7 100%);
  color: var(--ink);
  font-family: Inter, Arial, "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 3000;
  min-width: 140px;
  max-width: min(320px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.4;
}

.toast.success {
  border-color: #9dd8cf;
  background: #ecfdf9;
  color: var(--accent-strong);
}

.toast.error {
  border-color: #f3b5ad;
  background: #fff1f0;
  color: var(--danger);
}

.shell {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 460px);
  align-items: center;
  gap: 56px;
  width: min(1080px, calc(100vw - 40px));
  margin: 0 auto;
}

.login-copy h1 {
  margin: 0 0 16px;
  font-size: 56px;
  line-height: 1;
}

.login-copy p:not(.eyebrow) {
  width: min(520px, 100%);
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.login-card,
.panel,
.app-card,
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.login-card {
  display: grid;
  gap: 18px;
  padding: 30px;
}

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px;
  overflow: auto;
  color: #e5edf5;
  background: linear-gradient(180deg, #0f1a23 0%, #121820 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
}

.version-badge {
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 5px 9px;
  color: #9fb0c4;
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 6px;
  color: #20b2a6;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  border-radius: 8px;
  padding: 0 16px;
  color: #cbd5e1;
  background: transparent;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-upload-badge {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  margin-left: auto;
  border-radius: 999px;
  color: #063b35;
  background: #b7f7df;
  font-size: 12px;
  font-weight: 900;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: var(--sidebar-soft);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.account-box {
  margin-top: auto;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.account-box strong,
.account-box span {
  display: block;
}

.account-box span {
  margin-top: 4px;
  color: #9fb0c4;
  font-size: 13px;
}

.content {
  min-width: 0;
  width: min(1240px, 100%);
  padding: 30px;
}

.content-header,
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

h2 {
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.1;
}

h3 {
  margin-bottom: 16px;
  font-size: 18px;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat {
  min-height: 96px;
  display: grid;
  align-content: center;
  padding: 18px;
  box-shadow: none;
}

.stat span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  font-size: 24px;
  line-height: 1.15;
}

.stat.warning {
  border-color: #fedf89;
  background: #fffbeb;
}

.insight-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 18px;
}

.insight-bar span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: #475569;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.insight-bar strong {
  color: var(--ink);
}

.panel {
  padding: 22px;
  box-shadow: none;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 160px;
  gap: 12px;
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 16px;
}

.wide {
  grid-column: 1 / -1;
}

.narrow {
  width: min(520px, 100%);
}

label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.field-hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

#apkSelectionHint {
  display: block;
  border: 1px dashed #b7c4d3;
  border-radius: 8px;
  padding: 10px 12px;
  color: #334155;
  background: #f8fbfd;
  line-height: 1.5;
}

#apkSelectionHint strong {
  color: var(--accent);
}

#apkSelectionHint.error {
  border-color: #fecdca;
  color: var(--danger);
  background: #fffbfa;
}

#apkSelectionHint.error strong {
  color: var(--danger);
}

#apkSelectionHint span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.apk-batch-fields {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfd;
}

.apk-batch-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.apk-batch-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.apk-batch-list {
  display: grid;
  gap: 10px;
}

.apk-batch-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.9fr) minmax(180px, 0.9fr) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.apk-batch-remove {
  min-height: 44px;
  padding: 9px 14px;
}

.apk-batch-file {
  min-width: 0;
}

.apk-batch-file strong,
.apk-batch-file span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apk-batch-file span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

textarea {
  min-height: 108px;
  line-height: 1.55;
  resize: vertical;
}

input[type="file"] {
  padding: 8px 10px;
}

.expiry-control {
  display: grid;
  gap: 8px;
}

.expiry-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.expiry-presets button {
  min-height: 38px;
  border: 1px solid var(--line);
  color: #334155;
  background: #f8fbfd;
  font-size: 13px;
}

.expiry-presets button:hover,
.expiry-presets button.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 118, 110, 0.16);
}

button,
.app-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

button:hover,
.app-actions a:hover {
  background: var(--accent-strong);
}

button.ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

button.ghost:hover {
  background: #f8fafc;
}

button.danger {
  color: var(--danger);
  background: var(--danger-bg);
}

button.danger:hover {
  background: #fecdca;
}

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

.message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.message.error,
.error {
  color: var(--danger);
}

.upload-queue {
  display: grid;
  gap: 10px;
}

.upload-task-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.upload-task-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.upload-task-header strong,
.upload-task-header span {
  display: block;
}

.upload-task-header strong {
  margin-bottom: 4px;
  font-size: 16px;
}

.upload-task-header span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.upload-task-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.upload-task-summary span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: #334155;
  background: var(--panel-soft);
  font-weight: 800;
}

.upload-task-list {
  display: grid;
  gap: 10px;
}

.upload-task {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

#uploadForm {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.upload-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.field-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

#uploadForm > .wide,
#uploadForm > button[type="submit"],
#uploadStatus,
#uploadQueue {
  width: 100%;
}

#uploadForm > button[type="submit"] {
  width: min(520px, 100%);
  margin-top: 8px;
}

#uploadStatus {
  margin-top: 12px;
}

#uploadQueue {
  margin-top: 12px;
}

.upload-task-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.upload-task-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.upload-task-actions button {
  min-height: 36px;
  padding: 8px 12px;
  white-space: nowrap;
}

.upload-task strong,
.upload-task span,
.upload-task a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-task span {
  color: var(--muted);
  font-size: 13px;
}

.upload-task-file {
  color: #7b8794;
  font-size: 12px;
}

.upload-task.success {
  border-color: #abefc6;
  background: #f6fef9;
}

.upload-task.failed,
.upload-task.cancelled {
  border-color: #fecdca;
  background: #fffbfa;
}

.download-link-box {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfd;
}

.download-link-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.download-link-header span,
.link-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.link-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.55fr) minmax(170px, 0.65fr) auto;
  gap: 8px;
  align-items: center;
}

.link-form input,
.link-form button {
  min-height: 38px;
  font-size: 13px;
}

.download-link-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.download-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.download-link-row strong,
.download-link-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-link-row strong {
  max-width: 100%;
  font-size: 13px;
}

.download-link-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.link-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.link-actions a,
.link-actions button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.upload-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5edf5;
}

.upload-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #12b981, #0f766e);
}

.muted {
  color: var(--muted);
}

.app-list {
  display: grid;
  gap: 14px;
}

.app-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px;
  box-shadow: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.app-card:hover {
  border-color: #b7c7d7;
  transform: translateY(-1px);
}

.app-main {
  min-width: 0;
  display: flex;
  gap: 16px;
}

.app-icon {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  overflow: hidden;
  border-radius: 8px;
  background: #e6f4f1;
}

.app-icon img,
.icon-fallback {
  width: 100%;
  height: 100%;
}

.app-icon img {
  object-fit: cover;
}

.icon-fallback {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 28px;
  font-weight: 900;
}

.app-info {
  min-width: 0;
}

.app-info h3 {
  margin-bottom: 8px;
}

.app-info h3 span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.app-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 13px;
}

.title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.ok-badge {
  color: #067647;
  background: #dcfae6;
}

.danger-badge {
  color: #b42318;
  background: #fee4e2;
}

.info-badge {
  color: #175cd3;
  background: #dbeafe;
}

.expired-text {
  color: var(--danger);
  font-weight: 800;
}

.short-url {
  width: min(520px, 100%);
  margin-top: 10px;
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #1d4ed8;
  background: #f8fafc;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.totp-box {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.totp-box img {
  width: 180px;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.totp-box strong {
  word-break: break-all;
}

.totp-actions,
.totp-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.totp-inline button {
  min-height: 44px;
}

.app-actions {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  justify-content: flex-end;
  gap: 8px;
}

.app-actions button,
.app-actions a {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.edit-slot {
  grid-column: 1 / -1;
}

.edit-form {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.empty {
  padding: 42px;
  border: 1px dashed #b7c4d3;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.split {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.landing-builder {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(420px, 1fr);
  gap: 20px;
  align-items: start;
}

#landingForm {
  align-self: start;
  align-items: start;
}

#landingForm.form-grid {
  grid-template-columns: 1fr;
}

#landingForm .wide {
  grid-column: auto;
}

.user-list {
  display: grid;
  gap: 10px;
}

.landing-list {
  display: grid;
  gap: 12px;
}

.landing-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.landing-row:hover,
.user-row:hover,
.log-row:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.landing-thumb {
  width: 104px;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f8;
  color: var(--muted);
  font-weight: 900;
}

.landing-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing-row strong,
.landing-row span,
.landing-row code {
  display: block;
}

.landing-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.landing-row code {
  max-width: 100%;
  margin-top: 8px;
  overflow: hidden;
  color: #1d4ed8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-empty {
  box-shadow: none;
}

.cover-preview {
  display: grid;
  gap: 8px;
  align-content: start;
  max-height: 360px;
  overflow: auto;
}

.cover-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cover-preview-item {
  display: grid;
  gap: 6px;
  cursor: grab;
}

.cover-preview-item:active {
  cursor: grabbing;
}

.cover-preview img {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 220px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f8;
}

.cover-preview span,
.cover-order {
  color: var(--muted);
  font-size: 13px;
}

.cover-order {
  font-weight: 900;
}

.extra-text-list {
  display: grid;
  gap: 10px;
}

.extra-text-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.extra-text-row button {
  min-width: 72px;
  margin-top: 0;
}

.landing-live-preview {
  margin-bottom: 22px;
  display: grid;
  justify-items: center;
}

.landing-builder > .panel:last-child {
  position: sticky;
  top: 24px;
}

.preview-frame {
  width: min(390px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 12px;
  background: #101820;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.preview-canvas {
  position: relative;
  min-height: 560px;
  max-height: 720px;
  overflow: hidden;
  overflow-y: auto;
  color: var(--muted);
  background: #eef3f8;
  font-weight: 800;
  border-radius: 18px;
  touch-action: none;
}

.preview-bg {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  height: auto;
  object-fit: cover;
}

.preview-empty {
  width: 100%;
  aspect-ratio: 9 / 16;
  display: grid;
  place-items: center;
}

.preview-drag {
  position: absolute;
  max-width: 78%;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.preview-drag:active {
  cursor: grabbing;
}

.preview-title {
  margin: 0;
  color: #0f172a;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.preview-description {
  margin: 0;
  color: #334155;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
  border-radius: 8px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.42);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.preview-download {
  min-width: 180px;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 28px;
  color: #fff;
  background: linear-gradient(135deg, #18c79a 0%, #0f8f83 48%, #0b5f59 100%);
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.34);
  text-decoration: none;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0;
}

.preview-help {
  width: min(360px, 100%);
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.user-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
}

.user-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--sidebar);
  font-weight: 900;
}

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

.user-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.user-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-status {
  border-radius: 999px;
  padding: 6px 10px;
  color: #067647;
  background: #dcfae6;
  font-size: 12px;
  font-weight: 900;
}

.user-row span {
  display: inline-flex;
  color: var(--muted);
  font-size: 13px;
}

.log-list {
  display: grid;
  gap: 8px;
}

.log-policy {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  border: 1px solid #b7c4d3;
  border-radius: 8px;
  padding: 12px 14px;
  background: #f8fbfd;
}

.log-policy span {
  color: var(--muted);
  font-size: 13px;
}

.log-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(180px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  font-size: 12px;
}

.clean-log {
  grid-template-columns: minmax(170px, 0.65fr) minmax(120px, 0.35fr) minmax(260px, 1fr);
}

.log-action strong,
.log-actor strong,
.log-detail strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.log-row code {
  overflow: hidden;
  color: #475569;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.log-toolbar > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.log-toolbar button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.page-indicator {
  color: var(--ink);
  font-weight: 800;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.modal-panel {
  position: relative;
  width: min(420px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-panel img {
  width: min(260px, 70vw);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.modal-close {
  justify-self: end;
}

.landing-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 12%, rgba(32, 178, 166, 0.18), transparent 34%),
    linear-gradient(135deg, #eef7f5 0%, #f8fafc 46%, #edf3f8 100%);
}

.landing-shell {
  width: min(1120px, calc(100vw - 32px));
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 20px;
  margin: 0 auto;
  padding: 42px 0;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: stretch;
}

.landing-copy,
.landing-panel,
.landing-notes {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.landing-copy {
  display: grid;
  align-content: center;
  padding: 48px;
}

.landing-status {
  width: max-content;
  margin-bottom: 18px;
  border-radius: 999px;
  padding: 8px 12px;
  color: #067647;
  background: #dcfae6;
  font-size: 13px;
  font-weight: 900;
}

.landing-copy h1 {
  margin-bottom: 16px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.02;
}

.landing-subtitle {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.landing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 28px;
}

.landing-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: #334155;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.download-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 22px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  font-weight: 900;
}

.download-button:hover {
  background: var(--accent-strong);
}

.landing-panel {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
}

.landing-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--sidebar);
  font-size: 34px;
  font-weight: 900;
}

.landing-qr {
  width: 230px;
  height: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.landing-cover {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f8;
}

.landing-qr-row {
  width: 100%;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-align: left;
}

.small-qr {
  width: 82px;
  height: 82px;
}

.landing-panel p {
  margin: 0;
  color: var(--muted);
}

.landing-panel code {
  max-width: 100%;
  overflow: hidden;
  color: #1d4ed8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.landing-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  box-shadow: none;
}

.landing-notes div {
  display: grid;
  gap: 6px;
}

.landing-notes span {
  color: var(--muted);
}

.published-phone {
  width: min(430px, 100%);
  margin: 0 auto;
  border-radius: 34px;
  padding: 12px;
  background: #101820;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

.published-canvas {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  border-radius: 24px;
  background: #eef3f8;
}

.published-bg {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  height: auto;
  object-fit: cover;
}

.published-empty {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.published-title,
.published-description,
.published-download {
  position: absolute;
  max-width: 78%;
}

.published-title {
  margin: 0;
  color: #0f172a;
  font-size: 30px;
  line-height: 1.08;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.published-description {
  margin: 0;
  color: #334155;
  font-size: 16px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
  border-radius: 10px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.46);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.published-download {
  min-width: 190px;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0 30px;
  color: #fff;
  background: linear-gradient(135deg, #18c79a 0%, #0f8f83 48%, #0b5f59 100%);
  box-shadow: 0 18px 38px rgba(15, 118, 110, 0.36);
  text-decoration: none;
  font-size: 18px;
  font-weight: 900;
}

@media (max-width: 960px) {
  .login-view,
  .dashboard,
  .landing-hero,
  .landing-builder,
  .landing-notes,
  .landing-row,
  .split,
  .stats-row,
  .filter-bar,
  .form-grid,
  .log-row,
  .app-card {
    grid-template-columns: 1fr;
  }

  .login-view {
    align-content: center;
    gap: 28px;
    padding: 24px 0;
  }

  .login-copy h1 {
    font-size: 42px;
  }

  .sidebar {
    position: static;
    min-height: auto;
    height: auto;
    gap: 18px;
  }

  .brand {
    justify-content: space-between;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-box {
    margin-top: 0;
  }

  .content {
    width: 100%;
    padding: 20px;
  }

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

  .app-actions {
    justify-content: flex-start;
  }

  .link-form,
  .download-link-row,
  .apk-batch-row {
    grid-template-columns: 1fr;
  }

  .link-actions {
    justify-content: flex-start;
  }

  .landing-builder > .panel:last-child {
    position: static;
  }
}

@media (max-width: 560px) {
  .login-view {
    width: min(100vw - 24px, 1080px);
  }

  .login-card,
  .panel,
  .app-card {
    padding: 16px;
  }

  .app-main {
    flex-direction: column;
  }

  .content-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .content {
    padding: 16px 12px 24px;
  }

  .sidebar {
    padding: 18px 14px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-actions,
  .header-actions button,
  .filter-bar,
  .app-actions,
  .app-actions button,
  .app-actions a,
  .upload-task-header,
  .upload-task-summary,
  .upload-task,
  .upload-task-actions,
  .user-row,
  .user-actions,
  .landing-row,
  .log-toolbar,
  .log-toolbar > div {
    width: 100%;
  }

  .upload-task,
  .user-row,
  .landing-row,
  .extra-text-row {
    grid-template-columns: 1fr;
  }

  .upload-task-actions,
  .upload-task-summary,
  .user-actions,
  .log-toolbar,
  .log-toolbar > div {
    justify-content: flex-start;
  }

  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-frame {
    width: 100%;
    border-radius: 22px;
    padding: 10px;
  }

  .preview-canvas {
    min-height: 500px;
  }

  h2 {
    font-size: 28px;
  }
}
