/* AGENT_TARGET: magic-keepsake-camera-styles — camera modal, memory sparks, saved album */

.keepsake-camera-modal {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  place-items: center;
  padding: 18px;
}

.keepsake-camera-modal[hidden] {
  display: none;
}

.keepsake-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 24, 48, 0.58);
  backdrop-filter: blur(4px);
}

.keepsake-card {
  position: relative;
  width: min(1040px, calc(100vw - 28px));
  max-height: min(88vh, 820px);
  overflow: auto;
  border: 3px solid #f0b84e;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 254, 255, 0.94)),
    linear-gradient(135deg, #fff4c8, #d7fff3 52%, #f9d6ff);
  box-shadow: 0 18px 60px rgba(22, 18, 52, 0.34);
  color: #24324c;
}

.keepsake-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  min-width: 44px;
  min-height: 44px;
  border: 2px solid rgba(36, 50, 76, 0.16);
  border-radius: 12px;
  background: #ffffff;
  color: #7d3764;
  font: 900 26px/1 Arial, sans-serif;
  cursor: pointer;
}

.keepsake-header {
  padding: 22px 70px 14px 24px;
  border-bottom: 1px solid rgba(36, 50, 76, 0.14);
}

.keepsake-kicker {
  display: block;
  color: #7d3764;
  font:
    900 12px/1.2 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.keepsake-header h2,
.keepsake-album-head h3 {
  margin: 4px 0;
  color: #24324c;
  font:
    900 24px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0;
}

.keepsake-header p {
  margin: 0;
  max-width: 650px;
  color: #506074;
  font: 700 14px/1.35 "Trebuchet MS", Arial, sans-serif;
}

.keepsake-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 18px;
  padding: 18px;
}

.keepsake-capture-panel,
.keepsake-album-panel {
  min-width: 0;
}

.keepsake-preview {
  display: grid;
  place-items: center;
  min-height: 270px;
  overflow: hidden;
  border: 3px solid #89d8c6;
  border-radius: 14px;
  background:
    linear-gradient(45deg, rgba(137, 216, 198, 0.18) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(240, 184, 78, 0.18) 25%, transparent 25%),
    #f7fbff;
  background-size: 28px 28px;
}

.keepsake-preview img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #10162a;
}

.keepsake-empty-preview {
  padding: 18px;
  color: #506074;
  font:
    900 18px/1.2 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-align: center;
}

.keepsake-actions,
.keepsake-sparks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.keepsake-actions button,
.keepsake-spark {
  min-width: 0;
  min-height: 48px;
  border: 2px solid rgba(36, 50, 76, 0.16);
  border-radius: 12px;
  background: #ffffff;
  color: #24324c;
  font:
    900 13px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}

.keepsake-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.keepsake-actions .keepsake-primary {
  background: linear-gradient(180deg, #fff2bd, #ffd979);
  border-color: #d9941e;
}

.keepsake-sparks {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.keepsake-spark {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 8px;
  text-align: left;
}

.keepsake-spark span {
  font-size: 20px;
}

.keepsake-spark strong {
  overflow-wrap: anywhere;
}

.keepsake-spark.selected {
  border-color: #159d89;
  background: linear-gradient(180deg, #e8fff9, #c9f8ed);
  box-shadow: 0 0 0 3px rgba(21, 157, 137, 0.18);
}

.keepsake-actions button:focus-visible,
.keepsake-spark:focus-visible,
.keepsake-close:focus-visible {
  outline: 3px solid rgba(21, 157, 137, 0.75);
  outline-offset: 3px;
}

.keepsake-status {
  min-height: 22px;
  margin: 10px 0 0;
  color: #506074;
  font: 800 13px/1.35 "Trebuchet MS", Arial, sans-serif;
}

.keepsake-status[data-mode="success"] {
  color: #126f61;
}

.keepsake-status[data-mode="warn"] {
  color: #8e3d2c;
}

.keepsake-album-panel {
  border-left: 1px solid rgba(36, 50, 76, 0.14);
  padding-left: 18px;
}

.keepsake-album-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.keepsake-album-head h3 {
  font-size: 18px;
}

.keepsake-album-head span {
  color: #7d3764;
  font: 900 12px/1.2 "Trebuchet MS", Arial, sans-serif;
}

.keepsake-album {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.keepsake-album-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 2px dashed rgba(36, 50, 76, 0.2);
  border-radius: 14px;
  color: #506074;
  font: 800 14px/1.3 "Trebuchet MS", Arial, sans-serif;
  text-align: center;
}

.keepsake-memory-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(36, 50, 76, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
}

.keepsake-memory-card img {
  width: 112px;
  height: 74px;
  object-fit: cover;
  border-radius: 9px;
  background: #10162a;
}

.keepsake-memory-copy {
  min-width: 0;
}

.keepsake-memory-copy span,
.keepsake-memory-copy strong,
.keepsake-memory-copy small {
  display: block;
}

.keepsake-memory-copy span {
  color: #159d89;
  font: 900 12px/1.2 "Trebuchet MS", Arial, sans-serif;
}

.keepsake-memory-copy strong {
  margin-top: 2px;
  color: #24324c;
  font: 900 14px/1.15 "Trebuchet MS", Arial, sans-serif;
  overflow-wrap: anywhere;
}

.keepsake-memory-copy p {
  margin: 3px 0;
  color: #506074;
  font: 700 12px/1.25 "Trebuchet MS", Arial, sans-serif;
}

.keepsake-memory-copy small {
  color: #7d3764;
  font: 800 11px/1.2 "Trebuchet MS", Arial, sans-serif;
}

@media (max-width: 760px) {
  .keepsake-camera-modal {
    align-items: start;
    padding: 8px;
  }

  .keepsake-card {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }

  .keepsake-header {
    padding: 18px 62px 12px 14px;
  }

  .keepsake-header h2 {
    font-size: 19px;
  }

  .keepsake-layout {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .keepsake-preview {
    min-height: 210px;
  }

  .keepsake-actions {
    grid-template-columns: 1fr;
  }

  .keepsake-sparks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .keepsake-album-panel {
    border-left: 0;
    border-top: 1px solid rgba(36, 50, 76, 0.14);
    padding-top: 12px;
    padding-left: 0;
  }

  .keepsake-album {
    max-height: none;
  }
}
