@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

:root {
  --ink: #111418;
  --muted: #5B616E;
  --secondary: #2E333B;
  --soft: #4A505C;
  --accent: #3B5772;
  --accent-hover: #2A4157;
  --accent-tint: #EDF1F5;
  --border-card: #DADDE3;
  --border-input: #C9CDD5;
  --divider: #E6E8EC;
  --surface-info: #F4F5F7;
  --surface-input: #F7F8FA;
  --success: #1E6B45;
  --danger: #B42318;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #FFFFFF; color: var(--ink); font-family: var(--sans); -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 21px; font-weight: 600; }
button { font-family: inherit; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* ---------- Layout ---------- */
.page { max-width: 440px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding: 0 24px; display: flex; flex-direction: column; }
.main { flex-grow: 1; display: flex; flex-direction: column; gap: 24px; padding-bottom: 24px; }
.main.tight { gap: 20px; }
.bar + .main { padding-top: 24px; }
.center { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; gap: 36px; padding: 32px 0; }
.centered-text { align-items: center; text-align: center; }
.grow { flex-grow: 1; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.title-block { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; gap: 10px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.full { width: 100%; }

.footer { padding: 16px 0 24px; text-align: center; font-size: 13px; color: var(--muted); }
.footer a { color: var(--muted); }

.bar { height: 64px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--divider); }
.bar-logo { height: 26px; width: auto; display: block; }
.back { display: flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 500; padding: 12px 12px 12px 0; text-decoration: none; }
.small-link { font-size: 14px; font-weight: 500; padding: 12px 0; }

.logo { height: auto; display: block; align-self: center; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.brand-sub { font-size: 15px; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }

/* ---------- Text ---------- */
.muted { color: var(--muted); font-size: 14px; }
.normal { font-weight: 400; }
.small { font-size: 13px; }
.lead { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.note { margin: 0 0 8px; text-align: center; font-size: 13px; color: var(--muted); }
.overline { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.accent { color: var(--accent); display: flex; }
.mono { font-family: var(--mono); }
.hint { font-size: 13px; line-height: 1.4; color: var(--muted); }
.error { margin: 0; font-size: 14px; color: var(--danger); }
.status { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.status.ok { color: var(--success); }
.status.bad { color: var(--danger); }
.status.strong { gap: 8px; font-weight: 500; }
.summary { font-size: 14px; line-height: 1.45; color: var(--muted); text-align: center; }
.summary strong { color: var(--ink); font-weight: 500; }

/* ---------- Form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 14px; font-weight: 500; }
.field.left { text-align: left; }
.input { width: 100%; height: 48px; padding: 0 14px; font-size: 16px; font-family: inherit; color: var(--ink); border: 1px solid var(--border-input); border-radius: 10px; background: #FFFFFF; }
.input.mono { font-family: var(--mono); }
.input.filled { background: var(--surface-input); font-size: 15px; }
.textarea { height: auto; padding: 12px 14px; line-height: 1.4; resize: none; }
.with-eye { position: relative; }
.with-eye .input { padding-right: 52px; }
.with-eye .eye { position: absolute; top: 2px; right: 2px; }
.eye, .icon-btn { width: 44px; height: 44px; flex-shrink: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.eye > span { display: flex; }

.btn { height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 0; border-radius: 10px; background: var(--ink); color: #FFFFFF; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { color: #FFFFFF; background: #262B33; }
.btn > span { display: flex; }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-lg { height: 56px; font-size: 17px; }
.btn-outline { background: #FFFFFF; color: var(--ink); border: 1px solid var(--border-input); }
.btn-outline:hover { background: var(--surface-input); color: var(--ink); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #912018; }
.btn:disabled { opacity: 0.6; cursor: default; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--border-card); border-radius: 12px; }
.tile { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; background: var(--accent-tint); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.tile-md { width: 44px; height: 44px; }
.tile-lg { width: 48px; height: 48px; border-radius: 12px; }
.info { display: flex; gap: 12px; padding: 16px; border-radius: 12px; background: var(--surface-info); text-align: left; }
.info-icon { color: var(--accent); flex-shrink: 0; margin-top: 1px; display: flex; }
.info-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.45; }
.info-text strong { font-weight: 600; }
.info-text .muted { font-size: inherit; }

.choice { display: flex; align-items: center; gap: 16px; padding: 18px; border: 1px solid var(--border-card); border-radius: 14px; text-decoration: none; color: var(--ink); }
.choice:hover { color: var(--ink); background: var(--surface-input); }
.choice-admin { border-style: dashed; border-color: #B7BDC7; }
.choice-admin .tile { background: var(--surface-info); color: var(--ink); }
.choice-text { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; }
.choice-title { font-size: 17px; font-weight: 600; }
.admin-section { margin-top: 12px; gap: 12px; }

/* ---------- Upload ---------- */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 220px; padding: 24px; border: 1.5px dashed #9AA3B0; border-radius: 16px; background: var(--surface-input); cursor: pointer; text-align: center; }
.dropzone.dragging { border-color: var(--accent); background: var(--accent-tint); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.dropzone-title { font-size: 17px; font-weight: 600; color: var(--accent); }
.file-card { display: flex; align-items: center; gap: 14px; padding: 14px 8px 14px 16px; }
.file-text { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.file-name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-desc { font-size: 15px; line-height: 1.45; color: var(--secondary); margin-top: 6px; overflow-wrap: anywhere; }

/* ---------- Create: steps and protection ---------- */
.create { flex-grow: 1; display: flex; flex-direction: column; }
.step { display: none; }
.step-content, .step:target { display: flex; }
.create:has(.step:target) .step-content { display: none; }

[data-panel] { display: none; }
.panel { flex-direction: column; gap: 24px; }
.create:has([name=expiry][value=duration]:checked) [data-panel=duration],
.create:has([name=expiry][value=date]:checked) [data-panel=date] { display: flex; }

.toggle { position: relative; cursor: pointer; }
.toggle:has(:checked) { border-color: var(--accent); background: #F6F8FA; box-shadow: inset 0 0 0 1px var(--accent); }
.toggle:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.checkbox { width: 24px; height: 24px; flex-shrink: 0; border: 1.5px solid var(--border-input); border-radius: 7px; display: flex; align-items: center; justify-content: center; color: transparent; }
.toggle:has(:checked) .checkbox { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.info.warn { background: #FDF6E7; }
.info.warn .info-icon { color: #8A5A00; }

.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: #EEF0F3; border-radius: 12px; }
.segmented label { height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--soft); font-size: 15px; font-weight: 500; cursor: pointer; }
.segmented label:has(:checked) { background: #FFFFFF; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(17, 20, 24, 0.12); }
.segmented label:has(:focus-visible) { outline: 2px solid var(--accent); }
.segmented input, .units input { position: absolute; opacity: 0; pointer-events: none; }

.amount { width: 96px; height: 52px; flex-shrink: 0; font-size: 20px; font-weight: 500; text-align: center; }
.units { flex-grow: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.units label { height: 52px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-input); border-radius: 10px; font-size: 15px; font-weight: 500; cursor: pointer; }
.units label:has(:checked) { border: 1.5px solid var(--accent); background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.units label:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }

.calendar { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 600; }
.cal-nav { width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cal-nav:disabled { color: #B7BDC7; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-names { text-align: center; font-size: 12px; font-weight: 500; color: var(--muted); }
.cal-grid button { width: 100%; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-size: 15px; cursor: pointer; }
.cal-grid button:disabled { color: #A9AFB9; cursor: default; }
.cal-grid button.today { text-decoration: underline; text-underline-offset: 4px; }
.cal-grid button.selected { background: var(--accent); color: #FFFFFF; font-weight: 600; text-decoration: none; }

.stepper { display: flex; height: 64px; border: 1px solid var(--border-input); border-radius: 12px; overflow: hidden; }
.stepper button { width: 72px; border: 0; background: var(--surface-input); color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.stepper button:first-child { border-right: 1px solid var(--border-card); }
.stepper button:last-child { border-left: 1px solid var(--border-card); }
.stepper input { flex-grow: 1; min-width: 0; border: 0; text-align: center; font-size: 26px; font-weight: 600; font-family: inherit; color: var(--ink); background: #FFFFFF; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ---------- Created ---------- */
.qr { display: flex; justify-content: center; padding: 20px; border-radius: 16px; }
.qr svg { width: 196px; height: 196px; display: block; }

/* ---------- Admin ---------- */
.share-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.share-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 8px 14px 14px; }
.share-text { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.share-name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-desc { font-size: 14px; line-height: 1.4; color: var(--secondary); white-space: pre-line; overflow-wrap: anywhere; }
.share-text .small { margin-top: 2px; }
.revoke { height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--danger); font-size: 14px; font-weight: 600; cursor: pointer; }
.revoke:hover { background: #FDF0EF; }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(17, 20, 24, 0.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 440px; padding: 24px 24px 32px; background: #FFFFFF; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; gap: 16px; }
.sheet-share { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; background: var(--surface-info); }
.sheet-share .share-name { white-space: normal; overflow-wrap: anywhere; }
.sheet-text { margin: 0; font-size: 15px; line-height: 1.5; color: var(--soft); }

/* ---------- Retrieve ---------- */
.desc-card { width: 100%; display: flex; gap: 14px; padding: 16px; text-align: left; }
.desc-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.desc-body { font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
.secret { display: flex; align-items: center; gap: 4px; min-height: 64px; padding: 8px 4px 8px 16px; border: 1px solid var(--border-input); border-radius: 12px; background: var(--surface-input); }
.secret output { flex-grow: 1; min-width: 0; font-family: var(--mono); font-size: 20px; font-weight: 500; letter-spacing: 0.04em; word-break: break-all; }
