/* Plus-Tech design pack 1.0, 2026-11-30. Original tokens in brand.css. */
/* Copy/density review: unslop by Damir Sokolovsky (@heydamir), CC BY 4.0. https://heydamir.design/unslop */
:root {
  font-family: var(--pt-font-sans);
  color: var(--pt-fg);
  background: var(--pt-bg);
  font-synthesis: none;
  font-size: 15px;
  --line: var(--pt-line);
  --muted: var(--pt-muted);
  --success: var(--pt-stage4);
  --success-soft: #e5eee6;
  --warning: #77551e;
  --warning-soft: #f3eadb;
}
* { box-sizing: border-box; }
body { margin: 0; }
.legal-document { max-width: 860px; margin: 40px auto; padding: 0 24px 48px; }
.legal-document h1 { margin: 32px 0 20px; }
.legal-document h2 { margin: 32px 0 16px; }
.legal-document p { margin: 0 0 16px; overflow-wrap: anywhere; }
.legal-document nav { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 40px; font-size: 13px; }
button, input, select, textarea { font: inherit; }
a { color: var(--pt-accent-text); }
.app { max-width: 1440px; margin: auto; padding: 0 clamp(16px, 4vw, 48px); }
.header { height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 24px; text-decoration: none; color: inherit; }
button.brand { padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.brand-logo { display: block; width: 168px; height: 40px; }
.brand-sub { padding-left: 24px; border-left: 1px solid var(--pt-line-strong); font-size: 15px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.env { font-size: 11px; border: 1px solid var(--pt-line-strong); border-radius: var(--pt-radius-sm); padding: 7px 10px; color: var(--muted); }
main { min-height: calc(100vh - 80px); padding-bottom: 32px; }
.intro { padding: 24px 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.intro > div:first-child { max-width: 840px; }
h1 { font-size: clamp(26px, 2.4vw, 32px); letter-spacing: -.7px; line-height: 1.2; font-weight: 500; margin: 0; text-wrap: balance; }
.portal-label { display: block; margin-top: 8px; font: 12px/1.5 var(--pt-font-mono); color: var(--muted); }
h2 { font-size: 21px; letter-spacing: -.5px; line-height: 1.3; font-weight: 500; margin: 0; }
h3 { font-size: 16px; line-height: 1.4; font-weight: 500; margin: 0 0 12px; }
p { margin: 0; line-height: 1.65; }
.intro p { color: var(--muted); font-size: 13px; max-width: 760px; margin-top: 12px; }
.connection { display: flex; align-items: center; gap: 9px; font-size: 11px; border: 1px solid var(--line); background: var(--pt-surface); padding: 12px 16px; border-radius: var(--pt-radius-sm); white-space: nowrap; }
.dot, .small-dot { display: inline-block; background: var(--success); width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot.paused { background: var(--pt-stage3); }
.dot.pending { background: var(--pt-faint); }
.tabs { display: flex; gap: 32px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tab { font-size: 13px; padding: 16px 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.tab:hover { color: var(--pt-accent-text); }
.tab.active { color: var(--pt-accent-text); border-bottom-color: var(--pt-accent); font-weight: 500; }
.tab span { font: 10px var(--pt-font-mono); padding: 3px 6px; background: var(--pt-sunk); border-radius: 4px; margin-left: 6px; color: var(--muted); }
.tab.active span { background: var(--pt-accent-soft); color: var(--pt-accent-text); }
*[hidden] { display: none !important; }
.bridge-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 16px; }
.bridge-bar > div { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bridge-bar strong { font-weight: 500; }
.muted { color: var(--muted); font-size: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 500; line-height: 1.3; min-height: 48px; border: 1px solid var(--pt-accent); border-radius: var(--pt-radius-button); background: var(--pt-accent); color: var(--pt-on-accent); padding: 12px 20px; cursor: pointer; text-decoration: none; text-align: center; }
.button:hover { background: var(--pt-accent-hover); border-color: var(--pt-accent-hover); }
.button:disabled { opacity: .5; cursor: wait; }
.button.secondary { color: var(--pt-fg); background: transparent; border-color: var(--pt-line-strong); font-weight: 400; min-height: 40px; font-size: 12px; padding: 9px 16px; }
.button.secondary:hover { background: var(--pt-sunk); border-color: var(--pt-faint); }
.chat-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; }
.chat { border: 1px solid var(--line); background: var(--pt-surface); border-radius: var(--pt-radius); overflow: hidden; }
.chat-header { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.avatar { background: var(--pt-accent-soft); color: var(--pt-accent-text); height: 40px; width: 40px; flex-shrink: 0; border-radius: var(--pt-radius-sm); display: grid; place-items: center; font-size: 12px; font-weight: 500; }
.avatar img { width: 32px; height: 32px; display: block; }
.chat:nth-child(2) .avatar { background: var(--pt-sunk); color: var(--muted); }
.chat-title { font-weight: 500; font-size: 14px; line-height: 1.4; }
.chat-domain { font: 10px/1.5 var(--pt-font-mono); color: var(--muted); margin-top: 4px; }
.chat-head-status { margin-left: auto; font: 9px/1.5 var(--pt-font-mono); color: var(--pt-faint); text-align: right; }
.messages { height: 336px; padding: 20px 24px; overflow-y: auto; background: var(--pt-bg); scrollbar-color: var(--pt-line-strong) transparent; scrollbar-width: thin; }
.empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 12px; gap: 8px; }
.empty strong { font-size: 14px; color: var(--pt-fg); font-weight: 500; }
.message { max-width: 92%; margin-bottom: 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; background: var(--pt-surface); overflow-wrap: anywhere; font-size: 13px; }
.message.forwarded { margin-left: auto; border-color: #cad5ee; background: var(--pt-accent-soft); border-radius: 12px 12px 4px 12px; }
.message-author { font-size: 11px; font-weight: 500; color: var(--pt-accent-text); margin-bottom: 6px; }
.message-text { white-space: pre-wrap; line-height: 1.55; }
.message-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; color: var(--pt-faint); font: 10px var(--pt-font-mono); }
.reply-button { border: 0; background: none; padding: 4px 0; color: var(--pt-accent-text); font: 11px var(--pt-font-sans); cursor: pointer; }
.reply-preview { font-size: 11px; color: var(--muted); border-left: 2px solid var(--pt-accent); padding-left: 8px; margin: 0 0 8px; max-height: 48px; overflow: hidden; white-space: pre-line; }
.file { display: flex; align-items: center; gap: 8px; margin-top: 12px; background: var(--pt-surface); padding: 12px; border: 1px solid var(--line); border-radius: var(--pt-radius-sm); font-size: 11px; text-decoration: none; overflow-wrap: anywhere; }
.compose { padding: 16px 24px; border-top: 1px solid var(--line); }
textarea { resize: vertical; width: 100%; min-height: 56px; max-height: 170px; border: 0; border-radius: 4px; font-size: 13px; line-height: 1.5; padding: 4px 0; background: transparent; color: var(--pt-fg); }
textarea::placeholder { color: var(--pt-faint); opacity: 1; }
.compose-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.compose .button { min-height: 40px; font-size: 12px; padding: 9px 16px; }
.file-pick { font-size: 11px; color: var(--muted); cursor: pointer; margin: 0; padding: 8px 0; }
.file-pick input { width: 1px; height: 1px; min-height: 1px; position: absolute; opacity: 0; padding: 0; margin: 0; }
.selected-file { font-size: 10px; color: var(--pt-accent-text); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-reply { display: flex; align-items: center; justify-content: space-between; font-size: 11px; padding: 8px 12px; background: var(--pt-accent-soft); margin-bottom: 8px; border-radius: var(--pt-radius-sm); gap: 12px; }
.compose-reply button { border: 0; background: none; color: var(--pt-accent-text); cursor: pointer; }
.notice { padding: 16px 20px; background: var(--warning-soft); color: var(--warning); border: 1px solid #ddcba9; border-radius: var(--pt-radius-sm); margin-top: 24px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.notice.success { background: var(--success-soft); color: var(--success); border-color: #c7dacb; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin: 32px 0 12px; gap: 24px; }
.explanation { font-size: 13px; color: var(--muted); margin-bottom: 24px; max-width: 800px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--pt-radius); background: var(--pt-surface); }
table { border-collapse: collapse; width: 100%; font-size: 12px; text-align: left; }
th { font-weight: 400; color: var(--muted); background: var(--pt-sunk); padding: 16px 24px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 16px 24px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
td:first-child, td:nth-child(4) { font: 11px var(--pt-font-mono); font-variant-numeric: tabular-nums; }
td .button + .button { margin-left: 8px; }
tr:last-child td { border-bottom: 0; }
.table-empty { font: 13px/1.7 var(--pt-font-sans) !important; color: var(--muted); padding: 48px 24px; text-align: center; }
.state { font-size: 11px; padding: 5px 8px; border-radius: 6px; background: var(--pt-sunk); color: var(--muted); white-space: nowrap; }
.state-sent { background: var(--success-soft); color: var(--success); }
.state-working, .state-queued { background: var(--pt-accent-soft); color: var(--pt-accent-text); }
.state.error, .state-retry { background: var(--warning-soft); color: var(--warning); }
.setup-columns { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; margin-top: 24px; }
.setup-columns.two { grid-template-columns: minmax(0,720px); }
.panel { border: 1px solid var(--line); background: var(--pt-surface); border-radius: var(--pt-radius); padding: 32px; min-width: 0; }
.panel > label:first-child { margin-top: 0; }
.panel h2 { margin-bottom: 16px; font-size: 20px; }
.panel p { font-size: 13px; color: var(--muted); }
.step { font: 11px var(--pt-font-mono); color: var(--pt-accent-text); margin-bottom: 32px; }
.limits { margin: 32px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line); max-width: 1040px; }
.limits p { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
label { display: block; color: var(--pt-fg); font-size: 12px; margin: 24px 0; }
.field { margin: 24px 0; min-width: 0; }
.field > label { margin: 0; }
.panel > .field:first-child { margin-top: 0; }
.select-control { position: relative; margin-top: 8px; }
.select-single { margin-top: 0; cursor: text; }
.select-single:hover { border-color: var(--pt-line-strong); }
.select-control.is-open { z-index: 20; }
.select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 48px; padding: 12px 16px; border: 1px solid var(--pt-line-strong); border-radius: var(--pt-radius-button); background: var(--pt-bg); color: var(--pt-fg); text-align: left; font-size: 14px; line-height: 1.4; cursor: pointer; }
.select-trigger:hover { border-color: var(--pt-faint); }
.select-trigger:focus-visible { outline: none; border-color: var(--pt-accent); box-shadow: 0 0 0 1px var(--pt-accent); }
.select-trigger[aria-expanded="true"] { border-color: var(--pt-accent); background: var(--pt-surface); }
.select-trigger[aria-invalid="true"] { border-color: var(--warning); }
.select-trigger[aria-disabled="true"] { color: var(--muted); cursor: default; }
.select-value { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.select-arrow { display: block; width: 16px; height: 16px; flex-shrink: 0; background: var(--muted); -webkit-mask: var(--select-arrow-icon) center / contain no-repeat; mask: var(--select-arrow-icon) center / contain no-repeat; }
.is-open .select-arrow { transform: rotate(180deg); }
.select-menu { position: absolute; z-index: 21; top: calc(100% + 8px); left: 0; right: 0; max-height: min(240px, 40vh); overflow-y: auto; padding: 4px; background: var(--pt-surface); border: 1px solid var(--pt-line-strong); border-radius: var(--pt-radius-button); box-shadow: 0 12px 28px rgba(23,24,26,.12), 0 2px 6px rgba(23,24,26,.04); scrollbar-width: thin; scrollbar-color: var(--pt-line-strong) transparent; }
.opens-up .select-menu { top: auto; bottom: calc(100% + 8px); }
.select-option { position: relative; min-height: 44px; padding: 12px 40px 12px 12px; font-size: 14px; line-height: 1.4; border-radius: 6px; color: var(--pt-fg); overflow-wrap: anywhere; cursor: pointer; }
.select-option.is-active { background: var(--pt-sunk); }
.select-option[aria-selected="true"] { background: var(--pt-accent-soft); color: var(--pt-accent-text); }
.select-option[aria-selected="true"]::after { content: ""; position: absolute; width: 16px; height: 16px; right: 12px; top: 50%; transform: translateY(-50%); background: var(--pt-accent-text); -webkit-mask: var(--select-check-icon) center / contain no-repeat; mask: var(--select-check-icon) center / contain no-repeat; }
input, select { font-size: 14px; line-height: 1.4; min-height: 48px; padding: 12px 16px; border: 1px solid var(--pt-line-strong); border-radius: var(--pt-radius-button); width: 100%; background: var(--pt-bg); color: var(--pt-fg); margin-top: 8px; }
select { cursor: pointer; text-overflow: ellipsis; }
input:hover, select:hover { border-color: var(--pt-faint); }
output { display: block; font: 18px/1.6 var(--pt-font-mono); overflow-wrap: anywhere; margin-top: 24px; padding: 16px; border: 1px dashed var(--pt-line-strong); border-radius: var(--pt-radius-sm); color: var(--pt-accent-text); background: var(--pt-accent-soft); user-select: all; }
output:empty { display: none; }
.field-help { font-size: 11px !important; margin-top: 16px; line-height: 1.6; max-width: 540px; }
.route { padding: 24px; border: 1px solid var(--line); background: var(--pt-surface); border-radius: var(--pt-radius); display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 12px; font-size: 13px; }
.route > div { flex: 1; min-width: 0; overflow-wrap: anywhere; order: -1; }
.route strong { font-weight: 500; }
.route p { font-size: 12px; color: var(--muted); margin-top: 6px; }
.button.secondary.danger { color: #a32c32; }
.button.danger:not(.secondary) { background: #a32c32; border-color: #a32c32; color: #fff; }
.button.danger:not(.secondary):hover { background: #86232a; border-color: #86232a; }
#delete-dialog { width: min(460px, calc(100% - 32px)); max-height: calc(100% - 32px); margin: auto; padding: 32px; border: 1px solid var(--line); border-radius: var(--pt-radius); background: var(--pt-surface); color: var(--pt-fg); }
#delete-dialog::backdrop { background: rgb(0 18 42 / 35%); }
#delete-dialog h2 { margin: 0 0 16px; font-size: 24px; }
#delete-dialog p { font-size: 14px; line-height: 1.6; margin: 12px 0; }
#delete-dialog .delete-chat { font-weight: 500; overflow-wrap: anywhere; }
#delete-error { color: #a32c32; }
#delete-error:empty { display: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .file-pick:focus-within { outline: 2px solid var(--pt-accent); outline-offset: 4px; }
.install-shell { min-height: 100vh; padding-bottom: 0; }
.install-main { min-height: calc(100vh - 80px); display: grid; align-content: center; padding: 48px 0; }
.install-panel { max-width: 720px; }
.install-panel h1 { font-size: 32px; }
.install-panel p { margin-top: 16px; }
.install-note { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 24px !important; }
@media (max-width: 1050px) {
  .intro { display: block; }
  .connection { display: inline-flex; margin-top: 24px; }
  .chat-header { padding: 16px; gap: 8px; }
  .chat-grid { gap: 16px; }
  .messages, .compose { padding: 16px; }
  .chat-head-status { max-width: 78px; }
  .setup-columns { gap: 16px; }
  .panel { padding: 24px; }
}
@media (max-width: 760px) {
  .header { height: 80px; gap: 16px; }
  .brand { gap: 16px; }
  .brand-logo { width: 142px; height: 34px; }
  .brand-sub { padding-left: 16px; font-size: 13px; }
  .header-right { gap: 0; }
  .intro { padding: 24px 0; }
  h1 { letter-spacing: -.7px; }
  .setup-columns, .chat-grid { grid-template-columns: minmax(0,1fr); }
  .step { margin-bottom: 24px; }
  .messages { height: 320px; }
  .chat-head-status { max-width: none; }
  .section-heading { flex-wrap: wrap; gap: 8px; }
  .route { flex-wrap: wrap; gap: 16px; }
  .route > div { flex-basis: 100%; }
  th, td { padding: 16px; }
  table { min-width: 580px; }
}
@media (max-width: 420px) {
  .brand-logo { width: 126px; height: 30px; }
  .brand { gap: 12px; }
  .brand-sub { padding-left: 12px; }
  .env { font-size: 9px; padding: 6px 8px; }
  .tabs { gap: 24px; }
  .tab { font-size: 12px; }
  .panel { padding: 20px; }
  .selected-file { max-width: 80px; }
  .chat-title { font-size: 13px; }
  .chat-head-status { font-size: 8px; }
}

/* Icons: Lucide, ISC license in licenses/Lucide.txt. */
:root {
  --select-arrow-icon: url("data:image/svg+xml,%3Csvg%0A%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0A%20%20width%3D%2224%22%0A%20%20height%3D%2224%22%0A%20%20viewBox%3D%220%200%2024%2024%22%0A%20%20fill%3D%22none%22%0A%20%20stroke%3D%22currentColor%22%0A%20%20stroke-width%3D%222%22%0A%20%20stroke-linecap%3D%22round%22%0A%20%20stroke-linejoin%3D%22round%22%0A%3E%0A%20%20%3Cpath%20d%3D%22m6%209%206%206%206-6%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");
  --select-check-icon: url("data:image/svg+xml,%3Csvg%0A%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0A%20%20width%3D%2224%22%0A%20%20height%3D%2224%22%0A%20%20viewBox%3D%220%200%2024%2024%22%0A%20%20fill%3D%22none%22%0A%20%20stroke%3D%22currentColor%22%0A%20%20stroke-width%3D%222%22%0A%20%20stroke-linecap%3D%22round%22%0A%20%20stroke-linejoin%3D%22round%22%0A%3E%0A%20%20%3Cpath%20d%3D%22M20%206%209%2017l-5-5%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");
}
