:root {
  --ink: #151515;
  --muted: #777771;
  --line: #d7d7d2;
  --soft: #f5f5f3;
  --panel: #ffffff;
  --teal: #111111;
  --teal-dark: #2a2a2a;
  --coral: #d75d47;
  --gold: #c8922d;
  --red: #b42318;
  --green: #147846;
  --blue: #2764c5;
  --shadow: 0 18px 48px rgba(17, 17, 17, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--soft);
}

body.apple-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: #151515;
  background: #f5f5f3;
}

.apple-app {
  width: min(460px, calc(100% - 34px));
  padding: 34px 0;
}

.apple-card {
  width: 100%;
}

.apple-card h1 {
  margin: 0 0 28px;
  color: #151515;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.08;
}

.apple-form {
  display: grid;
  gap: 10px;
}

.apple-form label {
  display: block;
}

.apple-form input {
  width: 100%;
  min-height: 54px;
  border: 1px solid #d7d7d2;
  border-radius: 8px;
  padding: 0 16px;
  color: #111111;
  background: rgba(255, 255, 255, 0.82);
  font: inherit;
  font-size: 15px;
  outline: 0;
}

.apple-form input:focus {
  border-color: #111111;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.07);
}

.apple-form input::placeholder {
  color: #8d8d88;
}

.apple-form button {
  width: 100%;
  min-height: 54px;
  border: 1px solid #111111;
  border-radius: 8px;
  color: #ffffff;
  background: #111111;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.apple-form button:hover {
  color: #111111;
  background: #ffffff;
}

.apple-document {
  display: grid;
  gap: 6px;
  width: 100%;
  margin-bottom: 10px;
  border: 1px solid #d7d7d2;
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.58);
}

.apple-document span {
  color: #8d8d88;
  font-size: 13px;
}

.apple-document strong {
  color: #151515;
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.apple-document small {
  color: #8d8d88;
  font-size: 13px;
  line-height: 1.35;
}

.apple-format-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.apple-check {
  position: relative;
  display: block;
  min-height: 48px;
  border: 1px solid #d7d7d2;
  border-radius: 8px;
  color: #151515;
  background: rgba(255, 255, 255, 0.58);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
}

.apple-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.apple-check span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 10px;
}

.apple-check input:checked + span {
  color: #ffffff;
  background: #111111;
}

.apple-download-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.apple-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 54px;
  margin-top: 10px;
  border: 1px solid #d7d7d2;
  border-radius: 8px;
  padding: 0 16px;
  color: #8d8d88;
  background: rgba(255, 255, 255, 0.58);
  font-size: 15px;
  text-decoration: none;
}

.apple-download span {
  color: #151515;
}

.apple-download strong {
  color: #8d8d88;
  font-size: 13px;
}

.apple-download.ready {
  color: #111111;
  background: rgba(255, 255, 255, 0.82);
}

.apple-download.ready strong {
  color: #111111;
}

.apple-download.ready:hover {
  border-color: #111111;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.07);
}

.apple-alert,
.apple-success {
  margin: 0 0 14px;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
}

.apple-alert {
  border: 1px solid #e5b5b0;
  color: #921f17;
  background: #fff1f0;
}

.apple-success {
  display: grid;
  gap: 8px;
  border: 1px solid #cfd8c9;
  color: #293423;
  background: #fbfdf8;
}

.apple-success a {
  color: #111111;
  font-weight: 800;
}

body.plain-shell {
  color: #111827;
  background:
    linear-gradient(#eef2f6 1px, transparent 1px),
    linear-gradient(90deg, #eef2f6 1px, transparent 1px),
    #f8fafc;
  background-size: 28px 28px;
}

.plain-app {
  width: min(980px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 0 48px;
}

.plain-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 42px;
}

.plain-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #111827;
  font-size: 14px;
  font-weight: 800;
}

.plain-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #0f766e;
  background: #ffffff;
}

.plain-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  grid-template-rows: auto auto;
  gap: 14px;
}

.plain-card {
  border: 1px solid #d8e0e7;
  border-radius: 8px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.06);
}

.plain-link {
  display: grid;
  gap: 14px;
  grid-row: span 2;
  min-height: 290px;
}

.plain-card label {
  display: grid;
  gap: 14px;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.plain-link label {
  min-height: 0;
}

.plain-card input {
  width: 100%;
  min-height: 54px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 14px;
  color: #111827;
  background: #ffffff;
  font: inherit;
  font-size: 15px;
  outline: 0;
}

.plain-card input:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.10);
}

.plain-card input::placeholder {
  color: #94a3b8;
}

.plain-link input {
  min-height: 196px;
  align-self: stretch;
}

.plain-link button {
  width: 100%;
  min-height: 52px;
  border: 1px solid #0f766e;
  border-radius: 8px;
  color: #ffffff;
  background: #0f766e;
  box-shadow: none;
}

.plain-link button:hover {
  border-color: #0b5f59;
  background: #0b5f59;
}

.plain-email,
.plain-order {
  display: grid;
  gap: 14px;
}

.plain-label {
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.plain-code {
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
}

.plain-alert,
.plain-success {
  margin: 0 0 14px;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 700;
}

.plain-alert {
  border: 1px solid #fecaca;
  color: #991b1b;
  background: #fff1f2;
}

.plain-success {
  border: 1px solid #bbf7d0;
  color: #166534;
  background: #f0fdf4;
}

a {
  color: var(--teal);
}

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

.topbar {
  border-bottom: 1px solid #e2e2dd;
  background: rgba(245, 245, 243, 0.94);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  color: #151515;
  border: 1px solid var(--line);
  background: #ffffff;
}

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

.nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.hero,
.tool-home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 44px;
  align-items: center;
  padding: 56px 0;
}

.tool-home {
  min-height: calc(100vh - 125px);
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 470px);
  padding: 44px 0 64px;
}

.tool-copy {
  max-width: 620px;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 20px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1,
.tool-copy h1,
.page-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.04;
  letter-spacing: 0;
}

.tool-copy h1 {
  font-size: clamp(52px, 7vw, 92px);
}

.lead {
  max-width: 650px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.6;
}

.tool-copy .lead {
  max-width: 460px;
  font-size: 21px;
}

.mini-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.mini-steps span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--ink);
  background: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.panel,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
}

.request-panel {
  padding: 28px;
}

.panel h2,
.panel h3 {
  margin: 0 0 16px;
}

.request-panel h2 {
  font-size: 24px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-action-inline {
  display: flex;
  align-items: flex-end;
}

.form-action-inline button {
  width: 100%;
}

.field-title {
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 700;
}

.format-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
}

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

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.editor-toolbar button {
  min-height: 34px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 700;
}

.editor-toolbar button:hover {
  background: #f5f5f3;
}

.email-editor {
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  line-height: 1.55;
  outline: 0;
  overflow-wrap: anywhere;
}

.email-editor:focus {
  border-color: #111111;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.07);
}

.email-editor.is-dragging {
  border-color: var(--blue);
  background: #f3f7ff;
}

.email-editor.is-uploading {
  opacity: 0.72;
}

.email-editor img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.checkbox {
  display: flex;
  grid-template-columns: none;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.5;
}

.checkbox input {
  width: auto;
  min-height: auto;
  margin-top: 4px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  color: #ffffff;
  background: #111111;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.request-panel button {
  width: 100%;
}

.button:hover,
button:hover {
  background: #2a2a2a;
}

.button.secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #ffffff;
}

.button.danger {
  background: var(--red);
}

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

.notice,
.error,
.success {
  margin: 0 0 18px;
  border-radius: 8px;
  padding: 12px 14px;
  line-height: 1.5;
}

.notice {
  border: 1px solid #d8e8f9;
  background: #eef6ff;
  color: #174b83;
}

.error {
  border: 1px solid #f2c6c2;
  background: #fff1f0;
  color: var(--red);
}

.success {
  border: 1px solid #bfe4cf;
  background: #effaf3;
  color: var(--green);
}

.main {
  padding: 38px 0 54px;
}

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

.muted {
  color: var(--muted);
}

.status-link {
  overflow-wrap: anywhere;
}

.tiny {
  font-size: 13px;
}

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

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

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

th {
  color: var(--muted);
  background: #fafaf8;
  font-size: 13px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
}

.status-pending {
  color: #805600;
  background: #fff5d6;
}

.status-processing {
  color: var(--blue);
  background: #edf4ff;
}

.status-ready {
  color: var(--green);
  background: #eaf8ef;
}

.status-failed,
.status-cancelled {
  color: var(--red);
  background: #fff1f0;
}

.details {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.details dt,
.details dd {
  margin: 0;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.details dt {
  color: var(--muted);
  background: #fbfcfc;
  font-weight: 700;
}

.details dd {
  overflow-wrap: anywhere;
}

.details dt:last-of-type,
.details dd:last-of-type {
  border-bottom: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
}

.footer {
  padding: 26px 0;
  color: var(--muted);
  border-top: 1px solid rgba(24, 33, 43, 0.08);
}

@media (max-width: 860px) {
  .hero,
  .tool-home,
  .plain-grid,
  .admin-grid,
  .two {
    grid-template-columns: 1fr;
  }

  .tool-home {
    min-height: auto;
    gap: 30px;
  }

  .plain-app {
    padding-top: 20px;
  }

  .plain-head {
    margin-bottom: 28px;
  }

  .plain-link {
    grid-row: auto;
    min-height: 230px;
  }

  .plain-link input {
    min-height: 150px;
  }

  .plain-card {
    min-height: auto;
  }

  .section-head,
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .details dt {
    border-bottom: 0;
    padding-bottom: 4px;
  }
}
