:root {
  --bg: #f6f6f7;
  --card: #fff;
  --fg: #16181d;
  --dim: #6b7280;
  --line: #e3e4e8;
  --accent: #2563eb;
  --err: #b42318;
  --err-bg: #fef3f2;
  --ok: #1a7f45;
  --ok-bg: #eefaf2;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --card: #171a20;
    --fg: #e8eaed;
    --dim: #9aa1ac;
    --line: #262a32;
    --accent: #5b8cff;
    --err: #ff9d94;
    --err-bg: #2a1614;
    --ok: #5fd39b;
    --ok-bg: #12241b;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 680px; margin: 0 auto; padding: 32px 20px 64px; }
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); margin: 0 0 12px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
a { color: var(--accent); }
small { color: var(--dim); font-weight: 400; }
.sub { color: var(--dim); margin: 4px 0 20px; }
.center { text-align: center; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}
.scroll { overflow-x: auto; }

.head { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.icon { border-radius: 16px; flex: none; background: var(--line); }
.icon.ph { width: 72px; height: 72px; }
.head h1 { margin: 0; }
.head .sub { margin: 2px 0 0; }

label { display: block; font-weight: 500; margin-bottom: 14px; }
label small { margin-left: 4px; }
input[type=password], input[type=number] {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--fg); font: inherit;
}
.grid { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.drop {
  border: 1.5px dashed var(--line); border-radius: 10px; padding: 22px;
  text-align: center; cursor: pointer; color: var(--dim);
  transition: border-color .15s, background .15s, color .15s;
}
.drop input { display: block; margin: 0 auto 8px; }
.drop .picked-name { display: none; font-weight: 600; }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.drop.picked {
  border-style: solid;
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}
.drop.picked .hint { display: none; }
.drop.picked .picked-name { display: block; }

.progress { margin: 14px 0 4px; }
.progress .track {
  height: 8px; border-radius: 999px; background: var(--line); overflow: hidden;
}
.progress .fill {
  height: 100%; width: 0; border-radius: 999px; background: var(--accent);
  transition: width .18s ease-out;
}
.progress small { display: block; margin-top: 6px; text-align: center; }
.progress small.failed { color: var(--err); }
form.uploading .drop { opacity: .6; pointer-events: none; }
form.uploading button.primary { opacity: .7; }

.share { display: flex; gap: 8px; margin-bottom: 4px; }
.share input {
  flex: 1; min-width: 0; padding: 9px 11px; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--dim);
}
.share button {
  flex: none; padding: 9px 14px; font-weight: 600;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--fg);
}
.share button.copied, .row-actions button.copied { color: var(--ok); border-color: var(--ok); }
.row-actions { display: flex; gap: 10px; align-items: baseline; }
.row-actions form { display: inline; }

button { font: inherit; cursor: pointer; }
button.primary {
  width: 100%; padding: 11px; border: 0; border-radius: 9px;
  background: var(--accent); color: #fff; font-weight: 600;
}
button.link { border: 0; background: none; padding: 0; color: var(--accent); }
button.link.danger { color: var(--err); }

.install {
  display: block; text-align: center; text-decoration: none;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 17px;
  padding: 15px; border-radius: 12px; margin-bottom: 6px;
}
.install.disabled { opacity: .45; pointer-events: none; }

.qr { text-align: center; margin: 18px 0 24px; }
.qr img { background: #fff; padding: 8px; border-radius: 10px; width: 200px; height: auto; }
.qr small { display: block; margin-top: 6px; }

.banner { border-radius: 10px; padding: 12px 14px; margin-bottom: 18px; }
.banner.err { background: var(--err-bg); color: var(--err); border: 1px solid currentColor; }

dl { display: grid; grid-template-columns: 108px 1fr; gap: 8px 12px; margin: 0; }
dt { color: var(--dim); }
dd { margin: 0; overflow-wrap: anywhere; }

table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; color: var(--dim); font-weight: 500; }
th, td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid currentColor;
}
.t-ad-hoc { color: #1d7a4c; }
.t-development { color: #2563eb; }
.t-enterprise { color: #8a5a00; }
.t-app-store { color: var(--err); }
@media (prefers-color-scheme: dark) {
  .t-ad-hoc { color: #5fd39b; }
  .t-development { color: #7ea6ff; }
  .t-enterprise { color: #e0b45f; }
}

.notes ul, .links, .udids { margin: 0; padding-left: 18px; }
.notes li + li, .udids li + li { margin-top: 6px; }
.udids { list-style: none; padding: 0; }
.links { list-style: none; padding: 0; overflow-wrap: anywhere; }
.links li + li { margin-top: 6px; }
details summary { cursor: pointer; color: var(--dim); font-size: 14px; }
details[open] summary { margin-bottom: 12px; }
/* App Store Nova — оформление */
body {
  background: #f4f7fb;
  color: #172033;
}

main {
  max-width: 1000px;
  padding: 45px 24px 70px;
}

h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1px;
}

.card {
  background: #fff;
  border: 1px solid #e5eaf2;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 8px 28px rgba(30,50,80,.06);
}

button.primary,
button[type="submit"] {
  background: #2878f0;
  border-radius: 11px;
  padding: 13px 22px;
}

button.primary:hover,
button[type="submit"]:hover {
  background: #1765d1;
}

input {
  border-radius: 10px;
}

table {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}
/* Карточки приложений App Store Nova */
.store-header {
  margin-bottom: 40px;
}

.catalog {
  margin-top: 30px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.app-card {
  background: #fff;
  border: 1px solid #e5eaf2;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 8px 28px rgba(30,50,80,.06);
  transition: transform .2s, box-shadow .2s;
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(30,50,80,.12);
}

.app-icon {
  border-radius: 16px;
  object-fit: cover;
}

.app-info h2 {
  font-size: 19px;
  margin-bottom: 7px;
}

.app-meta,
.app-bundle {
  color: #7b8495;
  font-size: 13px;
}

.app-install {
  display: inline-block;
  background: #2878f0;
  color: #fff;
  padding: 11px 22px;
  border-radius: 11px;
  text-decoration: none;
  font-weight: 700;
}

.app-install:hover {
  background: #1765d1;
}

.store-footer {
  text-align: center;
  color: #8992a2;
  padding: 30px 0;
}
/* Верхняя панель App Store Nova */
.store-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  margin-bottom: 40px;
  background: #fff;
  border: 1px solid #e5eaf2;
  border-radius: 20px;
  box-shadow: 0 8px 28px rgba(30,50,80,.06);
}

.brand-mark {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 17px;
  background: linear-gradient(135deg, #2878f0, #65a5ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.store-header h1 {
  margin: 5px 0;
  font-size: 28px;
}

.store-header .sub {
  color: #7b8495;
  font-size: 14px;
}

.store-header .eyebrow {
  color: #2878f0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
/* App Store Nova — карточки приложений */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.app-card {
  background: #ffffff;
  border: 1px solid #e5eaf2;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 8px 28px rgba(30, 50, 80, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 35px rgba(30, 50, 80, 0.12);
}

.app-icon {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 18px;
}

.app-info h2 {
  margin: 16px 0 8px;
  font-size: 21px;
  font-weight: 750;
  color: #172033;
}

.app-meta,
.app-bundle,
.app-description {
  color: #718096;
  font-size: 13px;
  line-height: 1.6;
}

.app-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.app-install {
  background: #2878f0;
  color: #ffffff;
  border-radius: 12px;
  padding: 11px 22px;
  font-weight: 700;
  text-decoration: none;
}

.app-install:hover {
  background: #1765d1;
}

.app-manage {
  margin-top: 18px;
  border-top: 1px solid #edf0f5;
  padding-top: 12px;
}

@media (max-width: 600px) {
  .app-grid {
    grid-template-columns: 1fr;
  }
}
/* App Store Nova — сетка каталога */
.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.app-card {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.app-card .app-icon {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 18px;
}

.app-card h2 {
  font-size: 20px;
  margin: 14px 0 8px;
}

.app-card .app-install {
  display: inline-block;
  text-align: center;
  min-width: 110px;
}

@media (max-width: 800px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 520px) {
  .app-grid {
    grid-template-columns: 1fr;
  }
}
/* Категории App Store Nova */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
  padding: 0;
  background: transparent;
}

.category-btn {
  border: 1px solid #dce5f2;
  background: #fff;
  color: #26364d;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
}

.category-btn:hover {
  border-color: #2878f0;
  color: #2878f0;
}

.category-btn.active {
  background: #2878f0;
  color: #fff;
  border-color: #2878f0;
}

@media (max-width: 520px) {
  .category-filter {
    gap: 7px;
  }

  .category-btn {
    padding: 9px 14px;
    font-size: 13px;
  }
}
.category-filter {
  background: transparent !important;
  padding: 0 !important;
  width: fit-content;
}