*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: light;
  --bg-top: #fffaf0;
  --bg-bottom: #eef6ff;
  --shell-shadow: 0 24px 60px rgba(74, 101, 112, 0.18);
  --card-bg: rgba(255, 255, 255, 0.84);
  --card-border: rgba(147, 170, 177, 0.24);
  --text-strong: #23404a;
  --text-soft: #57727a;
  --text-muted: #6e8790;
  --accent: #2f909d;
  --accent-strong: #236d78;
  --accent-soft: #e4f5f6;
  --danger: #b85d65;
  --danger-soft: #fff0f2;
  --line: #cfe2e4;
  --input-bg: rgba(255, 255, 255, 0.74);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 226, 179, 0.9), transparent 34%),
    radial-gradient(circle at top right, rgba(180, 224, 229, 0.9), transparent 30%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  color: var(--text-strong);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.9rem;
  overflow-y: auto;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: auto -12% -18% auto;
  width: 14rem;
  height: 14rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.36);
  filter: blur(16px);
  pointer-events: none;
}

.mobile-shell {
  width: 100%;
  max-width: 430px;
  min-height: calc(100svh - 1.8rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.72rem;
  overflow-y: auto;
  max-height: none;
}

.narrow-shell {
  max-width: 400px;
}

.hero-card,
.panel-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  box-shadow: var(--shell-shadow);
  backdrop-filter: blur(14px);
}

.hero-card {
  padding: 1rem 1.05rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(247, 252, 255, 0.88));
}

.hero-card-compact {
  padding: 0.92rem 1rem;
}

.compact-hero {
  text-align: center;
}

.eyebrow {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #7f9aa3;
  margin-bottom: 0.3rem;
  font-weight: 700;
}

.hero-card h1 {
  font-size: clamp(1.15rem, 2.7vh, 1.48rem);
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 0.28rem;
  line-height: 1.1;
}

.hero-copy {
  font-size: 0.8rem;
  color: var(--text-soft);
  line-height: 1.34;
}

.panel-card {
  padding: 0.95rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.68rem;
}

.picker {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 5.35rem;
  padding: 1rem;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(246, 252, 252, 0.92), rgba(233, 246, 249, 0.82));
  border: 2px dashed #bad7db;
  border-radius: 22px;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.picker:hover {
  border-color: #85bcc3;
  transform: translateY(-1px);
}

.picker input[type="file"] {
  display: none;
}

.picker-title {
  margin-bottom: 0.25rem;
  font-weight: 700;
  color: var(--text-strong);
  text-align: center;
}

#file-summary {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  max-height: 4.5rem;
  overflow: auto;
  padding-right: 0.2rem;
}

.chip {
  background: rgba(228, 245, 246, 0.95);
  border: 1px solid rgba(115, 177, 184, 0.24);
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-strong);
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.84rem;
  color: var(--text-strong);
  font-weight: 600;
}

select,
input[type="password"],
input[type="text"],
input[readonly] {
  width: 100%;
  padding: 0.72rem 0.82rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--input-bg);
  color: var(--text-strong);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

select:focus,
input:focus {
  border-color: #85bcc3;
  box-shadow: 0 0 0 4px rgba(143, 205, 212, 0.26);
  background: #fff;
}

.hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  font-weight: 500;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.ghost-link {
  min-height: 2.65rem;
  font-size: 0.88rem;
  border-radius: 16px;
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), #4ca4ad);
  color: #fffefb;
  border: none;
  padding: 0.82rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 16px 28px rgba(58, 132, 142, 0.22);
}

.primary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.primary-btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-strong);
  border: 1px solid var(--line);
  padding: 0.68rem 0.95rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.secondary-btn:hover {
  background: #fff;
  transform: translateY(-1px);
}

.danger-btn {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(184, 93, 101, 0.18);
  padding: 0.68rem 0.95rem;
  cursor: pointer;
}

.danger-btn:hover {
  background: #ffe7ea;
}

.ghost-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.68rem 0.95rem;
  border: 1px solid rgba(115, 177, 184, 0.24);
  color: var(--accent-strong);
  text-decoration: none;
  background: rgba(246, 252, 252, 0.8);
}

.ghost-link:hover {
  background: #fff;
}

.mode-pill {
  display: inline-flex;
  align-self: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid rgba(115, 177, 184, 0.18);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.74rem;
  color: var(--accent-strong);
  text-align: center;
  font-weight: 700;
}

.status-line {
  min-height: 1.15rem;
  font-size: 0.82rem;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.35;
}

.status-line[data-tone="success"] {
  color: #2e7c59;
}

.status-line[data-tone="error"] {
  color: var(--danger);
}

.result-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.badge {
  background: linear-gradient(135deg, var(--accent), #5db2bb);
  color: white;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

#result-title {
  font-size: 1rem;
}

#share-url {
  font-size: 0.83rem;
}

.qr-box {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 8.8rem;
  padding: 0.3rem;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(242, 249, 250, 0.92));
  border: 1px solid rgba(115, 177, 184, 0.16);
}

.qr-box img,
.qr-box canvas,
.qr-box table {
  max-width: 100%;
  height: auto;
}

.action-row,
.action-stack {
  display: grid;
  gap: 0.62rem;
}

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

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

[hidden] {
  display: none !important;
}

@media (max-width: 420px) {
  body {
    padding: 0.7rem;
  }

  .mobile-shell {
    min-height: calc(100svh - 1.4rem);
  }

  .hero-card,
  .panel-card {
    border-radius: 24px;
    padding: 0.88rem;
  }

  .hero-card h1 {
    font-size: 1.2rem;
  }

  .hero-copy {
    font-size: 0.76rem;
  }

  .picker {
    min-height: 4.9rem;
    padding: 0.82rem;
  }

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