:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-soft: #eef4fb;
  --text: #162033;
  --muted: #667085;
  --line: #d8e1ec;
  --accent: #2274e0;
  --accent-strong: #155bb7;
  --mint: #2dbb96;
  --shadow: 0 24px 70px rgba(27, 45, 73, 0.12);
  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: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(45, 187, 150, 0.13), transparent 30rem),
    linear-gradient(135deg, #ffffff 0%, var(--bg) 48%, #eef5ff 100%);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 18px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid rgba(216, 225, 236, 0.84);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-media {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
}

.brand-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(34, 116, 224, 0.2);
  border-radius: 12px;
  background: linear-gradient(145deg, #ffffff, #e8f1ff);
  box-shadow: 0 12px 30px rgba(34, 116, 224, 0.16);
}

.brand-image {
  width: 42px;
  height: 42px;
  border-radius: 0px;
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(34, 116, 224, 0.16);
}

.brand-icon span {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: var(--accent);
}

.brand-icon span:nth-child(1) {
  width: 20px;
  height: 20px;
  border-radius: 8px;
  transform: rotate(45deg);
}

.brand-icon span:nth-child(2) {
  width: 8px;
  height: 24px;
  background: var(--mint);
  transform: translate(10px, -8px) rotate(45deg);
}

.brand-icon span:nth-child(3) {
  width: 7px;
  height: 7px;
  background: #ffbc42;
  transform: translate(-11px, 11px);
}

.brand-name {
  font-size: 1.02rem;
  font-weight: 750;
}

.admin-link,
.home-link,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(27, 45, 73, 0.07);
}

.ghost-button {
  cursor: pointer;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.main-shell,
.admin-shell,
.login-shell {
  width: min(1040px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(40px, 8vw, 88px) 0 72px;
}

.intro {
  display: grid;
  align-content: center;
  justify-items: start;
  min-height: 420px;
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid rgba(216, 225, 236, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78)),
    linear-gradient(90deg, rgba(34, 116, 224, 0.08), rgba(45, 187, 150, 0.12));
  box-shadow: var(--shadow);
}

.image-intro {
  justify-items: center;
  gap: 26px;
}

.center-image {
  display: grid;
  place-items: center;
  width: min(220px, 100%);
  aspect-ratio: 10 / 10;
}

.center-image img,
.image-placeholder {
  width: 85%;
  height: 85%;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 22px 56px rgba(27, 45, 73, 0.15);
}

.main-image {
  display: block;
}

.image-placeholder {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(216, 225, 236, 0.95);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(238, 245, 255, 0.92)),
    linear-gradient(135deg, rgba(34, 116, 224, 0.22), rgba(45, 187, 150, 0.18));
}

.image-placeholder::before,
.image-placeholder::after {
  position: absolute;
  content: "";
}

.image-placeholder::before {
  inset: 20%;
  border: 2px solid rgba(34, 116, 224, 0.18);
  border-radius: 8px;
}

.image-placeholder::after {
  right: 14%;
  bottom: 17%;
  width: 48%;
  height: 32%;
  border-radius: 999px 999px 0 0;
  background: rgba(45, 187, 150, 0.32);
}

.image-placeholder span {
  position: absolute;
  top: 22%;
  left: 18%;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 188, 66, 0.75);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.7rem, 7vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1rem;
}

.lead {
  max-width: 620px;
  margin: 22px 0 30px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
}

.primary-action,
.submit-button,
.save-button,
.copy-button,
.file-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(34, 116, 224, 0.22);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
  text-decoration: none;
}

.primary-action {
  width: fit-content;
  padding: 0 22px;
  font-size: 1rem;
}

.primary-action:hover,
.submit-button:hover,
.save-button:hover,
.copy-button:hover,
.file-download:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(34, 116, 224, 0.28);
}

.primary-action:focus-visible,
.submit-button:focus-visible,
.save-button:focus-visible,
.copy-button:focus-visible,
.file-download:focus-visible,
.admin-link:focus-visible,
.home-link:focus-visible,
.ghost-button:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(34, 116, 224, 0.26);
  outline-offset: 3px;
}

.download-mark {
  position: relative;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  background:
    radial-gradient(circle at 50% 3px, currentColor 0 2.5px, transparent 2.75px),
    linear-gradient(currentColor, currentColor) center 3px / 5px 14px no-repeat;
}

.download-mark::before,
.download-mark::after {
  position: absolute;
  content: "";
  left: 8.5px;
  bottom: 1px;
  width: 5px;
  height: 13px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: 50% calc(100% - 2px);
}

.download-mark::before {
  transform: rotate(-45deg);
}

.download-mark::after {
  transform: rotate(45deg);
}

.result-panel,
.admin-card,
.submissions-card,
.file-panel,
.file-card,
.assets-card,
.login-card {
  margin-top: 24px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 50px rgba(27, 45, 73, 0.08);
}

.login-card {
  width: min(460px, 100%);
  margin: 0 auto;
}

.output-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, 0.65fr);
  gap: 24px;
  align-items: start;
}

.panel-heading {
  margin-bottom: 20px;
}

.rows-list {
  display: grid;
  gap: 12px;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.row-text {
  margin: 0;
  color: #26344d;
  line-height: 1.5;
}

.instructions-block {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.instructions-block .eyebrow {
  margin-bottom: 8px;
}

.instructions-text {
  color: #26344d;
  line-height: 1.65;
  white-space: pre-line;
}

.copy-button {
  min-width: 92px;
  min-height: 42px;
  padding: 0 14px;
  box-shadow: none;
}

.file-box,
.current-file,
.asset-preview {
  display: grid;
  gap: 14px;
}

.asset-preview {
  margin-bottom: 18px;
}

.asset-preview img {
  width: min(180px, 100%);
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #ffffff;
}

.asset-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.file-meta {
  margin: 0;
  color: #26344d;
  line-height: 1.5;
}

.file-download {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  box-shadow: 0 10px 22px rgba(34, 116, 224, 0.16);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(22, 32, 51, 0.32);
}

.modal-window {
  width: min(480px, 100%);
  padding: 24px;
  border: 1px solid rgba(216, 225, 236, 0.9);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(16, 28, 46, 0.24);
}

.modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.icon-button {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.icon-button::before,
.icon-button::after {
  position: absolute;
  top: 17px;
  left: 10px;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted);
  content: "";
}

.icon-button::before {
  transform: rotate(45deg);
}

.icon-button::after {
  transform: rotate(-45deg);
}

.field-label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: #33415f;
  font-size: 0.92rem;
  font-weight: 750;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  transition: border 150ms ease, box-shadow 150ms ease;
}

input {
  height: 46px;
  padding: 0 13px;
}

input[type="file"] {
  height: auto;
  padding: 10px 13px;
}

textarea {
  min-height: 74px;
  resize: vertical;
  padding: 12px 13px;
}

input:focus,
textarea:focus {
  border-color: rgba(34, 116, 224, 0.55);
  box-shadow: 0 0 0 4px rgba(34, 116, 224, 0.09);
}

.secret-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.toggle-secret {
  min-width: 104px;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent);
  font-weight: 750;
  cursor: pointer;
  transition: border 150ms ease, color 150ms ease, background 150ms ease;
}

.toggle-secret:hover {
  border-color: rgba(34, 116, 224, 0.38);
  background: #f4f8ff;
  color: var(--accent-strong);
}

.toggle-secret:focus-visible {
  outline: 3px solid rgba(34, 116, 224, 0.26);
  outline-offset: 3px;
}

.submit-button,
.save-button {
  width: 100%;
  margin-top: 6px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.admin-title {
  margin-bottom: 24px;
}

.admin-title .lead {
  margin-bottom: 0;
}

.admin-form {
  display: grid;
  gap: 14px;
}

.saved-note {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--mint);
  font-weight: 750;
}

.submissions-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.submission-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.submission-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.submission-fields {
  display: grid;
  gap: 6px;
  margin: 0;
  color: #25344f;
  line-height: 1.45;
}

.submission-download {
  margin: 8px 0 0;
  color: #3f4d68;
  font-size: 0.9rem;
  line-height: 1.45;
}

.empty-state {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .site-header {
    min-height: 68px;
    padding: 14px 18px;
  }

  .main-shell,
  .admin-shell,
  .login-shell {
    width: min(100% - 28px, 1040px);
    padding-top: 30px;
  }

  .header-actions {
    gap: 8px;
  }

  .intro {
    min-height: 360px;
  }

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

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

  .secret-field {
    grid-template-columns: 1fr;
  }

  .toggle-secret {
    width: 100%;
  }

  .copy-button {
    width: 100%;
  }

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