/* Display ports. Colours match crates/lp-desktop THEMES; shared/test checks that they do. */
.port {
  --bg: #1b1d22; --bg2: #131418; --ink: #ffffff; --muted: #b4bac6; --ac: #2563eb; --ac-ink: #ffffff; --edge: #5b8def;
  --line: color-mix(in srgb, var(--ink) 12%, transparent);
  --zoom: 1;
  --orb: calc(56px * var(--zoom));
  --left: transparent; --left-ink: var(--ink);
  position: relative;
  box-sizing: border-box;
  container-type: inline-size;
  color: var(--ink);
  background: linear-gradient(var(--bg), var(--bg2));
  font: 500 15px/1.35 "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, sans-serif;
  text-align: left;
}
.port *, .port *::before { box-sizing: border-box; }
.port[data-theme="paper"] { --bg: #ffffff; --bg2: #f3f4f7; --ink: #14161a; --muted: #5a6070; --ac: #1d4ed8; --edge: #1d4ed8; }
.port[data-theme="midnight"] { --bg: #131a33; --bg2: #0b1022; --muted: #aeb9dc; --ac: #7c8cff; --ac-ink: #101010; --edge: #7c8cff; }
.port[data-theme="pitch"] { --bg: #0f2a1e; --bg2: #0a1c14; --muted: #a9cbb8; --ac: #34d399; --ac-ink: #101010; --edge: #34d399; }
.port[data-theme="claret"] { --bg: #35101d; --bg2: #230a13; --muted: #e0b4c0; --ac: #fb7185; --ac-ink: #101010; --edge: #fb7185; }
.port[data-orb="XL"] { --orb: calc(88px * var(--zoom)); }
.port[data-orb="L"] { --orb: calc(72px * var(--zoom)); }
.port[data-orb="M"] { --orb: calc(44px * var(--zoom)); }
.port[data-grow="score"]:not([data-orb="Tiny"]) { --orb: 92px; }
.port[data-grow="film"]:not([data-orb="Tiny"]) { --orb: max(148px, calc(56px * var(--zoom))); }
.port[data-loading] { opacity: .8; }

.pt-orb {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--orb);
  height: var(--orb);
  border: 3px solid var(--edge);
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(var(--ac), color-mix(in srgb, var(--ac), #000 35%));
  color: var(--ac-ink);
  font: 700 calc(var(--orb) * .27)/1 "Segoe UI", system-ui, sans-serif;
}
.pt-orb img, .pt-orb video { width: 100%; height: 100%; object-fit: cover; }
.pt-orb.film { position: relative; padding: 0; cursor: pointer; background: #000; }
.pt-orb .pt-badge { width: 44%; height: 44%; }
.port .pt-orb { transition: width .35s cubic-bezier(.2, 1.3, .4, 1), height .35s cubic-bezier(.2, 1.3, .4, 1); }
@media (prefers-reduced-motion: reduce) { .port .pt-orb { transition: none; } }

/* The brand's side: left of the orb on a bar, the head of every other port. */
.port[data-left="graphite"] { --left: #1b1d22; --left-ink: #ffffff; }
.port[data-left="paper"] { --left: #ffffff; --left-ink: #14161a; }
.port[data-left="midnight"] { --left: #131a33; --left-ink: #ffffff; }
.port[data-left="pitch"] { --left: #0f2a1e; --left-ink: #ffffff; }
.port[data-left="claret"] { --left: #35101d; --left-ink: #ffffff; }
.port[data-left="art"] { --left: #262626; --left-ink: #ffffff; }
.port:not([data-left="same"], [data-left=""]) .pt-left { color: var(--left-ink); }
.port:not([data-left="same"], [data-left=""]) .pt-left .pt-fresh { color: color-mix(in srgb, var(--left-ink), var(--left) 12%); }
.port[data-left="art"] { --left-fill: linear-gradient(rgb(0 0 0 / .6), rgb(0 0 0 / .6)), var(--left-art) center / cover; }
.port { --left-fill: var(--left); }
.port[data-port="bar"]:not([data-left="same"], [data-left=""])::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 12%; background: var(--left-fill); }
.port[data-port="bar"] > * { position: relative; }
.port[data-port="island"]:not([data-left="same"], [data-left=""]) > .pt-row:has(.pt-left), .port[data-port="dock"]:not([data-left="same"], [data-left=""]) > .pt-id { background: var(--left-fill); }
.port[data-port="island"][data-open="true"]:not([data-left="same"], [data-left=""]) > .pt-row { margin: -8px -18px 0; padding: 8px 18px; border-radius: 25px 25px 0 0; color: var(--left-ink); }
.port[data-port="island"]:not([data-left="same"], [data-left=""]) > .pt-row:has(.pt-left) .pt-btn { color: inherit; }
.port[data-port="dock"]:not([data-left="same"], [data-left=""]) > .pt-id { margin: -20px -18px 0; padding: 20px 18px; color: var(--left-ink); }
.port[data-port="widget"]:not([data-left="same"], [data-left=""]) .pt-id { background: var(--left-fill); color: var(--left-ink); }
.port[data-port="widget"]:not([data-left="same"], [data-left=""]) .pt-title { color: inherit; }
.port[data-barart="true"] { --ink: #ffffff; --muted: #e2e2e2; --bg: #262626; background: linear-gradient(rgb(0 0 0 / .6), rgb(0 0 0 / .6)), var(--bar-art) center / cover; }
.pt-left { display: flex; flex-direction: column; min-width: 0; }
.pt-title { font-weight: 600; }
.pt-title, .pt-fresh, .pt-head, .pt-ticker { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-fresh { min-height: 16px; font-size: 12px; color: var(--muted); }
.pt-meta, .pt-ticker { color: var(--muted); font-size: 14px; }
.pt-head { font-size: 16px; font-weight: 600; min-width: 0; }
.pt-big { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; font-size: 20px; font-weight: 600; line-height: 1.25; text-wrap: pretty; overflow-wrap: anywhere; }
.pt-row { display: flex; align-items: center; gap: 14px; min-width: 0; }

.pt-pic { position: relative; display: block; flex: none; overflow: hidden; border-radius: 12px; background: color-mix(in srgb, var(--bg), var(--ink) 10%); aspect-ratio: 16 / 9; }
.pt-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 33%; }
.pt-pic.pt-thumb { width: 64px; border-radius: 6px; }
.pt-pic.pt-hero { width: 100%; }
.pt-badge { position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: rgb(10 12 16 / .72); color: #fff; }
.pt-pic.pt-thumb .pt-badge { width: 24px; height: 24px; }
.pt-i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pt-i.fill { fill: currentColor; stroke: none; }
.pt-badge .pt-i { width: 50%; height: 50%; }
.pt-player { width: 100%; height: 40px; }
.pt-video { width: 100%; border-radius: 12px; background: #000; aspect-ratio: 16 / 9; }

.pt-board { display: inline-flex; gap: 20px; flex: none; }
.pt-side { display: inline-grid; grid-template-columns: 4px auto auto; align-items: center; column-gap: 9px; font-size: 18px; font-weight: 500; color: color-mix(in srgb, var(--ink), var(--bg) 22%); font-variant-numeric: tabular-nums; }
.pt-side.lead { color: var(--ink); font-weight: 700; }
.pt-side i { width: 4px; height: 1.25em; border-radius: 2px; background: var(--team); }
.pt-num { justify-self: end; padding-left: 6px; }
.pt-when { flex: none; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.pt-when.live { flex: 0 1 auto; min-width: 44px; overflow: hidden; text-overflow: ellipsis; padding: 2px 11px; border-radius: 99px; background: #c81e2d; color: #fff; }
.pt-right .pt-row .pt-when:not(.live) { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.pt-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: color-mix(in srgb, var(--ink), var(--bg) 30%); cursor: pointer; }
.pt-btn:hover { background: var(--line); color: var(--ink); }
.port :focus-visible { outline: 2px solid var(--edge); outline-offset: 2px; }
.pt-ctl { display: inline-flex; flex: none; margin-left: auto; }
.pt-open { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 99px; background: var(--ac); color: var(--ac-ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.pt-open:hover { filter: brightness(1.08); }
.pt-dots { display: inline-flex; gap: 6px; }
.pt-dots i { width: 5px; height: 5px; border-radius: 50%; background: color-mix(in srgb, var(--ink), transparent 70%); }
.pt-dots i.on { background: var(--ink); }
.pt-more { list-style: none; margin: 0; padding: 0; font-size: 14px; color: color-mix(in srgb, var(--ink), var(--bg) 14%); }
.pt-more li { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pt-more li::before { content: none; }

/* Signal bar: left zone | orb centred at 12% | right zone */
.port[data-port="bar"] { display: grid; grid-template-columns: max(0px, calc(12% - var(--orb) / 2)) var(--orb) minmax(0, 1fr); align-items: start; min-height: 52px; border-top: 2px solid var(--edge); }
.port[data-port="bar"] > .pt-orb { transform: translateY(-50%); margin: -1px 0 calc(var(--orb) * -1); }
.port[data-port="bar"] > .pt-left { height: 52px; justify-content: center; padding: 0 12px 0 18px; font-size: 14px; }
.pt-right { grid-column: 3; min-width: 0; padding: 0 8px 0 18px; }
.pt-right > .pt-row { height: 52px; }
.pt-ticker { flex: 1; min-width: 0; padding-left: 16px; border-left: 1px solid var(--line); }
.pt-detail { display: grid; grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 22px; padding: 14px 10px 16px 0; border-top: 1px solid var(--line); }
.pt-detail > .pt-wide, .pt-detail > .pt-video { width: 176px; height: 99px; }
.pt-detail .pt-copy { grid-column: 2; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pt-detail .pt-big { -webkit-line-clamp: 3; }
.pt-detail .pt-more { padding-left: 20px; border-left: 1px solid var(--line); }
.pt-detail .pt-more li { padding: 5px 0; border: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-detail .pt-more li:nth-child(n + 4) { display: none; }
.pt-detail .pt-act { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 10px; grid-column: 4; }
.port[data-port="bar"]:not([data-orb="Tiny"]) > .pt-orb { transform: none; margin: calc(var(--orb) * -.5 - 1px) 0 calc(var(--orb) * -.5); }
.port[data-port="bar"][data-grow="film"]:not([data-orb="Tiny"]) > .pt-orb { margin: calc(50px - var(--orb)) 0 -50px; }
.port[data-port="bar"][data-orb="Tiny"] { --orb: 68px; }
.port[data-port="bar"][data-orb="Tiny"] > .pt-orb { height: 28px; border-width: 1px; border-radius: 0; font-size: 12px; transform: none; margin: 11px 0 0; }
@container (max-width: 1000px) {
  .port[data-port="bar"] > .pt-left { visibility: hidden; }
  .pt-detail { grid-template-columns: auto minmax(0, 1fr) auto; }
  .pt-detail .pt-more { display: none; }
  .pt-detail .pt-act { grid-column: 3; }
}
@container (max-width: 640px) {
  .pt-right { padding: 0 0 0 10px; }
  .pt-right .pt-ticker, .pt-right > .pt-row > .pt-thumb { display: none; }
  .pt-right > .pt-row { gap: 8px; }
  .pt-right .pt-board { gap: 10px; }
  .pt-right .pt-side { font-size: 15px; column-gap: 6px; }
  .pt-right .pt-ctl .pt-btn:not(:last-child) { display: none; }
  .pt-detail { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-right: 14px; }
  .pt-detail > *, .pt-detail .pt-copy, .pt-detail .pt-act { grid-column: 1; }
  .pt-detail .pt-big { font-size: 17px; }
  .pt-detail .pt-act { flex-direction: row; justify-content: space-between; }
}
@container (max-width: 640px) {
  .pt-right .pt-board[data-long="true"] { display: grid; gap: 0; flex: 0 1 auto; min-width: 0; }
  .pt-right .pt-board[data-long="true"] .pt-side { grid-template-columns: 4px auto minmax(0, 1fr); font-size: 13px; min-width: 0; }
  .pt-board[data-long="true"] .pt-num { justify-self: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
}
@container (max-width: 520px) {
  .port[data-port="bar"][data-grow="film"]:not([data-orb="Tiny"]) > .pt-orb { width: 88px; height: 88px; margin: -38px 0 -50px; }
}
@container (max-width: 420px) {
  .pt-right .pt-when:not(.live) { display: none; }
  .port[data-port="bar"]:not([data-grow="film"]) > .pt-orb { width: 44px; height: 44px; margin: -23px 0 -21px; font-size: 12px; }
  .pt-right { padding-left: 0; }
  .pt-right .pt-board { gap: 5px; }
  .pt-right > .pt-row { gap: 4px; }
  .pt-right .pt-side { font-size: 14px; column-gap: 4px; }
  .pt-right .pt-num { padding-left: 0; }
  .pt-right .pt-when.live { padding: 2px 6px; font-size: 11px; max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
}

/* Island */
.port[data-port="island"] { width: min(440px, 100%); padding: 2px 8px 2px 18px; border: 1px solid var(--line); border-radius: 26px; box-shadow: 0 10px 34px rgb(0 0 0 / .34); }
.port[data-port="island"] .pt-row { min-height: 46px; }
.port[data-port="island"] .pt-row > .pt-thumb { width: 58px; }
.port[data-port="island"] .pt-head { flex: 1; }
.port[data-port="island"] .pt-board { gap: 16px; }
.pt-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--edge); }
.port[data-port="island"][data-open="true"] { display: flex; flex-direction: column; gap: 14px; padding: 8px 18px 16px; --orb: 34px; }
.port[data-port="island"][data-open="true"] .pt-orb { border-width: 0; font-size: 12px; }
.port[data-port="island"] .pt-act { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.port[data-port="island"] .pt-row .pt-left { flex: 1; }
.pt-big-board { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pt-big-board .pt-board, .pt-panel .pt-board { display: grid; flex: 1; gap: 8px; }
.pt-big-board .pt-side, .pt-panel .pt-side { display: grid; grid-template-columns: 4px 1fr auto; font-size: 24px; }
@container (max-width: 400px) { .port[data-port="island"][data-open="false"] .pt-ctl .pt-btn:not(:last-child), .port[data-port="island"][data-open="false"] .pt-row > .pt-thumb { display: none; } }

/* Side dock */
.port[data-port="dock"] { display: flex; flex-direction: column; gap: 16px; width: 300px; height: 100%; padding: 20px 18px 12px; border-right: 2px solid var(--edge); overflow: hidden; }
.pt-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.port[data-port="dock"] .pt-id .pt-orb { width: min(var(--orb), 72px); height: min(var(--orb), 72px); }
.port[data-port="dock"][data-orb="Tiny"] .pt-id .pt-orb { width: 68px; height: 28px; border-radius: 0; border-width: 1px; font-size: 12px; }
.pt-panel { display: grid; gap: 12px; padding: 16px; border-radius: 14px; background: color-mix(in srgb, var(--bg), var(--ink) 6%); justify-items: start; }
.pt-panel .pt-board { width: 100%; }
.port[data-port="dock"] .pt-more { flex: 1; min-height: 0; overflow: hidden; mask-image: linear-gradient(#000 82%, transparent); }
.port[data-port="dock"] .pt-act { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }

/* Browser toolbar */
.port[data-port="toolbar"] { background: none; width: 100%; max-width: 720px; }
.pt-chrome { display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 16px; border-radius: 14px 14px 0 0; background: #e6e9ee; --orb: 34px; }
.pt-chrome .pt-orb { border-width: 0; font-size: 11px; }
.pt-url { flex: 1; height: 32px; border-radius: 16px; background: #fff; }
.pt-pop { display: flex; flex-direction: column; gap: 14px; width: min(340px, 100%); margin: 8px 12px 0 auto; padding: 18px; border-radius: 16px; background: linear-gradient(var(--bg), var(--bg2)); box-shadow: 0 14px 40px rgb(0 0 0 / .34); }
.pt-pop .pt-act { display: flex; justify-content: space-between; align-items: center; }

/* Phone widget */
.port[data-port="widget"] { width: min(340px, 100%); border-radius: 28px; overflow: hidden; box-shadow: 0 14px 40px rgb(0 0 0 / .34); }
.port[data-port="widget"] .pt-pic.pt-hero { border-radius: 0; }
.port[data-port="widget"] .pt-id { padding: 16px; --orb: 48px; }
.port[data-port="widget"] .pt-head { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.port[data-port="widget"] .pt-title { font-size: 13px; color: var(--muted); font-weight: 500; }
