:root {
  color: #2d3436;
  background: #f5f7f9;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  --blue: #1f4e79;
  --blue-dark: #153a5c;
  --copper: #d97706;
  --slate: #4f5b66;
  --line: #d8dde2;
  --surface: #fff;
  --success: #547d63;
  --danger: #a33a32;
  --shadow: 0 12px 32px rgb(31 78 121 / 8%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  color: #fff;
  background: var(--blue);
  border-radius: 0.35rem;
}

.skip-link:focus {
  top: 1rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0.75rem max(1.25rem, calc((100vw - 1180px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

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

.brand svg {
  width: 44px;
  height: 44px;
}

.brand span {
  display: grid;
}

.brand strong {
  letter-spacing: 0.035em;
}

.brand small {
  color: var(--slate);
  font-weight: 600;
}

.environment {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.45rem 0.7rem;
  color: var(--slate);
  background: #eef2f5;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  background: var(--copper);
  border-radius: 50%;
}

main {
  width: min(1180px, calc(100% - 2.5rem));
  min-height: calc(100vh - 180px);
  margin: 0 auto;
  padding: 3.25rem 0 4rem;
}

.hero,
.section-heading,
.dialog-heading {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: space-between;
}

.hero {
  align-items: end;
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--copper);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0.45rem;
  color: var(--blue);
  font-size: clamp(2.15rem, 5vw, 3.7rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 0;
  color: var(--blue);
  font-size: 1.55rem;
}

.lede {
  margin-bottom: 0;
  color: var(--slate);
  font-size: 1.05rem;
}

.identity {
  display: grid;
  min-width: 250px;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 0.45rem;
  box-shadow: var(--shadow);
}

.identity-label {
  margin-bottom: 0.25rem;
  color: var(--slate);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.notice {
  margin-bottom: 1.25rem;
  padding: 0.9rem 1rem;
  color: var(--blue-dark);
  background: #e8f0f7;
  border: 1px solid #bdd0e2;
  border-radius: 0.45rem;
}

.notice[data-tone="error"] {
  color: #6f201c;
  background: #faecea;
  border-color: #e9b9b4;
}

.notice[data-tone="success"] {
  color: #31503c;
  background: #eaf2ed;
  border-color: #bfd2c5;
}

.auth-blocked,
.panel {
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
}

.auth-blocked {
  max-width: 660px;
  border-top: 4px solid var(--copper);
}

.tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: -1px;
}

.tab {
  padding: 0.8rem 1.15rem;
  color: var(--slate);
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  font-weight: 700;
}

.tab:hover,
.tab:focus-visible {
  color: var(--blue);
}

.tab.is-active {
  color: var(--blue);
  border-bottom-color: var(--copper);
}

.panel {
  border-top-left-radius: 0;
}

.section-heading {
  align-items: center;
  margin-bottom: 1.5rem;
}

.button {
  min-height: 42px;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  font-weight: 700;
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

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

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--blue-dark);
}

.button-secondary {
  color: var(--blue);
  background: #fff;
  border-color: #9eb4c8;
}

.button-danger {
  min-height: auto;
  padding: 0.4rem 0.65rem;
  color: var(--danger);
  background: #fff;
  border-color: #d9aaa6;
  font-size: 0.84rem;
}

.grant-form,
.filters {
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) minmax(180px, 1fr) minmax(210px, 1.2fr) auto;
  gap: 0.8rem;
  align-items: end;
  margin-bottom: 1.8rem;
  padding: 1.1rem;
  background: #f3f6f8;
  border-radius: 0.55rem;
}

.filters {
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--slate);
  font-size: 0.8rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.65rem;
  color: #2d3436;
  background: #fff;
  border: 1px solid #aeb8c1;
  border-radius: 0.35rem;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgb(217 119 6 / 32%);
  outline-offset: 2px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.85rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--slate);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  font-size: 0.9rem;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.8rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: capitalize;
}

.badge-active,
.badge-new {
  color: #31503c;
  background: #e2eee6;
}

.badge-revoked,
.badge-expired,
.badge-wont_fix {
  color: #6f201c;
  background: #f7e7e5;
}

.badge-future,
.badge-triaged,
.badge-confirmed,
.badge-fixed {
  color: var(--blue-dark);
  background: #e4edf5;
}

.feedback-list {
  display: grid;
  gap: 0.75rem;
}

.feedback-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 0.45rem;
}

.feedback-card h3 {
  margin: 0 0 0.45rem;
  color: var(--blue);
  font-size: 1rem;
}

.feedback-card p {
  margin-bottom: 0.55rem;
  color: #3e464d;
  line-height: 1.45;
}

.metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  color: var(--slate);
  font-size: 0.78rem;
}

.empty {
  margin: 1.5rem 0 0;
  padding: 1.5rem;
  color: var(--slate);
  background: #f3f6f8;
  border-radius: 0.45rem;
  text-align: center;
}

dialog {
  width: min(760px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 0.75rem;
  box-shadow: 0 24px 80px rgb(20 30 40 / 30%);
}

dialog::backdrop {
  background: rgb(21 34 47 / 58%);
}

.dialog-shell {
  padding: clamp(1.2rem, 4vw, 2rem);
}

.dialog-heading {
  margin-bottom: 1.25rem;
}

.icon-button {
  width: 40px;
  height: 40px;
  color: var(--slate);
  background: #eef2f5;
  border: 0;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.detail-grid div {
  padding: 0.75rem;
  background: #f3f6f8;
  border-radius: 0.4rem;
}

.detail-grid dt {
  margin-bottom: 0.25rem;
  color: var(--slate);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-note {
  margin-top: 1rem;
  padding: 1rem;
  white-space: pre-wrap;
  background: #f8f2e8;
  border-left: 4px solid var(--copper);
}

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  justify-content: space-between;
  padding: 1.4rem max(1.25rem, calc((100vw - 1180px) / 2));
  color: #dfe7ed;
  background: #263745;
  font-size: 0.78rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .grant-form,
  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .hero {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 580px) {
  main {
    width: min(100% - 1.5rem, 1180px);
    padding-top: 2rem;
  }

  .grant-form,
  .filters,
  .detail-grid {
    grid-template-columns: 1fr;
  }

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

  .feedback-card .button {
    justify-self: start;
  }

  .environment {
    font-size: 0;
  }

  .environment .status-dot {
    width: 0.7rem;
    height: 0.7rem;
  }
}
