@font-face {
  font-family: "Source Sans Pro";
  src: url("assets/fonts/source-sans-pro.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans Pro";
  src: url("assets/fonts/source-sans-pro-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "DBS Icons";
  src: url("assets/fonts/fontawesome.woff2") format("woff2");
  font-display: block;
}

:root {
  color-scheme: light;
  --canvas: #ecf0f5;
  --blue: #3c8dbc;
  --brand-blue: #367fa9;
  --primary: #337ab7;
  --sidebar: #222d32;
  --sidebar-width: 230px;
  --header-height: 50px;
  --line: #d2d6de;
  --text: #333;
  --muted: #5b6770;
  --mono: Monaco, Menlo, Consolas, monospace;
  --sans: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: white; font: 14px/1.42857 var(--sans); }
body.sidebar-collapsed { --sidebar-width: 50px; }
button { font: inherit; }
a { color: #3c8dbc; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #08659b; outline-offset: 2px; }
.skip, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.skip:focus { z-index: 20; left: 15px; top: 10px; width: auto; height: auto; padding: 8px 12px; clip-path: none; background: white; }

.ico::before { display: inline-block; font: normal 1em/1 "DBS Icons"; text-rendering: auto; }
.ico-menu::before { content: "\f0c9"; }
.ico-left::before { content: "\f060"; }
.ico-right::before { content: "\f061"; }
.ico-edit::before { content: "\f044"; }
.ico-pencil::before { content: "\f14b"; }
.ico-user::before { content: "\f007"; }
.ico-clock::before { content: "\f017"; }
.ico-pin::before { content: "\f08d"; }

.masthead { position: sticky; z-index: 5; top: 0; color: white; background: var(--blue); }
.masthead-inner { display: flex; min-height: var(--header-height); }
.brand {
  display: block;
  flex: 0 0 var(--sidebar-width);
  min-width: 0;
  padding: 0 15px;
  background: var(--brand-blue);
  color: white;
  font: 300 20px/50px "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-align: center;
  white-space: nowrap;
}
.brand strong { font-weight: 700; }
.brand:hover { background: #357ca5; }
.sidebar-collapsed .brand strong { font-size: 0; }
.sidebar-collapsed .brand strong::after { content: "DBS"; font-size: 14px; }
.sidebar-collapsed .brand span { display: none; }
.sidebar-collapsed .brand { padding-inline: 0; }
.masthead-main { display: flex; flex: 1; align-items: stretch; min-width: 0; }
.masthead-nav { display: flex; height: var(--header-height); white-space: nowrap; }
.masthead-nav a, .masthead-label, .header-toggle { display: flex; align-items: center; gap: 7px; color: white; padding: 0 15px; }
.masthead-nav a:hover, .header-toggle:hover { background: #0000001a; }
.masthead-label { margin-left: auto; white-space: nowrap; }
.header-toggle { display: none; border: 0; background: transparent; cursor: pointer; }
.masthead :focus-visible { outline-color: white; outline-offset: -3px; }

.layout { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); grid-template-rows: 1fr auto; min-height: calc(100dvh - var(--header-height)); }
.sidebar { grid-column: 1; grid-row: 1 / 3; min-width: 0; background: var(--sidebar); }
.sidebar-nav { display: grid; }
.sidebar-nav > * {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 12px 8px 12px 12px;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: #b8c7ce;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.sidebar-nav > :hover, .sidebar-nav > [aria-current] { border-left-color: var(--blue); background: #1e282c; color: white; }
.sidebar-nav .ico { width: 18px; text-align: left; }
.sidebar :focus-visible { outline-color: #9bddff; outline-offset: -3px; }
.sidebar-collapsed .sidebar-label { display: none; }
.sidebar-collapsed .sidebar-nav button .ico { transform: scaleX(-1); }

.workspace { grid-column: 2; min-width: 0; padding: 15px; background: var(--canvas); scroll-margin-top: var(--header-height); }
.workspace-heading h1 { margin: 0; font-size: 24px; font-weight: 400; line-height: 1.1; }
.workspace-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; margin: 22px 0 20px; }
.task-nav, .task-tabs { display: flex; flex-wrap: wrap; }
.task-nav a, .menu-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  margin-left: -1px;
  padding: 6px 12px;
  border: 1px solid #ddd;
  background: #fafafa;
  color: #666;
  font-size: 14px;
  line-height: 20px;
}
.task-nav > :first-child { margin-left: 0; border-radius: 4px 0 0 4px; }
.task-nav > :last-child { border-radius: 0 4px 4px 0; }
.menu-button { cursor: pointer; }
.task-tabs a[aria-current] { z-index: 1; border-color: var(--primary); background: var(--primary); color: white; }
.task-nav a:not([aria-current]):not([aria-disabled]):hover, .menu-button:hover { background: #eee; color: #23527c; }
.task-nav a[aria-disabled] { color: #777; background: #fafafa; cursor: default; }
.bottom-nav { margin: 20px 0 0; }
.timer { display: flex; align-items: stretch; min-height: 50px; border: 1px solid #d2d6de; background: #f9f9f9; }
.timer-button { display: grid; place-items: center; padding: 0 13px; border: 0; background: var(--blue); color: white; cursor: pointer; }
.timer-button .ico { font-size: 31px; }
.timer-button:not(:disabled):hover { background: var(--brand-blue); }
.timer-button:disabled { cursor: default; }
#timer-value { display: grid; min-width: 78px; padding: 0 12px; place-items: center; font: 400 20px/1.2 var(--sans); font-variant-numeric: tabular-nums; }

.task { min-width: 0; }
.pane { margin: 0 0 20px; border-top: 3px solid var(--blue); border-radius: 3px; background: white; box-shadow: 0 1px 1px #0000001a; }
.pane-bar { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 8px; padding: 10px; }
.pane-bar h2, .pane-bar h3 { margin: 0; color: var(--text); font-size: 14px; line-height: 1.1; font-weight: 700; }
.pane-body { padding: 10px; }
.pane-body p, .pane-body ul { margin: 0 0 10px; }
.pane-body p:last-child, .pane-body ul:last-child { margin-bottom: 0; }
.pane-body ul { padding-inline-start: 23px; }
.prompt-box { padding: 10px; border: 1px solid #b6bdc2; }
.prompt-box ul { list-style: none; padding: 0; }
.prompt-box li { margin-bottom: 10px; }
.prompt-box .task-title { margin: 0 0 10px; font-size: 14px; font-weight: 400; }
.schema-context code { font: italic 14px/1.42857 var(--sans); }
.pane-body code { overflow-wrap: anywhere; }
.note, .format { color: var(--muted); }
.pin-button, .copy, .viewer-close {
  padding: 3px 8px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #f4f4f4;
  color: #444;
  cursor: pointer;
}
.pin-button, .copy { margin-left: auto; }
.pin-button:hover, .copy:hover, .viewer-close:hover { background: #e7e7e7; }
.pin-button[aria-pressed="true"] { border-color: var(--brand-blue); color: white; background: var(--blue); }
.question.is-pinned { position: sticky; top: var(--header-height); z-index: 3; }
.question.is-pinned .pane-body { max-height: 42dvh; overflow: auto; }
.instruction .pane-body { min-height: 55px; }

.editor-frame { min-width: 0; }
.editor-tools { display: flex; flex-wrap: wrap; min-height: 26px; }
.editor-tools button, .underline-key { min-width: 30px; min-height: 26px; padding: 2px 6px; border: 1px solid #d1d1d1; background: #f7f7f7; color: #333; font: 12px/1.5 var(--mono); text-align: center; }
.editor-tools button { cursor: pointer; }
.underline-key { text-decoration: underline; }
.editor-tools button:hover { background: #e9e9e9; }
.editor-frame pre { min-width: 0; margin: 0; color: #222; white-space: pre-wrap; overflow-wrap: anywhere; }
.editor-frame code { font: 12px/1.55 var(--mono); }
.transform-editor { border: 1px solid #d2d6de; }
.transform-editor pre { min-height: 145px; padding: 10px; border-top: 1px solid #d2d6de; }
.syntax-state { margin: 8px 8px 5px; padding: 8px; border: 1px solid #a9cb98; background: #dff0d8; color: #3c763d; }
.relation-editor { display: grid; grid-template-columns: minmax(160px, 24%) minmax(0, 1fr); min-height: 122px; border: 1px solid #d2d6de; }
.schema { border-right: 1px solid #d2d6de; }
.schema details { border-bottom: 1px solid #ddd; }
.schema summary { padding: 6px 10px; font-weight: 700; cursor: pointer; list-style: none; }
.schema details[open] summary { background: var(--blue); color: white; }
.schema summary::-webkit-details-marker { display: none; }
.schema button { display: block; width: 100%; border: 0; padding: 3px 14px; background: #fff; color: var(--text); text-align: left; cursor: pointer; }
.schema button:hover { background: #f3f5f7; }
.editor-main { min-width: 0; }
.editor-line { display: grid; grid-template-columns: 29px minmax(0, 1fr); min-height: 90px; border-top: 1px solid #ddd; }
.line-number { padding: 3px 8px 0 0; color: #666; background: #f0f0f0; text-align: right; font: 12px/1.6 var(--mono); }
.editor-line pre { min-height: 90px; padding: 3px 7px; background: linear-gradient(#edf2f7 0 21px, white 21px); }
.transform-editor + .note { margin-top: 6px; }

.photo { display: inline-grid; max-width: 100%; border: 1px solid #d2d6de; }
.photo img { width: auto; max-width: 100%; max-height: 420px; object-fit: contain; object-position: left center; }
.photo > span { padding: 5px 8px; border-top: 1px solid #ddd; background: #f7f7f7; }
.photo:hover > span { background: #edf2f7; }
.model-answer .photo { display: grid; }
.diagram-preview { overflow: hidden; aspect-ratio: 1557 / 894; }
.diagram-preview img { width: 100%; max-height: none; height: auto; transform: translateY(-11.5%); }
.model-notes { margin-top: 10px; }
.model-notes summary { padding: 4px 0; color: #27628c; cursor: pointer; font-weight: 700; }

.site-footer { grid-column: 2; display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 15px; color: #444; background: white; }
.viewer, .task-menu { max-width: min(calc(100vw - 24px), 1180px); max-height: calc(100dvh - 24px); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 4px; color: #333; background: white; }
.viewer::backdrop, .task-menu::backdrop { background: #0009; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid #e5e5e5; }
.viewer-bar p { margin: 0; font-weight: 700; }
.viewer img { width: auto; max-height: calc(100dvh - 70px); margin: auto; object-fit: contain; }
.task-menu { width: min(460px, calc(100vw - 24px)); }
.menu-items { display: grid; }
.menu-items a { display: grid; grid-template-columns: 25px minmax(0, 1fr); gap: 8px; padding: 8px 12px; border-bottom: 1px solid #eee; }
.menu-items a:hover, .menu-items a[aria-current] { background: #ecf0f5; color: #23527c; }

@media (max-width: 1050px) {
  .masthead-nav a, .masthead-label { padding-inline: 8px; }
  .masthead-nav a { font-size: 13px; }
}
@media (max-width: 767px) {
  :root { --header-height: 100px; }
  .masthead-inner { display: block; }
  .brand { width: 100%; }
  .sidebar-collapsed .brand strong { font-size: 20px; }
  .sidebar-collapsed .brand strong::after { content: none; }
  .sidebar-collapsed .brand span { display: inline; }
  .masthead-main { min-height: 50px; }
  .masthead-nav { display: none; }
  .header-toggle { display: flex; }
  .layout { display: block; }
  .sidebar-collapsed .sidebar { display: none; }
  .workspace { padding: 12px; }
  .workspace-tools { margin-top: 16px; }
  .relation-editor { grid-template-columns: minmax(95px, 25%) minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .task-nav a, .menu-button { padding-inline: 7px; }
  .task-nav { row-gap: 3px; }
  .task-tabs a { min-width: 25px; justify-content: center; }
  .relation-editor { grid-template-columns: minmax(0, 1fr); }
  .schema { border-right: 0; }
}
