/* Digital twin page: the Kepler-style plant viewer (#ptw), industry cards and twin-type grid */
.dt-stage > .s__wrap { position: relative; z-index: 2; }
.ptw-sec { padding-top: clamp(28px, 4vw, 48px); }
.ptw {
  --ptw-bg: #0a0d10; --ptw-panel: #10161a; --ptw-line: rgba(255, 255, 255, .1); --ptw-text: #e3f6fa; --ptw-mute: #9fb3ba;
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 360px; background: var(--ptw-bg); color: var(--ptw-text);
  border-radius: 18px; overflow: hidden; border: 1px solid #1d2a30; box-shadow: 0 30px 80px -40px rgba(4, 40, 48, .55);
}
.ptw > * { min-width: 0; }
.ptw__top { grid-column: 1 / -1; display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--ptw-line); flex-wrap: wrap; }
.ptw__tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ptw__tab { appearance: none; border: 1px solid var(--ptw-line); background: transparent; color: var(--ptw-mute); font: 600 13px/1 "Source Sans 3", system-ui, sans-serif; padding: 9px 12px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.ptw__tab:hover { color: var(--ptw-text); border-color: rgba(86, 221, 248, .4); }
.ptw__tab[aria-selected="true"] { background: #0b8fa8; border-color: #0b8fa8; color: #fff; }
.ptw__pill { font: 600 11px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; color: #ffc300; border: 1px solid rgba(255, 195, 0, .35); padding: 6px 9px; border-radius: 6px; white-space: nowrap; }
.ptw__map { position: relative; min-height: clamp(520px, 66vh, 760px); background: radial-gradient(ellipse at 50% 40%, #15232a 0%, #0a0d10 70%); }
.ptw__map canvas { outline: none; }
.ptw__boot { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ptw-mute); font: 500 14px/1.5 "Source Sans 3", system-ui, sans-serif; text-align: center; padding: 20px; }
.ptw.is-live .ptw__boot { display: none; }
.ptw.is-failed .ptw__boot::after { content: " The 3D view could not load on this connection; the panel on the right still shows the plant."; }
.ptw__hint { position: absolute; left: 12px; bottom: 12px; z-index: 2; font: 500 12px/1.4 "Source Sans 3", system-ui, sans-serif; color: var(--ptw-mute); background: rgba(10, 13, 16, .7); border: 1px solid var(--ptw-line); padding: 6px 9px; border-radius: 8px; pointer-events: none; }
.ptw__legend { position: absolute; left: 12px; top: 12px; z-index: 2; display: flex; gap: 10px; flex-wrap: wrap; font: 600 11.5px/1 "Source Sans 3", system-ui, sans-serif; color: var(--ptw-text); background: rgba(10, 13, 16, .72); border: 1px solid var(--ptw-line); padding: 7px 10px; border-radius: 8px; pointer-events: none; }
.ptw__legend span { display: inline-flex; align-items: center; gap: 5px; }
.ptw__legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ptw__side { background: var(--ptw-panel); border-left: 1px solid var(--ptw-line); padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 14px; max-height: clamp(520px, 66vh, 760px); overflow: auto; scrollbar-width: thin; }
.ptw__k { font: 600 10.5px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: #56ddf8; margin: 0 0 6px; display: flex; justify-content: space-between; }
.ptw__title { font: 600 18px/1.25 "Source Sans 3", system-ui, sans-serif; margin: 0; color: #fff; }
.ptw__reads { font-size: 12.5px; line-height: 1.45; color: var(--ptw-mute); margin: 4px 0 0; }
.ptw__kpis { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ptw__kpis li { background: rgba(255, 255, 255, .04); border: 1px solid var(--ptw-line); border-radius: 9px; padding: 8px 9px; }
.ptw__kpis span { display: block; font-size: 11px; color: var(--ptw-mute); }
.ptw__kpis b { display: block; font-size: 15px; color: #fff; margin-top: 2px; font-weight: 700; }
.ptw__modes { display: flex; gap: 4px; background: rgba(255, 255, 255, .05); padding: 3px; border-radius: 9px; }
.ptw__mode { flex: 1; appearance: none; border: 0; background: transparent; color: var(--ptw-mute); font: 600 12.5px/1 "Source Sans 3", system-ui, sans-serif; padding: 8px 6px; border-radius: 7px; cursor: pointer; }
.ptw__mode[aria-pressed="true"] { background: #0b8fa8; color: #fff; }
.ptw__time { display: grid; gap: 6px; }
.ptw__when { font: 600 12px/1 "IBM Plex Mono", ui-monospace, monospace; color: #ffc300; }
.ptw__range { width: 100%; accent-color: #0b8fa8; }
.ptw__range:disabled { opacity: .35; }
.ptw__alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ptw-al { appearance: none; width: 100%; text-align: left; display: grid; grid-template-columns: 24px 1fr; gap: 9px; background: rgba(255, 255, 255, .035); border: 1px solid var(--ptw-line); border-left: 3px solid #f1920e; border-radius: 9px; padding: 9px 10px; color: var(--ptw-text); cursor: pointer; font: inherit; }
.ptw-al--red { border-left-color: #e3342f; }
.ptw-al:hover { background: rgba(86, 221, 248, .07); }
.ptw-al i { font-style: normal; font: 700 12px/24px "Source Sans 3", system-ui, sans-serif; width: 24px; height: 24px; text-align: center; border-radius: 50%; background: #d6780a; color: #fff; }
.ptw-al--red i { background: #e3342f; }
.ptw-al b { display: block; font-size: 13px; line-height: 1.3; }
.ptw-al small { display: block; font-size: 12px; line-height: 1.42; color: var(--ptw-mute); margin-top: 3px; }
.ptw-al em { display: block; font-style: normal; font-size: 11.5px; color: #56ddf8; margin-top: 4px; }
.ptw__none { font-size: 12.5px; color: var(--ptw-mute); }
.ptw__layers { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 12.5px; color: var(--ptw-text); }
.ptw__layers label { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 3px 0; }
.ptw__layers input { accent-color: #0b8fa8; margin: 0; }
.ptw__layers i { width: 14px; height: 8px; border-radius: 3px; flex: none; }
.ptw__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; }
.ptw__prod { color: #56ddf8; font-weight: 600; text-decoration: none; }
.ptw__prod:hover { text-decoration: underline; }
.ptw__reset { appearance: none; background: none; border: 1px solid var(--ptw-line); color: var(--ptw-mute); border-radius: 7px; padding: 5px 8px; font: 600 11.5px/1 "Source Sans 3", system-ui, sans-serif; cursor: pointer; }
.ptw-tip small { display: block; font: 600 10px/1.2 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: #56ddf8; margin-bottom: 2px; }
.ptw-tip b { color: #fff; }
.ptw-st { font-style: normal; font-weight: 700; }
.ptw-st--run { color: #26c485; } .ptw-st--slow { color: #f1920e; } .ptw-st--down { color: #ff6b66; } .ptw-st--idle { color: #9fb3ba; }
.ptw-note { margin: 10px 2px 0; font-size: 12.5px; color: #6a7779; }

/* twin types */
.dt-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dt-type { background: #fff; border: 1px solid #dceef2; border-radius: 14px; padding: 18px 18px 16px; }
.dt-type small { font: 600 11px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: #0b8fa8; }
.dt-type h3 { margin: 8px 0 6px; font-size: 18px; line-height: 1.25; color: #2f3a3d; }
.dt-type p { margin: 0 0 8px; font-size: 14.5px; line-height: 1.5; color: #55605f; }
.dt-type a { font-size: 14px; font-weight: 600; color: #0a6f83; }
.dt-define { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; color: #2f3a3d; max-width: 980px; margin: 0 0 26px; }
.dt-define b { color: #0a6f83; }

/* industry cards */
.dt-inds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dt-ind { background: #fff; border: 1px solid #dceef2; border-radius: 16px; padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.dt-ind header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.dt-ind h3 { margin: 0; font-size: 20px; line-height: 1.25; color: #2f3a3d; }
.dt-ind header small { font: 600 11px/1 "IBM Plex Mono", ui-monospace, monospace; color: #0b8fa8; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.dt-ind dl { margin: 0; display: grid; grid-template-columns: 112px 1fr; gap: 6px 12px; font-size: 14.5px; line-height: 1.48; }
.dt-ind dt { color: #0a6f83; font-weight: 600; }
.dt-ind dd { margin: 0; color: #55605f; }
.dt-ind__act { display: flex; gap: 14px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.dt-ind__act a { font-size: 14px; font-weight: 600; color: #0a6f83; text-decoration: none; }
.dt-ind__act a:hover { text-decoration: underline; }
.dt-ind__act .dt-3d { color: #fff; background: #0b8fa8; padding: 7px 12px; border-radius: 8px; }
.dt-ind__act .dt-3d:hover { background: #0a6f83; text-decoration: none; }

/* layers table + modes */
.dt-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dt-table table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; background: #fff; border-radius: 12px; overflow: hidden; }
.dt-table th, .dt-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #e3eff2; vertical-align: top; line-height: 1.5; }
.dt-table thead th { background: #eef8fa; color: #2f3a3d; font-size: 13px; letter-spacing: .02em; }
.dt-table tbody th { color: #0a6f83; white-space: nowrap; }
.dt-table td { color: #55605f; }
.dt-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dt-mode { border-radius: 14px; padding: 18px; background: #0f1a1f; color: #e3f6fa; }
.dt-mode small { font: 600 11px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: #ffc300; }
.dt-mode h3 { margin: 8px 0 6px; font-size: 19px; color: #fff; }
.dt-mode p { margin: 0; font-size: 14.5px; line-height: 1.55; color: #b7c8cd; }

@media (max-width: 1080px) {
  .ptw { grid-template-columns: minmax(0, 1fr); }
  .ptw__side { border-left: 0; border-top: 1px solid var(--ptw-line); max-height: none; }
  .dt-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .ptw { border-radius: 12px; }
  .ptw__map { min-height: 440px; }
  .ptw__top { padding: 10px; }
  .ptw__tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .ptw__tab { white-space: nowrap; }
  .ptw__pill { display: none; }
  .ptw__legend { display: none; }
  .dt-types, .dt-inds, .dt-modes { grid-template-columns: 1fr; }
  .dt-ind dl { grid-template-columns: 1fr; gap: 2px; }
  .dt-ind dd { margin-bottom: 6px; }
}
.dt-gloss { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14.5px; line-height: 1.5; }
.dt-gloss dt { font-weight: 700; color: #0a6f83; }
.dt-gloss dd { margin: 0; color: #55605f; }
@media (max-width: 720px) { .dt-gloss { grid-template-columns: 1fr; } .dt-gloss dd { margin-bottom: 6px; } }
