:root {
  --bg: #f5efe6;
  --panel: #fffdfa;
  --panel-strong: #fdf8f1;
  --ink: #1d2a33;
  --muted: #5c6b73;
  --line: #dccfbe;
  --brand: #133b5c;
  --brand-strong: #0e2d46;
  --accent: #f08a5d;
  --ok: #2e7d32;
  --warn: #b8561f;
  --error: #b42318;
  --shadow: 0 20px 45px rgba(19, 59, 92, 0.12);
  font-family: 'Avenir Next', 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(
      circle at top left,
      rgba(240, 138, 93, 0.18),
      transparent 30%
    ),
    linear-gradient(180deg, #f6f2eb 0%, #efe5d6 100%);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

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

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

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  box-shadow: 0 14px 28px rgba(19, 59, 92, 0.16);
  flex: 0 0 auto;
}

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

.hero h1 {
  margin: 0;
  /* max-width: 14ch; */
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
}

.hero-copy {
  max-width: 48rem;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

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

.card {
  background: rgba(255, 253, 250, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(220, 207, 190, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.section-heading h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.section-heading p {
  margin: 0 0 18px;
  color: var(--muted);
}

.instruction-callout {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(19, 59, 92, 0.08);
  border: 1px solid rgba(19, 59, 92, 0.12);
}

.instruction-callout__title {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.instruction-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
}

.instruction-list li + li {
  margin-top: 6px;
}

.stack {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.92rem;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 14px 16px;
  background: var(--panel-strong);
  color: var(--ink);
}

.field textarea {
  resize: vertical;
  min-height: 260px;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid rgba(19, 59, 92, 0.18);
  border-color: var(--brand);
}

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

.result-card .field + .actions {
  margin-top: 14px;
}

.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    background 160ms ease;
}

.primary-button {
  background: var(--brand);
  color: white;
  font-weight: 700;
}

.secondary-button {
  background: white;
  color: var(--brand);
  border: 1px solid rgba(19, 59, 92, 0.18);
  font-weight: 700;
}

.install-button {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 8px 12px;
  font-size: 0.86rem;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(19, 59, 92, 0.08);
}

.ghost-button {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--ink);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

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

.capture-action {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-radius: 20px;
  border: 1px solid rgba(19, 59, 92, 0.18);
  background: var(--panel);
  min-height: 96px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
}

.capture-action.primary-action {
  background: linear-gradient(
    135deg,
    rgba(19, 59, 92, 0.1),
    rgba(240, 138, 93, 0.12)
  );
}

.capture-action:hover {
  transform: translateY(-1px);
}

.capture-action:focus-within {
  border-color: var(--brand);
  box-shadow:
    0 0 0 3px rgba(19, 59, 92, 0.16),
    0 0 0 6px rgba(240, 138, 93, 0.2);
}

.capture-action input:focus-visible {
  outline: none;
}

.capture-icon {
  width: 52px;
  height: 52px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.capture-icon svg {
  width: 28px;
  height: 28px;
  fill: var(--brand);
}

.capture-action input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.capture-action-label {
  display: block;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.2;
}

.capture-action-copy {
  display: grid;
  gap: 4px;
}

.capture-action-hint {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.preview-card {
  min-height: 280px;
  border-radius: 24px;
  overflow: hidden;
  background: #f1ebe2;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.compact-preview {
  min-height: 220px;
  margin-bottom: 18px;
}

.preview-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  background: #f9f4ed;
}

.preview-card:not(.empty) img {
  display: block;
}

.preview-card:not(.empty) p {
  display: none;
}

.preview-card p {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.upload-feedback {
  margin: 0 0 18px;
  border-radius: 16px;
  padding: 10px 12px;
  line-height: 1.45;
  font-weight: 600;
  font-size: 0.92rem;
}

.upload-feedback.info {
  background: rgba(19, 59, 92, 0.09);
  color: var(--brand);
}

.upload-feedback.error {
  background: rgba(180, 35, 24, 0.12);
  color: var(--error);
}

.upload-feedback.success {
  background: rgba(46, 125, 50, 0.12);
  color: var(--ok);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 440px);
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: 0 18px 36px rgba(19, 59, 92, 0.2);
  z-index: 20;
}

.toast.info {
  background: rgba(19, 59, 92, 0.96);
  color: #fff;
}

.toast.success {
  background: rgba(46, 125, 50, 0.96);
  color: #fff;
}

.toast.warning {
  background: rgba(184, 86, 31, 0.96);
  color: #fff;
}

.toast.error {
  background: rgba(180, 35, 24, 0.96);
  color: #fff;
}

.tip {
  margin-top: 18px;
  background: rgba(240, 138, 93, 0.12);
  color: #6d3b25;
  border-radius: 18px;
  padding: 14px 16px;
  line-height: 1.45;
}

.auth-actions {
  align-items: center;
  margin-bottom: 16px;
}

.session-label {
  color: var(--muted);
  font-weight: 700;
}

.doc-link-wrap {
  margin-top: 14px;
}

.doc-link-wrap a {
  color: var(--brand);
  font-weight: 700;
}

.app-footer {
  display: flex;
  gap: 18px;
  justify-content: center;
  padding: 22px 0 4px;
}

.app-footer a {
  color: var(--brand);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.app-footer a:hover,
.app-footer a:focus-visible {
  text-decoration: underline;
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
    gap: 14px;
  }

  .brand-lockup {
    align-items: flex-start;
  }

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

  .install-button {
    align-self: flex-start;
  }

  .brand-logo {
    width: 60px;
    height: 60px;
    border-radius: 18px;
  }

  .app-shell {
    width: min(100% - 20px, 1100px);
    padding-top: 18px;
  }

  .card {
    padding: 18px;
    border-radius: 24px;
  }

  .hero h1 {
    max-width: 11ch;
  }
}
