/* Shared functional pages */
.unified-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(244, 240, 231, 0.94);
  backdrop-filter: blur(18px);
}
.function-page, .app-site { min-height: 100dvh; }
.dialog-open { overflow: hidden; }
.action-button, .text-button, .danger-button, .row-actions button, .row-actions a, .table-pagination button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.25s var(--ease), color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}
.action-button {
  min-height: 52px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 2px 16px 16px 16px;
  font-size: 13px;
  font-weight: 650;
}
.action-button-primary { color: var(--white); background: var(--ink); }
.action-button-primary:hover { background: var(--accent); transform: translateY(-2px); }
.action-button-secondary { border: 1px solid var(--line); background: rgba(255, 253, 248, 0.68); }
.action-button-secondary:hover { border-color: var(--ink); transform: translateY(-2px); }
.action-button:active, .text-button:active, .danger-button:active { transform: scale(0.98); }
.action-button:disabled, .danger-button:disabled { cursor: wait; opacity: 0.58; }
.text-button { padding: 9px 4px; color: var(--ink-soft); background: transparent; font-size: 12px; }
.text-button:hover { color: var(--ink); }
.danger-button { min-height: 42px; padding: 0 17px; border-radius: 2px 12px 12px 12px; color: #fff; background: #a84434; font-size: 12px; font-weight: 650; }
.danger-button:hover { background: #8e372b; }
.button-spinner, .button-loader {
  display: none;
  width: 15px;
  height: 15px;
  flex: none;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: function-spin 0.72s linear infinite;
}
.is-loading .button-spinner, .is-loading .button-loader { display: block; }
.field-group { display: grid; gap: 8px; }
.field-group label { color: #6f736c; font-size: 11px; font-weight: 600; }
.field-group input, .field-group select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 3px 12px 12px 12px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.76);
  font: 13px var(--font);
  outline: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field-group input:focus, .field-group select:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(23, 63, 51, 0.09); }
.inline-message { min-height: 19px; margin: 12px 0 0; color: #a33c2c; font-size: 12px; line-height: 1.5; }
.function-footer { margin-top: 24px; }
.function-toast {
  position: fixed;
  z-index: 15;
  left: 50%;
  bottom: 26px;
  min-width: min(88vw, 320px);
  padding: 14px 18px;
  color: var(--white);
  background: var(--forest);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 2px 13px 13px 13px;
  box-shadow: 0 18px 46px rgba(23, 63, 51, 0.22);
  transform: translateX(-50%);
  text-align: center;
  font-size: 12px;
}

/* App official site */
.app-site { background: #edf3fb; }
.app-site .unified-header { background: rgba(244, 240, 231, 0.96); }
.app-hero {
  width: min(calc(100% - (var(--gutter) * 2)), 1440px);
  min-height: min(720px, calc(100dvh - 94px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(430px, 0.78fr) minmax(0, 1.22fr);
  overflow: hidden;
  background: #edf3fb;
}
.app-hero > img { grid-column: 2; grid-row: 1; width: 100%; height: 100%; min-height: 620px; object-fit: cover; object-position: 69% center; }
.app-hero-copy {
  position: relative;
  z-index: 2;
  grid-column: 1;
  grid-row: 1;
  padding: clamp(72px, 10vh, 116px) clamp(34px, 4vw, 54px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--paper);
}
.app-hero-copy::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 -82px 0 auto;
  width: 84px;
  background: linear-gradient(90deg, var(--paper), rgba(244, 240, 231, 0));
}
.app-hero-copy h1 { margin: 24px 0 0; font-size: clamp(46px, 4.2vw, 60px); line-height: 1.04; letter-spacing: -0.065em; }
.app-hero-copy > p:last-child { max-width: 440px; margin: 27px 0 0; color: var(--ink-soft); font-size: 16px; line-height: 1.8; }
.app-hero-en > img { object-position: 72% center; }
.download-dock {
  width: min(calc(100% - (var(--gutter) * 2)), var(--container));
  margin: 0 auto;
  padding: 72px 0 78px;
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  align-items: end;
  gap: clamp(44px, 7vw, 100px);
}
.download-dock h2 { margin: 12px 0 0; font-size: clamp(31px, 3.2vw, 46px); letter-spacing: -0.045em; }
.download-dock > div:first-child > p:last-child { margin: 14px 0 0; color: var(--ink-soft); font-size: 13px; }
.download-options { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(21, 64, 120, 0.22); border-bottom: 1px solid rgba(21, 64, 120, 0.22); }
.download-options a { min-height: 112px; padding: 22px 21px; display: grid; align-content: center; grid-template-columns: auto 1fr; gap: 5px 15px; border-right: 1px solid rgba(21, 64, 120, 0.19); background: rgba(255, 255, 255, 0.32); transition: background 0.3s ease, transform 0.3s var(--ease); }
.download-options a:last-child { border-right: 0; }
.download-options a:hover { position: relative; background: rgba(255, 255, 255, 0.82); transform: translateY(-4px); }
.download-options span { grid-row: 1 / 3; align-self: center; color: #7b8ba1; font: 600 10px/1 var(--mono); }
.download-options small { color: #7b8ba1; font: 600 8px/1 var(--mono); letter-spacing: 0.09em; }
.download-options b { color: #17212d; font-size: 14px; }
.download-status { grid-column: 2; min-height: 16px; margin: -42px 0 0; color: #748398; font-size: 10px; }
.app-story { width: min(100%, 1440px); margin: 0 auto; padding: 18px; display: grid; gap: 18px; background: #dfe9f8; }
.app-story figure { margin: 0; overflow: hidden; background: #dfe8f3; }
.app-story img { width: 100%; height: auto; }
.app-site .site-footer { border-color: rgba(21, 64, 120, 0.2); }

/* Certificate entry and workspace */
.certificate-page {
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, rgba(23, 26, 23, 0.06) 1px, transparent 0);
  background-size: 44px 44px;
}
.certificate-main { min-height: calc(100dvh - 94px); }
.certificate-gate {
  width: min(calc(100% - (var(--gutter) * 2)), var(--container));
  min-height: calc(100dvh - 94px);
  margin: 0 auto;
  padding: clamp(52px, 7vh, 82px) 0 clamp(70px, 9vh, 105px);
  display: grid;
  grid-template-columns: minmax(500px, 1.15fr) minmax(360px, 0.85fr);
  align-items: center;
  gap: clamp(60px, 8vw, 120px);
}
.gate-visual { position: relative; min-height: 570px; overflow: hidden; border-radius: 28px 3px 28px 28px; background: var(--forest); box-shadow: 0 30px 78px rgba(27, 51, 66, 0.18); }
.gate-visual > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.78; }
.gate-visual::after { content: ""; position: absolute; inset: 0; background: rgba(13, 38, 54, 0.24); }
.gate-certificate { position: absolute; z-index: 2; left: 50%; top: 50%; width: min(64%, 385px); min-height: 300px; padding: 38px 28px; display: grid; justify-items: center; align-content: start; color: var(--ink); background: rgba(255, 253, 248, 0.95); box-shadow: 0 25px 62px rgba(12, 31, 53, 0.28); transform: translate(-50%, -50%) rotate(-2deg); }
.gate-certificate::before, .gate-certificate::after { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(23, 63, 51, 0.34); }
.gate-certificate::after { inset: 17px; border-color: rgba(231, 94, 60, 0.28); }
.gate-certificate img { width: 38px; margin-bottom: 12px; }
.gate-certificate small { font: 700 10px/1 var(--mono); letter-spacing: 0.14em; }
.gate-certificate strong { margin: 34px 0 9px; font-size: clamp(29px, 3vw, 42px); letter-spacing: 0.12em; }
.gate-certificate span { color: #6f736d; font: 600 8px/1 var(--mono); letter-spacing: 0.14em; }
.gate-content h1 { margin: 25px 0 0; font-size: clamp(45px, 4.6vw, 67px); line-height: 1.07; letter-spacing: -0.06em; }
.gate-content > p:not(.eyebrow):not(.gate-note) { max-width: 520px; margin: 27px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.82; }
.gate-actions { margin-top: 35px; display: flex; gap: 12px; }
.admin-login-form { max-width: 470px; margin-top: 32px; padding-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--line); }
.admin-login-form .inline-message, .admin-login-form .form-button-row { grid-column: 1 / -1; }
.form-button-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.gate-note { margin: 25px 0 0; display: flex; align-items: center; gap: 9px; color: #858980; font-size: 10px; }
.gate-note i { width: 6px; height: 6px; border-radius: 50%; background: var(--forest); }

.certificate-workspace { width: min(calc(100% - (var(--gutter) * 2)), var(--container)); margin: 0 auto; padding: 72px 0 94px; }
.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 42px; }
.workspace-heading h1 { margin: 16px 0 0; font-size: clamp(42px, 5vw, 67px); letter-spacing: -0.06em; line-height: 1; }
.workspace-heading > div > p:last-child { margin: 18px 0 0; color: var(--ink-soft); font-size: 14px; }
.workspace-account { display: flex; align-items: center; gap: 18px; }
.role-chip { padding: 9px 12px; color: var(--forest); background: rgba(23, 63, 51, 0.1); border-radius: 2px 9px 9px 9px; font: 650 10px/1 var(--mono); }
.role-chip.is-admin { color: #99432e; background: rgba(231, 94, 60, 0.12); }
.workspace-tools { margin-top: 52px; padding: 24px 0; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.filter-form { min-width: 0; display: grid; grid-template-columns: 1.25fr 0.75fr 0.72fr 0.72fr auto; align-items: end; gap: 12px; }
.filter-actions { display: flex; align-items: center; gap: 13px; }
.admin-actions { display: flex; gap: 10px; }
.table-status { min-height: 42px; padding: 18px 0 9px; color: var(--ink-soft); font-size: 11px; }
.table-status.is-error { color: #a33c2c; }
.certificate-table-wrap { position: relative; overflow-x: auto; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); background: rgba(255, 253, 248, 0.52); }
.certificate-table { width: 100%; min-width: 1180px; border-collapse: collapse; font-size: 12px; }
.certificate-table th { padding: 15px 12px; color: #777b74; background: rgba(233, 227, 215, 0.48); border-bottom: 1px solid var(--line); text-align: left; font: 650 9px/1.3 var(--mono); letter-spacing: 0.05em; white-space: nowrap; }
.certificate-table td { padding: 15px 12px; border-bottom: 1px solid rgba(23, 26, 23, 0.1); line-height: 1.55; vertical-align: middle; }
.certificate-table tbody tr:last-child td { border-bottom: 0; }
.certificate-table tbody tr { transition: background 0.2s ease; }
.certificate-table tbody tr:hover { background: rgba(255, 253, 248, 0.82); }
.certificate-table .event-cell { max-width: 245px; }
.mono-cell { color: #676b65; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.selection-column { width: 42px; text-align: center !important; }
.selection-column input, .row-selection { width: 15px; height: 15px; accent-color: var(--forest); }
.award-tag { padding: 5px 8px; display: inline-block; border-radius: 2px 7px 7px 7px; white-space: nowrap; font-size: 10px; }
.award-first { color: #865c18; background: #f1e3bf; }
.award-second { color: #566067; background: #e0e5e5; }
.award-third { color: #8b4b29; background: #edd2c0; }
.award-merit { color: var(--forest); background: #dce7e0; }
.award-none { color: #777; background: #e7e4dc; }
.row-actions { display: flex; gap: 4px; white-space: nowrap; }
.row-actions button, .row-actions a { padding: 7px 9px; color: var(--ink); background: transparent; border-radius: 2px 7px 7px 7px; font-size: 10px; }
.row-actions button:hover, .row-actions a:hover { color: var(--white); background: var(--forest); }
.row-actions .is-danger:hover { background: #9e3f31; }
.row-actions button:disabled, .row-actions a[aria-disabled="true"] { opacity: 0.34; pointer-events: none; }
.skeleton-row td { height: 56px; }
.skeleton-row span { width: 100%; height: 10px; display: block; background: linear-gradient(90deg, rgba(23,26,23,.05), rgba(23,26,23,.11), rgba(23,26,23,.05)); background-size: 200% 100%; animation: skeleton-shift 1.4s ease infinite; }
.table-empty { min-height: 330px; padding: 60px 24px; display: grid; place-items: center; align-content: center; text-align: center; }
.table-empty > span { width: 54px; height: 54px; border: 1px solid var(--line); border-radius: 50%; background: radial-gradient(circle, var(--forest) 0 5px, transparent 6px); }
.table-empty h2 { margin: 21px 0 0; font-size: 22px; }
.table-empty p { max-width: 440px; margin: 11px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.batch-bar { position: sticky; z-index: 4; bottom: 18px; width: max-content; max-width: 100%; margin: 18px auto 0; padding: 9px 10px 9px 17px; display: flex; align-items: center; gap: 22px; color: var(--white); background: var(--ink); border: 1px solid rgba(255,255,255,.12); border-radius: 3px 14px 14px 14px; box-shadow: 0 16px 42px rgba(23, 26, 23, 0.18); font-size: 11px; }
.batch-bar b { font-family: var(--mono); }
.table-pagination { min-height: 66px; padding-top: 21px; display: flex; justify-content: center; gap: 7px; }
.table-pagination button { min-width: 37px; height: 37px; border: 1px solid var(--line); color: var(--ink-soft); background: rgba(255,253,248,.58); border-radius: 2px 8px 8px 8px; font-size: 11px; }
.table-pagination button:hover:not(:disabled), .table-pagination button[aria-current="page"] { color: var(--white); background: var(--forest); border-color: var(--forest); }
.table-pagination button:disabled { opacity: .35; cursor: not-allowed; }
.retention-note { margin: 2px 0 0; color: #8b776d; text-align: center; font-size: 10px; }

/* Dialogs */
.function-dialog { width: min(92vw, 760px); padding: 0; overflow: hidden; color: var(--ink); background: var(--paper); border: 0; border-radius: 3px 24px 24px 24px; box-shadow: 0 36px 100px rgba(22, 42, 34, 0.28); }
.function-dialog::backdrop { background: rgba(18, 27, 23, 0.7); backdrop-filter: blur(7px); }
.function-dialog > form, .function-dialog > div { padding: 34px; }
.function-dialog header { margin-bottom: 27px; display: flex; justify-content: space-between; gap: 30px; align-items: start; }
.function-dialog header p { margin: 0 0 10px; color: var(--accent); font: 650 9px/1 var(--mono); letter-spacing: 0.14em; }
.function-dialog h2 { margin: 0; font-size: 31px; letter-spacing: -0.04em; }
.dialog-close { width: 38px; height: 38px; flex: none; border: 1px solid var(--line); color: var(--ink); background: transparent; border-radius: 50%; cursor: pointer; font-size: 20px; }
.member-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 17px; }
.field-wide { grid-column: 1 / -1; }
.function-dialog footer { margin-top: 26px; display: flex; justify-content: flex-end; align-items: center; gap: 19px; }
.compact-dialog { max-width: 540px; }
.file-drop { min-height: 150px; padding: 26px; display: grid; place-items: center; align-content: center; gap: 8px; border: 1px dashed rgba(23,63,51,.4); background: rgba(255,253,248,.54); text-align: center; cursor: pointer; }
.file-drop span { font-size: 15px; font-weight: 650; }
.file-drop small, .import-hint { color: var(--ink-soft); font-size: 10px; }
.file-drop input { max-width: 100%; margin-top: 10px; font-size: 11px; }
.import-hint { margin: 14px 0 0; line-height: 1.6; }
.preview-dialog { width: min(94vw, 980px); }
.preview-stage { min-height: 420px; padding: 20px; display: grid; place-items: center; background: var(--paper-deep); }
.preview-stage img { max-width: 100%; max-height: 68dvh; box-shadow: 0 18px 55px rgba(35, 47, 40, .18); }
.preview-loading { color: var(--ink-soft); font-size: 12px; }
.dialog-copy { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.75; }

/* Redeem */
.redeem-page {
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, rgba(23, 26, 23, 0.06) 1px, transparent 0);
  background-size: 44px 44px;
}
.redeem-main { width: min(calc(100% - (var(--gutter) * 2)), var(--container)); margin: 0 auto; padding: 66px 0 92px; }
.redeem-intro { min-height: 400px; display: grid; grid-template-columns: 1fr 0.72fr; align-items: center; gap: clamp(50px, 9vw, 130px); }
.redeem-intro h1 { margin: 22px 0 0; font-size: clamp(48px, 5vw, 72px); line-height: 1.04; letter-spacing: -0.065em; }
.redeem-intro > div:first-child > p:not(.eyebrow) { max-width: 580px; margin: 25px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.8; }
.redeem-steps { margin: 31px 0 0; padding: 0; display: flex; gap: 28px; list-style: none; }
.redeem-steps li { display: flex; align-items: center; gap: 9px; }
.redeem-steps span { color: var(--accent); font: 650 9px/1 var(--mono); }
.redeem-steps b { font-size: 11px; font-weight: 600; }
.coupon-motif { position: relative; min-height: 310px; padding: 34px; overflow: hidden; display: grid; align-content: space-between; color: var(--ink); background: var(--accent); border-radius: 3px 24px 24px 24px; box-shadow: 24px 24px 0 rgba(23, 63, 51, .14); transform: rotate(2deg); }
.coupon-motif::before, .coupon-motif::after { content: ""; position: absolute; left: -13px; top: 72px; width: 26px; height: 26px; border-radius: 50%; background: var(--paper); box-shadow: 440px 0 var(--paper); }
.coupon-motif::after { top: auto; bottom: 72px; }
.coupon-motif > span { font: 700 10px/1 var(--mono); letter-spacing: .14em; }
.coupon-motif strong { align-self: center; font-size: 112px; letter-spacing: -.08em; }
.coupon-motif strong small { font-size: 30px; vertical-align: top; letter-spacing: 0; }
.coupon-motif i { width: 80px; height: 30px; justify-self: end; background: repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 6px); }
.redeem-workspace { margin-top: 80px; padding: clamp(26px, 4vw, 48px); display: grid; grid-template-columns: 1fr 0.92fr; gap: clamp(34px, 5vw, 70px); color: var(--white); background: var(--ink); border-radius: 3px 28px 28px 28px; box-shadow: 0 32px 78px rgba(36, 38, 32, 0.17); }
.redeem-form-panel { min-height: 520px; padding: 16px 8px 8px; display: flex; flex-direction: column; }
.redeem-form-panel .section-number { color: #ef8c72; }
.redeem-form-panel h2 { margin: 44px 0 0; font-size: clamp(29px, 3vw, 40px); }
.redeem-form-panel > p:not(.section-number) { margin: 14px 0 31px; color: #9a9d96; font-size: 13px; }
.coupon-code-field { position: relative; min-height: 78px; padding: 13px 55px 11px 19px; border: 1px solid #444740; border-radius: 3px 13px 13px 13px; display: grid; align-content: center; background: #242621; transition: border-color .2s ease, box-shadow .2s ease; }
.coupon-code-field:focus-within { border-color: #e9795d; box-shadow: 0 0 0 3px rgba(231, 94, 60, .12); }
.coupon-code-field > span { color: #92968f; font: 650 9px/1 var(--mono); letter-spacing: .12em; }
.coupon-code-field input { width: 100%; margin-top: 9px; padding: 0; border: 0; outline: 0; color: var(--white); background: transparent; font: 14px var(--mono); }
.coupon-code-field input::placeholder { color: #686b65; font-family: var(--font); }
.clear-code-button { position: absolute; right: 14px; bottom: 13px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: #abadA6; background: #343630; cursor: pointer; font-size: 20px; }
.coupon-submit, .redeem-button { width: 100%; min-height: 58px; margin-top: 14px; border: 0; border-radius: 2px 15px 15px 15px; display: flex; align-items: center; justify-content: center; gap: 10px; color: #fff; background: var(--accent); cursor: pointer; font-size: 14px; font-weight: 700; transition: transform .25s var(--ease), filter .25s ease; }
.coupon-submit:hover:not(:disabled), .redeem-button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.04); }
.coupon-submit:disabled, .redeem-button:disabled { cursor: wait; opacity: .68; }
.form-message { min-height: 22px; margin: 10px 4px 0; color: #f19782; font-size: 11px; line-height: 1.5; }
.form-message.is-success { color: #8ab69f; }
.redeem-assurances { margin: auto 0 5px; padding: 0; display: flex; justify-content: space-between; gap: 12px; list-style: none; color: #9a9d96; font-size: 11px; }
.redeem-assurances li { display: flex; align-items: center; gap: 8px; }
.redeem-assurances i { width: 7px; height: 7px; border-radius: 50%; background: #7ea890; }
.coupon-result-panel { position: relative; min-width: 0; min-height: 520px; overflow: hidden; color: var(--ink); background: #f0ece2; border-radius: 3px 20px 20px 20px; }
.result-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.result-cube { position: relative; width: 94px; height: 94px; margin-bottom: 28px; animation: result-float 5s ease-in-out infinite; }
.result-cube span { position: absolute; width: 56px; height: 56px; background: #dce4db; transform: rotate(30deg) skew(-5deg); }
.result-cube span:nth-child(1) { left: 11px; top: 4px; }
.result-cube span:nth-child(2) { right: 0; top: 25px; background: #9fb4aa; }
.result-cube span:nth-child(3) { left: 12px; bottom: 0; background: var(--forest); }
.result-empty p { margin: 0 0 9px; font-size: 20px; font-weight: 700; }
.result-empty small { color: #85877f; font-size: 12px; }
.result-lines { width: 56%; margin-top: 39px; display: grid; gap: 10px; }
.result-lines i { height: 6px; background: #ddd8ce; }
.result-lines i:nth-child(2) { width: 82%; }
.result-lines i:nth-child(3) { width: 58%; }
.coupon-result { min-height: 100%; padding: 27px; }
.coupon-result > header { display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 16px; }
.coupon-image-wrap { width: 78px; height: 78px; overflow: hidden; background: #dce4db; border-radius: 3px 15px 15px 15px; }
.coupon-image-wrap img, .coupon-image-wrap svg { width: 100%; height: 100%; object-fit: cover; }
.coupon-result header p { margin: 0 0 7px; color: #74766f; font-size: 10px; }
.coupon-result header h3 { margin: 0; font-size: clamp(19px, 1.8vw, 25px); }
.valid-badge { padding: 8px 11px; color: #176445; background: #d6e4da; border-radius: 2px 10px 10px 10px; font-size: 10px; white-space: nowrap; }
.valid-badge i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #176445; }
.result-divider { height: 1px; margin: 24px 0; background: var(--line); }
.amount-label, .result-note { margin: 0; color: #74766f; font-size: 11px; }
.coupon-amount { margin: 2px 0 5px; display: flex; align-items: flex-start; line-height: 1; }
.coupon-amount small { margin-top: 14px; font-size: 28px; font-weight: 700; }
.coupon-amount strong { font-size: clamp(63px, 6vw, 82px); letter-spacing: -.07em; }
.masked-code { min-height: 16px; margin: 11px 0 0; color: #969990; font: 9px var(--mono); letter-spacing: .08em; }
.redeem-button { margin-top: 19px; background: var(--forest); }
.irreversible-note { margin: 12px 0 0; color: #99604f; font-size: 9px; text-align: center; }
.redeemed-result { position: absolute; inset: 0; padding: 34px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.success-mark { width: 84px; height: 84px; padding: 8px; border: 1px solid #9cb0a6; border-radius: 50%; }
.success-mark span { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--forest); font-size: 32px; }
.success-kicker { margin: 25px 0 12px !important; color: #2d7156 !important; font: 700 9px/1 var(--mono) !important; letter-spacing: .16em; }
.redeemed-result h3 { margin: 0; font-size: 35px; }
.redeemed-result > p:not(.success-kicker) { max-width: 350px; margin: 15px 0 25px; color: #74766f; font-size: 12px; line-height: 1.7; }
.redeemed-result button { padding: 11px 19px; border: 1px solid var(--ink); border-radius: 2px 10px 10px 10px; background: transparent; cursor: pointer; }
.dialog-coupon { margin-top: 22px; padding: 18px 20px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: var(--paper-deep); }
.dialog-coupon span { font-size: 13px; font-weight: 650; }
.dialog-coupon strong { font-size: 26px; }
.dialog-coupon small { font-size: 16px; }

@keyframes function-spin { to { transform: rotate(360deg); } }
@keyframes skeleton-shift { to { background-position: -200% 0; } }
@keyframes result-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (max-width: 1100px) {
  .app-hero { grid-template-columns: minmax(360px, .8fr) minmax(0, 1.2fr); }
  .download-dock { grid-template-columns: 1fr; }
  .download-status { grid-column: 1; margin-top: -38px; }
  .certificate-gate { grid-template-columns: minmax(430px, 1fr) minmax(330px, .8fr); gap: 54px; }
  .workspace-tools { grid-template-columns: 1fr; }
  .filter-form { grid-template-columns: repeat(4, 1fr); }
  .filter-actions { grid-column: 1 / -1; }
  .admin-actions { justify-self: end; grid-row: 2; margin-top: -52px; }
}

@media (max-width: 860px) {
  .unified-header { position: sticky; }
  .unified-header .site-nav { background: rgba(244, 240, 231, .98); }
  .app-hero { width: 100%; min-height: 0; grid-template-columns: 1fr; }
  .app-hero-copy { grid-column: 1; grid-row: 1; min-height: 420px; padding-inline: var(--gutter); }
  .app-hero-copy::after { inset: auto 0 -70px; width: 100%; height: 72px; background: linear-gradient(180deg, var(--paper), rgba(244,240,231,0)); }
  .app-hero > img { grid-column: 1; grid-row: 2; min-height: 460px; object-position: 66% center; }
  .download-options { grid-template-columns: 1fr; }
  .download-options a { min-height: 82px; border-right: 0; border-bottom: 1px solid rgba(21,64,120,.19); }
  .download-options a:last-child { border-bottom: 0; }
  .certificate-gate { min-height: auto; padding-top: 58px; grid-template-columns: 1fr; }
  .gate-visual { min-height: 500px; }
  .gate-content { max-width: 650px; }
  .workspace-heading { align-items: start; }
  .filter-form { grid-template-columns: repeat(2, 1fr); }
  .admin-actions { grid-row: auto; margin-top: 0; justify-self: start; }
  .redeem-intro { grid-template-columns: 1fr; }
  .coupon-motif { width: min(100%, 480px); margin-left: auto; }
  .redeem-workspace { grid-template-columns: 1fr; }
  .redeem-form-panel { min-height: 480px; }
  .coupon-result-panel { min-height: 500px; }
}

@media (max-width: 600px) {
  .action-button { width: 100%; }
  .app-hero-copy { min-height: 380px; padding-top: 60px; padding-bottom: 64px; }
  .app-hero-copy h1 { font-size: 46px; }
  .app-hero > img { min-height: 330px; }
  .download-dock { padding: 56px 0 65px; gap: 33px; }
  .download-dock h2 { font-size: 31px; }
  .download-status { margin-top: -22px; }
  .app-story { padding: 8px; gap: 8px; }
  .certificate-gate { padding-top: 40px; gap: 47px; }
  .gate-visual { min-height: 400px; }
  .gate-certificate { width: 74%; min-height: 235px; padding: 27px 18px; }
  .gate-certificate strong { margin-top: 23px; font-size: 27px; }
  .gate-content h1 { font-size: 43px; }
  .gate-actions { display: grid; }
  .admin-login-form { grid-template-columns: 1fr; }
  .admin-login-form .inline-message, .admin-login-form .form-button-row { grid-column: 1; }
  .form-button-row { display: grid; }
  .certificate-workspace { padding-top: 50px; }
  .workspace-heading { display: grid; }
  .workspace-account { justify-content: space-between; }
  .workspace-tools { margin-top: 38px; }
  .filter-form { grid-template-columns: 1fr; }
  .filter-actions { grid-column: 1; display: grid; }
  .admin-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .certificate-table-wrap { margin-inline: calc(var(--gutter) * -1); padding-left: var(--gutter); }
  .certificate-table { min-width: 1080px; }
  .batch-bar { bottom: 10px; }
  .table-pagination { justify-content: start; overflow-x: auto; }
  .function-dialog > form, .function-dialog > div { padding: 26px 20px; }
  .member-form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: 1; }
  .function-dialog footer { display: grid; }
  .preview-dialog footer { display: flex; }
  .preview-stage { min-height: 280px; padding: 10px; }
  .redeem-main { padding-top: 52px; }
  .redeem-intro { min-height: 0; gap: 55px; }
  .redeem-intro h1 { font-size: 47px; }
  .redeem-steps { display: grid; gap: 13px; }
  .coupon-motif { min-height: 280px; }
  .coupon-motif strong { font-size: 92px; }
  .redeem-workspace { margin-top: 64px; padding: 24px 17px 17px; }
  .redeem-form-panel { min-height: 455px; padding-inline: 4px; }
  .redeem-assurances { flex-wrap: wrap; }
  .coupon-result-panel { min-height: 480px; }
  .coupon-result { padding: 22px 18px; }
  .coupon-result > header { grid-template-columns: 66px 1fr; }
  .coupon-image-wrap { width: 66px; height: 66px; }
  .valid-badge { grid-column: 1 / -1; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .result-cube, .button-spinner, .button-loader, .skeleton-row span { animation: none !important; }
}

/* Competition sky theme */
.app-site,
.certificate-page,
.redeem-page {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 84% -8%, rgba(120, 201, 245, 0.38), transparent 34rem),
    linear-gradient(rgba(47, 115, 217, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 115, 217, 0.045) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
}

.unified-header,
.app-site .unified-header {
  background: rgba(244, 248, 255, 0.88);
  border-bottom-color: rgba(7, 26, 61, 0.12);
  box-shadow: 0 10px 34px rgba(22, 71, 130, 0.055);
  backdrop-filter: blur(20px) saturate(1.18);
}
.unified-header .site-nav a[aria-current="page"] { color: var(--accent); }
.unified-header .site-nav a[aria-current="page"]::after { height: 2px; background: var(--sky); }
.brand small { color: #607895; }
.eyebrow, .section-number { color: var(--accent); }
.action-button { border-radius: 3px 15px 15px 15px; }
.action-button-primary { color: var(--white); background: var(--accent); box-shadow: 0 12px 26px rgba(33, 92, 168, 0.16); }
.action-button-primary:hover { background: #225fac; }
.action-button-secondary { border-color: rgba(47, 115, 217, 0.22); background: rgba(251, 253, 255, 0.76); }
.action-button-secondary:hover { border-color: var(--accent); color: var(--accent); }
.field-group label { color: #617792; }
.field-group input, .field-group select { border-color: rgba(7, 26, 61, 0.15); background: rgba(251, 253, 255, 0.88); }
.field-group input:focus, .field-group select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 115, 217, 0.1); }
.function-toast { background: var(--forest-deep); box-shadow: 0 18px 46px rgba(7, 27, 61, 0.2); }

/* App / sky runway */
.app-hero {
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid rgba(47, 115, 217, 0.13);
  border-radius: 4px 28px 28px 28px;
  background: #e8f3ff;
  box-shadow: 0 30px 80px rgba(34, 85, 146, 0.12);
}
.app-hero > img { filter: saturate(0.94) contrast(1.025); }
.app-hero-copy {
  overflow: hidden;
  background:
    radial-gradient(circle at 118% 110%, rgba(120, 201, 245, 0.36), transparent 18rem),
    rgba(248, 252, 255, 0.97);
}
.app-hero-copy::before {
  content: "";
  position: absolute;
  right: -190px;
  bottom: -245px;
  width: 410px;
  height: 410px;
  border: 1px solid rgba(47, 115, 217, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(47, 115, 217, 0.035), 0 0 0 84px rgba(47, 115, 217, 0.02);
  pointer-events: none;
}
.app-hero-copy::after { background: linear-gradient(90deg, var(--paper), rgba(244, 248, 255, 0)); }
.download-dock { position: relative; }
.download-dock::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid rgba(47, 115, 217, 0.14);
  border-bottom: 1px solid rgba(47, 115, 217, 0.14);
  pointer-events: none;
}
.download-options { overflow: hidden; border: 0; border-radius: 3px 18px 18px 18px; box-shadow: 0 22px 50px rgba(7, 27, 61, 0.15); }
.download-options a { color: var(--white); border-color: rgba(238, 248, 255, 0.15); background: rgba(7, 27, 61, 0.96); }
.download-options a:hover { color: var(--white); background: var(--accent); }
.download-options span, .download-options small { color: #98d5f7; }
.download-options b { color: var(--white); }
.download-status { color: #607793; }
.app-story { padding: 12px; gap: 12px; background: #d8e9fa; border-top: 1px solid rgba(47, 115, 217, 0.12); }
.app-story figure { background: #e7f2fc; }
.app-site .site-footer { border-color: rgba(47, 115, 217, 0.18); }

/* Certificates / competitive arena */
.certificate-gate { position: relative; }
.certificate-gate::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -16vw;
  top: 8%;
  width: min(54vw, 720px);
  aspect-ratio: 1;
  border: 1px solid rgba(47, 115, 217, 0.11);
  border-radius: 50%;
  box-shadow: 0 0 0 58px rgba(47, 115, 217, 0.025), 0 0 0 116px rgba(47, 115, 217, 0.016);
}
.gate-visual { background: var(--forest-deep); border: 1px solid rgba(47, 115, 217, 0.18); box-shadow: 0 32px 80px rgba(7, 27, 61, 0.2); }
.gate-visual > img { opacity: 0.9; }
.gate-visual::after { background: linear-gradient(180deg, rgba(7, 26, 61, 0.04), rgba(7, 26, 61, 0.3)); }
.gate-certificate { background: rgba(251, 253, 255, 0.96); box-shadow: 0 26px 66px rgba(7, 27, 61, 0.3); }
.gate-certificate::before { border-color: rgba(47, 115, 217, 0.38); }
.gate-certificate::after { border-color: rgba(120, 201, 245, 0.55); }
.gate-certificate span, .gate-note { color: #637995; }
.gate-note i { background: var(--accent); }
.role-chip, .role-chip.is-admin { color: #235fae; background: rgba(47, 115, 217, 0.1); }
.workspace-tools { border-color: rgba(47, 115, 217, 0.17); }
.certificate-table-wrap { border-top-color: var(--accent); background: rgba(251, 253, 255, 0.65); }
.certificate-table th { color: #607590; background: rgba(216, 234, 250, 0.72); }
.certificate-table td { border-bottom-color: rgba(7, 26, 61, 0.09); }
.certificate-table tbody tr:hover { background: rgba(225, 239, 253, 0.72); }
.mono-cell { color: #526984; }
.award-merit { color: #245f9f; background: #dbeafb; }
.award-none { color: #687a90; background: #e5edf7; }
.row-actions button:hover, .row-actions a:hover { background: var(--accent); }
.table-empty > span { background: radial-gradient(circle, var(--accent) 0 5px, transparent 6px); }
.batch-bar { background: var(--forest-deep); box-shadow: 0 16px 42px rgba(7, 27, 61, 0.2); }
.table-pagination button { background: rgba(251, 253, 255, 0.72); }
.table-pagination button:hover:not(:disabled), .table-pagination button[aria-current="page"] { background: var(--accent); border-color: var(--accent); }
.retention-note { color: #6b7f98; }
.function-dialog { background: var(--paper); box-shadow: 0 36px 100px rgba(7, 27, 61, 0.28); }
.function-dialog::backdrop { background: rgba(5, 17, 39, 0.72); }
.file-drop { border-color: rgba(47, 115, 217, 0.42); background: rgba(251, 253, 255, 0.58); }

/* Coupons / secure timing console */
.redeem-intro { position: relative; }
.coupon-motif { color: var(--ink); background: var(--sky); box-shadow: 24px 24px 0 rgba(7, 27, 61, 0.12); }
.coupon-motif i { background: repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 6px); }
.redeem-workspace {
  border: 1px solid rgba(120, 201, 245, 0.17);
  background-color: var(--forest-deep);
  background-image:
    radial-gradient(circle at 0 0, rgba(120, 201, 245, 0.13), transparent 28rem),
    linear-gradient(rgba(120, 201, 245, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 201, 245, 0.045) 1px, transparent 1px);
  background-size: auto, 38px 38px, 38px 38px;
  box-shadow: 0 34px 84px rgba(7, 27, 61, 0.19), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.redeem-form-panel .section-number { color: var(--sky); }
.redeem-form-panel > p:not(.section-number), .redeem-assurances { color: #9eb1ca; }
.coupon-code-field { border-color: rgba(152, 213, 247, 0.24); background: rgba(13, 42, 83, 0.82); }
.coupon-code-field:focus-within { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(120, 201, 245, 0.12); }
.coupon-code-field > span { color: #98d5f7; }
.coupon-code-field input::placeholder { color: #6f86a4; }
.clear-code-button { color: #bdd7ec; background: #153662; }
.coupon-submit, .redeem-button { background: var(--accent); }
.form-message { color: #ff9f96; }
.form-message.is-success { color: #98d5f7; }
.redeem-assurances i { background: var(--sky); }
.coupon-result-panel {
  background-color: #edf6ff;
  background-image:
    linear-gradient(rgba(47, 115, 217, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 115, 217, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}
.result-cube span { background: #d6ecfb; }
.result-cube span:nth-child(2) { background: #8dcdf2; }
.result-cube span:nth-child(3) { background: var(--accent); }
.result-empty small, .coupon-result header p, .amount-label, .result-note, .masked-code, .redeemed-result > p:not(.success-kicker) { color: #627993; }
.result-lines i { background: #d5e4f3; }
.coupon-image-wrap { background: #dceaf8; }
.valid-badge { color: #235fae; background: #d8eafb; }
.valid-badge i { background: var(--accent); }
.irreversible-note { color: #7a6880; }
.success-mark { border-color: #92bee5; }
.success-mark span { background: var(--accent); }
.success-kicker { color: #235fae !important; }
.dialog-coupon { background: var(--paper-deep); }

@media (max-width: 860px) {
  .unified-header .site-nav { background: rgba(244, 248, 255, 0.98); }
  .app-hero { margin-top: 0; border-inline: 0; border-radius: 0; }
  .app-hero-copy::after { background: linear-gradient(180deg, var(--paper), rgba(244, 248, 255, 0)); }
}

@media (max-width: 600px) {
  .app-story { padding: 7px; gap: 7px; }
  .download-options { border-radius: 3px 15px 15px 15px; }
  .certificate-gate::before { display: none; }
}
