body { margin: 0; background: var(--paper); font-family: var(--font-body); color: var(--ink); }
.wrap { max-width: 480px; margin: 0 auto; padding: 18px 14px 90px; }
.wtitle { font-family: var(--font-head); font-size: 22px; margin: 6px 0 16px; text-align: center; }

.wcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.wsection { margin-bottom: 6px; }
.wsection-title { font-family: var(--font-head); font-size: 15px; color: var(--ink-soft); margin: 18px 2px 8px; }
.wsection:first-child .wsection-title { margin-top: 4px; }

.wgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.wgrid-thumb { position: relative; aspect-ratio: 1.55; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #eee; }
.wgrid-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; display: block; }
.wgrid-remove {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; line-height: 1; padding: 0;
}
.wgrid-badge {
  position: absolute; bottom: 4px; left: 4px; background: var(--ok); color: #fff;
  width: 18px; height: 18px; border-radius: 50%; font-size: 11px; display: flex; align-items: center; justify-content: center;
}
.wgrid-caption { font-size: 12px; text-align: center; margin-top: 5px; color: var(--ink); }
.wcard img.logo { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: #eee; }
.wcard .front { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; }
.wcard .body { flex: 1; min-width: 0; }
.wcard .title { font-size: 15px; }
.wcard .sub { font-size: 12px; color: var(--ink-soft); }
.wcard .remove { background: none; border: none; color: var(--ink-soft); font-size: 18px; cursor: pointer; padding: 4px 8px; }

.empty { text-align: center; color: var(--ink-soft); padding: 60px 20px; }

.fab-row { position: fixed; bottom: 16px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; }
.fab-row .btn { box-shadow: 0 4px 14px rgba(0,0,0,.18); }

.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); display: none;
}
.drawer-backdrop.open { display: block; }
.drawer {
  position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper);
  border-radius: 18px 18px 0 0; max-height: 78vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .2s ease; padding: 18px 16px 30px;
}
.drawer.open { transform: translateY(0); }
.drawer h3 { font-family: var(--font-head); font-weight: 400; margin: 14px 0 8px; }
.dir-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }

dialog#capture-dialog { border: none; border-radius: 14px; padding: 18px; max-width: 340px; width: 90%; }
dialog#capture-dialog img { width: 100%; border-radius: 8px; margin-top: 8px; }

.show-overlay {
  display: none; position: fixed; inset: 0; background: #ffffff; z-index: 50;
  flex-direction: column; align-items: center; justify-content: center; padding: 24px;
}
.show-overlay.open { display: flex; }
.show-content { text-align: center; max-width: 340px; width: 100%; }
.show-content img, .show-content svg { max-width: 100%; }
.show-content .cap { font-family: var(--font-body); color: #333; margin-top: 14px; font-size: 15px; }
.show-content .big-value { font-family: var(--font-mono, monospace); font-size: 22px; letter-spacing: 1px; margin-top: 10px; color: #111; }
.show-close {
  position: fixed; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%;
  border: none; background: #f1efe8; font-size: 18px; z-index: 51;
}
