/* diary/data.css — non-tab 管理麻吉記憶 bottom sheet.
 * Component-only; tokens come from diary.css. The sheet intentionally exposes only export and
 * full Clear, never profile prose, impressions, structured memories, edits, or confirmations. */

body.dmLock { overflow: hidden; }

.dmScrim {
  position: fixed;
  inset: 0;
  background: rgba(43, 42, 38, 0.38);
  z-index: 70;
}

.dmSheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  max-width: var(--maxw);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 32px);
  overflow-y: auto;
  padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  background: var(--surface);
  box-shadow: 0 -10px 40px rgba(43, 42, 38, 0.22);
  z-index: 71;
  transform: translateY(100%);
  transition: transform 0.24s ease;
}
.dmSheet.up { transform: none; }

.dmHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dmTitle {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}
.dmClose {
  flex: none;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.dmClose:hover { color: var(--text); background: var(--surface-2); }

.dmIntro {
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}
.dmActions,
.dmConfirmRow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.dmBtn {
  min-width: 132px;
  min-height: 44px;
  padding: 9px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease;
}
.dmBtn:hover { border-color: var(--brand); }
.dmBtn:disabled { opacity: 0.55; cursor: default; }
.dmClear { color: var(--rec); }
.dmClear:hover { border-color: var(--rec); }
.dmDanger {
  border-color: var(--rec);
  background: var(--rec);
  color: var(--brand-ink);
}
.dmDanger:hover { border-color: var(--rec); }

.dmConfirm { margin-top: 14px; }
.dmConfirmAsk {
  margin: 0 2px 12px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: center;
}
.dmMsg {
  margin: 14px 2px 0;
  color: var(--muted);
  font-family: var(--kai);
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  text-align: center;
}
.dmMsg.dmErr { color: var(--rec); }

/* device code (audit #152): the diary's only key — shown, copyable, restorable */
.dmCodeWrap {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.dmCodeTitle {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.dmCode {
  display: block;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}
.dmCode:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.dmCodeSmall { font-size: 0.78rem; padding: 6px 8px; }
.dmCodeHint,
.dmCodeAsk,
.dmCodeFoundLabel {
  margin: 8px 2px 10px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}
.dmCodeRow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.dmSmall { min-width: 0; min-height: 40px; padding: 7px 16px; font-size: 0.88rem; }
.dmCodeForm { margin-top: 10px; }
.dmCodeInput {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92rem;
}
.dmCodeInput:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.dmCodeFound {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.dmCodeMsg { margin-top: 10px; }

@media (max-width: 360px) {
  .dmBtn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .dmSheet, .dmBtn { transition: none; }
}
