/* Coryton Portal · styles.css
 *
 * Every class is prefixed pt- so nothing collides with anything an app's
 * vendored module might inject later. The colours and sizes (the :root
 * tokens) come from lib/coryton.css, the shared Coryton look kept in Improve
 * and synced here each weekday: never edit that file here, and do not
 * redefine its tokens in this one.
 *
 * Light theme only, like the apps. No external fonts. The page body never
 * scrolls sideways: wide tables scroll inside .pt-scroll.
 */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}

a { color: var(--teal-2); }
h1, h2, h3 { color: var(--navy); margin: 0 0 8px; line-height: 1.25; }
h1 { font-size: 22px; }
p { margin: 0 0 10px; }

.pt-icon { width: 22px; height: 22px; flex: none; display: inline-block; vertical-align: middle; }
.pt-icon--xs { width: 14px; height: 14px; vertical-align: -2px; }
.pt-muted { color: var(--ink-soft); }
.pt-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* ---- header -------------------------------------------------------------- */

.pt-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px;
  padding: 12px 24px; background: var(--navy); color: #fff; border-bottom: 4px solid var(--teal);
}
.pt-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; }
.pt-brand > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.pt-brand-name { font-size: 18px; font-weight: 700; letter-spacing: 0.2px; }
.pt-brand-sub { font-size: 12px; color: #b9c4dc; }
.pt-mark { width: 36px; height: 36px; flex: none; display: block; border-radius: 8px; }
/* The icon is the header's own navy: a faint edge keeps its shape visible there. */
.pt-header .pt-mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28); }
.pt-mark--lg { width: 48px; height: 48px; border-radius: 11px; }

.pt-session { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #cfd9ef; }
.pt-session-who { display: flex; flex-direction: column; line-height: 1.25; }
.pt-session-who strong { color: #fff; font-size: 13px; }
.pt-avatar {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--navy-3); color: #fff; font-weight: 700; font-size: 12px; border: 1px solid rgba(255, 255, 255, 0.25);
}


.pt-main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 24px 40px; }

body.pt-out .pt-header { display: none; }
body.pt-out .pt-main { max-width: none; padding: 0; display: flex; }

/* ---- buttons ------------------------------------------------------------- */

.pt-btn {
  display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 6px; border: 1px solid var(--border); background: var(--card);
  color: var(--ink); cursor: pointer; text-decoration: none; line-height: 1.3; white-space: nowrap;
}
.pt-btn:hover { background: var(--chip); }
.pt-btn--primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.pt-btn--primary:hover { background: var(--teal-2); border-color: var(--teal-2); }
.pt-btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.35); padding: 5px 11px; font-size: 12px; }
.pt-btn--ghost:hover { background: rgba(255, 255, 255, 0.12); }
.pt-btn--locked { background: var(--chip); color: var(--ink-soft); cursor: default; border-style: dashed; }
.pt-btn--locked:hover { background: var(--chip); }
.pt-btn--block { width: 100%; justify-content: center; padding: 11px 14px; font-size: 14px; }
.pt-btn:focus-visible, .pt-tile:focus-visible, .pt-util:focus-visible, .pt-person:focus-visible, .pt-recent-chip:focus-visible {
  outline: 3px solid rgba(13, 148, 136, 0.45); outline-offset: 2px;
}
.pt-link { font-size: 12.5px; font-weight: 600; }

/* ---- home ---------------------------------------------------------------- */

.pt-hello { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin: 0 0 18px; }
.pt-hello h1 { margin: 0 0 2px; font-size: 24px; }

.pt-search {
  position: relative; display: flex; align-items: center; width: min(360px, 100%);
  color: var(--ink-soft);
}
.pt-search .pt-icon { position: absolute; left: 11px; width: 18px; height: 18px; pointer-events: none; }
.pt-search input {
  width: 100%; padding: 10px 12px 10px 38px; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
}
.pt-search input:focus { outline: 3px solid rgba(13, 148, 136, 0.3); border-color: var(--teal); }

.pt-results {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-up); padding: 12px 16px; margin: -6px 0 18px;
}
.pt-results[hidden] { display: none; }
.pt-results-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-soft); margin: 4px 0 4px; }
.pt-results-list { list-style: none; margin: 0 0 8px; padding: 0; }
.pt-results-list li { padding: 5px 0; border-bottom: 1px solid var(--chip); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.pt-results-list li:last-child { border-bottom: 0; }
.pt-result-name { font-weight: 700; color: var(--navy); }
.pt-result-where { font-size: 12.5px; color: var(--ink-soft); }
.pt-results-empty { color: var(--ink-soft); font-size: 13px; }

.pt-section {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-soft);
  margin: 22px 0 10px;
}

.pt-recent-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-recent-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; font-size: 13px;
}
.pt-recent-chip strong { color: var(--navy); }
.pt-recent-chip span { color: var(--ink-soft); font-size: 12px; }
.pt-recent-chip:hover { border-color: var(--teal); }

/* The nine. Three by three from tablet up; two across on a phone. */
.pt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.pt-tile {
  --acc: var(--teal);
  position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 164px; min-width: 0;
  padding: 16px 18px 16px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; overflow: hidden;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, border-color 0.12s;
}
.pt-tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--acc); }
.pt-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); border-color: color-mix(in srgb, var(--acc) 45%, var(--border)); }
.pt-tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pt-tile-icon {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px;
  background: color-mix(in srgb, var(--acc) 12%, #fff); color: var(--acc);
}
.pt-tile-icon .pt-icon { width: 24px; height: 24px; }
.pt-tile-name { font-size: 16.5px; font-weight: 700; color: var(--navy); line-height: 1.25; }
.pt-tile-count { font-size: 12.5px; color: var(--ink-soft); }
.pt-tile-apps { list-style: none; margin: auto 0 0; padding: 8px 0 0; display: flex; flex-wrap: wrap; gap: 5px; }
.pt-tile-app {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--acc) 10%, #fff); color: color-mix(in srgb, var(--acc) 70%, #000);
  border: 1px solid color-mix(in srgb, var(--acc) 25%, #fff);
}
.pt-tile-app--off { background: var(--chip); color: var(--ink-soft); border-color: var(--border); }

.pt-tile--empty { background: #fafbfc; box-shadow: none; }
.pt-tile--empty::before { background: var(--border); }
.pt-tile--empty .pt-tile-icon { background: var(--chip); color: #8a94a8; }
.pt-tile--empty .pt-tile-name { color: #3b4763; }

.pt-mine {
  display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 2px 8px; border-radius: 999px; background: var(--navy); color: #fff; white-space: nowrap;
}

.pt-utils { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pt-util {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border); color: var(--ink); text-decoration: none; box-shadow: var(--shadow);
}
.pt-util:hover { border-color: var(--teal); }
.pt-util-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--chip); color: var(--navy); flex: none; }
.pt-util-icon .pt-icon { width: 20px; height: 20px; }
.pt-util-name { display: block; font-weight: 700; color: var(--navy); }
.pt-util-blurb { display: block; font-size: 12px; color: var(--ink-soft); }

/* ---- a business function ------------------------------------------------- */

.pt-crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); margin: 0 0 14px; }
.pt-crumbs a { color: var(--ink-soft); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.pt-crumbs a:hover { color: var(--teal-2); }

.pt-area-head {
  --acc: var(--teal);
  display: flex; gap: 18px; align-items: center; padding: 20px 22px; margin: 0 0 18px;
  background: var(--card); border: 1px solid var(--border); border-left: 6px solid var(--acc);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.pt-area-head h1 { margin: 0 0 2px; }
.pt-area-head p { margin: 0 0 4px; color: var(--ink-soft); }
.pt-area-icon {
  width: 60px; height: 60px; flex: none; display: grid; place-items: center; border-radius: 14px;
  background: color-mix(in srgb, var(--acc) 12%, #fff); color: var(--acc);
}
.pt-area-icon .pt-icon { width: 32px; height: 32px; }
.pt-area-meta { font-size: 12.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* App tiles on a function page: the app's own icon, name, stage, one line.
   Three across on a desktop, two on a phone, like the home screen. */
.pt-app-grid { --acc: var(--teal); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pt-app-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  min-width: 0; padding: 20px 16px 18px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, border-color 0.12s;
}
a.pt-app-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); border-color: color-mix(in srgb, var(--acc) 45%, var(--border)); }
a.pt-app-tile:focus-visible { outline: 3px solid rgba(13, 148, 136, 0.45); outline-offset: 2px; }
.pt-app-icon {
  width: 72px; height: 72px; display: grid; place-items: center; margin-bottom: 4px;
  border-radius: 18px; overflow: hidden; background: var(--chip); flex: none;
}
.pt-app-icon img { width: 100%; height: 100%; display: block; }
.pt-app-icon--letter { background: var(--acc); color: #fff; font-size: 32px; font-weight: 800; }
.pt-app-icon--screen { background: var(--acc); color: #fff; }
.pt-app-icon--screen .pt-icon { width: 38px; height: 38px; }
.pt-app-name { font-size: 15.5px; font-weight: 700; color: var(--navy); line-height: 1.25; }
.pt-app-flag { line-height: 1; }
.pt-app-vendor { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); margin-top: -4px; }
button.pt-app-tile { font: inherit; cursor: pointer; width: 100%; }
button.pt-app-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); border-color: color-mix(in srgb, var(--acc) 45%, var(--border)); }
button.pt-app-tile:focus-visible { outline: 3px solid rgba(13, 148, 136, 0.45); outline-offset: 2px; }
.pt-app-desc { font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; max-width: 30ch; }
.pt-app-lock {
  position: absolute; top: 10px; right: 10px; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--chip); color: var(--red);
}
.pt-app-tile--locked .pt-app-icon, .pt-app-tile--off .pt-app-icon { filter: grayscale(1); opacity: 0.55; }
/* Greyed and at the end of the page (Craig, 16 Nov 2026), still pressable:
   it leads to My access. */
.pt-app-tile--locked { background: #fafbfc; box-shadow: none; }
.pt-app-tile--locked .pt-app-name { color: #5b6680; }
.pt-app-tile--locked .pt-app-desc, .pt-app-tile--locked .pt-app-vendor { color: #8a94a8; }
.pt-app-tile--locked .pt-app-flag { opacity: 0.6; }
.pt-app-ask { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-top: auto; }
.pt-app-tile--off { background: #fafbfc; box-shadow: none; }
/* The demo's empty slots ("Room for another app"): drawn by area.js only. */
.pt-app-tile--room {
  background: transparent; box-shadow: none; border: 2px dashed var(--border); justify-content: center;
}
.pt-app-icon--room { background: transparent; border: 2px dashed var(--border); color: #9aa4b8; font-size: 30px; font-weight: 400; }
.pt-app-tile--room .pt-app-name { color: #8a94a8; text-transform: uppercase; letter-spacing: 0.5px; font-size: 13px; }
.pt-app-tile--room .pt-app-desc { color: #9aa4b8; }

/* Coming soon and Suspended (17 Nov 2026): pressable, to say why they open
   nothing. Suspended is greyed like a locked tile. */
.pt-app-note { font-size: 12px; font-weight: 600; line-height: 1.4; max-width: 30ch; }
.pt-app-tile--coming .pt-app-note { color: #0d2858; }
.pt-app-tile--suspended { background: #fafbfc; box-shadow: none; }
.pt-app-tile--suspended .pt-app-icon { filter: grayscale(1); opacity: 0.55; }
.pt-app-tile--suspended .pt-app-name { color: #5b6680; }
.pt-app-tile--suspended .pt-app-note { color: #991b1b; }

.pt-stage { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
/* The five badges (Craig, 17 Nov 2026: option C on the mockup). Every pair
   is 5.5:1 or better; the word is always on the badge. */
.pt-stage--demo { background: #e3e8f1; color: #0d2858; }
.pt-stage--pilot { background: #fef3c7; color: #92400e; }
.pt-stage--live { background: #e0f2f1; color: #0b5f58; }
.pt-stage--soon { background: #0d2858; color: #ffffff; }
.pt-stage--suspended { background: #fee2e2; color: #991b1b; }
.pt-stage--screen { background: var(--chip); color: var(--navy); }
.pt-stage--unknown { background: var(--chip); color: var(--ink-soft); }

/* ---- shared blocks ------------------------------------------------------- */

.pt-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); margin: 0 0 12px; }
.pt-prose h2 { font-size: 15px; margin-top: 16px; }
.pt-prose h2:first-child { margin-top: 0; }
.pt-prose p:last-child { margin-bottom: 0; }
.pt-kv { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; padding: 4px 0; }
.pt-kv > span:first-child { width: 110px; color: var(--ink-soft); font-size: 12.5px; font-weight: 600; }

.pt-chip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--navy); margin: 0 4px 4px 0; text-transform: none; letter-spacing: 0; }

.pt-empty {
  padding: 28px 18px; text-align: center; color: var(--ink-soft);
  background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); margin: 0 0 12px;
}
.pt-empty strong { color: var(--ink); }
.pt-note { margin: 16px 0 10px; padding: 6px 0 6px 12px; font-size: 12.5px; color: var(--ink-soft); border-left: 3px solid var(--border); }
.pt-warn { padding: 10px 14px; border-radius: 6px; background: var(--amber-bg); color: var(--amber-fg); margin: 0 0 12px; }
.pt-warn ul { margin: 6px 0 0; padding-left: 20px; }
.pt-ok { padding: 10px 14px; border-radius: 6px; background: #ecfdf5; color: #065f46; margin: 0 0 12px; display: flex; gap: 8px; align-items: center; }

/* My access: the Admin box, and each app's level from the Access app. */
.pt-admin-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 5px 0; }
.pt-admin-row .pt-btn { min-width: 170px; }
.pt-level { font-weight: 600; white-space: nowrap; }
.pt-level-note { font-size: 12px; }

/* Requests for access (16 Nov 2026): the request panel, the links on My
   access, and the list of a person's own requests. */
.pt-request { max-width: 640px; }
.pt-request-head { display: flex; gap: 12px; align-items: center; margin: 0 0 10px; }
.pt-request-head img { border-radius: 8px; }
.pt-request-head div { display: flex; flex-direction: column; }
.pt-request-form { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 0; }
.pt-request-form textarea { resize: vertical; min-height: 72px; }
.pt-request-form .pt-gate-error { margin: 6px 0 0; }
.pt-request-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 10px 0 0; }
.pt-ask { display: block; font-size: 12px; font-weight: 600; margin-top: 2px; }
.pt-req-status { font-weight: 600; white-space: nowrap; }

/* Being set up (17 Nov 2026): Access says the person has a level, and the
   tile opens after the Access sync's next update. Amber, not red: nothing
   is wrong, it is on its way. */
.pt-setup { margin: 4px 0 8px; padding: 10px 14px; border-radius: 6px; background: var(--amber-bg); color: var(--amber-fg);
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; white-space: normal; }
.pt-setup p { margin: 0; flex: 1 1 24ch; }
.pt-setup .pt-btn { flex: none; }
td .pt-setup { margin: 6px 0 2px; padding: 8px 10px; font-size: 12px; font-weight: 400; max-width: 46ch; }
.pt-app-tile--setup .pt-app-setup { color: var(--amber-fg); }
.pt-app-tile--setup .pt-app-setup strong { color: var(--amber-fg); }
.pt-app-setup-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 12px; margin-top: auto; padding-top: 4px; }
.pt-app-more { font-size: 12px; font-weight: 600; }
.pt-req-status--approved { color: var(--green); }
.pt-req-status--declined { color: var(--red); }

.pt-state { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.pt-state--open { color: var(--green); }
.pt-state--no { color: var(--red); }

.pt-scroll { overflow-x: auto; max-width: 100%; margin: 0 0 12px; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--border); }
.pt-table { border-collapse: collapse; width: 100%; font-size: 13px; background: var(--card); }
.pt-table th { text-align: left; padding: 8px 12px; background: var(--chip); color: var(--navy); font-size: 12px; border-bottom: 1px solid var(--border); }
.pt-table td, .pt-table tbody th { padding: 8px 12px; border-bottom: 1px solid var(--chip); vertical-align: middle; }
.pt-table tbody th { background: var(--card); font-size: 13px; white-space: nowrap; }
.pt-table tr:last-child td, .pt-table tr:last-child th { border-bottom: 0; }
.pt-matrix-h { text-align: center !important; font-size: 11px !important; line-height: 1.2; width: 74px; }
.pt-matrix-c { text-align: center; color: var(--border); }
.pt-matrix-c--on { color: var(--teal); font-size: 16px; }

/* ---- sign-in gate -------------------------------------------------------- */

.pt-gate {
  flex: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(135deg, #0d2858 0%, #1e3a5f 100%);
}
.pt-gate-card {
  width: 400px; max-width: 100%; background: var(--card); border-radius: 14px; padding: 28px 26px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.pt-gate-brand { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; }
.pt-gate-brand .pt-muted { font-size: 12.5px; }
.pt-gate-title { font-size: 19px; font-weight: 700; color: var(--navy); }
.pt-gate-small { font-size: 12px; color: var(--ink-soft); text-align: center; margin: 8px 0 0; }

/* The live sign-in form (screens/signin.js). */
.pt-signin-form { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 0; }
.pt-signin-form .pt-btn { margin-top: 10px; }
/* Sign in with Microsoft, only when its switch is on (identity.js). The
   button itself is the shared module's .cysi-btn; these place it. */
.pt-gate-ms .cysi-btn { max-width: none; }
.pt-gate-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; font-size: 12px; color: var(--ink-soft); }
.pt-gate-or::before, .pt-gate-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.pt-gate-error { margin: 0 0 14px; padding: 10px 12px; border-radius: 6px; background: var(--red-bg); color: var(--red-fg); font-size: 13px; }
.pt-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--navy); margin-top: 6px; }
.pt-input {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
}
.pt-input:focus { outline: 3px solid rgba(13, 148, 136, 0.3); border-color: var(--teal); }

/* Where Improve's widget puts its "Suggest an improvement" button (suggest.js). */
.pt-suggest { margin-left: auto; display: flex; align-items: center; }
.pt-suggest:empty { display: none; }
/* The line pointing at that button (PORTAL-SUG-0002): home screen only, and
   never without the button, so it cannot point at nothing (demo, or the
   widget failed to start). */
.pt-suggest-lead {
  display: none; margin: 0 0 0 auto; max-width: 400px; text-align: right;
  font-size: 12.5px; line-height: 1.35; color: #cfd9ef;
}
body.pt-on-home .pt-suggest-lead:has(+ .pt-suggest:not(:empty)) { display: block; }
body.pt-on-home .pt-suggest-lead:has(+ .pt-suggest:not(:empty)) + .pt-suggest { margin-left: 0; }
/* The Install button (install.js): there only while the browser offers to
   install the portal, so an empty slot takes no room. It sits just left of
   the person, after the suggestion button when there is one. */
.pt-install { margin-left: auto; display: flex; align-items: center; }
.pt-install:empty { display: none; }
.pt-suggest:not(:empty) ~ .pt-install { margin-left: 0; }
.pt-install-btn .pt-icon { width: 16px; height: 16px; }
.pt-gate-demo { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border); }
.pt-gate-demo-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--amber-fg); margin: 0 0 8px; }
.pt-people { display: flex; flex-direction: column; gap: 6px; }
.pt-person {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; text-align: left;
  font: inherit; background: var(--card); border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.pt-person:hover { border-color: var(--teal); background: #f8fbfb; }
.pt-person-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.pt-person strong { color: var(--navy); font-size: 13.5px; }
.pt-person .pt-muted { font-size: 12px; }
.pt-person .pt-avatar { background: var(--chip); color: var(--navy); border-color: var(--border); }
.pt-person-tag { margin: 0 0 0 auto; background: var(--navy); color: #fff; white-space: nowrap; }

/* ---- device preview (demo) ---------------------------------------------- */

.pt-view-switch {
  display: inline-flex; gap: 2px; padding: 2px; margin-right: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 7px;
}
.pt-view-btn {
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  padding: 4px 10px; border: 0; border-radius: 5px; background: transparent; color: #cfd9ef;
}
.pt-view-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.pt-view-btn--on, .pt-view-btn--on:hover { background: #fff; color: var(--navy); }
.pt-view-btn:focus-visible { outline: 3px solid rgba(13, 148, 136, 0.6); outline-offset: 1px; }

body.pt-previewing .pt-main { max-width: none; padding-top: 14px; padding-bottom: 18px; }
.pt-preview-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; justify-content: center;
  margin: 0 0 12px; font-size: 13px;
}
.pt-preview-bar strong { color: var(--navy); }
.pt-preview-hint { flex-basis: 100%; text-align: center; font-size: 12px; }
.pt-btn--small { padding: 4px 10px; font-size: 12px; }
.pt-preview-fit { position: relative; width: 100%; overflow: hidden; }
/* Absolutely placed so the unscaled size never widens or lengthens the page;
   preview.js scales it and sets the holder's height to match. */
.pt-device {
  position: absolute; top: 0; left: 0;
  box-sizing: content-box; border-style: solid; border-color: #111827; background: #111827;
  box-shadow: 0 24px 60px rgba(16, 25, 46, 0.28), inset 0 0 0 1px #374151;
  overflow: hidden; transform-origin: top left;
}
.pt-device-screen { display: block; border: 0; background: var(--paper); }
.pt-device--phone .pt-device-screen { border-radius: 34px; }
.pt-device--tablet .pt-device-screen { border-radius: 16px; }

/* Inside the frame the page is the device's own screen: no demo switch. */
body.pt-in-frame .pt-view-switch { display: none; }

/* ---- toast --------------------------------------------------------------- */

.pt-toast-host { position: fixed; left: 0; right: 0; bottom: 20px; z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.pt-toast {
  background: #111827; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; max-width: min(92vw, 520px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); opacity: 0; transform: translateY(12px); transition: opacity 0.2s, transform 0.2s;
}
.pt-toast.pt-toast-show { opacity: 1; transform: translateY(0); }

/* ---- responsive ---------------------------------------------------------- */

@media (max-width: 1100px) {
  /* No room beside the brand and the person: the button stands alone. */
  body.pt-on-home .pt-suggest-lead:has(+ .pt-suggest:not(:empty)) { display: none; }
  body.pt-on-home .pt-suggest-lead:has(+ .pt-suggest:not(:empty)) + .pt-suggest { margin-left: auto; }
}

@media (max-width: 860px) {
  .pt-app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .pt-header { padding: 10px 16px; flex-wrap: nowrap; gap: 8px; }
  .pt-brand { gap: 10px; }
  .pt-brand-name { font-size: 16px; }
  .pt-mark { width: 32px; height: 32px; border-radius: 7px; }
  .pt-brand-sub { display: none; }
  .pt-session { gap: 8px; }
  .pt-session-who { display: none; }
  /* Room is short: the Install button keeps its icon and drops the word. */
  .pt-install-label { display: none; }
  .pt-install-btn { padding: 5px 8px; }
  /* Already on a phone: nothing to preview. */
  .pt-view-switch { display: none; }
  .pt-main { padding: 16px 16px 32px; }
  .pt-hello h1 { font-size: 20px; }
  .pt-search { width: 100%; }
  .pt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pt-tile { min-height: 132px; padding: 14px 14px 12px; }
  .pt-tile-icon { width: 38px; height: 38px; }
  .pt-tile-name { font-size: 14.5px; }
  .pt-tile-count { font-size: 11.5px; }
  .pt-tile-apps { display: none; }
  .pt-mine { font-size: 9.5px; padding: 2px 6px; }
  .pt-area-head { padding: 14px 16px; gap: 12px; align-items: flex-start; }
  .pt-area-icon { width: 46px; height: 46px; }
  .pt-area-icon .pt-icon { width: 26px; height: 26px; }
  .pt-app-grid { gap: 10px; }
  .pt-app-tile { padding: 16px 10px 14px; }
  .pt-app-icon { width: 56px; height: 56px; border-radius: 14px; }
  .pt-app-name { font-size: 14px; }
  .pt-app-desc { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .pt-tile, .pt-toast { transition: none; }
  .pt-tile:hover { transform: none; }
}
