:root {
  --bg: #f3efe7;
  --panel: rgba(255, 251, 245, 0.88);
  --ink: #201912;
  --muted: #6b6258;
  --line: rgba(32, 25, 18, 0.12);
  --accent: #b35c2e;
  --accent-strong: #8e4219;
  --accent-soft: #f4dfcf;
  --shadow: 0 24px 70px rgba(66, 41, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(179, 92, 46, 0.14), transparent 28%),
    linear-gradient(180deg, #f9f4ec 0%, #efe8dd 48%, #e7dece 100%);
}

a {
  color: inherit;
}

.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.shell-compact {
  width: min(820px, calc(100% - 32px));
  padding-top: 72px;
}

.hero {
  padding: 8px 4px 28px;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--accent-strong);
}

.hero h1,
.panel-head h2 {
  margin: 0;
  font-weight: 700;
}

.hero h1 {
  font-size: clamp(40px, 7vw, 72px);
  line-height: 0.95;
  max-width: 9ch;
}

.lede,
.panel-head p,
.muted,
.status,
.note,
table {
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.lede {
  max-width: 680px;
  margin: 18px 0 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  border-radius: 28px;
  padding: 28px;
  margin-top: 24px;
}

.panel-main {
  margin-top: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 22px;
}

.panel-head-compact {
  display: block;
  margin-bottom: 18px;
}

.panel-head-compact h1,
.panel-head-compact h2 {
  text-align: center;
}

.panel-head h2 {
  font-size: 28px;
}

.panel-head h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
}

.panel-head p {
  margin: 0;
  max-width: 520px;
  line-height: 1.5;
  color: var(--muted);
}

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

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

label span,
.label {
  display: block;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  color: var(--accent-strong);
}

input,
button,
.ghost {
  border-radius: 16px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  padding: 14px 16px;
  font-size: 16px;
  color: var(--ink);
}

input:focus {
  outline: 2px solid rgba(179, 92, 46, 0.18);
  border-color: rgba(179, 92, 46, 0.4);
}

.actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
}

button,
.ghost {
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
}

button {
  background: linear-gradient(135deg, var(--accent), #cf8252);
  color: #fffaf5;
  box-shadow: 0 18px 35px rgba(179, 92, 46, 0.22);
}

.status {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.admin-login-panel {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.admin-topbar-stack {
  align-items: center;
}

.admin-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
}

.admin-subtitle {
  margin: 8px 0 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--muted);
  line-height: 1.5;
}

.admin-link-button,
.admin-logout {
  min-height: 44px;
  white-space: nowrap;
}

.admin-success,
.admin-error {
  font-family: "Helvetica Neue", Arial, sans-serif;
  padding: 12px 14px;
  border-radius: 14px;
  margin: 0 0 18px;
}

.admin-success {
  background: #edf8ef;
  color: #17653c;
  border: 1px solid #cbe9d1;
}

.admin-error {
  background: #fff0ef;
  color: #9d2a24;
  border: 1px solid #f3c7c3;
}

.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.admin-checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.admin-checkbox span {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
}

.admin-stats {
  display: flex;
  gap: 18px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--muted);
}

.hidden {
  display: none;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 320px);
  gap: 24px;
  align-items: center;
}

.result-link {
  display: inline-block;
  margin: 6px 0 10px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  word-break: break-all;
}

.inline-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.ghost {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.qr-wrap {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 239, 228, 0.92));
  border-radius: 24px;
  border: 1px solid var(--line);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
}

.qr-wrap img {
  width: min(280px, 100%);
  height: auto;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  border-top: 0;
  color: var(--accent-strong);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.target-cell a,
.note,
.empty,
td {
  word-break: break-word;
}

.note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.empty {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 20px, 1100px);
    padding: 24px 0 40px;
  }

  .panel {
    border-radius: 22px;
    padding: 20px;
  }

  .panel-head,
  .form-grid,
  .result-grid,
  .actions {
    display: block;
  }

  .panel-head p,
  .status {
    margin-top: 10px;
  }

  .form-grid label {
    display: block;
    margin-bottom: 16px;
  }

  button {
    width: 100%;
  }

  .status {
    margin-top: 12px;
  }

  .inline-actions {
    flex-direction: column;
  }

  .ghost {
    width: 100%;
  }

  .qr-wrap {
    margin-top: 20px;
    min-height: auto;
    padding: 20px;
  }

  .admin-topbar,
  .admin-stats {
    display: block;
  }

  .admin-link-button,
  .admin-logout {
    width: 100%;
    margin-top: 12px;
  }
}
