/* Service Information (SI) module styles.
   Uses shell design tokens from app/shell/tis.css. Graphics stay on white (.on-white). */

/* ---------- group & browse views ---------- */
.si-gcnt { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 6px; }
.si-ghead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.si-ghead a { color: var(--fg); }
.si-ghead a:hover { color: var(--accent); }
.si-fbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 14px; }
.si-fbar .inp { flex: 1; min-width: 200px; max-width: 440px; height: 36px; font-size: 14px; }
.si-fbar .sel { max-width: 260px; }
.si-more { margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.si-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; margin-top: 2px; }
.si-appl-pill { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--fg); background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.si-nw { white-space: nowrap; }

/* ---------- document layout (matches mockup shell.html) ---------- */
.doc-head .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.si-applies { font-size: 13px; color: var(--muted); margin: 0 0 12px; line-height: 1.5; }
.si-applies b { color: var(--fg); font-weight: 600; }
.doc-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.doc-wrap.no-rel { grid-template-columns: minmax(0, 1fr); }
.doc-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; overflow-x: auto; }
.rel { position: sticky; top: calc(var(--hdr) + 16px); display: flex; flex-direction: column; gap: 16px; }
.rel .lbl { margin-bottom: 6px; }
.ri { display: flex; align-items: flex-start; gap: 9px; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); font-size: 13.5px; margin-bottom: 6px; line-height: 1.35; }
.ri:hover { border-color: var(--accent); text-decoration: none; background: var(--panel2); }
.ri svg.i { margin-top: 1px; color: var(--accent); }
.ri .rit { min-width: 0; flex: 1; }
.ri small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.pn a { display: block; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--fg); font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.pn a:hover { border-color: var(--accent); text-decoration: none; background: var(--panel2); }
.pn small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.pn .nx { text-align: right; }

/* ---------- converted TIS document content (article.doc) ---------- */
article.doc { overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.55; }
article.doc > p.title:first-child,
article.doc > h3:first-child,
article.doc > .si > h3:first-child,
article.doc > .ntf > h3:first-child { display: none; }
article.doc h2 { font-size: 1.2rem; margin: 1.1em 0 .45em; }
article.doc h3 { font-size: 1.1rem; margin: 1em 0 .4em; }
article.doc h4 { font-size: 1rem; margin: .85em 0 .3em; }
article.doc p { margin: .45em 0; }
article.doc p.high, article.doc .high, article.doc .topic, article.doc .bold { font-weight: 650; }
article.doc .tab { display: inline-block; width: 2em; }
article.doc .wrkstep { margin: 10px 0; padding-left: 12px; border-left: 3px solid var(--line); }
article.doc .si-tscroll { overflow-x: auto; max-width: 100%; margin: 8px 0; }
article.doc table { border-collapse: collapse; margin: 6px 0; max-width: 100%; }
article.doc table.cals { width: 100%; }
article.doc table.cals th, article.doc table.cals td,
article.doc table[border="1"] th, article.doc table[border="1"] td {
  border: 1px solid var(--line); padding: 4px 8px; vertical-align: top;
}
article.doc table.cals th, article.doc table[border="1"] th { background: var(--panel2); text-align: left; }
article.doc table.noframe th, article.doc table.noframe td { border: none; border-bottom: 1px solid var(--line); padding: 4px 8px; }
article.doc table.border-all { border: 1px solid var(--line); }
article.doc .border-botright { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 8px; }
article.doc .border-right { border-right: 1px solid var(--line); padding: 4px 8px; }
article.doc .border-bot { border-bottom: 1px solid var(--line); padding: 4px 8px; }
article.doc .border-none { border: none; padding: 4px 8px; }
article.doc td { vertical-align: top; }
article.doc td p { margin: .2em 0; }
article.doc td.step-first-para { white-space: nowrap; width: 1%; padding-right: .5em; font-weight: 650; }
article.doc table.mainstep { margin: 6px 0; }
article.doc table table td.step-first-para { font-weight: normal; }
article.doc td[width="10%"] { width: auto; }
article.doc .operation-nr { color: var(--muted); font-size: .85rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
article.doc .picto, article.doc .gt-picto {
  display: inline-block; background: var(--accent); color: var(--accent-fg); border-radius: 5px;
  padding: 1px 9px; font-size: 12px; font-weight: 700; margin-right: 6px; vertical-align: middle;
}
article.doc .picto-caution, article.doc .picto-warning { background: var(--bad); color: #fff; }
article.doc .picto-important, article.doc .picto-note { background: var(--warn); color: #fff; }
article.doc .picto:empty { display: none; }
article.doc .notice, article.doc .important, article.doc .caution, article.doc .warning {
  border-left: 4px solid var(--warn); background: var(--panel2); padding: 8px 12px; margin: 10px 0; border-radius: 0 8px 8px 0;
}
article.doc .warning, article.doc .caution { border-color: var(--bad); }
article.doc .gt-notice { font-weight: 700; color: var(--accent); }
article.doc .gt-important { font-weight: 700; color: var(--warn); }
article.doc .gt-warning, article.doc .gt-caution { font-weight: 700; color: var(--bad); }
article.doc .gt-service, article.doc .tech-spec { font-weight: 650; }
article.doc .tool {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
}
article.doc .field-name { font-weight: 650; padding-right: 10px; white-space: nowrap; color: var(--muted); }
article.doc .ftnote { font-size: .88rem; color: var(--muted); margin: 6px 0; }
article.doc .ftnref { font-size: .8em; vertical-align: super; }
article.doc a.xref { padding: 0 3px; font-weight: 650; }
article.doc a.xref.dead { color: var(--muted); font-weight: inherit; border-bottom: 1px dotted var(--muted); cursor: help; text-decoration: none; }
article.doc .missing { color: var(--bad); font-size: .85em; }
article.doc gm\:callout { display: none; }

/* graphics: drawn on white paper, zoomable */
article.doc figure.ill { margin: 8px 0; display: inline-block; max-width: 100%; }
article.doc figure.ill a { display: inline-block; max-width: 100%; cursor: zoom-in; }
article.doc figure.ill img {
  display: block; max-width: 100%; height: auto; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; transition: border-color .12s;
}
article.doc figure.ill a:hover img { border-color: var(--accent); }
article.doc td figure.ill { margin: 0 0 0 12px; }
article.doc td figure.ill img { max-width: min(320px, 100%); }

/* auto-linked DTC badges inside SI documents */
a.dtc-badge {
  display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86em; font-weight: 700; padding: 0 5px; margin: 0 1px;
  border-radius: 4px; border: 1px solid #f0b67f; background: #fff3e6; color: #b44700;
  text-decoration: none; vertical-align: baseline;
}
a.dtc-badge:hover { background: #ffe0c2; border-color: #d95d00; text-decoration: none; }
:root[data-theme=dark] a.dtc-badge { background: #36200d; border-color: #8f4e14; color: #ffb26b; }
:root[data-theme=dark] a.dtc-badge:hover { background: #4f2d11; border-color: #d97724; }

/* dark-mode legibility for legacy HTML attributes inside article.doc */
:root[data-theme=dark] article.doc [bgcolor] { background-color: var(--panel2) !important; color: var(--fg); }
:root[data-theme=dark] article.doc font[color="#254164"],
:root[data-theme=dark] article.doc font[color="blue"],
:root[data-theme=dark] article.doc font[color="BLUE"] { color: var(--accent) !important; }
:root[data-theme=dark] article.doc font[color="brown"],
:root[data-theme=dark] article.doc font[color="BROWN"] { color: #e3a869 !important; }
:root[data-theme=dark] article.doc font[color="red"],
:root[data-theme=dark] article.doc font[color="RED"] { color: var(--bad) !important; }

/* ---------- figure lightbox ---------- */
.si-lb {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(10, 14, 20, .75);
}
.si-lb-box {
  max-width: min(96vw, 1200px); max-height: 92vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.si-lb-hd {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 16px;
  border-bottom: 1px solid var(--line); font-size: 13.5px; font-weight: 600;
}
.si-lb-body { overflow: auto; padding: 14px; background: #fff; text-align: center; }
.si-lb-body img { max-width: 100%; height: auto; display: block; margin: 0 auto; background: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .doc-wrap { grid-template-columns: minmax(0, 1fr); }
  .rel { position: static; }
}
@media (max-width: 640px) {
  .doc-card { padding: 14px; }
  .pn { grid-template-columns: 1fr; }
  .si-fbar .inp, .si-fbar .sel { max-width: none; width: 100%; }
  /* stack side-by-side step/illustration layout tables cleanly on narrow phones */
  article.doc > table:not(.cals):not(.mainstep) > tbody > tr > td[width="90%"],
  article.doc > table:not(.cals):not(.mainstep) > tbody > tr > td[width="10%"] {
    display: block; width: 100% !important; text-align: left !important;
  }
  article.doc td figure.ill { margin: 8px 0; }
  article.doc figure.ill img { width: auto !important; max-width: 100% !important; }
}

@media print {
  .pn, .rel, .si-lb, .si-fbar { display: none !important; }
  .doc-wrap { display: block; }
  .doc-card { border: 0; padding: 0; overflow: visible; background: #fff; }
  article.doc [bgcolor] { background-color: #f0f0f0 !important; color: #000 !important; }
  article.doc font { color: #000 !important; }
  a.dtc-badge { background: none !important; border: 1px solid #666 !important; color: #000 !important; }
  figure.ill, .wrkstep, .notice, .important, .caution, .warning { break-inside: avoid; page-break-inside: avoid; }
  article.doc figure.ill img { max-width: 100% !important; height: auto !important; }
}
