.pocket-keepsakes { box-sizing: border-box; }
.pocket-keepsakes .pocket-heading { color: #0a3161; opacity: 1; }
.pocket-keepsakes button { font-family: Georgia, serif; color: #0a3161; cursor: pointer; }
.pocket-keepsakes .pocket-add,
.pocket-keepsakes .pocket-controls button { min-height: 44px; padding: 6px 8px; border: 1px solid #0a316144; background: #f9edcf; font-size: clamp(0.6rem, 0.85vw, 0.85rem); font-weight: bold; text-transform: uppercase; }
.pocket-keepsakes .pocket-add { box-sizing: border-box; width: 60%; min-width: min(100%, 7.5rem); justify-self: center; display: block; margin-inline: auto; }
.pocket-keepsakes .pocket-controls button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: fit-content; max-width: 100%; color: #0a3161; text-align: center; }
.pocket-stack { position: relative; margin: 12px 12px 12px 3px; }
.pocket-backing { position: absolute; inset: 0; background: #e8d4b4; border: 1px solid #9f805e55; transform: translate(calc(var(--pocket-layer) * 3px), calc(var(--pocket-layer) * 3px)) rotate(calc(var(--pocket-layer) * 2deg)); pointer-events: none; }
.pocket-keepsakes .pocket-card { display: grid; gap: 6px; position: relative; width: 100%; padding: 12px; text-align: left; border: 1px solid #9f805e55; border-radius: 2px; background: linear-gradient(#fff9e3, #eddbb6); box-shadow: 0 5px 9px #2d18082b; transform: rotate(-1deg); }
.pocket-card small { color: #0a3161; font-size: clamp(0.55rem, 0.72vw, 0.75rem); letter-spacing: 0.05em; }
.pocket-card strong { color: #0a3161; font-size: clamp(0.8rem, 1vw, 1rem); overflow-wrap: anywhere; }
.pocket-keepsakes .pocket-card p { font-size: clamp(0.7rem, 0.88vw, 0.9rem); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.miles-state-sheet[data-planner-mode="myPlans"] .pocket-keepsakes:not(.is-empty) { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: visible; }
.pocket-keepsakes .pocket-stack { min-height: 0; max-height: 230px; }
.pocket-keepsakes .pocket-card { box-sizing: border-box; height: 100%; min-height: 0; padding: 6px 10px; gap: 3px; grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden; }
.pocket-card strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pocket-thumbnail { min-height: 0; height: 100%; max-height: 100px; width: 100%; max-width: 180px; justify-self: center; align-self: center; overflow: hidden; }
.pocket-thumbnail img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.pocket-thumbnail img[hidden] { display: none; }
.pocket-controls { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pocket-controls:has(button) { min-height: calc(47px + clamp(0.6rem, 0.84vw, 0.78rem)); }
.pocket-keepsakes .pocket-controls span { margin: 0; color: #bf0d3e; opacity: 1; font-size: clamp(0.5rem, 0.7vw, 0.65rem); line-height: 1.2; text-transform: uppercase; }
.pocket-keepsakes :focus-visible, .pocket-dialog :focus-visible { outline: 3px solid #0a3161; outline-offset: 2px; }
.pocket-dialog { box-sizing: border-box; width: min(680px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 32px); overflow-y: auto; margin: auto; padding: 22px; border: 2px solid #0a3161; border-radius: 4px; background: #f7ecd6; color: #0a3161; font: 1rem/1.5 Georgia, serif; box-shadow: 0 15px 45px #0006; overflow-wrap: anywhere; }
.pocket-dialog::backdrop { background: #04182bb3; }
.pocket-dialog header { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 18px; }
.pocket-dialog h2 { margin: 0; color: #0a3161; font: bold 1.4rem/1.2 Georgia, serif; }
.pocket-dialog-heading { min-width: 0; flex: 1; }
.pocket-dialog-actions { display: grid; justify-items: end; flex: 0 0 auto; gap: 4px; max-width: 150px; }
.pocket-dialog .pocket-remove { background: transparent; border-color: transparent; padding: 6px; font-size: 0.7rem; text-transform: uppercase; }
.pocket-link-source { display: grid; gap: 2px; margin: 18px 0 10px; }
.pocket-link-source small { font-size: 0.75rem; font-weight: bold; letter-spacing: 0.08em; text-transform: uppercase; }
.pocket-dialog .pocket-open-link { display: inline-block; padding: 10px 16px; border: 1px solid #0a316166; background: #e8d4b4; font-weight: bold; font-size: 0.85rem; text-transform: uppercase; text-decoration: none; }
.pocket-dialog button, .pocket-dialog a { color: #0a3161; }
.pocket-dialog button { padding: 9px 12px; min-height: 44px; border: 1px solid #0a316166; background: #e8d4b4; font: bold 0.85rem Georgia, serif; cursor: pointer; }
.pocket-dialog button:disabled { opacity: 0.65; cursor: wait; }
.pocket-dialog label { display: grid; gap: 4px; margin: 12px 0; }
.pocket-dialog input, .pocket-dialog textarea { box-sizing: border-box; min-width: 0; width: 100%; padding: 10px; border: 1px solid #0a316166; background: #fffbef; color: #0a3161; font: 1rem/1.4 Georgia, serif; }
.pocket-dialog textarea { resize: vertical; }
.pocket-dialog .pocket-qr-scan { background: transparent; font-size: 0.8rem; text-transform: uppercase; }
.pocket-qr-status { margin: 4px 0 12px; font-size: 0.85rem; }
.pocket-qr-status:empty { display: none; }
.pocket-image-choice { min-width: 0; margin: 16px 0; padding: 0; border: 0; }
.pocket-image-choice legend { margin-bottom: 8px; font-size: 0.8rem; font-weight: bold; letter-spacing: 0.06em; text-transform: uppercase; }
.pocket-image-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pocket-image-actions button { text-transform: uppercase; }
.pocket-image-choice p { margin: 8px 0 0; font-size: 0.85rem; overflow-wrap: anywhere; }
.pocket-dialog form > button, .pocket-dialog [data-pocket-body] > button { margin: 6px 8px 6px 0; }
.pocket-dialog .pocket-choice { display: block; width: 100%; text-align: left; }
.pocket-card .pocket-category, .pocket-dialog .pocket-category { color: #bf0d3e; text-transform: uppercase; letter-spacing: 0.07em; }
.pocket-dialog .pocket-category { margin: 0 0 6px; font-size: 0.75rem; }
.pocket-note { white-space: pre-wrap; }
.pocket-photo-view img { display: block; width: 100%; height: auto; }
.pocket-photo-view a { display: inline-block; padding: 10px 0; }
.pocket-collection-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.pocket-collection-controls button { padding: 6px 10px; font-size: .8rem; }
.pocket-collection-count { font: .8rem/1.3 Georgia, serif; white-space: nowrap; }
.pocket-collection-controls .pocket-collection-add { margin-left: auto; }
.pocket-keepsakes .pocket-empty-card { height: auto; min-height: 80px; margin-top: 12px; grid-template-rows: auto minmax(0, 1fr) auto; }
@media (max-width: 520px) { .pocket-dialog { padding: 16px; } .pocket-dialog header button { max-width: 110px; } }
@media (max-width: 700px) {
  .miles-state-sheet[data-planner-mode="myPlans"]:has(.pocket-keepsakes--small-screen) { overflow: visible; }
  .miles-state-sheet[data-planner-mode="myPlans"] .pocket-keepsakes.pocket-keepsakes--small-screen {
    top: calc(100% + 16px); left: 5%; width: 90%; height: 320px;
    padding: 12px; transform: none; background: #e8d4b4; border: 1px solid #9f805e55;
  }
  .pocket-keepsakes--small-screen .pocket-add,
  .pocket-keepsakes--small-screen .pocket-controls button { font-size: 0.75rem; }
  .pocket-keepsakes--small-screen .pocket-controls span { font-size: 0.65rem; }
  .pocket-keepsakes--small-screen .pocket-controls:has(button) { min-height: calc(47px + 0.78rem); }
}
