:root {
  color-scheme: light;
  --ink: #18212b;
  --line: #d6dee8;
  --paper: #ffffff;
  --wash: #f4f7fb;
  --accent: #165dcc;
  --accent-ink: #ffffff;
}
* { box-sizing: border-box; }
html,
body { min-height: 100%; }
body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button,
select { font: inherit; }
button {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #aeb9c7;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
button:focus-visible,
select:focus-visible,
a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: -3px; }
button:disabled,
select:disabled { cursor: not-allowed; opacity: .58; }
.example-browser {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  min-width: 0;
  overflow-x: hidden;
  background: var(--paper);
}
.picker-area {
  --arrow-width: clamp(88px, 8vw, 120px);
  --toolbar-gap: 10px;
  padding: 12px clamp(14px, 3vw, 48px) 10px;
  min-width: 0;
}
.example-title {
  grid-area: title;
  align-self: end;
  margin: 0;
  font-size: clamp(15px, 1.8vw, 20px);
  line-height: 1.25;
}
.example-toolbar {
  display: grid;
  grid-template-columns: var(--arrow-width) minmax(0, 1fr) auto auto var(--arrow-width);
  grid-template-rows: auto 48px;
  grid-template-areas:
    "previous title . . next"
    "previous picker download own next";
  align-items: stretch;
  column-gap: var(--toolbar-gap);
  row-gap: 6px;
  min-width: 0;
}
.picker-controls {
  grid-area: picker;
  min-width: 0;
}
#example-picker {
  width: 100%;
  min-width: 0;
  height: 48px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid #aeb9c7;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.download-source,
.try-own-file {
  display: inline-flex;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  height: 48px;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid #aeb9c7;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
.download-source {
  grid-area: download;
  text-decoration: none;
}
.try-own-file {
  grid-area: own;
}
.try-own-file[hidden] {
  display: none;
}
.download-source:hover { border-color: var(--accent); background: #e6eefb; }
.try-own-file:hover:not(:disabled) { border-color: var(--accent); background: #e6eefb; }
.download-source[aria-disabled="true"] { cursor: wait; opacity: .58; pointer-events: none; }
.own-pdf-output-dialog {
  width: min(92vw, 460px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 20px 60px #13233a55;
}
.own-pdf-output-dialog::backdrop { background: #13233a88; }
.own-pdf-output-dialog form { display: grid; gap: 14px; padding: 22px; }
.own-pdf-output-dialog h2,
.own-pdf-output-dialog p { margin: 0; }
.own-pdf-output-dialog label { display: flex; gap: 9px; align-items: flex-start; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.dialog-actions button { min-height: 42px; padding: 8px 14px; border: 1px solid #aeb9c7; border-radius: 8px; }
.dialog-import { background: var(--accent); color: #fff; border-color: var(--accent) !important; }
.view-tabs {
  display: flex;
  grid-row: 2;
  gap: 0;
  min-width: 0;
  overflow-x: auto;
  padding: 0 clamp(14px, 3vw, 48px);
  background: var(--wash);
  border-bottom: 1px solid var(--line);
}
.view-tabs button {
  flex: 0 0 auto;
  position: relative;
  z-index: 0;
  min-height: 46px;
  margin: 8px 2px -1px 0;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: #3e4a59;
  font-weight: 700;
}
.view-tabs button:hover:not(:disabled) { background: #e6eefb; }
.view-tabs button[aria-pressed="true"] {
  z-index: 1;
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--paper);
}
.example-arrow {
  display: flex;
  align-self: stretch;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 8px 6px;
  border: 1px solid #aeb9c7;
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
}
.example-arrow:hover:not(:disabled) { border-color: var(--accent); background: #e6eefb; }
.arrow-glyph { font-size: 42px; line-height: .9; }
.arrow-label { margin-top: 7px; font-size: 12px; font-weight: 700; line-height: 1.15; text-align: center; }
.previous-arrow {
  grid-area: previous;
}
.next-arrow {
  grid-area: next;
}
.viewer-status {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid #b8c7dc;
  border-radius: 8px;
  background: #f3f7fd;
  color: #24446d;
  font-size: 14px;
  line-height: 1.35;
}
.viewer-status[hidden] { display: none; }
.viewer-status[data-tone="error"] {
  border-color: #d98f8f;
  background: #fff5f5;
  color: #8d2525;
}
.example-preview {
  display: grid;
  grid-row: 3;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fff;
}
#example-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 640px) {
  .picker-area { --arrow-width: clamp(54px, 17vw, 66px); --toolbar-gap: 8px; width: 100%; max-width: 100%; padding: 10px; }
  .example-title { font-size: 16px; }
  .example-toolbar {
    grid-template-columns: var(--arrow-width) minmax(0, 1fr) var(--arrow-width);
    grid-template-rows: auto 48px 48px 48px;
    grid-template-areas:
      "previous title next"
      "previous picker next"
      "previous download next"
      "previous own next";
    row-gap: 8px;
  }
  .download-source,
  .try-own-file { min-width: 0; width: 100%; padding-inline: 8px; white-space: normal; }
  .example-arrow { position: static; min-height: 0; }
  .arrow-glyph { font-size: 34px; }
  .arrow-label { margin-top: 5px; font-size: 10px; }
  .view-tabs { padding-inline: 6px; }
  .view-tabs button { min-height: 42px; margin-top: 6px; padding: 8px 10px; font-size: 13px; }
}
