:root {
  --bg: #eef5fb;
  --card: #f8fbfe;
  --text: #243041;
  --muted: #6f7f92;
  --border: #d8e3f0;
  --primary: #5b8def;
  --primary-hover: #4a7fe8;
  --success: #20b26b;
  --danger: #ea6b6b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(180deg, #edf4fb 0%, #f5f9fd 100%);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
}
.main-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border-radius: 22px;
  box-shadow: 0 10px 35px rgba(44, 84, 130, 0.12);
  padding: 18px;
  border: 1px solid #ecf2f8;
}
.tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.box {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.red { background: #ff605c; }
.yellow { background: #ffbd44; }
.green { background: #00ca4e; }
.title-wrap {
  margin-left: 8px;
}
.title-wrap h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}
.title-wrap p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.intro {
  margin-top: 16px;
}
.intro p {
  margin: 0;
  line-height: 1.65;
  color: #506174;
  font-size: 14px;
}
.meta-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.meta-row span {
  font-size: 12px;
  color: #57718f;
  background: #eef4fb;
  padding: 6px 10px;
  border-radius: 999px;
}
.switcher {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 18px;
}
.tab, .tab-link {
  border: none;
  border-radius: 14px;
  background: #edf3f9;
  color: #617488;
  padding: 11px 8px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tab.is-active {
  background: var(--primary);
  color: white;
}
.home-switcher {
  grid-template-columns: repeat(4, 1fr);
}
.admin-header-nav {
  grid-template-columns: 1fr;
}
.panel { display: none; margin-top: 16px; }
.panel.is-active { display: block; }
.section-box {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: white;
  padding: 16px;
}
.section-box h2 {
  margin: 0;
  font-size: 20px;
}
.sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
input, textarea, button {
  width: 100%;
  font: inherit;
  border-radius: 16px;
}
input, textarea {
  border: 1px dashed #c8d7e6;
  background: #fbfdff;
  padding: 12px 14px;
  color: var(--text);
}
textarea {
  resize: vertical;
  min-height: 160px;
}
button {
  border: none;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
}
.primary-btn {
  background: var(--primary);
  color: white;
}
.primary-btn:hover { background: var(--primary-hover); }
.dropzone {
  border: 1.5px dashed #c8d7e6;
  background: #fbfdff;
  border-radius: 20px;
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  color: var(--muted);
  cursor: pointer;
  box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.08);
}
.dropzone.dragover {
  border-color: var(--primary);
  background: #f1f7ff;
}
.upload-icon {
  font-size: 34px;
  color: var(--primary);
}
#file { display: none; }
.alert {
  margin-top: 14px;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
}
.alert.success {
  background: #ecfbf3;
  color: #1d8d57;
  border: 1px solid #cdeedb;
}
.alert.error {
  background: #fff2f2;
  color: #c55454;
  border: 1px solid #f3d1d1;
}
.result-card, .pickup-view, .pickup-preview, .empty-state, .admin-item, .debug-box {
  margin-top: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fbfdff;
  padding: 14px;
}
.result-card {
  position: relative;
  overflow: hidden;
}
.result-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(91,141,239,.14), rgba(91,141,239,0));
}
.result-card code {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 2px;
}
.qr-wrap {
  display: grid;
  gap: 8px;
  align-items: start;
}
.qr-wrap canvas {
  width: 132px;
  height: 132px;
  background: white;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.result-layout {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.result-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 120px;
}
.result-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #eef4fb;
  color: #57718f;
  font-weight: 700;
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.result-actions button {
  width: auto;
  background: #eef4fb;
  color: #4f6780;
}
.pickup-view, .pickup-preview, .debug-box {
  white-space: pre-wrap;
  word-break: break-word;
}
.pickup-view {
  background: #ffffff;
}
.pickup-view strong {
  font-size: 15px;
}
.pickup-preview:empty { display: none; }
.pickup-preview img {
  max-width: 100%;
  display: block;
  border-radius: 12px;
  cursor: zoom-in;
}
.empty-state {
  text-align: center;
  color: var(--muted);
  border-style: dashed;
}
.debug-toggle {
  margin-top: 14px;
}
.debug-toggle summary {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.admin-list {
  display: grid;
  gap: 10px;
}
.admin-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.admin-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.admin-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.admin-tag {
  border-radius: 999px;
  background: #eef4fb;
  color: #59738f;
  padding: 4px 8px;
  font-size: 12px;
}
.danger {
  background: #fff1f1 !important;
  color: #d15b5b !important;
}
.footer-note {
  margin-top: 16px;
}
.runtime-limits {
  display: grid;
  gap: 8px;
}
.runtime-limits .limit-item {
  font-size: 12px;
  color: var(--muted);
  background: #f3f7fb;
  border-radius: 12px;
  padding: 8px 10px;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.68);
}
.lightbox-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}
.lightbox-content img {
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  border-radius: 14px;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: white;
  color: #3d4f63;
  font-size: 24px;
}
.hidden { display: none !important; }
@media (max-width: 560px) {
  .main-card { padding: 14px; }
  .switcher { grid-template-columns: repeat(2, 1fr); }
  .row { grid-template-columns: 1fr; }
}
size: 24px;
}
.hidden { display: none !important; }
@media (max-width: 560px) {
  .main-card { padding: 14px; }
  .switcher { grid-template-columns: repeat(2, 1fr); }
  .row { grid-template-columns: 1fr; }
}
