/* Mobile SEF concept viewer. Desktop links retain their existing behavior. */
html.sef-viewer-open,
body.sef-viewer-open {
  overflow: hidden;
  overscroll-behavior: none;
}

dialog.sef-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-sizing: border-box;
  background: #f1f6fb;
  color: #17334e;
  font: inherit;
}

.sef-viewer[open] { display: flex; flex-direction: column; }
.sef-viewer::backdrop { background: #17334ec9; }
.sef-viewer [hidden] { display: none !important; }
.sef-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid #d6e3ed;
  background: #fff;
}
.sef-viewer-heading { min-width: 0; }
.sef-viewer-brand { margin: 0 0 4px; color: #0870bc; font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.sef-viewer-brand span { color: #61788c; font-weight: 400; }
.sef-viewer-heading h2 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.4; letter-spacing: -.035em; }
.sef-viewer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 56px;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid #c7dce9;
  border-radius: 6px;
  background: #fff;
  color: #235f85;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}
.sef-viewer button:focus-visible,
.sef-viewer-viewport:focus-visible { outline: 3px solid #0870bc; outline-offset: -3px; }
.sef-viewer button[aria-pressed="true"] { border-color: #0870bc; background: #e4f2fb; color: #0564a8; }
.sef-viewer .sef-viewer-close { background: #0870bc; border-color: #0870bc; color: #fff; }
.sef-viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid #d6e3ed;
  background: #fff;
}
.sef-viewer-scale-note { margin-left: auto; color: #61788c; font-size: 11px; white-space: nowrap; }
.sef-viewer-viewport {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
}
.sef-viewer-stage { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.sef-viewer-image { display: block; width: 100%; height: 100%; max-width: 100%; object-fit: contain; user-select: none; }
.sef-viewer.is-zoomed .sef-viewer-stage { display: block; width: max(100%, 960px); height: auto; min-height: 100%; }
.sef-viewer.is-zoomed .sef-viewer-image { width: 100%; height: auto; max-width: none; max-height: none; object-fit: initial; }
.sef-viewer-error { position: absolute; inset: 20px 16px auto; margin: 0; padding: 16px; border: 1px solid #c7dce9; background: #fff; font-size: 13px; line-height: 1.7; }
.sef-viewer-footer {
  flex-shrink: 0;
  padding: 11px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  border-top: 1px solid #d6e3ed;
  background: #fff;
}
.sef-viewer-hint { margin: 0 0 4px; color: #235f85; font-size: 12px; font-weight: 500; line-height: 1.6; }
.sef-viewer-footer #sef-viewer-note { margin: 0; color: #61788c; font-size: 10px; line-height: 1.6; }
