:root {
  color-scheme: dark;
  --page: #061521;
  --page-deep: #04101a;
  --surface: #0d2332;
  --surface-raised: #112b3c;
  --surface-soft: #173548;
  --line: rgba(174, 211, 228, 0.14);
  --line-strong: rgba(174, 211, 228, 0.24);
  --text: #f3f8fb;
  --muted: #9db3c1;
  --brand: #41d7a7;
  --brand-strong: #24c390;
  --brand-soft: rgba(65, 215, 167, 0.12);
  --blue: #63aaf7;
  --redmine: #ff7777;
  --gitlab: #ff9c5a;
  --danger: #ff8a8a;
  --warning: #ffd37a;
  --radius: 1.15rem;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 20rem; background: var(--page-deep); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(49, 150, 155, 0.17), transparent 30rem),
    radial-gradient(circle at 92% 18%, rgba(40, 105, 174, 0.13), transparent 26rem),
    linear-gradient(180deg, var(--page) 0%, var(--page-deep) 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.28;
  background-image: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 3rem 3rem;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

button, input, select { font: inherit; }
button, input, select, a { -webkit-tap-highlight-color: transparent; }

button {
  min-height: 2.9rem;
  border: 0;
  border-radius: 0.8rem;
  cursor: pointer;
  font-weight: 750;
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:disabled { cursor: wait; opacity: 0.55; transform: none; }

input, select {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.78rem;
  background: rgba(4, 16, 26, 0.68);
  color: var(--text);
  padding: 0.78rem 0.9rem;
}

input::placeholder { color: #6f8999; }

input:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(65, 215, 167, 0.28);
  outline-offset: 2px;
  border-color: var(--brand);
}

select { color-scheme: dark; }

.shell {
  width: min(100% - 1.25rem, 72rem);
  margin-inline: auto;
  padding: max(0.75rem, env(safe-area-inset-top)) 0 max(3rem, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 4.5rem;
  margin-bottom: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border: 1px solid rgba(65, 215, 167, 0.45);
  border-radius: 0.78rem;
  background: linear-gradient(145deg, rgba(65, 215, 167, 0.24), rgba(65, 170, 247, 0.1));
  color: var(--brand);
  font-size: 1.05rem;
  font-weight: 900;
  box-shadow: 0 8px 28px rgba(34, 180, 137, 0.14);
}

.brand-name, .brand-product { display: block; }
.brand-name { font-size: 0.98rem; font-weight: 850; letter-spacing: 0.01em; }
.brand-product { margin-top: 0.05rem; color: var(--muted); font-size: 0.7rem; }
.topbar-actions { display: flex; align-items: center; gap: 0.55rem; }

.eyebrow {
  margin: 0 0 0.32rem;
  color: var(--brand);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  line-height: 1.3;
}

h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; letter-spacing: -0.035em; }
h1 { font-size: clamp(2rem, 9vw, 4.35rem); line-height: 1.02; }
h2 { font-size: clamp(1.35rem, 5vw, 1.85rem); }
h3 { font-size: 1.4rem; }

.card, .tool-card, .system-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(17, 43, 60, 0.96), rgba(10, 31, 44, 0.96));
  box-shadow: var(--shadow);
}

.login-layout {
  display: grid;
  align-items: center;
  gap: 2rem;
  min-height: calc(100vh - 9rem);
  padding-bottom: 8vh;
}

.login-intro h1 span { color: var(--brand); }
.login-intro > p:not(.eyebrow) {
  max-width: 35rem;
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 3vw, 1.12rem);
  line-height: 1.65;
}

.trust-list { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1.35rem; }
.trust-list span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(17, 43, 60, 0.55);
  color: #b9cbd5;
  padding: 0.5rem 0.7rem;
  font-size: 0.73rem;
  font-weight: 650;
}

.trust-list span::before { content: "✓"; color: var(--brand); font-weight: 900; }
.login-card { padding: 1.25rem; }
.card-heading, .tool-card-header, .system-card, .system-status, .agent-heading, .section-heading, .account-chip, .polling-option, .input-action {
  display: flex;
  align-items: center;
}

.card-heading, .tool-card-header { gap: 0.8rem; }
.supporting-copy, .heading-copy p, .tool-description { color: var(--muted); line-height: 1.55; }
.supporting-copy { margin: 1rem 0 0; font-size: 0.88rem; }
.feature-icon {
  display: grid;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 0.82rem;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 900;
}

.lock-icon { font-size: 0.85rem; letter-spacing: 0.15em; }
.stack-form { display: grid; gap: 0.55rem; margin-top: 1.25rem; }
.stack-form label, .lookup-form label { color: #c5d5de; font-size: 0.78rem; font-weight: 750; }
.stack-form input { margin-bottom: 0.35rem; }
.primary-button, .compact-button {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #032419;
  box-shadow: 0 9px 24px rgba(36, 195, 144, 0.18);
}

.primary-button:hover, .compact-button:hover { background: linear-gradient(135deg, #59e1b4, #2bcd99); }
.secondary-button, .icon-button, .text-button {
  border: 1px solid var(--line-strong);
  background: rgba(157, 190, 208, 0.08);
  color: var(--text);
}

.secondary-button:hover, .icon-button:hover { background: rgba(157, 190, 208, 0.15); }
.login-form button { width: 100%; margin-top: 0.45rem; }
.error { min-height: 1.2rem; margin: 0.8rem 0 0; color: var(--danger); font-size: 0.82rem; line-height: 1.45; }

.app-panel { display: grid; min-width: 0; gap: 1rem; }
.app-panel > *, .feature-grid > *, .result-card > *, .result-section, .redmine-textile {
  min-width: 0;
  max-width: 100%;
}
.account-chip {
  flex: 0 0 auto;
  gap: 0.65rem;
  max-width: 18rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgba(13, 35, 50, 0.7);
  padding: 0.65rem 0.8rem;
}
.topbar-account { max-width: 10rem; padding: 0.45rem 0.65rem; }

.notification-center { position: relative; flex: 0 0 auto; }
.notification-button {
  position: relative;
  display: grid;
  width: 2.65rem;
  min-height: 2.65rem;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: rgba(157, 190, 208, 0.08);
  color: var(--muted);
}
.notification-button svg {
  width: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.notification-button.has-unread {
  border-color: rgba(255, 119, 119, 0.5);
  background: rgba(255, 119, 119, 0.12);
  color: var(--redmine);
}
.notification-count {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  display: grid;
  min-width: 1.25rem;
  height: 1.25rem;
  place-items: center;
  border: 2px solid var(--page);
  border-radius: 999px;
  background: var(--redmine);
  color: #230607;
  padding-inline: 0.2rem;
  font-size: 0.62rem;
  font-weight: 900;
}
.notification-panel {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  z-index: 30;
  width: min(22rem, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 1rem;
  background: #0b2231;
  box-shadow: var(--shadow);
}
.notification-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 0.9rem;
}
.notification-panel-heading > span { display: grid; gap: 0.1rem; }
.notification-panel-heading small { color: var(--muted); font-size: 0.7rem; }
.notification-panel-heading button {
  min-height: 2rem;
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0.25rem;
  font-size: 0.7rem;
}
.notification-panel-heading button:disabled { color: var(--muted); }
.notification-list { max-height: min(28rem, 70vh); overflow-y: auto; padding: 0.35rem; }
.notification-list-item {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 0;
  gap: 0.2rem;
  border-radius: 0.72rem;
  background: transparent;
  color: var(--text);
  padding: 0.72rem 0.75rem 0.72rem 1rem;
  text-align: left;
}
.notification-list-item:hover { background: rgba(157, 190, 208, 0.09); }
.notification-list-item.unread { background: rgba(255, 119, 119, 0.07); }
.notification-list-item.unread::before {
  position: absolute;
  top: 1rem;
  left: 0.35rem;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--redmine);
  content: "";
}
.notification-list-item strong { font-size: 0.82rem; }
.notification-list-item span, .notification-list-item small {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.account-chip > span:last-child { min-width: 0; }
.account-chip strong { display: block; overflow: hidden; font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.account-label { display: block; margin-bottom: 0.12rem; color: var(--muted); font-size: 0.65rem; }
.avatar { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0.28rem var(--brand-soft); }

.service-tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: rgba(4, 16, 26, 0.94);
  padding: 0.35rem;
  backdrop-filter: blur(14px);
}
.service-tab, .subview-tab, .back-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}
.service-tab { min-width: 0; min-height: 2.6rem; padding: 0.55rem 0.4rem; font-size: 0.78rem; }
.service-tab.active, .subview-tab.active {
  border-color: var(--line-strong);
  background: var(--brand-soft);
  color: var(--brand);
}
.subview-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin-top: 0.8rem; }
.subview-tab { min-height: 2.55rem; padding: 0.55rem; font-size: 0.76rem; }
.back-button {
  min-height: 2.3rem;
  margin-bottom: 0.7rem;
  padding: 0.4rem 0.65rem;
  color: var(--brand);
  font-size: 0.76rem;
}
.back-button:hover { background: var(--brand-soft); }
.workspace-card { padding: 1rem; }
.workspace-copy { margin: 0.65rem 0 0; line-height: 1.55; }

.system-card { justify-content: space-between; gap: 1rem; padding: 0.85rem 1rem; }
.system-status { gap: 0.75rem; min-width: 0; }
.system-status > div { min-width: 0; }
.system-status strong { display: block; margin-top: 0.12rem; font-size: 0.86rem; }
.pulse-mark { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0.3rem var(--brand-soft); }
.label { color: var(--muted); font-size: 0.68rem; }
.refresh-button { flex: 0 0 auto; min-height: 2.45rem; padding: 0.55rem 0.8rem; font-size: 0.76rem; }

.agent-card { padding: 1rem; }
.agent-heading { align-items: flex-start; }
.heading-copy { min-width: 0; flex: 1; }
.heading-copy h2 { font-size: 1.25rem; }
.heading-copy p:not(.eyebrow) { margin: 0.3rem 0 0; font-size: 0.8rem; }
.agent-heading > button { flex: 0 0 auto; min-height: 2.5rem; padding: 0.55rem 0.75rem; font-size: 0.75rem; }
.agent-icon { background: rgba(99, 170, 247, 0.12); color: var(--blue); }
.polling-option {
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  cursor: pointer;
}

.polling-option strong, .polling-option small { display: block; }
.polling-option strong { font-size: 0.85rem; }
.polling-option small { margin-top: 0.25rem; color: var(--muted); font-size: 0.72rem; line-height: 1.4; }
.switch { position: relative; flex: 0 0 auto; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { display: block; width: 2.8rem; height: 1.55rem; border-radius: 999px; background: #405563; transition: background 180ms ease; }
.switch-track::after { display: block; width: 1.15rem; height: 1.15rem; margin: 0.2rem; border-radius: 50%; background: white; content: ""; transition: transform 180ms ease; }
.switch input:checked + .switch-track { background: var(--brand-strong); }
.switch input:checked + .switch-track::after { transform: translateX(1.25rem); }
.switch input:focus-visible + .switch-track { outline: 3px solid rgba(65, 215, 167, 0.28); outline-offset: 2px; }

.tools-section { margin-top: 0; }
.section-title { margin-bottom: 0.9rem; }
.section-title h2 { font-size: 1.55rem; }
.feature-grid { display: grid; gap: 0.85rem; }
.tool-card { position: relative; overflow: hidden; padding: 1rem; }
.tool-card::before { position: absolute; inset: 0 0 auto; height: 2px; content: ""; }
.redmine-card::before { background: linear-gradient(90deg, var(--redmine), transparent); }
.gitlab-card::before { background: linear-gradient(90deg, var(--gitlab), transparent); }
.eyebrow.redmine { color: var(--redmine); }
.eyebrow.gitlab { color: var(--gitlab); }
.redmine-icon { background: rgba(255, 119, 119, 0.12); color: var(--redmine); }
.gitlab-icon { background: rgba(255, 156, 90, 0.12); color: var(--gitlab); }
.tool-description { margin: 0.6rem 0 0.8rem; font-size: 0.82rem; }
.button-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.button-grid button { min-width: 0; padding: 0.65rem; font-size: 0.78rem; }
.lookup-form { display: grid; gap: 0.5rem; margin-top: 1rem; }
.assigned-filters { display: grid; gap: 0.75rem; margin: 1rem 0; }
#redmineSnapshotPanel .section-heading > .badge { flex-shrink: 0; }
.assigned-filters label { display: grid; gap: 0.4rem; min-width: 0; color: #c5d5de; font-size: 0.78rem; font-weight: 750; }
.assigned-filters input, .assigned-filters select { width: 100%; min-width: 0; }
.assigned-filters p { margin: 0; }
@media (min-width: 42rem) {
  .assigned-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .assigned-filters p { align-self: center; }
}
.input-action { position: relative; gap: 0.5rem; }
.input-prefix { position: absolute; left: 0.9rem; z-index: 1; color: var(--muted); font-weight: 850; }
.input-action input { min-width: 0; padding-left: 1.75rem; }
.compact-button { flex: 0 0 auto; min-height: 3rem; padding: 0.7rem 0.9rem; }
.gitlab-form { margin-top: 0; }
.full-button { width: 100%; margin-top: 0.7rem; }

.result-card, .history-card { margin-top: 0.5rem; padding: 1rem; }
.section-heading { justify-content: space-between; gap: 1rem; }
.section-heading > * { min-width: 0; }
.text-button { min-height: 2.35rem; padding: 0.45rem 0.7rem; color: var(--brand); font-size: 0.75rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  border-radius: 999px;
  padding: 0.38rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: currentColor; }
.badge.neutral { background: rgba(157, 179, 193, 0.12); color: #a9bac4; }
.badge.good { background: var(--brand-soft); color: var(--brand); }
.badge.waiting { background: rgba(255, 211, 122, 0.12); color: var(--warning); }
.badge.bad { background: rgba(255, 138, 138, 0.12); color: var(--danger); }
.request-list { display: grid; gap: 0.55rem; margin-top: 0.9rem; }
.empty-state, .muted { color: var(--muted); }
.empty-state { margin: 0; border: 1px dashed var(--line-strong); border-radius: 0.8rem; padding: 1rem; text-align: center; font-size: 0.8rem; }
.courier-entry, .courier-event { border-top: 1px solid var(--line-strong); padding: 0.8rem 0; overflow-wrap: anywhere; }
.courier-entry p { margin: 0.3rem 0; color: var(--muted); }
.courier-page { display: grid; gap: 1rem; }
.courier-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; padding: 1.75rem 1.9rem; border: 1px solid var(--line); border-radius: 1.25rem; background: linear-gradient(115deg, #123a48, #0c2538 65%, #102b35); }
.courier-hero h1 { margin: 0.15rem 0 0.4rem; font-size: clamp(2rem, 4vw, 2.85rem); line-height: 1.05; }
.courier-hero p:last-child { max-width: 38rem; margin: 0; color: var(--muted); }
.courier-hero-actions { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.courier-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7rem; }
.courier-stats > div { display: grid; gap: 0.4rem; min-height: 5.3rem; padding: 0.9rem 1.1rem; border: 1px solid var(--line); border-radius: 0.9rem; background: rgba(17, 43, 60, 0.75); }
.courier-stats span { color: var(--muted); font-size: 0.78rem; }
.courier-stats strong { font-size: 1.5rem; line-height: 1; font-variant-numeric: tabular-nums; }
.nightly-mirrors { padding: 1.25rem; }
.nightly-mirrors-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-top: 1rem; }
.nightly-mirror-item { min-width: 0; padding: .9rem; border: 1px solid var(--line); border-radius: .8rem; background: rgba(4,16,26,.45); }
.nightly-mirror-item p, .nightly-mirror-item small { color: var(--muted); overflow-wrap: anywhere; }
.nightly-mirror-item p { min-height: 2.4em; margin: .6rem 0; }
.nightly-mirror-last { display: block; color: var(--brand) !important; margin-bottom: .3rem; }
.nightly-mirror-branch { display: block; margin-top: .4rem; }
.nightly-mirror-commit { display: block; margin-top: .35rem; }
.nightly-mirror-commit a { color: var(--brand); }
.nightly-branch-editor { margin-top: .7rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.nightly-branch-editor summary { cursor: pointer; color: var(--brand); font-weight: 700; }
.nightly-branch-form { display: grid; gap: .65rem; margin-top: .8rem; }
.nightly-branch-form label { display: grid; gap: .25rem; font-size: .85rem; font-weight: 700; }
.nightly-branch-form input { width: 100%; min-width: 0; }
.nightly-branch-form button { justify-self: start; }
@media (max-width: 950px) { .nightly-mirrors-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .nightly-mirrors-grid { grid-template-columns: 1fr; } }
.courier-layout { display: grid; grid-template-columns: minmax(15rem, 0.85fr) minmax(0, 1.7fr); align-items: start; gap: 1rem; }
.courier-list-panel, .courier-detail-panel { min-height: 12rem; padding: 1.25rem; }
.courier-panel-heading, .courier-detail-heading, .courier-turn-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.7rem; }
.courier-panel-heading h2, .courier-detail-heading h2 { margin: 0.2rem 0 0.7rem; font-size: 1.35rem; }
.courier-stream-list { display: grid; gap: 0.55rem; }
.courier-stream { display: grid; gap: 0.2rem; width: 100%; min-height: 4.2rem; padding: 0.8rem 0.9rem; border: 1px solid var(--line); background: rgba(4,16,26,.45); color: var(--text); text-align: left; }
.courier-stream.selected { border-color: var(--brand); background: rgba(65,215,167,.11); }
.courier-stream small, .courier-subtitle, .courier-turn small { color: var(--muted); overflow-wrap: anywhere; }
.courier-detail-heading h2 { margin-bottom: 0.15rem; }
.courier-detail-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.courier-detail-actions .secondary-button { min-height: 2.2rem; padding: .45rem .7rem; font-size: .76rem; }
.courier-memory { margin: 1.2rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 1rem; }
.courier-memory a { color: var(--brand); }
.courier-memory-editor { margin-top: .8rem; }
.courier-memory-field { display: block; margin: .8rem 0; font-size: .85rem; }
.courier-memory-field textarea { display: block; width: 100%; margin-top: .4rem; resize: vertical; font: inherit; }
.courier-continuation { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.courier-continuation .secondary-button { display: inline-block; margin: .4rem .5rem .4rem 0; }
.courier-now, .courier-registration { margin: 1rem 0; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: .8rem; background: rgba(4,16,26,.42); line-height: 1.5; }
.courier-registration { border-color: rgba(255,211,122,.4); }
.courier-archive-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.courier-archive-row span { overflow-wrap: anywhere; }
.courier-archives { margin-top: .2rem; }
.courier-subtitle { margin: 0; font-size: 0.8rem; }
.courier-state { padding: .4rem .65rem; border-radius: 99px; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.courier-state.active { background: rgba(65,215,167,.15); color: var(--brand); }
.courier-state.paused { background: rgba(255,211,122,.16); color: var(--warning); }
.courier-linked { display: grid; gap: .4rem; margin: 1.15rem 0; padding: .85rem; border: 1px solid var(--line); border-radius: .8rem; background: rgba(4,16,26,.35); font-size: .85rem; overflow-wrap: anywhere; }
.courier-linked a { color: var(--brand); }
.courier-linked span { color: var(--muted); }
.courier-heartbeat { margin: 0 0 1.15rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .8rem; background: rgba(8, 35, 45, .55); }
.courier-heartbeat p { margin: .45rem 0 0; }
.courier-heartbeat small { display: block; margin-top: .35rem; color: var(--muted); overflow-wrap: anywhere; }
.courier-controls { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.courier-monitor, .courier-check { display: flex; gap: .55rem; align-items: center; font-size: .86rem; line-height: 1.4; }
.courier-monitor input, .courier-check input { width: 1.1rem; min-height: 1.1rem; flex: none; accent-color: var(--brand); }
.courier-help { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.courier-progress { margin-top: 1.3rem; padding: 1.1rem 1.2rem; border: 1px solid rgba(65,215,167,.35); border-radius: .95rem; background: linear-gradient(135deg, rgba(65,215,167,.11), rgba(12,37,56,.42)); }
.courier-progress-top { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.courier-progress-top .eyebrow { margin: 0; }
.courier-progress h3 { margin: .55rem 0 .2rem; font-size: 1.15rem; }
.courier-progress-live, .courier-progress-alert { padding: .28rem .58rem; border-radius: 99px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.courier-progress-live { color: var(--brand); background: rgba(65,215,167,.16); }
.courier-progress-alert { color: var(--warning); background: rgba(255,211,122,.16); }
.courier-progress-time { margin: .25rem 0 1rem; color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; }
.courier-progress-stages { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: .3rem; padding: 0; margin: 0; list-style: none; }
.courier-progress-stages li { min-width: 0; padding: .45rem .3rem; border-top: 3px solid var(--line-strong); color: var(--muted); text-align: center; font-size: .72rem; font-weight: 750; }
.courier-progress-stages li.done { border-color: var(--brand); color: var(--brand); }
.courier-progress-stages li.current { border-color: var(--warning); color: var(--text); }
.courier-progress-indeterminate { height: .28rem; margin-top: .85rem; overflow: hidden; border-radius: 99px; background: rgba(65,215,167,.13); }
.courier-progress-indeterminate::after { display: block; width: 35%; height: 100%; border-radius: inherit; background: var(--brand); content: ""; animation: courier-progress-sweep 1.8s ease-in-out infinite alternate; }
.courier-progress-note { margin: .75rem 0 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
@keyframes courier-progress-sweep { from { transform: translateX(0); } to { transform: translateX(190%); } }
.courier-turns-heading { margin: 1.6rem 0 .8rem; font-size: 1rem; }
.courier-turn { margin-top: .65rem; padding: 1rem; border: 1px solid var(--line); border-radius: .85rem; background: rgba(4,16,26,.42); overflow-wrap: anywhere; }
.courier-turn-top span { color: var(--muted); font-size: .77rem; text-align: right; }
.courier-summary { display: grid; gap: .2rem; margin-top: .85rem; }
.courier-summary strong { color: var(--brand); font-size: .78rem; }
.courier-summary p { margin: 0 0 .65rem; line-height: 1.5; white-space: pre-wrap; }
.courier-turn-meta { margin: .25rem 0 0; padding-top: .55rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.courier-alert { color: var(--warning); }
.courier-empty { padding: 2rem 1rem; color: var(--muted); text-align: center; line-height: 1.5; }
.courier-link-form { display: grid; gap: .5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.courier-link-form h3 { margin: .2rem 0; }
.courier-link-form label { margin-top: .4rem; font-size: .84rem; font-weight: 700; }
.courier-link-form small { color: var(--muted); font-weight: 400; }
.courier-link-form #courierFolderFields { display: grid; gap: .5rem; }
.courier-link-form #courierFolderFields[hidden] { display: none; }
.courier-advanced { margin-top: .5rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: .7rem; }
.courier-advanced summary { cursor: pointer; font-weight: 700; }
.courier-advanced label { display: block; margin: .65rem 0 .3rem; }
.courier-advanced input, .courier-advanced select { width: 100%; }
.courier-more-turns { margin-top: .9rem; }
.courier-form-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.courier-diagnostics { padding: 1rem 1.2rem; }
.courier-diagnostics summary { cursor: pointer; font-weight: 750; }
.courier-diagnostics ol { margin: .8rem 0 0; padding-left: 1.4rem; color: var(--muted, #a8b5ca); }
.courier-diagnostics li + li { margin-top: .55rem; }
.courier-health-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; margin-top: 1rem; }
.courier-health-grid > div { min-width: 0; padding: .8rem; border: 1px solid var(--line); border-radius: .7rem; }
.courier-health-grid p, .courier-events { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
@media (max-width: 760px) { .courier-hero { align-items: flex-start; flex-direction: column; padding: 1.25rem; } .courier-stats { grid-template-columns: repeat(2,minmax(0,1fr)); } .courier-layout, .courier-health-grid { grid-template-columns: 1fr; } .courier-panel-heading { flex-wrap: wrap; } .courier-progress-stages li { font-size: .65rem; } }
.request-item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--line);
  background: rgba(4, 16, 26, 0.42);
  color: var(--text);
  padding: 0.75rem;
  text-align: left;
}

.request-item:hover { background: rgba(157, 190, 208, 0.1); }
.request-item small { display: block; margin-top: 0.18rem; color: var(--muted); }
.result-section { margin-top: 1rem; }
.result-section h3 { margin: 1.2rem 0 0.55rem; font-size: 1rem; letter-spacing: -0.015em; }
.ticket-list { display: grid; gap: 0.55rem; }
.ticket, .description, .note-body, .attachment {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(4, 16, 26, 0.44);
  padding: 0.8rem;
}

.ticket strong { display: block; }
.snapshot-body { margin-top: 1rem; }
.ticket-button {
  width: 100%;
  color: var(--text);
  text-align: left;
}
.ticket-button:hover { border-color: var(--brand); background: rgba(65, 215, 167, 0.08); }
.ticket-meta { margin-top: 0.3rem; color: var(--muted); font-size: 0.75rem; }
.description, .note-body { overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.55; }
.redmine-textile {
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.redmine-textile > :first-child { margin-top: 0; }
.redmine-textile > :last-child { margin-bottom: 0; }
.redmine-textile p { margin: 0 0 0.85rem; }
.redmine-textile a { color: var(--brand); text-decoration: underline; text-underline-offset: 0.16rem; }
.redmine-textile blockquote {
  margin: 0.85rem 0;
  border-left: 0.22rem solid var(--brand);
  background: rgba(65, 215, 167, 0.06);
  padding: 0.65rem 0.8rem;
}
.redmine-textile pre {
  width: 100%;
  max-width: 100%;
  max-height: none;
  margin: 0.85rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #020a10;
  padding: 0.8rem;
  white-space: pre;
}
.redmine-textile code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.redmine-textile :not(pre) > code {
  border-radius: 0.3rem;
  background: rgba(157, 190, 208, 0.12);
  padding: 0.08rem 0.3rem;
}
.redmine-textile ul, .redmine-textile ol { margin: 0.7rem 0; padding-left: 1.4rem; }
.redmine-inline-image { margin: 0.85rem 0; }
.redmine-inline-image img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 40rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #071721;
  object-fit: contain;
}
.redmine-missing-image { color: var(--muted); font-style: italic; }
.redmine-table-wrap { width: 100%; max-width: 100%; margin: 0.85rem 0; overflow-x: auto; }
.redmine-textile table { width: 100%; border-collapse: collapse; }
.redmine-textile td { border: 1px solid var(--line); padding: 0.5rem; vertical-align: top; }
.redmine-list-depth-2 { margin-left: 1rem; }
.redmine-list-depth-3, .redmine-list-depth-4, .redmine-list-depth-5, .redmine-list-depth-6 { margin-left: 2rem; }
.gitlab-markdown { overflow-wrap: anywhere; line-height: 1.6; }
.gitlab-markdown > :first-child { margin-top: 0; }
.gitlab-markdown > :last-child { margin-bottom: 0; }
.gitlab-markdown h1, .gitlab-markdown h2, .gitlab-markdown h3,
.gitlab-markdown h4, .gitlab-markdown h5, .gitlab-markdown h6 { margin: 1.2rem 0 0.55rem; }
.gitlab-markdown p { margin: 0 0 0.85rem; white-space: pre-wrap; }
.gitlab-markdown ul, .gitlab-markdown ol { margin: 0.7rem 0; padding-left: 1.4rem; }
.gitlab-markdown a { color: var(--brand); text-decoration: underline; text-underline-offset: 0.16rem; }
.gitlab-markdown code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.gitlab-markdown :not(pre) > code { border-radius: 0.3rem; background: rgba(157, 190, 208, 0.12); padding: 0.08rem 0.3rem; }
.gitlab-markdown blockquote { margin: 0.85rem 0; border-left: 0.22rem solid var(--brand); padding: 0.65rem 0.8rem; background: rgba(65, 215, 167, 0.06); }
.gitlab-markdown hr { margin: 1.2rem 0; border: 0; border-top: 1px solid var(--line); }
.gitlab-markdown-table-wrap { width: 100%; max-width: 100%; margin: 0.85rem 0; overflow-x: auto; }
.gitlab-markdown table { width: 100%; border-collapse: collapse; }
.gitlab-markdown th, .gitlab-markdown td { border: 1px solid var(--line); padding: 0.5rem 0.65rem; text-align: left; vertical-align: top; }
.gitlab-markdown th { background: rgba(157, 190, 208, 0.08); }
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.65rem; }
.attachment { overflow: hidden; }
.attachment img { display: block; width: 100%; max-height: 24rem; border-radius: 0.55rem; background: #071721; object-fit: contain; }
.attachment a { color: var(--brand); overflow-wrap: anywhere; }
.pipeline { display: flex; justify-content: space-between; gap: 0.6rem; border-bottom: 1px solid var(--line); padding: 0.6rem 0; }
details { border-top: 1px solid var(--line); padding: 0.7rem 0; }
summary { cursor: pointer; font-weight: 700; }
pre { max-height: 34rem; overflow: auto; border: 1px solid var(--line); border-radius: 0.8rem; background: #020a10; color: #dce9ef; padding: 0.85rem; white-space: pre-wrap; overflow-wrap: anywhere; }

.toast {
  position: fixed;
  inset: auto 0.75rem max(0.75rem, env(safe-area-inset-bottom));
  z-index: 20;
  max-width: 28rem;
  margin-inline: auto;
  border: 1px solid rgba(65, 215, 167, 0.32);
  border-radius: 0.85rem;
  background: #102f3c;
  color: var(--text);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
  font-size: 0.82rem;
}

.code-review-notification {
  position: fixed;
  right: max(0.75rem, env(safe-area-inset-right));
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  z-index: 21;
  display: grid;
  width: min(calc(100% - 1.5rem), 24rem);
  max-width: calc(100vw - 1.5rem);
  min-height: 0;
  gap: 0.25rem;
  border: 1px solid rgba(65, 215, 167, 0.4);
  border-radius: 1rem;
  background: linear-gradient(145deg, #123748, #0b2937);
  color: var(--text);
  padding: 1rem;
  box-shadow: var(--shadow);
  text-align: left;
}
.code-review-notification:hover { border-color: var(--brand); background: #143d4e; }
.notification-kicker { color: var(--brand); font-size: 0.65rem; font-weight: 900; letter-spacing: 0.14em; }
.code-review-notification strong { font-size: 0.95rem; }
.code-review-notification strong, .code-review-notification > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.code-review-notification > span:last-child { color: var(--muted); font-size: 0.74rem; line-height: 1.4; }

.hidden, .service-hidden, [hidden] { display: none !important; }

@media (min-width: 42rem) {
  .shell { width: min(100% - 2.5rem, 72rem); padding-top: max(1rem, env(safe-area-inset-top)); }
  .login-layout { grid-template-columns: minmax(0, 1.15fr) minmax(20rem, 0.85fr); gap: clamp(2rem, 7vw, 6rem); }
  .login-card { padding: 1.6rem; }
  .feature-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .agent-card, .tool-card, .result-card, .history-card { padding: 1.25rem; }
}

@media (max-width: 36rem) {
  .service-tabs { display: flex; overflow-x: auto; scrollbar-width: thin; }
  .service-tab { flex: 0 0 5.5rem; }
  .notification-panel { position: fixed; top: 4.25rem; right: 0.75rem; left: 0.75rem; width: auto; max-width: none; }
  .topbar { min-height: 4rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
  .topbar-actions { width: 100%; justify-content: flex-end; gap: 0.35rem; }
  .icon-button { min-height: 2.35rem; padding: 0.45rem 0.6rem; font-size: 0.7rem; }
  .badge { padding-inline: 0.5rem; }
  .topbar-account { max-width: 7rem; }
  .topbar-account .account-label { display: none; }
  .system-card { align-items: stretch; flex-direction: column; }
  .refresh-button { width: 100%; }
  .agent-heading { flex-wrap: wrap; }
  .agent-heading .heading-copy { width: calc(100% - 3.7rem); }
  .agent-heading > button { width: 100%; margin-top: 0.25rem; }
  .button-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .courier-progress-indeterminate::after { animation: none; width: 100%; }
}

.assigned-filters .mention-filter { display: flex; align-items: center; gap: 0.5rem; min-height: 2.5rem; }
.assigned-filters .mention-filter input { width: auto; }
.courier-waiting { padding: 1rem; border: 1px solid var(--border, #294452); border-radius: 1rem; margin: 1rem 0; }
.courier-waiting h3 { margin-top: 0; }
.courier-waiting small { display: block; margin-top: .5rem; overflow-wrap: anywhere; }
.courier-waiting-fault, .courier-waiting-uncertain { border-color: #f5c763; }
.courier-waiting-stale { border-style: dashed; }
.courier-timeline { margin: 1rem 0; padding: 1rem; border: 1px solid var(--border, #294452); border-radius: 1rem; overflow-wrap: anywhere; }
.courier-timeline summary { cursor: pointer; font-weight: 700; }
.courier-timeline p, .courier-timeline li { font-size: .9rem; }
.courier-timeline li { margin: .6rem 0; }
.courier-timeline time { color: var(--muted); }
.courier-deployment-details summary { cursor: pointer; font-weight: 700; }
.courier-deployments-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
.courier-deployment-row { border: 1px solid var(--border, #294452); border-radius: .8rem; padding: 1rem; overflow-wrap: anywhere; }
.courier-deployment-row small { display: block; margin-top: .5rem; }
