/* The site-wide notice (/platform/assets/notice.js, data in /platform/notice.json): a dialog on entering, then a bar at the
   very top of the page. The bar is in the page's flow: it pushes the page down and covers nothing (not the map's buttons, the
   search or the sheet). Level "alert" is red, white text (6.5:1); "info" is the sea colour. Light and dark themes alike. */
.db-notice-bar {
  flex: none; position: relative; z-index: 1200; margin: 0;
  background: #b3261e; color: #fff; border-bottom: 1px solid rgba(0, 0, 0, .28);
  font: 700 15px/1.35 var(--db-font, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
}
.db-notice-bar.db-notice-info { background: #1d5f6a; }
.db-notice-bar .db-notice-in {
  position: relative; margin: 0; min-height: 38px; box-sizing: border-box;
  padding: calc(9px + env(safe-area-inset-top, 0px)) calc(56px + env(safe-area-inset-right, 0px)) 9px max(12px, env(safe-area-inset-left, 0px));
}
.db-notice-bar .db-notice-open { cursor: pointer; }
.db-notice-bar .db-notice-open:hover { text-decoration: underline; text-underline-offset: 3px; }
.db-notice-sep { opacity: .85; }
.db-notice-bar .db-notice-link {
  color: #fff !important; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap;
}
.db-notice-bar .db-notice-min {
  appearance: none; -webkit-appearance: none; position: absolute; margin: 0; padding: 0; width: 36px; height: 36px;
  right: max(8px, env(safe-area-inset-right, 0px)); top: calc(50% + env(safe-area-inset-top, 0px) / 2); transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .6); background: rgba(0, 0, 0, .12); color: #fff;
}
.db-notice-bar .db-notice-min:hover { background: rgba(0, 0, 0, .25); }
.db-notice-bar .db-notice-open:focus-visible, .db-notice-bar .db-notice-link:focus-visible, .db-notice-bar .db-notice-min:focus-visible {
  outline: 3px solid #fff; outline-offset: 2px; box-shadow: none; border-radius: 3px;
}

/* made small: a red chip on a thin strip of the page's own colour */
.db-notice-bar.is-small { background: transparent; border-bottom: 0; }
.db-notice-bar.is-small .db-notice-in {
  min-height: 0; padding: calc(5px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 5px max(12px, env(safe-area-inset-left, 0px));
}
.db-notice-bar .db-notice-chip {
  appearance: none; -webkit-appearance: none; margin: 0; border: 0; display: inline-flex; align-items: center; min-height: 32px;
  padding: 4px 14px; border-radius: 999px; background: #b3261e; color: #fff; cursor: pointer; text-align: left;
  font: 700 14px/1.3 var(--db-font, system-ui, sans-serif); box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.db-notice-bar.db-notice-info .db-notice-chip { background: #1d5f6a; }
.db-notice-bar .db-notice-chip:hover { filter: brightness(1.08); text-decoration: none; }
.db-notice-bar .db-notice-chip:focus-visible { outline: 3px solid var(--db-text, #1b1d21); outline-offset: 2px; border-radius: 999px; }

/* the dialog (a modal <dialog>, or a fixed box with a shade where <dialog> is missing) */
.db-notice-dialog {
  box-sizing: border-box; width: min(520px, calc(100% - 32px)); max-width: none; max-height: calc(100% - 32px); overflow: auto;
  margin: auto; padding: 20px 22px 20px; border: 0; border-top: 8px solid #b3261e; border-radius: 12px;
  background: var(--db-surface, #fffdf9); color: var(--db-text, #1b1d21);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .38), 0 2px 8px rgba(0, 0, 0, .2);
  font: 400 16.5px/1.5 var(--db-font, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
}
.db-notice-dialog.db-notice-info { border-top-color: #1d5f6a; }
.db-notice-dialog::backdrop { background: rgba(16, 19, 23, .66); }
.db-notice-dialog.is-fallback { display: none; }
.db-notice-dialog.is-fallback.is-open {
  display: block; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 100001; margin: 0;
}
.db-notice-shade { position: fixed; inset: 0; z-index: 100000; background: rgba(16, 19, 23, .66); }
.db-notice-dialog .db-notice-title {
  margin: 0 0 10px; color: #b3261e; font: 800 21px/1.25 var(--db-display, var(--db-font, system-ui, sans-serif)); letter-spacing: -.01em;
}
.db-notice-dialog.db-notice-info .db-notice-title { color: var(--db-sea, #1d5f6a); }
.db-notice-dialog .db-notice-text { margin: 0 0 18px; }
.db-notice-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.db-notice-dialog .db-notice-go, .db-notice-dialog .db-notice-ok {
  flex: 1 1 200px; box-sizing: border-box; min-height: 48px; margin: 0; padding: 10px 16px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; text-align: center; cursor: pointer;
  font: 700 16px/1.25 var(--db-font, system-ui, sans-serif); text-decoration: none;
}
.db-notice-dialog .db-notice-go { background: #b3261e; border: 2px solid #b3261e; color: #fff !important; }
.db-notice-dialog.db-notice-info .db-notice-go { background: #1d5f6a; border-color: #1d5f6a; }
.db-notice-dialog .db-notice-go[hidden] { display: none; }
.db-notice-dialog .db-notice-ok { background: var(--db-surface-2, #eee9e0); border: 2px solid var(--db-border-strong, #b9b0a2); color: var(--db-text, #1b1d21); }
.db-notice-dialog .db-notice-go:hover { filter: brightness(1.08); }
.db-notice-dialog .db-notice-ok:hover { background: var(--db-surface-3, #e3ddd1); }
.db-notice-dialog .db-notice-go:focus-visible, .db-notice-dialog .db-notice-ok:focus-visible {
  outline: 2px solid var(--db-text, #1b1d21); outline-offset: 3px; box-shadow: none;
}
:root[data-theme="dark"] .db-notice-dialog { box-shadow: 0 24px 60px rgba(0, 0, 0, .7), 0 0 0 1px var(--db-border, #2c333d); }
:root[data-theme="dark"] .db-notice-dialog .db-notice-title { color: #f2857b; }
:root[data-theme="dark"] .db-notice-dialog::backdrop, :root[data-theme="dark"] .db-notice-shade { background: rgba(0, 0, 0, .72); }
@media (max-width: 420px) {
  .db-notice-bar { font-size: 14px; }
  .db-notice-dialog { padding: 18px 16px 16px; font-size: 16px; }
  .db-notice-dialog .db-notice-title { font-size: 19px; }
}
@media print { .db-notice-bar, .db-notice-dialog, .db-notice-shade { display: none !important; } }
