*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Fluent neutrals */
  --bg: #f3f2f1;
  --surface: #ffffff;
  --border: #edebe9;
  --border-strong: #c8c6c4;
  --text: #201f1e;
  --muted: #605e5c;
  /* Was #a19f9d (2.62:1 on white). #767676 hits 4.67:1 for WCAG AA. */
  --subtle: #767676;

  /* M365 blue */
  --accent: #0078d4;
  --accent-hover: #106ebe;
  --accent-pressed: #005a9e;
  --accent-light: #deecf9;

  --sidebar-w: 200px;
  --layout-max: 1440px;
  --suite-h: 48px;
  --cmd-h: 44px;

  /* Fluent tier colours (darkened where needed for WCAG AA on 11px bold white text).
     Each value below achieves >= 4.5:1 contrast against #fff. */
  --tier-chat: #0078d4;     /* 4.54:1 */
  --tier-licensed: #5c428b; /* was #8764b8 (3.49) -> 8.00:1 */
  --tier-both: #00575c;     /* was #038387 (4.05) -> 8.33:1 */

  /* Fluent sensitivity colours */
  --sens-public: #0e700e;    /* was #107c10 (4.50) -> 5.03:1 */
  --sens-internal: #6b6b00;  /* was #8a8a00 (3.54) -> 5.55:1 */
  --sens-restricted: #a4262c;/* was #d13438 (4.05) -> 7.19:1 */
  --sens-vendor: #5c428b;    /* was #8764b8 (3.49) -> 8.00:1 */

  /* Category-group stripe colours (3px non-text UI; 3:1 minimum per WCAG 1.4.11).
     Re-use the darkened tokens above so stripe and badge hues stay coherent. */
  --group-grc: var(--tier-chat);
  --group-arch: var(--tier-licensed);
  --group-secops: var(--tier-both);
  --group-support: var(--sens-public);
}

body {
  font-family: "Segoe UI", "Segoe UI Web (West European)", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.panel-open { overflow: hidden; }

/* ── Skip link (visually hidden until focused) ── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: 2px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  z-index: 100;
  transition: top .15s ease-out;
}
.skip-link:focus {
  top: 8px;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Main landmark focusable but not an outline when clicked */
#main:focus { outline: none; }

/* ── Suite bar (SharePoint top bar) ── */
.suite-bar {
  background: var(--accent);
  color: #fff;
  height: var(--suite-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 12px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.suite-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.suite-right {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.suite-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 2px;
  flex-shrink: 0;
  opacity: .85;
  transition: background .1s, opacity .1s;
}
.suite-icon-btn:hover { background: rgba(255,255,255,.15); opacity: 1; }

.suite-avatar {
  background: #fff;
  color: var(--accent);
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: .03em;
  flex-shrink: 0;
  transition: opacity .1s;
}
.suite-avatar:hover { opacity: .9; }

.suite-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suite-search {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px;
  padding: 0 10px;
  gap: 6px;
  height: 32px;
  width: 100%;
  max-width: 560px;
  transition: background .15s, border-color .15s;
}
.suite-search:focus-within {
  background: #fff;
  border-color: #fff;
}
.suite-search:focus-within svg { color: var(--accent); }
.suite-search svg { color: rgba(255,255,255,.7); flex-shrink: 0; }

#search {
  border: none;
  background: none;
  font-size: 14px;
  font-family: inherit;
  color: #fff;
  width: 100%;
  outline: none;
}
#search::placeholder { color: rgba(255,255,255,.65); }
.suite-search:focus-within #search { color: var(--text); }
.suite-search:focus-within #search::placeholder { color: var(--muted); }

/* ── Command bar ── */
.command-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--cmd-h);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: var(--suite-h);
  z-index: 10;
}

.command-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.cmd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  font-weight: 400;
  cursor: pointer;
  border-radius: 2px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .1s;
}
.cmd-btn:hover { background: var(--bg); }
.cmd-btn:active { background: var(--border); }
.cmd-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--accent);
}

.cmd-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 6px;
  flex-shrink: 0;
}

#results-count {
  font-size: 13px;
  color: var(--muted);
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Page header (SharePoint page header band) ── */
.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.page-header-inner {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 24px 24px 24px calc(var(--sidebar-w) + 24px);
}
.page-topic {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.page-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.2;
  color: var(--text);
}
.page-desc {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  max-width: 780px;
}
.page-meta {
  margin-top: 12px;
  font-size: 12px;
  color: var(--subtle);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.meta-sep { color: var(--border-strong); }

/* ── Layout ── */
.layout {
  display: flex;
  max-width: var(--layout-max);
  width: 100%;
  margin: 0 auto;
  padding: 0;
  align-items: flex-start;
  flex: 1;
}

/* ── Left nav (SharePoint-style) ── */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  min-height: calc(100vh - var(--suite-h) - var(--cmd-h));
  padding: 12px 0;
  position: sticky;
  top: calc(var(--suite-h) + var(--cmd-h));
  overflow-y: auto;
  max-height: calc(100vh - var(--suite-h) - var(--cmd-h));
}

#sidebar h2 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--subtle);
  padding: 8px 16px 4px;
}

.cat-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  transition: background .1s;
  position: relative;
  line-height: 1.3;
}

.cat-btn:hover { background: var(--bg); }

.cat-btn.active {
  background: var(--accent-light);
  color: var(--accent-pressed);
  font-weight: 600;
}

.cat-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.cat-btn.cat-empty { color: var(--subtle); }

.cat-count {
  float: right;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg);
  color: var(--muted);
  padding: 0 5px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 16px;
}
.cat-count--empty { color: var(--border-strong); background: none; }

/* ── Main content ── */
#content {
  flex: 1;
  min-width: 0;
  padding: 20px 24px 32px;
}

/* ── Prompt cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: 2px;
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: 0 1.6px 3.6px rgba(0,0,0,.072), 0 .3px .9px rgba(0,0,0,.052);
  transition: box-shadow .15s, transform .1s;
}

.card:hover {
  box-shadow: 0 3.2px 7.2px rgba(0,0,0,.132), 0 .6px 1.8px rgba(0,0,0,.108);
}

.card[data-group="GRC"]          { border-left-color: var(--group-grc); }
.card[data-group="Architecture"] { border-left-color: var(--group-arch); }
.card[data-group="SecOps"]       { border-left-color: var(--group-secops); }
.card[data-group="Support"]      { border-left-color: var(--group-support); }

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.prompt-id {
  font-size: 11px;
  font-weight: 600;
  font-family: "Cascadia Code", "Consolas", monospace;
  background: var(--accent-light);
  color: var(--accent-pressed);
  padding: 2px 6px;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  line-height: 1.3;
  color: var(--text);
}

.badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 2px;
  color: #fff;
  white-space: nowrap;
}

.badge-chat      { background: var(--tier-chat); }
.badge-licensed  { background: var(--tier-licensed); }
.badge-both      { background: var(--tier-both); }
.badge-tier      { background: var(--muted); }

.badge-public    { background: var(--sens-public); }
.badge-internal  { background: var(--sens-internal); }
.badge-restricted { background: var(--sens-restricted); }
.badge-vendor    { background: var(--sens-vendor); }

.badge-cat {
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-weight: 400;
}

.badge-caveat {
  background: #fff4ce;
  color: #603d00;
  border: 1px solid #fce100;
  font-weight: 600;
}

.goal {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ── Fluent-style buttons ── */
.card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-primary, .btn-secondary {
  font-size: 13px;
  font-family: inherit;
  padding: 4px 14px;
  border-radius: 2px;
  cursor: pointer;
  transition: background .1s, border-color .1s;
  height: 30px;
  display: inline-flex;
  align-items: center;
}

.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active { background: var(--accent-pressed); border-color: var(--accent-pressed); }
.btn-primary.copied { background: var(--sens-public); border-color: var(--sens-public); }

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover { background: var(--bg); border-color: var(--muted); }
.btn-secondary.copied { background: var(--sens-public); border-color: var(--sens-public); color: #fff; }

/* ── Empty state ── */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty strong { display: block; font-size: 16px; margin-bottom: 6px; color: var(--text); }

/* ── Copilot badge ── */
.copilot-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #1b4aef;
  background: #eff4ff;
  border: 1px solid #c7d7fd;
  border-radius: 2px;
  padding: 2px 6px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  margin-top: 1px;
}

/* ── Side panel (Fluent Panel) ── */
.panel-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .3);
  z-index: 40;
  animation: fade-in .15s ease-out;
}
.panel-scrim[hidden] { display: none; }

.prompt-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100vw);
  background: var(--surface);
  box-shadow: -14px 0 32px rgba(0, 0, 0, .18), -4px 0 8px rgba(0, 0, 0, .08);
  z-index: 50;
  transform: translateX(100%);
  transition: transform .22s cubic-bezier(0.1, 0.9, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.prompt-panel.open { transform: translateX(0); }

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-title {
  font-size: 18px;
  font-weight: 600;
  flex: 1;
  line-height: 1.3;
  color: var(--text);
}
.panel-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  flex-shrink: 0;
  transition: background .1s, color .1s;
}
.panel-close:hover { background: var(--bg); color: var(--text); }

.panel-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.panel-section { margin-bottom: 22px; }
.panel-section:last-child { margin-bottom: 0; }

.panel-heading {
  font-size: 11px;
  font-weight: 600;
  color: var(--subtle);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.panel-heading-warn { color: var(--sens-restricted); }

.panel-goal {
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
}

.panel-prompt {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 2px;
  padding: 12px 14px;
  font-size: 13px;
  font-family: "Segoe UI", "Segoe UI Web (West European)", sans-serif;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
  color: var(--text);
}

.panel-caveats {
  font-size: 13px;
  background: #fff4ce;
  border: 1px solid #fce100;
  color: #603d00;
  padding: 8px 12px;
  border-radius: 2px;
  line-height: 1.55;
}

.panel-apps {
  font-size: 13px;
  color: var(--muted);
}

.panel-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Footer ── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.site-footer-inner {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 14px 24px 14px calc(var(--sidebar-w) + 24px);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.site-footer-inner a {
  color: var(--accent);
  text-decoration: none;
}
.site-footer-inner a:hover { text-decoration: underline; }
.footer-sep { color: var(--border-strong); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .page-header-inner,
  .site-footer-inner {
    padding-left: 24px;
  }
}

@media (max-width: 680px) {
  .layout { flex-direction: column; }
  #sidebar {
    width: 100%;
    min-height: unset;
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    padding: 8px;
    gap: 2px;
  }
  #sidebar h2 { display: none; }
  .cat-btn { width: auto; padding: 6px 12px; }
  .cat-btn.active::before { display: none; }
  #content { padding: 14px; }
  .suite-bar { grid-template-columns: auto 1fr auto; }
  .suite-name { display: none; }
  .suite-right .suite-icon-btn:not(:last-child) { display: none; }

  .command-bar {
    overflow-x: auto;
    padding: 0 12px;
  }
  #results-count { display: none; }

  .page-header-inner { padding: 16px 14px; }
  .page-title { font-size: 22px; }

  .prompt-panel { width: 100vw; }

  .site-footer-inner { padding: 12px 14px; }
}
