:root {
  color-scheme: light;
  --ink: #1d211e;
  --muted: #66706a;
  --glass: rgba(255, 255, 255, 0.10);
  --glass-strong: rgba(255, 255, 255, 0.24);
  --line: rgba(255, 255, 255, 0.56);
  --bg-image: url("/assets/floral-bg.png");
  --accent: #4b8a76;
  --accent-strong: #397461;
  --accent-soft: rgba(230, 244, 238, 0.42);
  --bad: #a84c55;
  --bad-soft: rgba(253, 236, 238, 0.78);
  --shadow: 0 28px 80px rgba(42, 57, 50, 0.10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(251, 250, 246, 0.36)),
    var(--bg-image) center center / cover no-repeat fixed,
    #f8f7f1;
  color: var(--ink);
  letter-spacing: 0;
}

body[data-bg="floral"] {
  --bg-image: url("/assets/floral-bg.png");
}

body[data-bg="silk"] {
  --bg-image: url("/assets/bg-silk.png");
}

body[data-bg="peony"] {
  --bg-image: url("/assets/bg-peony.png");
}

body[data-bg="porcelain"] {
  --bg-image: url("/assets/bg-porcelain.png");
}

body[data-bg="lavender"] {
  --bg-image: url("/assets/bg-lavender.png");
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.shell {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 22px;
  width: min(760px, calc(100vw - 36px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 0;
}

.main-panel,
.download-panel,
.admin-panel,
.auth-panel,
.modal-card {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.04) 42%, rgba(255, 255, 255, 0.12)),
    var(--glass);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -22px 54px rgba(255, 255, 255, 0.08),
    inset 0 0 34px rgba(255, 255, 255, 0.05),
    0 24px 70px rgba(42, 57, 50, 0.10);
  backdrop-filter: blur(18px) saturate(1.28) contrast(1.02);
  -webkit-backdrop-filter: blur(18px) saturate(1.28) contrast(1.02);
  overflow: hidden;
}

.main-panel::before,
.download-panel::before,
.admin-panel::before,
.auth-panel::before,
.modal-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.70), transparent 24%),
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.42), transparent 28%);
  mix-blend-mode: screen;
}

.main-panel {
  padding: 30px;
}

.download-panel {
  padding: 22px;
}

.admin-panel {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.auth-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 88px 18px 42px;
}

.auth-panel {
  width: min(430px, 100%);
  padding: 24px;
}

.auth-switch {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.auth-switch button {
  min-height: 44px;
  border-radius: 999px;
  background: transparent;
  color: rgba(29, 33, 30, 0.62);
  font-size: 14px;
  font-weight: 820;
}

.auth-switch button.active {
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(42, 57, 50, 0.08);
}

.auth-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}

.auth-form input {
  min-height: 56px;
  border-color: rgba(255, 255, 255, 0.62);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.20);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.auth-form input::placeholder {
  color: rgba(29, 33, 30, 0.48);
}

.auth-submit {
  min-height: 58px;
  margin-top: 4px;
  font-size: 17px;
}

.account-bar {
  position: fixed;
  left: 18px;
  top: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 4px 5px 4px 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.10);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 14px 38px rgba(42, 57, 50, 0.10);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  color: rgba(29, 33, 30, 0.70);
  font-size: 13px;
  font-weight: 800;
}

.account-bar span {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-bar button {
  min-height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 850;
}

.upload-form {
  display: grid;
  gap: 18px;
}

.upload-button,
.primary,
.download,
.secondary,
.icon-button,
.settings-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 850;
}

.upload-button {
  position: relative;
  width: 100%;
  min-height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  background:
    linear-gradient(135deg, rgba(184, 207, 197, 0.88), rgba(114, 157, 137, 0.64)),
    rgba(72, 118, 98, 0.46);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -18px 34px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px) saturate(1.16);
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
  cursor: pointer;
  overflow: hidden;
}

.upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-button span {
  max-width: 86%;
  overflow-wrap: anywhere;
  text-align: center;
  font-size: 24px;
  line-height: 1.18;
}

.upload-button.dragging {
  border-color: rgba(255, 255, 255, 0.84);
  background: rgba(230, 244, 238, 0.24);
}

.primary {
  width: 100%;
  min-height: 68px;
  background: rgba(75, 138, 118, 0.92);
  color: white;
  box-shadow: 0 16px 34px rgba(75, 138, 118, 0.20);
  font-size: 21px;
}

.primary:hover {
  background: var(--accent-strong);
}

.notification-toggle {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 2px 4px 0;
  color: rgba(29, 33, 30, 0.78);
  cursor: pointer;
  user-select: none;
}

.notification-toggle input {
  width: 19px;
  height: 19px;
  margin: 2px 0 0;
  accent-color: var(--accent-strong);
  cursor: pointer;
}

.notification-toggle span {
  display: grid;
  gap: 2px;
}

.notification-toggle strong {
  font-size: 0.93rem;
  line-height: 1.25;
}

.notification-toggle small {
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.36;
}

.notification-toggle input:disabled {
  cursor: wait;
}

.progress-state {
  margin-top: -4px;
  color: rgba(75, 39, 57, 0.88);
  font-size: 0.94rem;
  font-weight: 850;
  text-align: center;
}

.progress-wrap {
  height: 15px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -8px 18px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.progress-wrap[hidden],
[hidden] {
  display: none !important;
}

.progress-wrap span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: rgba(75, 138, 118, 0.86);
  box-shadow: 0 0 22px rgba(75, 138, 118, 0.24);
  will-change: width;
}

.download-panel:empty,
.jobs-list:empty {
  display: none;
}

.jobs-list {
  display: grid;
  gap: 14px;
}

.empty {
  display: none;
}

.job-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 28px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -14px 28px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.job-card h3,
.job-meta,
.progress,
.job-error {
  display: none;
}

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

.download {
  min-height: 58px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid rgba(255, 255, 255, 0.48);
  padding: 0 18px;
  font-size: 16px;
}

.download:hover {
  background: rgba(218, 239, 230, 0.92);
}

.admin-access-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  color: rgba(29, 33, 30, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.admin-access-controls select {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.50);
  color: var(--ink);
  padding: 0 13px;
  font: inherit;
}

.admin-email-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 136px;
  gap: 10px;
}

.admin-email-form input {
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.10);
  color: var(--ink);
  padding: 0 18px;
}

.admin-email-list {
  display: grid;
  gap: 9px;
}

.admin-email-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.10);
  padding: 6px 8px 6px 16px;
}

.admin-email-row span {
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 750;
}

.admin-email-row strong {
  border-radius: 999px;
  background: rgba(230, 244, 238, 0.42);
  color: var(--accent-strong);
  padding: 7px 10px;
  font-size: 12px;
}

.admin-email-row.pending strong {
  background: rgba(255, 255, 255, 0.46);
  color: rgba(29, 33, 30, 0.70);
}

.admin-email-row button {
  min-height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  color: rgba(29, 33, 30, 0.72);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 850;
}

.admin-email-row.pending button {
  background: rgba(75, 138, 118, 0.90);
  color: white;
}

.job-card:has(.job-actions:empty) {
  display: none;
}

.service-controls {
  display: none;
}

.settings-button {
  position: fixed;
  left: 18px;
  top: 18px;
  z-index: 3;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  border: 1px solid transparent;
  background: transparent;
  color: transparent;
  font-size: 16px;
  opacity: 0;
}

.background-picker {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 4;
}

.background-toggle {
  min-width: 74px;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.10);
  color: rgba(29, 33, 30, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 14px 38px rgba(42, 57, 50, 0.10);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  font-size: 14px;
  font-weight: 850;
}

.background-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  display: grid;
  gap: 8px;
  min-width: 178px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 20px 60px rgba(42, 57, 50, 0.14);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
}

.background-menu button {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.16);
  color: var(--ink);
  padding: 4px 10px 4px 5px;
  text-align: left;
  font-size: 14px;
  font-weight: 780;
}

.background-menu button.active {
  background: rgba(230, 244, 238, 0.34);
}

.background-menu span {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: var(--swatch) center / cover;
}

.settings-button:hover {
  opacity: 1;
  color: rgba(29, 33, 30, 0.78);
  background: rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 42, 40, 0.24);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  padding: 26px;
  background: rgba(255, 255, 255, 0.78);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.card-head h2,
.card-head p {
  margin: 0;
}

.card-head h2 {
  font-size: 24px;
  line-height: 1.15;
}

.quiet-line {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  font-size: 20px;
}

.modal form {
  display: grid;
  gap: 14px;
}

.modal label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  padding: 12px 16px;
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(75, 138, 118, 0.13);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-primary,
.secondary {
  min-height: 48px;
  padding: 0 18px;
  font-size: 15px;
}

.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 40px));
  border-radius: 24px;
  background: rgba(29, 33, 30, 0.86);
  color: white;
  padding: 13px 16px;
  box-shadow: var(--shadow);
  font-size: 14px;
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(251, 250, 246, 0.86)),
      var(--bg-image) center center / cover no-repeat fixed,
      #f8f7f1;
  }

  .shell {
    width: min(100vw - 24px, 760px);
    gap: 16px;
  }

  .main-panel,
  .download-panel,
  .admin-panel,
  .auth-panel {
    border-radius: 28px;
  }

  .main-panel {
    padding: 18px;
  }

  .download-panel {
    padding: 16px;
  }

  .admin-panel {
    padding: 16px;
  }

  .auth-view {
    padding-inline: 12px;
  }

  .auth-panel {
    padding: 18px;
  }

  .account-bar {
    max-width: calc(100vw - 112px);
  }

  .upload-button {
    min-height: 78px;
  }

  .upload-button span {
    font-size: 20px;
  }

  .primary {
    min-height: 60px;
    font-size: 18px;
  }

  .job-actions {
    grid-template-columns: 1fr;
  }

  .admin-email-form,
  .admin-email-row {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.access-line {
  color: rgba(77, 51, 66, 0.75);
  font-size: 0.78rem;
  white-space: nowrap;
}

.job-status-panel {
  margin: 12px auto 0;
  width: min(650px, calc(100% - 28px));
  padding: 13px 17px;
  border: 1px solid rgba(120, 76, 98, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 30px rgba(79, 41, 62, 0.08);
  display: grid;
  gap: 4px;
}

.job-status-panel strong {
  color: #4b2739;
  font-size: 0.92rem;
}

.job-status-panel span,
.job-expiration {
  color: rgba(77, 51, 66, 0.72);
  font-size: 0.82rem;
}

.job-ready-line {
  color: #4b2739;
  font-weight: 700;
  margin-bottom: 5px;
}

.admin-analytics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 15px;
}

.admin-analytics div {
  padding: 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
  display: grid;
  gap: 2px;
}

.admin-analytics strong {
  color: #4b2739;
  font-size: 1rem;
}

.admin-analytics span {
  color: rgba(77, 51, 66, 0.7);
  font-size: 0.7rem;
  line-height: 1.25;
}

@media (max-width: 760px) {
  .access-line {
    display: none;
  }
}


.auth-heading {
  margin: 0 0 24px;
  text-align: center;
}

.auth-heading h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.1;
}

.auth-heading p,
.auth-note,
.auth-code-hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-note {
  margin-top: 14px;
  font-size: 14px;
  text-align: center;
}

.auth-code-hint {
  margin: -2px 4px 4px;
  font-size: 15px;
}

.email-code {
  letter-spacing: 0.35em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.text-button {
  padding: 6px 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 700;
}

.text-button:hover {
  text-decoration: underline;
}

@media (max-width: 540px) {
  .auth-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}


.auth-passkey {
  min-height: 50px;
  justify-content: center;
  border: 1px solid rgba(75, 138, 118, 0.30);
  background: rgba(236, 247, 241, 0.68);
  color: var(--accent-strong);
  font-weight: 820;
}

.auth-timer {
  min-height: 20px;
  margin: -6px 4px 0;
  color: rgba(77, 51, 66, 0.72);
  font-size: 13px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.auth-error {
  margin: -2px 4px 0;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 760px) {
  #setupPasskeyButton {
    display: none;
  }
}


.auth-passkey-help {
  justify-self: center;
  color: rgba(57, 116, 97, 0.88);
  font-size: 13px;
}

.quick-login-card {
  width: min(480px, 100%);
}

.quick-login-actions {
  margin-top: 8px;
}

@media (max-width: 540px) {
  .quick-login-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
