:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef2f3;
  --text: #172126;
  --muted: #5c6a70;
  --border: #d8e0e3;
  --accent: #146c72;
  --accent-strong: #0b4f54;
  --danger: #a83232;
  --warning: #a56608;
  --urgent: #a32149;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  height: 56px;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.brand {
  color: var(--text);
  font-weight: 700;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 16px;
}

.topbar-actions form {
  margin: 0;
}

.page {
  margin: 0 auto;
  max-width: 1480px;
  padding: 28px 24px 48px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 28px;
  letter-spacing: 0;
  margin-bottom: 6px;
}

h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin: 0;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-height: 38px;
  padding: 8px 10px;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
}

.button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 650;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.button.ghost {
  background: transparent;
}

.notice {
  background: #e8f6ec;
  border: 1px solid #b8dfc2;
  border-radius: 6px;
  color: #1c6b34;
  padding: 10px 12px;
}

.warning-panel {
  background: #fff8e8;
  border: 1px solid #ead7a8;
  border-radius: 6px;
  color: var(--warning);
  margin: 0;
  padding: 10px 12px;
}

.auth-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 80px auto;
  max-width: 420px;
  padding: 28px;
}

.stack {
  display: grid;
  gap: 14px;
}

.error {
  color: var(--danger);
}

.toolbar,
.ticket-header {
  align-items: end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.toolbar p,
.ticket-header p {
  color: var(--muted);
  margin-bottom: 0;
}

.filters,
.status-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.filters input {
  min-width: 220px;
}

.ticket-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

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

.ticket-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.ticket-table tr:last-child td {
  border-bottom: 0;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.pill {
  background: var(--surface-2);
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
}

.priority-high {
  color: var(--warning);
}

.priority-urgent {
  color: var(--urgent);
}

.status-open {
  color: #1d7a3a;
}

.status-closed {
  color: var(--danger);
}

.back {
  margin-bottom: 12px;
}

.settings-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  max-width: 720px;
  padding: 18px;
}

.settings-panel.wide-panel {
  max-width: 1180px;
}

.platform-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.platform-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.platform-card input {
  width: 100%;
}

.metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metric-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 14px;
}

.metric-card strong {
  font-size: 28px;
  line-height: 1;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.activity-table pre {
  font-size: 11px;
  max-height: 120px;
}

.status-list {
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
}

.alpha-form textarea {
  min-height: 92px;
}

.alpha-metrics {
  margin-bottom: 20px;
}

.alpha-admin-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.alpha-admin-grid .settings-panel {
  max-width: none;
}

.alpha-roster-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding: 18px;
}

.alpha-roster-panel p,
.alpha-admin-grid p {
  color: var(--muted);
}

.alpha-roster-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alpha-roster-actions form {
  margin: 0;
}

.table-scroll {
  overflow-x: auto;
}

.invite-result {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.invite-result input {
  width: 100%;
}

.launcher-link-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.launcher-link-panel p {
  color: var(--muted);
  margin-bottom: 0;
}

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

.launcher-link-row {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.launcher-link-row input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  width: 100%;
}

.checkbox-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.checkbox-row input {
  min-height: 0;
}

.detail-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 420px;
}

.thread,
.side section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
}

.side {
  display: grid;
  gap: 18px;
}

.message {
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 8px;
  padding: 14px 0;
}

.message.private {
  background: #fff8e8;
  border: 1px solid #ead7a8;
  border-radius: 8px;
  margin: 12px 0;
  padding: 12px;
}

.message-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.composer {
  border-top: 1px solid var(--border);
  margin-top: 18px;
  padding-top: 18px;
}

dl {
  display: grid;
  gap: 8px 12px;
  grid-template-columns: 92px minmax(0, 1fr);
  margin: 0;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

details {
  border-top: 1px solid var(--border);
  padding: 10px 0;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

.audit {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.audit li {
  display: grid;
  gap: 2px;
}

.audit time,
.audit small {
  color: var(--muted);
}

@media (max-width: 980px) {
  .toolbar,
  .ticket-header {
    align-items: stretch;
    display: grid;
  }

  .filters,
  .status-form {
    justify-content: stretch;
  }

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

  .filters > *,
  .status-form > * {
    flex: 1 1 180px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .alpha-admin-grid {
    grid-template-columns: 1fr;
  }

  .launcher-link-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }
}

.gem-alpha-body {
  --gem-black: #000201;
  --gem-panel: rgba(0, 2, 1, 0.72);
  --gem-blue-panel: #011725;
  --gem-line: #4e5967;
  --gem-red: #6e0303;
  --gem-red-bright: #9e0707;
  --gem-muted: #cccaca;
  background: var(--gem-black);
  color: #fff;
  font-family: "brother-1816", "Open Sans", system-ui, sans-serif;
  font-weight: 300;
  min-height: 100vh;
}

.gem-alpha-body a,
.gem-alpha-body a:hover {
  color: #fff;
}

.gem-alpha-header {
  inset: 0 0 auto;
  padding-top: 0;
  position: absolute;
  z-index: 10;
}

.gem-alpha-navbar {
  align-items: center;
  background: var(--gem-panel);
  border: 1px solid var(--gem-line);
  display: flex;
  min-height: 67px;
  width: min(1170px, 100% - 30px);
  margin: 0 auto;
}

.gem-alpha-logo {
  display: block;
  margin-left: 25px;
  width: min(225px, 45vw);
}

.gem-alpha-logo img {
  display: block;
  height: auto;
  width: 100%;
}

.gem-alpha-nav-actions {
  align-self: stretch;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  margin-left: auto;
  text-transform: uppercase;
}

.gem-alpha-nav-actions a {
  align-items: center;
  display: flex;
  padding: 0 18px;
  text-decoration: none;
  transition: background 0.35s;
}

.gem-alpha-nav-actions a:hover {
  background: #500202;
  text-decoration: none;
}

.gem-alpha-nav-actions .gem-alpha-nav-join {
  background: #880404;
  padding-left: 24px;
  padding-right: 24px;
}

.gem-alpha-nav-actions .gem-alpha-nav-join:hover {
  background: var(--gem-red-bright);
}

.gem-alpha-page {
  background-image:
    linear-gradient(180deg, rgba(0, 2, 1, 0.12), rgba(0, 2, 1, 0.82) 78%),
    url("/static/gemini/default_page_bg.jpg");
  background-position: top;
  background-repeat: no-repeat;
  background-size: 100%;
  min-height: 100vh;
  padding: 200px 0 100px;
}

.gem-alpha-content {
  margin: 0 auto;
  max-width: 980px;
  padding: 0 15px;
}

.gem-alpha-content-narrow {
  max-width: 760px;
}

.gem-alpha-title {
  margin-bottom: 60px;
  text-align: center;
}

.gem-alpha-title h1 {
  color: #fff;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.gem-alpha-title span {
  color: #fff;
  display: block;
  font-size: 18px;
}

.gem-alpha-panel {
  background: rgba(0, 2, 1, 0.78);
  border: 1px solid var(--gem-line);
  display: grid;
  gap: 30px;
  justify-items: center;
  margin: 0 auto;
  max-width: 720px;
  padding: 44px 36px;
  text-align: center;
}

.gem-alpha-panel p {
  color: #fff;
  font-size: 21px;
  line-height: 1.35;
  margin: 0;
}

.gem-alpha-panel h2 {
  font-size: 24px;
  margin: 0;
}

.gem-alpha-invite-form {
  display: grid;
  gap: 18px;
  text-align: left;
  width: min(100%, 520px);
}

.gem-alpha-invite-form input:not([type="checkbox"]) {
  width: 100%;
}

.gem-alpha-invite-form .gem-alpha-btn {
  cursor: pointer;
  justify-self: center;
}

.gem-alpha-terms {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  line-height: 1.4;
}

.gem-alpha-terms input {
  margin-top: 3px;
  min-height: 0;
}

.gem-alpha-panel .gem-alpha-form-error {
  color: #ff8b8b;
  font-size: 16px;
}

.gem-alpha-actions {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  width: 100%;
}

.gem-alpha-launcher-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  width: 100%;
}

.gem-alpha-btn {
  border: 1px solid #fff;
  color: #fff;
  display: inline-block;
  font-size: 14px;
  line-height: 1.428;
  max-width: 325px;
  min-width: 250px;
  padding: 12px 20px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 0.45s, border-color 0.45s;
}

.gem-alpha-btn:hover {
  text-decoration: none;
}

.gem-alpha-btn-red {
  background: var(--gem-red);
}

.gem-alpha-btn-red:hover {
  background: var(--gem-red-bright);
}

.gem-alpha-btn-transparent {
  background: var(--gem-panel);
  border-color: #2d3c46;
}

.gem-alpha-btn-transparent:hover {
  border-color: var(--gem-red);
}

.gem-alpha-closed {
  color: var(--gem-muted);
  text-transform: uppercase;
}

.gem-alpha-application-page {
  padding-bottom: 70px;
}

.gem-alpha-form-shell {
  background: rgba(0, 2, 1, 0.82);
  border: 1px solid var(--gem-line);
  margin: 0 auto;
  max-width: 920px;
  min-height: 1241px;
  overflow: hidden;
  width: 100%;
}

.gem-alpha-form-shell iframe {
  border: 0;
  display: block;
  height: 1241px;
  min-height: 1241px;
  width: 100%;
}

.gem-patch-content {
  max-width: 1180px;
}

.gem-patch-panel {
  gap: 34px;
  justify-items: stretch;
  max-width: 1040px;
  text-align: left;
}

.gem-patch-panel * {
  text-align: left;
}

.gem-patch-version {
  background: rgba(12, 22, 28, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 18px 20px;
}

.gem-patch-version h2,
.gem-patch-section > h2 {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  text-transform: uppercase;
}

.gem-patch-version p {
  color: #d8e6ef;
  font-size: 18px;
  line-height: 1.35;
  margin: 4px 0 0;
}

.gem-patch-section {
  display: grid;
  gap: 14px;
}

.gem-patch-list {
  display: grid;
  gap: 18px;
  list-style-position: outside;
  list-style-type: disc;
  margin: 0;
  padding: 0 0 0 24px;
}

.gem-patch-item {
  padding: 0;
}

.gem-patch-item h3 {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  text-transform: uppercase;
}

.gem-patch-item p {
  color: #d8e6ef;
  font-size: 18px;
  line-height: 1.35;
  margin: 2px 0 0;
  text-align: left;
}

.gem-patch-pagination {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  gap: 18px;
  padding-top: 28px;
}

.gem-patch-version-links,
.gem-patch-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.gem-patch-version-link {
  background: rgba(0, 2, 1, 0.68);
  border: 1px solid #2d3c46;
  color: #fff;
  display: inline-block;
  font-size: 14px;
  line-height: 1.428;
  min-width: 140px;
  padding: 10px 16px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.gem-patch-version-link:hover,
.gem-patch-version-link.is-active {
  border-color: var(--gem-red);
  text-decoration: none;
}

.gem-patch-version-link.is-active {
  background: var(--gem-red);
}

@media (max-width: 767px) {
  .gem-alpha-header {
    position: relative;
  }

  .gem-alpha-navbar {
    flex-wrap: wrap;
    width: 100%;
  }

  .gem-alpha-logo {
    margin: 10px auto;
  }

  .gem-alpha-nav-actions {
    border-top: 1px solid var(--gem-line);
    flex-basis: 100%;
    margin-left: 0;
  }

  .gem-alpha-nav-actions a {
    flex: 1;
    justify-content: center;
    min-height: 48px;
  }

  .gem-alpha-page {
    background-size: 900px;
    padding-top: 50px;
  }

  .gem-alpha-title {
    margin-bottom: 40px;
  }

  .gem-alpha-title h1 {
    font-size: 40px;
  }

  .gem-alpha-panel {
    padding: 32px 20px;
  }

  .gem-alpha-actions {
    width: 100%;
  }

  .gem-alpha-launcher-actions {
    flex-direction: column;
  }

  .gem-alpha-btn {
    max-width: none;
    width: 100%;
  }

  .gem-patch-panel {
    gap: 26px;
  }

  .gem-patch-page-actions,
  .gem-patch-version-links {
    align-items: stretch;
    flex-direction: column;
  }

  .gem-patch-version-link {
    width: 100%;
  }
}
