.personal-memory-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.personal-memory-panel > p {
  margin: 0;
  line-height: 1.65;
}
dialog:has(.personal-memory-home) {
  width: 460px;
  padding: 20px;
  border-color: #bdbdbd;
  border-radius: 12px;
  background: #fff;
}
dialog:has(.personal-memory-home) .dialog-head {
  min-height: 26px;
  margin-bottom: 6px;
}
dialog:has(.personal-memory-home) .dialog-head h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
}
dialog:has(.personal-memory-home) .dialog-head .icon-button {
  width: 28px;
  height: 28px;
  margin: -4px -8px -4px 0;
}
dialog:has(.personal-memory-home) .dialog-head .icon-button img {
  width: 14px;
  height: 14px;
}
.personal-memory-home {
  gap: 12px;
}
.memory-status {
  border: 1px solid #d5d5d5;
  border-radius: 12px;
  padding: 1px 8px;
  background: #f5f5f5;
  color: #888;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}
.memory-status.is-enabled {
  border-color: #b9dfd3;
  background: #e1f4ed;
  color: #126e59;
}
.personal-memory-home > .memory-intro {
  color: #666;
  font-size: 12px;
  line-height: 20px;
}
.memory-extraction {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 30px 52px;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #e1f4ed;
}
.memory-extraction-title {
  font-size: 13px;
  line-height: 20px;
  white-space: nowrap;
}
.memory-extraction-hint {
  color: #858d89;
  font-size: 12px;
  line-height: 18px;
}
.memory-enable-switch {
  width: 30px;
  height: 16px;
  padding: 2px;
  background: #acb3ae;
}
.memory-enable-switch:before {
  width: 12px;
  height: 12px;
  box-shadow: none;
}
.memory-enable-switch[aria-checked="true"] {
  background: #126e59;
}
.memory-enable-switch[aria-checked="true"]:before {
  transform: translateX(14px);
}
.memory-enable-button {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 7px;
  border-color: #126e59;
  background: #126e59;
  font-size: 13px;
  white-space: nowrap;
}
.memory-enable-button:hover {
  background: #0e5b49;
}
.memory-policy {
  margin: 0;
  padding: 12px 14px 12px 22px;
  border-radius: 8px;
  background: #f5f5f5;
  color: #666;
  font-size: 12px;
  line-height: 22px;
  list-style-type: "· ";
}
.personal-memory-collection {
  overflow: hidden;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
}
.personal-memory-collection .personal-memory-list:not([hidden]):not(:empty) {
  max-height: 280px;
  overflow-y: auto;
  padding: 12px;
  border-bottom: 1px solid #d8d8d8;
}
.personal-memory-list[hidden] {
  display: none;
}
.personal-memory-summary {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 12px;
  line-height: 20px;
}
.personal-memory-summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -3px;
}
.personal-memory-disclosure-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #888;
}
.personal-memory-disclosure-action .icon {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}
.personal-memory-summary[aria-expanded="true"]
  .personal-memory-disclosure-action
  .icon {
  transform: rotate(180deg);
}
.personal-memory-list {
  display: grid;
  gap: 12px;
}
.personal-memory-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.personal-memory-row p {
  line-height: 1.65;
  white-space: pre-wrap;
}
.personal-memory-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.personal-memory-row .actions {
  margin-top: 10px;
}
.memory-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--muted);
}
.memory-empty-state {
  display: flex;
  min-height: 172px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 12px;
  border-bottom: 1px solid #d8d8d8;
}
.memory-empty-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 2px;
  border-radius: 50%;
  background: #e1f4ed;
}
.memory-empty-icon .icon {
  width: 14px;
  height: 14px;
  filter: invert(33%) sepia(24%) saturate(1567%) hue-rotate(113deg)
    brightness(92%) contrast(89%);
}
.memory-empty-state p {
  margin: 0;
  line-height: 20px;
}
.memory-empty-state .memory-empty-title {
  font-size: 14px;
}
.memory-empty-state .memory-empty-hint {
  color: #888;
  font-size: 12px;
}
.memory-empty-state button {
  margin-top: 6px;
}
.memory-empty-state button .icon {
  width: 12px;
  height: 12px;
}
.memory-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.memory-footer .actions {
  margin: 0;
  gap: 12px;
}
.memory-footer button,
.memory-empty-state button {
  font-size: 12px;
}
.memory-footer .text-action {
  padding: 6px 0;
}
.memory-footer .memory-history {
  color: #0066c0;
}
.memory-footer .memory-clear {
  color: #e13b3b;
}
@media (max-width: 420px) {
  dialog:has(.personal-memory-home) {
    padding: 16px;
  }
  .memory-extraction {
    grid-template-columns: minmax(0, 1fr) 30px 52px;
    gap: 4px 10px;
  }
  .memory-extraction-hint {
    grid-column: 1;
    grid-row: 2;
  }
  .memory-enable-switch {
    grid-column: 2;
    grid-row: 1 / 3;
  }
  .memory-enable-button {
    grid-column: 3;
    grid-row: 1 / 3;
  }
  .memory-footer,
  .memory-footer .actions {
    gap: 8px;
  }
}
@media (max-width: 600px) {
  .personal-memory-panel .actions {
    flex-wrap: wrap;
  }
  .personal-memory-row {
    padding: 12px;
  }
}
