* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #1f1a16;
  background:
    radial-gradient(circle at top left, rgba(196, 110, 47, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(12, 121, 103, 0.22), transparent 34%),
    linear-gradient(180deg, #f6f1e7 0%, #efe4d2 52%, #f8f2e8 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  font-family: 'Aptos', 'Segoe UI', sans-serif;
}

a {
  color: #084d42;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.hero,
.summary-grid,
.actions,
.grid,
.button-row,
.scope-grid {
  display: grid;
  gap: 1rem;
}

.hero {
  grid-template-columns: 1.1fr 0.9fr;
  align-items: start;
  margin-bottom: 1rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.resource-links,
.checklist,
.usage-grid {
  display: grid;
  gap: 0.85rem;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.actions {
  grid-template-columns: repeat(3, max-content);
  margin-bottom: 1rem;
}

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

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

.panel,
.auth-card,
.summary-card {
  background: rgba(255, 250, 242, 0.84);
  border: 1px solid rgba(63, 45, 29, 0.12);
  border-radius: 1.5rem;
  padding: 1.2rem 1.25rem;
  box-shadow: 0 16px 44px rgba(34, 26, 20, 0.1);
  backdrop-filter: blur(10px);
}

.auth-card,
.panel {
  display: grid;
  gap: 1rem;
}

.auth-header {
  margin-bottom: 0;
}

.auth-card {
  width: 100%;
  max-width: 34rem;
  justify-self: end;
}

.eyebrow,
.hint,
.panel-copy,
.summary-detail,
pre {
  color: #5d5146;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #084d42;
}

.dashboard-brand-link {
  color: inherit;
  text-decoration: none;
}

.dashboard-brand-link:hover {
  text-decoration: underline;
}

h1,
h2 {
  margin: 0 0 0.85rem;
  font-family: 'Iowan Old Style', Georgia, serif;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  max-width: 12ch;
}

h2 {
  margin-bottom: 0.2rem;
}

.lede,
.panel-copy {
  margin: 0;
  line-height: 1.65;
}

.summary-card {
  display: grid;
  gap: 0.4rem;
}

.summary-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #084d42;
}

.summary-card strong {
  font-family: 'Iowan Old Style', Georgia, serif;
  font-size: 2rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field + .field {
  margin-top: 0.2rem;
}

.scope-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.scope-fieldset legend {
  margin-bottom: 0.45rem;
  padding: 0;
  font-weight: 700;
}

input,
select {
  width: 100%;
  max-width: 100%;
  min-height: 3rem;
  padding: 0 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(18, 33, 30, 0.16);
  background: rgba(255, 255, 255, 0.75);
  color: #1f1a16;
  font: inherit;
}

.scope-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0.15rem;
}

.scope-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3rem;
  margin: 0;
  padding: 0 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(18, 33, 30, 0.12);
  background: rgba(255, 248, 236, 0.92);
  cursor: pointer;
}

.scope-option input {
  width: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
}

.button-row {
  grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
  align-items: center;
  margin-top: 0.2rem;
}

.operator-access {
  display: grid;
  gap: 0.25rem;
  padding: 0.8rem 1rem 0.95rem;
  border: 1px solid rgba(63, 45, 29, 0.12);
  border-radius: 1rem;
  background: rgba(255, 248, 236, 0.8);
}

.operator-access summary {
  cursor: pointer;
  font-weight: 700;
  color: #084d42;
  list-style-position: outside;
}

.operator-access[open] summary {
  margin-bottom: 0;
}

.operator-access-body {
  display: grid;
  gap: 0.8rem;
  padding-top: 0.2rem;
}

.operator-access .field + .field {
  margin-top: 0;
}

.operator-access .button-row {
  margin-top: 0;
}

.checklist-item,
.resource-card,
.usage-card,
.sensitive-block {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(63, 45, 29, 0.12);
  border-radius: 1rem;
  background: rgba(255, 248, 236, 0.92);
}

.checklist-item {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.85rem;
}

.checklist-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.8rem;
  min-height: 1.9rem;
  padding: 0 0.75rem;
  border-radius: 999px;
  background: rgba(12, 121, 103, 0.1);
  color: #084d42;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.checklist-item.is-pending .checklist-badge {
  background: rgba(196, 110, 47, 0.12);
  color: #8a5424;
}

.checklist-copy {
  display: grid;
  gap: 0.25rem;
}

.checklist-copy span,
.resource-card span,
.usage-card span,
.sensitive-block span {
  color: #5d5146;
  line-height: 1.55;
}

.resource-card {
  color: inherit;
}

.resource-card:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

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

.usage-card strong,
.sensitive-block strong {
  font-family: 'Iowan Old Style', Georgia, serif;
  font-size: 1.2rem;
}

.usage-meter {
  width: 100%;
  height: 0.8rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(18, 33, 30, 0.08);
}

.usage-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, #0c7967 0%, #084d42 100%);
}

.sensitive-panel {
  display: grid;
  gap: 0.85rem;
}

button {
  min-height: 2.9rem;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #0c7967 0%, #084d42 100%);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button.secondary {
  background: rgba(12, 121, 103, 0.08);
  border-color: rgba(12, 121, 103, 0.18);
  color: #1f1a16;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.key-list {
  display: grid;
  gap: 0.85rem;
}

.watch-list,
.watch-detail,
.watch-destination-list,
.watch-run-list,
.watch-event-list,
.watch-delivery-list {
  display: grid;
  gap: 0.85rem;
}

.watch-card,
.watch-section,
.watch-detail-header,
.watch-destination-item,
.watch-run-item,
.watch-event-item,
.watch-delivery-item {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(63, 45, 29, 0.12);
  border-radius: 1rem;
  background: rgba(255, 248, 236, 0.92);
}

.watch-card.is-selected {
  border-color: rgba(12, 121, 103, 0.35);
  box-shadow: inset 0 0 0 1px rgba(12, 121, 103, 0.18);
}

.watch-card-header,
.watch-destination-header,
.watch-run-header,
.watch-event-header,
.watch-delivery-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.watch-card-actions,
.watch-destination-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.watch-meta,
.watch-inline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.watch-section-title {
  margin: 0;
  font-family: 'Iowan Old Style', Georgia, serif;
  font-size: 1.25rem;
}

.watch-section-copy,
.watch-inline-copy {
  color: #5d5146;
  line-height: 1.55;
}

.watch-detail-grid {
  display: grid;
  gap: 1rem;
}

.watch-destination-form {
  display: grid;
  gap: 0.75rem;
}

.watch-compact-list {
  display: grid;
  gap: 0.7rem;
}

.watch-json-preview {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(18, 33, 30, 0.06);
  color: #5d5146;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.shell > .panel {
  margin-bottom: 1rem;
}

.key-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(63, 45, 29, 0.12);
  border-radius: 1rem;
  background: rgba(255, 248, 236, 0.92);
}

.key-item-main {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.key-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.key-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0 0.7rem;
  border: 1px solid rgba(18, 33, 30, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: #5d5146;
  font-size: 0.95rem;
}

.key-scopes {
  color: #5d5146;
  line-height: 1.6;
  word-break: break-word;
}

.key-item-actions {
  display: grid;
  grid-auto-flow: column;
  gap: 0.75rem;
  align-self: center;
}

.empty-state {
  margin: 0;
  color: #5d5146;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Cascadia Code', Consolas, monospace;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .hero,
  .summary-grid,
  .grid,
  .grid-wide,
  .actions,
  .scope-grid,
  .usage-grid {
    grid-template-columns: 1fr;
  }

  .panel-header,
  .key-item {
    align-items: start;
  }

  .watch-card-header,
  .watch-destination-header,
  .watch-run-header,
  .watch-event-header,
  .watch-delivery-header {
    align-items: start;
  }

  .key-item {
    grid-template-columns: 1fr;
  }

  .key-item-actions {
    grid-auto-flow: row;
    width: 100%;
  }

  .button-row {
    grid-template-columns: 1fr;
  }

  .auth-card {
    max-width: none;
    justify-self: stretch;
  }
}
