@font-face {
  font-family: "Enode Sans";
  src: url("./fonts/EnodeSans-VF.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --brand-75: #f0fde8;
  --brand-100: #e4fed2;
  --brand-150: #cfffad;
  --brand-225: #b0f87c;
  --brand-275: #99e467;
  --brand-700: #10450c;
  --gray-75: #f8f7f7;
  --gray-100: #f4f2f1;
  --gray-125: #efedeb;
  --gray-150: #e8e5e3;
  --gray-175: #dcd8d6;
  --gray-225: #c5c1bf;
  --gray-475: #6e6a68;
  --gray-650: #4c4948;
  --gray-800: #252322;
  --gray-850: #151413;
  --white: #fff;
  --error: #b93f36;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--gray-100);
  color: var(--gray-800);
  font-family: "Enode Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
::selection { background: var(--brand-150); color: #000; }
:focus-visible { outline: 2px solid var(--brand-225); outline-offset: 2px; }

.site-header { height: 64px; }
.header-inner { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.brand { display: flex; align-items: center; justify-content: center; color: var(--gray-800); }
.brand svg { display: block; width: auto; height: 18px; }

.page-shell { width: min(100% - 40px, 720px); margin: 0 auto; padding: 58px 0 100px; }
.page-heading { margin-bottom: 32px; text-align: center; }
.page-heading h1 { margin: 0; font-size: 36px; line-height: 1.15; letter-spacing: -.015em; font-weight: 500; }

.app-card { min-width: 0; overflow: hidden; border: 1px solid var(--gray-175); border-radius: var(--radius-lg); background: var(--white); box-shadow: 0 10px 28px rgba(21, 20, 19, .07), 0 1px 2px rgba(21, 20, 19, .04); }
.panel { padding: 0; }
.result-view h2, #open-key-form h2, .open-result h2 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -.01em; font-weight: 510; }
.modal-body { padding: 24px; }
#create-form, .result-view, .open-result { display: flex; flex-direction: column; }
.modal-footer { position: sticky; bottom: 0; z-index: 1; display: flex; min-height: 64px; align-items: center; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--gray-150); background: var(--gray-75); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--gray-650); font-size: 13px; line-height: 1.4; font-weight: 450; }
.optional { margin-left: 5px; color: var(--gray-475); font-size: 11px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--gray-175); border-radius: var(--radius-md); background: var(--white); color: var(--gray-800); font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.field input, .field select { height: 42px; padding: 0 12px; }
.field textarea { min-height: 86px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.field textarea.key-input { min-height: 168px; font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
.field input::placeholder, .field textarea::placeholder { color: #918d8b; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--gray-225); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gray-800); box-shadow: 0 0 0 1px var(--gray-800); outline: 0; }
.field input.invalid, .field select.invalid, .field textarea.invalid { border-color: var(--error); }
.select-wrap, .password-wrap { position: relative; }
.select-icon { position: absolute; right: 12px; top: 13px; color: var(--gray-475); pointer-events: none; }
select { appearance: none; cursor: pointer; }
.password-wrap input { padding-right: 56px; }
.visibility { position: absolute; top: 7px; right: 7px; height: 28px; border: 0; border-radius: var(--radius-sm); padding: 0 7px; background: var(--gray-125); color: var(--gray-650); cursor: pointer; font-size: 11px; font-weight: 500; }
.visibility:hover { background: var(--gray-150); color: var(--gray-800); }
.field-foot { min-height: 14px; display: flex; justify-content: space-between; color: var(--gray-475); font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.field-error { min-height: 0; color: var(--error); font-size: 11px; line-height: 1.3; }
.field-error:not(:empty) { min-height: 14px; }

.consent-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--gray-150); }
.consent-row p { margin: 0; max-width: 620px; color: var(--gray-650); font-size: 12px; line-height: 1.5; }
.check { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 0; padding: 0; border: 1px solid var(--gray-225); border-radius: var(--radius-sm); background: var(--white); color: transparent; cursor: pointer; font-size: 12px; line-height: 16px; }
.check.checked { border-color: var(--gray-800); background: var(--gray-800); color: var(--white); }
.consent-error { display: block; margin: 5px 0 0 28px; }

.primary-button, .copy-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; border: 0; border-radius: 999px; padding: 0 15px; background: var(--gray-800); color: var(--white); cursor: pointer; font-size: 15px; line-height: 1; font-weight: 490; transition: background .15s, color .15s, opacity .15s; }
.primary-button:hover, .copy-button:hover { background: var(--brand-225); color: var(--gray-850); }
.primary-button:disabled { opacity: .5; cursor: progress; }
.primary-button span { margin-left: 4px; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; height: 36px; border: 0; border-radius: 999px; padding: 0 15px; background: var(--gray-150); color: var(--gray-650); cursor: pointer; font-size: 14px; font-weight: 490; }
.secondary-button:hover { color: var(--gray-800); background: var(--gray-175); }

.result-title-row { display: flex; align-items: center; gap: 10px; }
.status-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-225); color: var(--gray-850); font-size: 12px; font-weight: 700; }
.result-view .modal-body > p { margin: 10px 0 22px; color: var(--gray-650); font-size: 14px; }
.link-box { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--gray-175); border-radius: var(--radius-md); background: var(--gray-75); }
.link-preview { min-width: 0; flex: 1; padding: 0 7px; color: var(--gray-650); font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-button { flex: 0 0 auto; height: 32px; padding: 0 12px; font-size: 12px; }
.link-meta { display: flex; justify-content: space-between; margin-top: 7px; color: var(--gray-475); font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.warning-card { display: flex; gap: 9px; align-items: flex-start; margin-top: 22px; padding: 12px; border: 1px solid #dbce91; border-radius: var(--radius-md); background: #fffbdc; }
.warning-card > span { flex: 0 0 auto; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #dfc94f; color: var(--gray-850); font-size: 11px; font-weight: 700; }
.warning-card p { margin: 0; color: var(--gray-650); font-size: 12px; line-height: 1.5; }

.recipient-intro { margin: 10px 0 22px; color: var(--gray-650); font-size: 14px; line-height: 1.5; }
.recipient-intro a { color: var(--gray-800); font-weight: 550; text-underline-offset: 2px; }
.recipient-intro a:hover { color: var(--brand-700); }
.recipient-intro code { color: var(--gray-800); font-size: 12px; }
.open-result-header { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 18px; }
.verified-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; background: var(--brand-100); color: var(--brand-700); font: 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.verified-badge span { font-family: inherit; }
.details-card { border: 1px solid var(--gray-175); border-radius: var(--radius-md); overflow: hidden; }
.detail-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; min-height: 54px; padding: 9px 12px; border-bottom: 1px solid var(--gray-150); background: var(--white); }
.detail-row:last-child { border-bottom: 0; }
.detail-label { color: var(--gray-475); font-size: 12px; }
.detail-value { min-width: 0; color: var(--gray-800); font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.detail-action { height: 28px; margin-left: 10px; border: 0; padding: 0 8px; border-radius: var(--radius-sm); background: var(--gray-125); color: var(--gray-650); cursor: pointer; font-size: 11px; font-weight: 500; }
.detail-action:hover { color: var(--gray-800); background: var(--gray-150); }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 10; padding: 10px 13px; border-radius: var(--radius-md); background: var(--gray-850); color: var(--white); font-size: 12px; box-shadow: 0 8px 30px rgba(21, 20, 19, .18); transform: translateY(10px); opacity: 0; pointer-events: none; transition: .18s; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #7d2924; }
[hidden] { display: none !important; }

@media (max-width: 680px) {
  .page-shell { width: min(100% - 24px, 720px); padding: 46px 0 72px; }
  .page-heading { margin-bottom: 28px; }
  .page-heading h1 { font-size: 36px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .modal-body { padding: 20px; }
  .modal-footer { padding: 12px 20px; }
  .link-box { align-items: stretch; flex-direction: column; }
  .copy-button { width: 100%; }
  .open-result-header { align-items: flex-start; flex-direction: column; }
  .detail-row { grid-template-columns: 96px 1fr auto; }
}

@media (max-width: 420px) {
  .detail-row { grid-template-columns: 1fr auto; gap: 4px; }
  .detail-label { grid-column: 1 / -1; }
}
