/* Central notification dialog contract. Owned by ModalManager. */
.notice-overlay { box-sizing: border-box; position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: var(--m-overlay); overscroll-behavior: contain; }
.notice-overlay.active { display: flex; }
dialog.notice-overlay { margin: 0; width: 100%; height: 100%; max-width: none; max-height: none; border: 0; color: inherit; }
dialog.notice-overlay::backdrop { background: transparent; }
.notice-overlay.closing { display: flex; pointer-events: none; opacity: 0; }
.notice-overlay > .notice-dialog {
  --notice-tone: var(--m-warning);
  --notice-soft: var(--m-warning-bg);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(520px, 100%);
  max-width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--m-border);
  border-top: 3px solid var(--notice-tone);
  border-radius: 14px;
  background: var(--m-surface);
  color: var(--m-text);
  box-shadow: var(--m-shadow-float);
  font-family: system-ui, -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.65;
  text-align: left;
  isolation: isolate;
}
.notice-dialog[data-notice-type='danger'], .notice-dialog[data-notice-type='error'] { --notice-tone: var(--m-danger); --notice-soft: var(--m-danger-bg); }
.notice-dialog[data-notice-type='info'] { --notice-tone: var(--m-info); --notice-soft: var(--m-info-bg); }
.notice-dialog[data-notice-type='success'] { --notice-tone: var(--m-success); --notice-soft: var(--m-success-bg); }
.notice-dialog .notice-header { display: flex; align-items: flex-start; gap: 12px; flex: 0 0 auto; padding: 20px 20px 16px 24px; }
.notice-dialog .notice-icon { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 12px; background: var(--notice-soft); color: var(--notice-tone); }
.notice-dialog svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.notice-dialog .notice-heading { flex: 1; min-width: 0; }
.notice-dialog .notice-kind { color: var(--notice-tone); font-size: 12px; font-weight: 600; }
.notice-dialog .notice-title { margin: 2px 0 0; color: var(--m-text); font-size: 20px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.notice-dialog .notice-close { display: grid; place-items: center; box-sizing: border-box; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--m-text-2); cursor: pointer; }
.notice-dialog .notice-close:hover { background: var(--m-surface-2); }
.notice-dialog .notice-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 0 24px 20px; overflow-wrap: anywhere; }
.notice-dialog .notice-message { margin: 0; white-space: pre-wrap; color: var(--m-text); }
.notice-dialog .notice-section { margin-top: 20px; }
.notice-dialog .notice-section-title { margin: 0 0 8px; font-size: 14px; color: var(--m-text); font-weight: 650; }
.notice-dialog .notice-details { margin: 0; padding: 4px 12px; background: var(--m-surface-2); border: 1px solid var(--m-border); border-radius: 8px; }
.notice-dialog .notice-detail { display: flex; align-items: baseline; gap: 16px; justify-content: space-between; padding: 8px 0; }
.notice-dialog .notice-detail + .notice-detail { border-top: 1px solid var(--m-border); }
.notice-dialog .notice-detail dt { color: var(--m-text-2); flex: 1; min-width: 0; }
.notice-dialog .notice-detail dd { margin: 0; flex: 1; min-width: 0; text-align: right; color: var(--m-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.notice-dialog .notice-list { margin: 0; padding-left: 20px; }
.notice-dialog .notice-list li + li { margin-top: 6px; }
.notice-dialog .notice-impact { margin-top: 16px; padding: 12px 14px; border-left: 3px solid var(--notice-tone); border-radius: 4px; background: var(--notice-soft); color: var(--m-text); white-space: pre-wrap; }
.notice-dialog .notice-footer { display: flex; flex: 0 0 auto; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--m-border); background: var(--m-surface-2); }
.notice-dialog .notice-footer--summary { align-items: center; justify-content: space-between; }
.notice-dialog .notice-actions { display: flex; align-items: center; gap: 8px; }
.notice-dialog .notice-button { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; min-width: 96px; min-height: 44px; padding: 10px 18px; border: 1px solid var(--m-text-3); border-radius: 8px; background: var(--m-surface); color: var(--m-text); font: inherit; font-weight: 600; line-height: 1.4; cursor: pointer; touch-action: manipulation; white-space: normal; overflow-wrap: anywhere; }
.notice-dialog .notice-button--primary { background: var(--m-primary); border-color: var(--m-primary); color: var(--m-on-primary); }
.notice-dialog[data-notice-type='danger'] .notice-button--primary { background: var(--m-danger); border-color: var(--m-danger); }
.notice-dialog :is(.notice-button, .notice-close):focus-visible { outline: 3px solid var(--m-primary); outline-offset: 3px; }
.notice-dialog .notice-button--choice { flex: 1 1 0; min-width: 0; min-height: 72px; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; }
.notice-dialog .notice-button--choice span { color: var(--m-text-2); font-size: 12px; font-weight: 400; line-height: 1.5; }
.notice-dialog .notice-button--choice:disabled { opacity: .65; cursor: wait; }
.notice-overlay.active > .notice-dialog { animation: notice-enter 160ms ease-out; }
@keyframes notice-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .notice-dialog .notice-header { padding: 16px 12px 16px 16px; gap: 10px; }
  .notice-dialog .notice-title { font-size: 18px; }
  .notice-dialog .notice-body { padding: 0 16px 16px; }
  .notice-dialog .notice-footer { padding: 12px 16px; }
  .notice-dialog .notice-button { flex: 1; min-width: 0; }
}
@media (max-height: 480px) { .notice-dialog .notice-header { padding-top: 12px; padding-bottom: 12px; } .notice-dialog .notice-footer { padding-top: 12px; padding-bottom: 12px; } }
@media (prefers-reduced-motion: reduce) { .notice-overlay.active > .notice-dialog { animation: none; } }
@media (forced-colors: active) { .notice-overlay > .notice-dialog, .notice-dialog .notice-button, .notice-dialog .notice-close { border: 1px solid ButtonText; } .notice-dialog .notice-icon { outline: 1px solid CanvasText; } }

.notice-dialog .notice-input-field { display: grid; gap: 8px; margin-top: 16px; font-weight: 600; }
.notice-dialog .notice-input { box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--m-text-3); border-radius: 8px; background: var(--m-surface); color: var(--m-text); font: inherit; font-size: 16px; }
.notice-dialog .notice-error { color: var(--m-danger); font-size: 12px; font-weight: 400; }
.notice-dialog .notice-input:focus-visible { outline: 3px solid var(--m-primary); outline-offset: 2px; }
