:root {
  --brand: #2563eb;
  --brand-dark: color-mix(in srgb, var(--brand) 78%, #102044);
  --ink: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: rgba(255, 255, 255, 0.92);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--brand) 13%, transparent), transparent 32rem),
    linear-gradient(145deg, #f8fafc 0%, #eef4ff 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}
a { color: inherit; }
.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-header {
  width: calc(100% - 40px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: inline-flex; gap: 12px; align-items: center; font-weight: 750; text-decoration: none; }
.brand img { width: 36px; height: 36px; object-fit: contain; }
.support-link { color: var(--muted); font-size: 14px; text-decoration: none; }
.home-main {
  width: calc(100% - 40px);
  max-width: 1180px;
  margin: auto;
  padding: 54px 0 82px;
  display: grid;
  grid-template-columns: 1fr 0.86fr;
  gap: clamp(42px, 8vw, 100px);
  align-items: center;
}
.eyebrow { margin: 0 0 16px; color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(42px, 6vw, 76px); line-height: 1.04; letter-spacing: -.055em; }
.hero h1 span { color: var(--brand); }
.hero > p:not(.eyebrow) { max-width: 600px; margin: 24px 0; color: var(--muted); font-size: 18px; line-height: 1.8; }
.feature-list { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 13px; color: #334155; }
.feature-list li::before { content: "✓"; color: var(--brand); font-weight: 800; margin-right: 10px; }
.upload-panel, .download-card, .message-card {
  border: 1px solid rgba(226, 232, 240, .9);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(30, 64, 175, .12);
  backdrop-filter: blur(18px);
  border-radius: 24px;
}
.upload-panel { padding: clamp(24px, 4vw, 38px); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-heading h2 { margin: 4px 0 26px; font-size: 25px; }
.step { margin: 0; color: var(--muted); font-size: 13px; }
.status-badge { padding: 7px 10px; border-radius: 999px; background: #ecfdf5; color: #047857; font-size: 12px; font-weight: 700; }
.token-field { display: grid; gap: 8px; margin-bottom: 16px; color: #334155; font-size: 13px; font-weight: 700; }
.token-field input { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font: inherit; outline: none; }
.token-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.drop-zone { min-height: 178px; padding: 28px; border: 1.5px dashed #cbd5e1; border-radius: 16px; background: #f8fafc; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-align: center; transition: .2s ease; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, white); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone > span:last-child { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.upload-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); font-size: 24px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; padding: 14px 20px; font: inherit; font-weight: 750; cursor: pointer; text-decoration: none; }
.primary-button { width: 100%; margin-top: 16px; color: white; background: var(--brand); box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 24%, transparent); }
.primary-button:hover { background: var(--brand-dark); }
.primary-button:disabled { opacity: .65; cursor: wait; }
.secondary-button { margin-top: 18px; color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, white); }
.form-status { min-height: 20px; margin: 12px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.form-status.is-error { color: #b91c1c; }
.upload-result { margin-top: 18px; padding: 14px; border-radius: 14px; background: #ecfdf5; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.upload-result[hidden] { display: none; }
.upload-result a { display: block; max-width: 220px; color: #047857; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-check { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #10b981; color: white; }
.copy-button { border: 0; border-radius: 9px; padding: 8px 10px; background: white; cursor: pointer; }
.catalog-section { width: calc(100% - 40px); max-width: 1180px; margin: 0 auto; padding: 0 0 76px; }
.catalog-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 18px; }
.catalog-heading h2 { margin: 4px 0 0; font-size: 26px; }
.catalog-count { color: var(--muted); font-size: 13px; }
.app-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.app-item { min-width: 0; padding: 18px; border: 1px solid rgba(226, 232, 240, .9); border-radius: 17px; background: rgba(255,255,255,.78); display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.app-item-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--brand), var(--brand-dark)); font-size: 20px; font-weight: 800; }
.app-item-content { min-width: 0; }
.app-item-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.app-item-title h3 { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.app-item-title span { flex: none; padding: 4px 7px; border-radius: 6px; background: #eff6ff; color: var(--brand); font-size: 10px; font-weight: 800; }
.app-item-content > p { margin: 5px 0 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.app-item-content dl { display: flex; gap: 16px; margin: 0; }
.app-item-content dl div { display: flex; gap: 5px; align-items: baseline; }
.app-item-content dt { color: var(--muted); font-size: 11px; }
.app-item-content dd { margin: 0; font-size: 12px; font-weight: 700; }
.app-item-link { flex: none; color: var(--brand); font-size: 13px; font-weight: 800; text-decoration: none; }
.app-item-link span { margin-left: 4px; font-size: 16px; }
.empty-catalog { width: calc(100% - 40px); max-width: 1180px; margin: -38px auto 76px; color: var(--muted); text-align: center; font-size: 13px; }
.admin-main { width: calc(100% - 40px); max-width: 1180px; margin: auto; padding: 28px 0 80px; }
.admin-topbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.admin-heading { display: flex; align-items: center; gap: 14px; }
.admin-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: white; background: linear-gradient(145deg, var(--brand), var(--brand-dark)); font-size: 25px; box-shadow: 0 10px 22px color-mix(in srgb, var(--brand) 22%, transparent); }
.admin-topbar h1 { margin: 4px 0 6px; font-size: 36px; letter-spacing: -.04em; }
.admin-topbar p:not(.eyebrow) { margin: 0; color: var(--muted); }
.admin-actions { display: flex; align-items: center; gap: 10px; }
.admin-actions .secondary-button { margin: 0; }
.logout-button { border: 0; padding: 10px; color: var(--muted); background: transparent; cursor: pointer; font: inherit; }
.admin-online { display: inline-flex; align-items: center; gap: 6px; color: #047857; font-size: 12px; font-weight: 700; }
.admin-online i { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px #d1fae5; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-card { min-width: 0; padding: 19px; border: 1px solid rgba(226,232,240,.9); border-radius: 17px; background: rgba(255,255,255,.82); display: flex; align-items: flex-start; gap: 13px; }
.metric-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; font-size: 19px; font-weight: 800; }
.metric-blue .metric-icon { color: #2563eb; background: #dbeafe; }.metric-purple .metric-icon { color: #7c3aed; background: #ede9fe; }.metric-green .metric-icon { color: #059669; background: #d1fae5; }.metric-orange .metric-icon { color: #d97706; background: #fef3c7; }
.metric-card span, .metric-card small { display: block; color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; margin: 8px 0 4px; font-size: 32px; letter-spacing: -.04em; }
.admin-panel { margin-top: 18px; padding: 26px; border: 1px solid rgba(226,232,240,.9); border-radius: 20px; background: rgba(255,255,255,.86); box-shadow: 0 16px 45px rgba(30,64,175,.06); }
.admin-panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.admin-panel-heading h2 { margin: 4px 0 0; font-size: 22px; }
.admin-upload-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.admin-drop-zone { min-width: 0; flex: 1; padding: 14px 16px; border: 1px dashed #cbd5e1; border-radius: 13px; background: #f8fafc; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: .2s ease; }
.admin-drop-zone:hover, .admin-drop-zone.is-dragging { border-color: var(--brand); background: #eff6ff; }
.admin-drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.admin-drop-zone strong, .admin-drop-zone small { display: block; }.admin-drop-zone strong { font-size: 13px; }.admin-drop-zone small { margin-top: 3px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.admin-upload-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: #dbeafe; color: var(--brand); font-size: 21px; font-weight: 800; }
.admin-upload-form .primary-button { width: auto; margin: 0; }
.admin-upload-form .primary-button span { margin-right: 7px; font-size: 18px; }
.admin-upload-progress { flex: 1 0 100%; padding-top: 14px; }.admin-upload-progress[hidden] { display: none; }.progress-meta { display: flex; justify-content: space-between; color: #334155; font-size: 12px; }.progress-meta span { color: var(--brand); font-weight: 800; }.progress-track { height: 8px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: #e2e8f0; }.progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #60a5fa); transition: width .15s ease; }.admin-upload-progress p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.table-toolbar { display: flex; align-items: center; gap: 14px; }.table-toolbar input { width: 220px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; outline: none; font: inherit; font-size: 12px; }.table-toolbar input:focus { border-color: var(--brand); }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.admin-table th { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.admin-table td { padding: 14px 12px; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.admin-table td:first-child { min-width: 180px; }
.admin-table td small { display: block; margin-top: 4px; color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.platform-pill { padding: 4px 7px; border-radius: 6px; font-size: 10px; font-weight: 800; }.platform-ios { color: #2563eb; background: #dbeafe; }.platform-android { color: #047857; background: #d1fae5; }
.row-actions { display: flex; align-items: center; gap: 10px; }
.row-actions a { color: var(--brand); text-decoration: none; }
.row-actions button { border: 0; padding: 0; color: #b91c1c; background: transparent; cursor: pointer; font: inherit; }
.admin-empty { padding: 32px 16px; color: var(--muted); text-align: center; }.admin-empty strong { display: block; margin-top: 10px; color: var(--ink); }.admin-empty p { margin: 5px 0 0; font-size: 13px; }.empty-icon { width: 42px; height: 42px; margin: auto; display: grid; place-items: center; border-radius: 13px; color: var(--brand); background: #dbeafe; font-size: 23px; font-weight: 800; }
.stats-note { color: #475569; font-size: 13px; line-height: 1.7; }
.stats-note p { margin: 6px 0 0; }
.admin-login-main { padding-top: 56px; }
.admin-login-card { max-width: 440px; margin: auto; }
.admin-login-card h1 { margin: 4px 0 8px; }
.admin-login-card > p:not(.eyebrow):not(.form-status) { color: var(--muted); }
.admin-login-form { margin-top: 24px; text-align: left; }
.download-main, .center-main { width: min(620px, calc(100% - 32px)); margin: auto; padding: 32px 0 76px; }
.download-card { padding: clamp(26px, 6vw, 46px); text-align: center; }
.app-icon { width: 82px; height: 82px; margin: 0 auto 20px; border-radius: 22px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--brand), var(--brand-dark)); font-size: 34px; font-weight: 800; box-shadow: 0 14px 30px color-mix(in srgb, var(--brand) 24%, transparent); }
.download-card h1 { margin: 0; font-size: 32px; letter-spacing: -.03em; }
.subtitle { margin: 9px 0 26px; color: var(--muted); }
.meta-grid { margin: 0 0 28px; display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-align: left; }
.meta-grid div { padding: 14px; border-bottom: 1px solid var(--line); }
.meta-grid div:nth-child(odd) { border-right: 1px solid var(--line); }
.meta-grid div:nth-last-child(-n + 2) { border-bottom: 0; }
.meta-grid dt { color: var(--muted); font-size: 12px; }
.meta-grid dd { margin: 4px 0 0; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.qr-code { width: 190px; height: 190px; margin: 0 auto 10px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.qr-code svg { width: 100%; height: 100%; }
.qr-caption { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.notice { margin-top: 24px; padding: 16px; border-radius: 13px; background: #f8fafc; color: #475569; text-align: left; font-size: 13px; line-height: 1.65; }
.notice p { margin: 5px 0 0; }
.message-card { padding: 52px 34px; text-align: center; }
.message-card h1 { margin: 8px 0; }
.message-card > p:not(.error-code) { color: var(--muted); }
.error-code { margin: 0; color: var(--brand); font-size: 48px; font-weight: 850; }
footer { margin-top: auto; padding: 20px; color: var(--muted); font-size: 12px; text-align: center; }
footer a { text-decoration: none; }
.footer-dot { padding: 0 8px; }

@media (max-width: 840px) {
  .home-main { grid-template-columns: 1fr; padding-top: 20px; }
  .hero { text-align: center; }
  .hero > p:not(.eyebrow) { margin-left: auto; margin-right: auto; }
  .feature-list { width: fit-content; margin-left: auto; margin-right: auto; text-align: left; }
  .catalog-section { width: calc(100% - 24px); }
  .app-grid { grid-template-columns: 1fr; }
  .admin-main { width: calc(100% - 24px); }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .site-header { width: calc(100% - 28px); padding: 20px 0; }
  .home-main { width: calc(100% - 24px); gap: 30px; padding-bottom: 50px; }
  .hero h1 { font-size: 39px; }
  .hero > p:not(.eyebrow) { font-size: 16px; }
  .upload-panel { border-radius: 19px; }
  .panel-heading { display: block; }
  .status-badge { display: inline-block; margin-bottom: 16px; }
  .meta-grid { grid-template-columns: 1fr; }
  .meta-grid div, .meta-grid div:nth-child(odd) { border-right: 0; border-bottom: 1px solid var(--line); }
  .meta-grid div:last-child { border-bottom: 0; }
  .upload-result { grid-template-columns: auto 1fr; }
  .copy-button { grid-column: 1 / -1; }
  .catalog-heading { align-items: start; }
  .app-item { grid-template-columns: auto 1fr; }
  .app-item-link { grid-column: 2; }
  .admin-topbar { display: block; }
  .admin-actions { margin-top: 18px; }
  .admin-panel { padding: 18px; }
  .admin-upload-form { align-items: stretch; flex-direction: column; }
  .admin-upload-form .primary-button { width: 100%; }
  .admin-online { margin-right: auto; }.table-toolbar { display: block; }.table-toolbar input { width: 100%; margin-top: 12px; }.admin-panel-heading { display: block; }.admin-panel-heading > .table-toolbar { margin-top: 12px; }.metrics-grid { gap: 9px; }.metric-card { padding: 14px; }.metric-icon { width: 30px; height: 30px; font-size: 16px; }.metric-card strong { font-size: 25px; }
}
