:root {
  --occt-blue-950: #09263a;
  --occt-blue-900: #0f3a57;
  --occt-blue-800: #005b8f;
  --occt-blue-700: #0f78b3;
  --occt-cyan-500: #21a3cf;
  --occt-sand-100: #f6f2ea;
  --occt-sand-200: #ece4d7;
  --surface: #fffdfa;
  --surface-alt: #f8fbfd;
  --line: rgba(15, 58, 87, 0.14);
  --line-strong: rgba(15, 58, 87, 0.24);
  --text: #1c2831;
  --text-muted: #5c6b76;
  --shadow-lg: 0 32px 80px rgba(9, 38, 58, 0.14);
  --shadow-md: 0 18px 40px rgba(9, 38, 58, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max-width: 1420px;
  --font-sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-serif: Iowan Old Style, Palatino Linotype, Book Antiqua, Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(33, 163, 207, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 120, 179, 0.16), transparent 32%),
    linear-gradient(180deg, #eff6fa 0%, #f6f2ea 46%, #f9fbfc 100%);
  min-height: 100vh;
}

a {
  color: var(--occt-blue-800);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--occt-blue-700);
}

.shell {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero,
.ticket-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 36px;
  background:
    linear-gradient(140deg, rgba(9, 38, 58, 0.97), rgba(0, 91, 143, 0.92) 42%, rgba(33, 163, 207, 0.88)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  color: white;
  box-shadow: var(--shadow-lg);
}

.hero::after,
.ticket-hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -36% auto;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.hero__inner,
.ticket-hero {
  padding: 42px clamp(24px, 4vw, 54px);
}

.hero h1,
.ticket-hero h1 {
  margin: 10px 0 16px;
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 4vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  max-width: 14ch;
  overflow-wrap: anywhere;
}

.hero__lede {
  max-width: 62ch;
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.86);
}

.hero__meta,
.ticket-hero__head,
.badge-row,
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__meta {
  margin-top: 28px;
}

.hero__meta span,
.breadcrumbs span,
.breadcrumbs a {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}

.breadcrumbs {
  margin-bottom: 20px;
}

.breadcrumbs a {
  text-decoration: none;
}

.layout {
  display: grid;
  gap: 28px;
  margin-top: 28px;
}

.search-panel {
  width: 100%;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.results {
  min-width: 0;
}

.sidebar {
  display: grid;
  gap: 20px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 250, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  padding: 28px;
}

.card--results {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.panel-header,
.results__header,
.ticket-hero__head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field--wide {
  grid-column: span 2;
}

.field span,
.eyebrow {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--occt-cyan-500);
  box-shadow: 0 0 0 5px rgba(33, 163, 207, 0.14);
  transform: translateY(-1px);
}

.ghost-button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.64);
  color: var(--occt-blue-900);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.ghost-button:hover,
.primary-link:hover {
  border-color: rgba(33, 163, 207, 0.5);
  background: #fff;
}

.stats-list {
  display: grid;
  gap: 18px;
  margin: 18px 0 0;
}

.stats-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.stats-list dt {
  color: var(--text-muted);
}

.stats-list dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pill {
  padding: 10px 14px;
  border: 1px solid rgba(15, 120, 179, 0.18);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(230, 242, 248, 0.9));
  color: var(--occt-blue-900);
  font-weight: 700;
  cursor: pointer;
}

.result-list {
  display: grid;
  gap: 12px;
}

.ticket-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 20px;
  border-radius: 20px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(244,248,251,0.88));
  overflow: hidden;
}

.ticket-card:hover {
  transform: translateY(-2px);
  border-color: rgba(33, 163, 207, 0.28);
  box-shadow: 0 18px 34px rgba(15, 58, 87, 0.08);
}

.ticket-card__id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--occt-blue-900), var(--occt-blue-700));
  color: white;
  font-weight: 800;
}

.ticket-card__summary {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.18rem;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.ticket-card__excerpt {
  margin: 10px 0 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.ticket-card__meta,
.ticket-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.ticket-card__meta span,
.ticket-card__badges span,
.badge,
.mention,
.relationship-meta,
.permalink {
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.9rem;
}

.ticket-card__meta span {
  background: rgba(15, 58, 87, 0.06);
  color: var(--text-muted);
}

.badge {
  background: rgba(33, 163, 207, 0.12);
  color: var(--occt-blue-900);
  font-weight: 700;
}

.badge--status {
  background: rgba(15, 120, 179, 0.14);
}

.badge--severity {
  background: rgba(202, 126, 43, 0.14);
}

.badge--resolution {
  background: rgba(42, 122, 87, 0.14);
}

.mention {
  background: rgba(15, 58, 87, 0.08);
  color: var(--occt-blue-900);
  font-weight: 700;
}

.empty-state,
.muted {
  color: var(--text-muted);
  line-height: 1.6;
}

.ticket-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  margin-top: 28px;
  align-items: start;
}

.ticket-layout > * {
  min-width: 0;
}

.ticket-sidebar {
  display: grid;
  gap: 20px;
}

.page-ticket .ticket-hero {
  padding: 22px 28px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(243,248,251,0.96)),
    linear-gradient(140deg, rgba(9, 38, 58, 0.04), rgba(33, 163, 207, 0.08));
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.page-ticket .ticket-hero::after {
  display: none;
}

.page-ticket .ticket-hero h1 {
  max-width: none;
  margin: 6px 0 0;
  color: var(--text);
  font-size: clamp(1.45rem, 2.4vw, 2.15rem);
  line-height: 1.15;
}

.page-ticket .ticket-hero .eyebrow {
  color: var(--occt-blue-800);
}

.page-ticket .breadcrumbs {
  margin-bottom: 14px;
}

.page-ticket .breadcrumbs span,
.page-ticket .breadcrumbs a {
  background: rgba(15, 58, 87, 0.06);
  color: var(--text-muted);
}

.page-ticket .ticket-hero__head {
  align-items: center;
}

.page-ticket .badge-row {
  justify-content: flex-start;
}

.fact-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.fact-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 58, 87, 0.06);
  color: var(--text-muted);
  font-size: 0.92rem;
}

.fact-chip strong {
  color: var(--text);
}

.version-list,
.attachment-list,
.relationship-list,
.related-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.version-list li,
.attachment-list li,
.relationship-list li,
.related-list li {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.attachment-main {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: start;
}

.attachment-preview {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(15, 58, 87, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

.attachment-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.relationship-type {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.prose,
.prose p,
.prose li {
  line-height: 1.72;
}

.prose a,
.relationship-list a,
.related-list a {
  overflow-wrap: anywhere;
}

.prose > :first-child {
  margin-top: 0;
}

.prose pre,
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.prose pre {
  overflow: auto;
  padding: 18px;
  border-radius: 18px;
  background: #102a3d;
  color: #f1f5f8;
}

.prose code {
  background: rgba(15, 58, 87, 0.08);
  padding: 0.18em 0.4em;
  border-radius: 0.5em;
}

.prose table,
.history-table {
  width: 100%;
  border-collapse: collapse;
}

.prose table th,
.prose table td,
.history-table th,
.history-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.timeline-section,
.history-section {
  grid-column: 1 / -1;
  min-width: 0;
}

.detail-grid {
  display: grid;
  gap: 14px;
  margin: 18px 0 0;
}

.detail-grid div {
  display: grid;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.detail-grid dt {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-grid dd {
  margin: 0;
  font-weight: 700;
}

.discussion-item {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.discussion-item + .discussion-item {
  margin-top: 18px;
}

.discussion-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.discussion-item__note,
.role-pill {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(15, 58, 87, 0.06);
  color: var(--text-muted);
  font-size: 0.88rem;
}

.discussion-item__body {
  min-width: 0;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,250,252,0.96));
  border: 1px solid rgba(15, 58, 87, 0.08);
}

.discussion-time {
  color: var(--text-muted);
}

.permalink {
  background: rgba(15, 58, 87, 0.06);
  text-decoration: none;
}

.support-page {
  width: min(720px, calc(100% - 32px));
  margin: 10vh auto 0;
}

@media (max-width: 1120px) {
  .content-grid,
  .ticket-layout {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .ticket-sidebar {
    order: 2;
  }

  .search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field--wide {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, var(--max-width));
    padding-top: 12px;
  }

  .hero__inner,
  .ticket-hero {
    padding: 28px 18px;
  }

  .card {
    padding: 20px;
    border-radius: 22px;
  }

  .panel-header,
  .results__header,
  .ticket-hero__head {
    flex-wrap: wrap;
  }

  .panel-header .ghost-button {
    width: 100%;
    justify-content: center;
  }

  .hero h1 {
    font-size: clamp(2rem, 11vw, 3.1rem);
  }

  .page-ticket .ticket-hero h1 {
    font-size: clamp(1.08rem, 6.2vw, 1.42rem);
    line-height: 1.12;
  }

  .hero__lede {
    font-size: 1rem;
    line-height: 1.55;
  }

  .ticket-card {
    padding: 16px;
    gap: 12px;
  }

  .ticket-card__summary {
    font-size: 1rem;
    line-height: 1.2;
  }

  .ticket-card__meta,
  .ticket-card__badges {
    gap: 8px;
    margin-top: 12px;
  }

  .ticket-card__meta span,
  .ticket-card__badges span,
  .badge,
  .mention,
  .relationship-meta,
  .permalink,
  .discussion-item__note,
  .role-pill {
    padding: 6px 9px;
    font-size: 0.8rem;
  }

  .search-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .field--wide {
    grid-column: span 1;
  }

  .ticket-card {
    grid-template-columns: 1fr;
  }

  .history-table {
    min-width: 640px;
  }
}
