:root {
  --md-sys-color-primary: #2563eb;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-secondary: #64748b;
  --md-sys-color-background: #f6f8fb;
  --md-sys-color-surface: #ffffff;
  --md-sys-color-surface-variant: #eef2f7;
  --md-sys-color-outline: #d9e1ec;
  --md-sys-color-on-surface: #111827;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-2: 0 8px 24px rgba(15, 23, 42, 0.08);
  --nav-width: 272px;
  --nav-header-height: 72px;
}

body {
  margin: 0;
  font-family: "Google Sans", "Roboto", "Segoe UI", Arial, sans-serif;
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-surface);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.admin-login-shell {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f6f8fb;
}

.admin-login-shell[hidden] {
  display: none;
}

.admin-login-panel {
  width: min(100%, 420px);
  padding: 36px;
  background: #fff;
  border: 1px solid #d9e1ec;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}

.admin-login-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #2563eb;
  background: #dbeafe;
  border-radius: 12px;
}

.admin-login-mark svg { width: 24px; height: 24px; }
.admin-login-kicker { margin: 24px 0 8px; color: #64748b; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; }
.admin-login-panel h1 { margin: 0; color: #111827; font-size: 26px; line-height: 1.2; }
.admin-login-copy { margin: 10px 0 28px; color: #64748b; font-size: 14px; line-height: 1.5; }
.admin-login-form { display: grid; gap: 8px; }
.admin-login-form label { margin-top: 8px; color: #334155; font-size: 13px; font-weight: 600; }
.admin-login-form input { width: 100%; height: 44px; box-sizing: border-box; }
.admin-login-password-wrap { position: relative; }
.admin-login-password-wrap input { padding-right: 68px; }
.admin-login-password-toggle { position: absolute; top: 2px; right: 2px; height: 40px; padding: 0 12px; color: #2563eb; background: transparent; box-shadow: none; }
.admin-login-password-toggle:hover { color: #1558b0; background: #f1f8ff; box-shadow: none; }
.admin-login-error { margin: 8px 0 0; color: #b42318; font-size: 13px; }
.admin-login-submit { width: 100%; margin-top: 16px; height: 44px; }

body.admin-login-locked > *:not(#admin-login-shell) { visibility: hidden; }

@media (max-width: 480px) {
  .admin-login-panel { padding: 28px 22px; }
}

/* Sidebar */
.app-drawer {
  width: var(--nav-width);
  height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-right: 1px solid var(--md-sys-color-outline);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.drawer-header {
  padding: 0 20px;
  height: var(--nav-header-height);
  display: flex;
  align-items: center;
  flex: 0 0 var(--nav-header-height);
  border-bottom: 1px solid #edf2f7;
}

.drawer-header h1 {
  font-size: 19px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-scroll-frame {
  flex: 1;
  min-height: 0;
  padding: 10px 8px 12px;
  overflow: hidden;
  position: relative;
}

.drawer-scroll-frame::before,
.drawer-scroll-frame::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 18px;
  z-index: 1;
  pointer-events: none;
}

.drawer-scroll-frame::before {
  top: 10px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(248, 250, 252, 0));
}

.drawer-scroll-frame::after {
  bottom: 12px;
  background: linear-gradient(0deg, rgba(248, 250, 252, 0.96), rgba(248, 250, 252, 0));
}

.nav-list {
  height: 100%;
  padding: 10px 8px 18px 2px;
  margin: 0;
  list-style: none;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 transparent;
  border: 1px solid #e6edf5;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
  box-sizing: border-box;
}

.nav-list::-webkit-scrollbar {
  width: 10px;
}

.nav-list::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.7);
  border-radius: 999px;
}

.nav-list::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.nav-item {
  margin-bottom: 2px;
}

.nav-section {
  margin: 16px 10px 6px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.nav-section:first-child {
  margin-top: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: 40px;
  border-radius: 10px;
  color: #334155;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
  gap: 10px;
}

.nav-link:hover {
  background-color: #eef4ff;
  color: #1d4ed8;
}

.nav-link.active {
  background-color: #dbeafe;
  color: var(--md-sys-color-primary);
  box-shadow: inset 3px 0 0 var(--md-sys-color-primary);
}

.nav-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex: 0 0 auto;
}

.nav-label {
  white-space: nowrap;
}

.nav-icon-wrap {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.nav-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  display: inline-block;
  box-sizing: border-box;
  border: 2px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
  position: absolute;
  top: -5px;
  right: -7px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.nav-badge.show {
  opacity: 1;
  transform: scale(1);
}

/* Main Content */
.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  min-width: 0;
}

.top-app-bar {
  height: 72px;
  flex: 0 0 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(246, 248, 251, 0.92);
  border-bottom: 1px solid #e6edf5;
  backdrop-filter: blur(12px);
}

.admin-session-bar { display: flex; align-items: center; gap: 12px; }
.admin-session-username { color: #64748b; font-size: 13px; }
.admin-logout-button { height: 36px; padding: 0 14px; }

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0;
}

.scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 36px;
  min-width: 0;
}

/* Page Containers */
.page {
  display: none;
  /* Hidden by default */
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeIn 0.2s ease;
}

.page.active {
  display: grid;
  gap: 18px;
}

.pricing-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.pricing-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: var(--md-sys-color-surface-variant);
  border: 1px solid var(--md-sys-color-outline);
  justify-self: start;
  max-width: 100%;
}

.pricing-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.task-governance-hero,
.task-governance-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.task-governance-summary strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 36px;
  line-height: 1;
  color: var(--md-sys-color-primary);
}

.task-governance-editor {
  display: grid;
  gap: 14px;
}

.task-governance-editor .form-field {
  display: grid;
  gap: 6px;
}

.task-governance-editor .inline-field {
  display: inline-grid;
  width: fit-content;
  max-width: 100%;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  gap: 8px;
}

.task-governance-editor textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  min-height: 110px;
}

#page-storage-governance.storage-governance-page {
  max-width: 100%;
  overflow-x: hidden;
}

.storage-governance-dashboard-grid,
.storage-cleanup-summary-grid,
.storage-cleanup-form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.storage-governance-dashboard-grid > *,
.storage-cleanup-summary-grid > *,
.storage-cleanup-form-grid > *,
.storage-governance-page .card,
.storage-governance-page .form-field,
.storage-governance-page input,
.storage-governance-page select,
.storage-governance-page button,
.storage-governance-page .badge {
  min-width: 0;
}

.storage-governance-page input,
.storage-governance-page select,
.storage-governance-page textarea {
  width: 100%;
}

.storage-governance-page input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.storage-governance-page .task-governance-editor > .inline-field {
  display: inline-flex;
  width: auto;
  justify-self: start;
  align-items: center;
  gap: 8px;
}

.storage-governance-page .task-governance-editor > .inline-field input[type="checkbox"] {
  margin: 0;
}

.storage-governance-page .section-header {
  min-width: 0;
}

.storage-governance-page .section-header > *,
.storage-governance-page .task-governance-actions {
  min-width: 0;
}

.storage-governance-page .task-governance-actions input {
  flex: 1 1 240px;
}

.storage-governance-page .model-preview {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.storage-cleanup-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.storage-expiry-section {
  display: grid;
  gap: 16px;
}

.storage-expiry-policy-grid,
.storage-expiry-filter-grid,
.storage-expiry-impact-grid,
.storage-expiry-case-detail-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.storage-expiry-note-field {
  display: grid;
  gap: 6px;
}

.storage-expiry-impact-grid > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 6px;
  background: var(--md-sys-color-surface-container-low, #f8f9fa);
}

.storage-expiry-impact-grid span,
.storage-expiry-detail-row span {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 13px;
}

.storage-expiry-impact-grid strong {
  font-size: 22px;
  font-weight: 600;
}

.storage-expiry-filter-actions,
.storage-expiry-pagination {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
}

.storage-expiry-detail {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.storage-expiry-detail-row {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.storage-expiry-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 22px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  background: var(--md-sys-color-surface, #fff);
  color: var(--md-sys-color-on-surface, #202124);
  overflow-y: auto;
}

.storage-expiry-dialog::backdrop {
  background: rgba(32, 33, 36, 0.55);
}

.storage-expiry-dialog form {
  display: grid;
  gap: 14px;
}

.storage-expiry-dialog .icon-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

#storage-expiry-cases,
#storage-expiry-revisions {
  table-layout: fixed;
}

#storage-expiry-cases th,
#storage-expiry-cases td,
#storage-expiry-revisions th,
#storage-expiry-revisions td {
  padding: 10px 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

@media (max-width: 720px) {
  .storage-expiry-filter-actions,
  .storage-expiry-pagination {
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .storage-expiry-filter-actions button,
  .storage-expiry-pagination button {
    flex: 1 1 120px;
  }
}

#page-redis-observability.redis-observability-page {
  max-width: 100%;
  overflow-x: hidden;
}

.redis-observability-page .card {
  min-width: 0;
}

.redis-observability-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border-color: #cbd9ea;
}

.redis-observability-hero-copy {
  display: grid;
  gap: 10px;
  min-width: 260px;
}

.redis-observability-hero-copy h2 {
  margin-bottom: 0;
}

.redis-observability-meta,
.redis-observability-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.redis-observability-primary-status {
  min-width: 88px;
  justify-content: center;
}

.redis-observability-actions {
  justify-content: flex-end;
  align-items: flex-end;
  min-width: 360px;
}

.redis-observability-actions .form-field {
  display: grid;
  gap: 6px;
  min-width: 150px;
  flex: 0 1 180px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.redis-observability-actions .inline-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  background: #f8fafc;
  color: #1f2937;
  font-size: 13px;
  font-weight: 700;
}

.redis-observability-actions input[type="checkbox"] {
  flex: 0 0 16px;
  min-width: 16px;
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  display: inline-block;
}

.redis-observability-actions input[type="number"],
.redis-observability-actions input[type="text"] {
  min-width: 0;
  width: 100%;
}

.redis-observability-summary-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.redis-observability-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.redis-observability-signal-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(280px, 0.72fr) minmax(620px, 1.28fr);
  align-items: start;
}

.redis-observability-latency-card,
.redis-observability-slowlog-card {
  align-self: start;
}

.redis-observability-section-band {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px 0;
  color: #334155;
}

.redis-observability-section-band span {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.redis-observability-section-band strong {
  font-size: 14px;
}

.redis-status-badge {
  display: inline-flex;
  align-items: center;
}

.redis-observability-summary-card {
  display: grid;
  gap: 8px;
  align-content: start;
}

.redis-observability-summary-card strong {
  font-size: 16px;
  line-height: 1.25;
}

.redis-observability-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.redis-observability-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

#redis-observability-server,
#redis-observability-latency,
#redis-observability-slowlog,
#redis-observability-commandstats,
#redis-observability-queues,
#redis-observability-provider-slots,
#redis-observability-workers {
  table-layout: fixed;
  width: 100%;
}

#redis-observability-server th,
#redis-observability-server td,
#redis-observability-latency th,
#redis-observability-latency td,
#redis-observability-slowlog th,
#redis-observability-slowlog td,
#redis-observability-commandstats th,
#redis-observability-commandstats td,
#redis-observability-queues th,
#redis-observability-queues td,
#redis-observability-provider-slots th,
#redis-observability-provider-slots td,
#redis-observability-workers th,
#redis-observability-workers td {
  padding: 10px 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

#redis-observability-errors {
  display: grid;
  gap: 10px;
}

.redis-observability-error {
  border: 1px solid #f1d0cb;
  background: #fef7f6;
  border-radius: 8px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}

.redis-observability-error strong {
  font-size: 13px;
}

.redis-observability-error span {
  color: #c5221f;
  font-size: 12px;
}

.redis-observability-error p {
  margin: 0;
  color: #5f6368;
  font-size: 12px;
  line-height: 1.5;
}

#redis-observability-server th:nth-child(1),
#redis-observability-server td:nth-child(1),
#redis-observability-latency th:nth-child(1),
#redis-observability-latency td:nth-child(1),
#redis-observability-slowlog th:nth-child(1),
#redis-observability-slowlog td:nth-child(1),
#redis-observability-queues th:nth-child(1),
#redis-observability-queues td:nth-child(1),
#redis-observability-provider-slots th:nth-child(1),
#redis-observability-provider-slots td:nth-child(1),
#redis-observability-workers th:nth-child(1),
#redis-observability-workers td:nth-child(1) {
  width: 10%;
}

#redis-observability-server th:nth-child(2),
#redis-observability-server td:nth-child(2),
#redis-observability-latency th:nth-child(2),
#redis-observability-latency td:nth-child(2),
#redis-observability-slowlog th:nth-child(2),
#redis-observability-slowlog td:nth-child(2),
#redis-observability-queues th:nth-child(2),
#redis-observability-queues td:nth-child(2),
#redis-observability-provider-slots th:nth-child(2),
#redis-observability-provider-slots td:nth-child(2),
#redis-observability-workers th:nth-child(2),
#redis-observability-workers td:nth-child(2) {
  width: 14%;
}

#redis-observability-slowlog th:nth-child(5),
#redis-observability-slowlog td:nth-child(5),
#redis-observability-provider-slots th:nth-child(8),
#redis-observability-provider-slots td:nth-child(8) {
  width: 24%;
}

#redis-observability-workers td .status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#redis-observability-workers td:nth-child(1) {
  width: 9%;
}

#redis-observability-workers td:nth-child(8),
#redis-observability-workers td:nth-child(9) {
  width: 12%;
}

.redis-observability-latency-card #redis-observability-latency th:nth-child(1),
.redis-observability-latency-card #redis-observability-latency td:nth-child(1) {
  width: 36%;
}

.redis-observability-latency-card #redis-observability-latency th:nth-child(2),
.redis-observability-latency-card #redis-observability-latency td:nth-child(2),
.redis-observability-latency-card #redis-observability-latency th:nth-child(3),
.redis-observability-latency-card #redis-observability-latency td:nth-child(3) {
  width: 20%;
}

.redis-observability-slowlog-card #redis-observability-slowlog {
  table-layout: fixed;
}

.redis-observability-slowlog-card #redis-observability-slowlog th:nth-child(1),
.redis-observability-slowlog-card #redis-observability-slowlog td:nth-child(1) {
  width: 7%;
}

.redis-observability-slowlog-card #redis-observability-slowlog th:nth-child(2),
.redis-observability-slowlog-card #redis-observability-slowlog td:nth-child(2) {
  width: 17%;
}

.redis-observability-slowlog-card #redis-observability-slowlog th:nth-child(3),
.redis-observability-slowlog-card #redis-observability-slowlog td:nth-child(3) {
  width: 18%;
}

.redis-observability-slowlog-card #redis-observability-slowlog th:nth-child(4),
.redis-observability-slowlog-card #redis-observability-slowlog td:nth-child(4) {
  width: 30%;
}

.redis-observability-slowlog-card #redis-observability-slowlog th:nth-child(5),
.redis-observability-slowlog-card #redis-observability-slowlog td:nth-child(5) {
  width: 28%;
}

@media (max-width: 900px) {
  .redis-observability-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .redis-observability-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .redis-observability-signal-grid {
    grid-template-columns: 1fr;
  }
}

#storage-cleanup-jobs,
#storage-cleanup-revisions {
  table-layout: fixed;
}

#storage-cleanup-jobs th,
#storage-cleanup-jobs td,
#storage-cleanup-revisions th,
#storage-cleanup-revisions td {
  padding: 10px 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

#storage-cleanup-jobs th:nth-child(1),
#storage-cleanup-jobs td:nth-child(1),
#storage-cleanup-revisions th:nth-child(1),
#storage-cleanup-revisions td:nth-child(1) {
  width: 18%;
}

#storage-cleanup-jobs th:nth-child(2),
#storage-cleanup-jobs td:nth-child(2),
#storage-cleanup-jobs th:nth-child(3),
#storage-cleanup-jobs td:nth-child(3),
#storage-cleanup-jobs th:nth-child(4),
#storage-cleanup-jobs td:nth-child(4) {
  width: 10%;
}

#storage-cleanup-jobs th:nth-child(5),
#storage-cleanup-jobs td:nth-child(5),
#storage-cleanup-jobs th:nth-child(6),
#storage-cleanup-jobs td:nth-child(6),
#storage-cleanup-jobs th:nth-child(7),
#storage-cleanup-jobs td:nth-child(7),
#storage-cleanup-jobs th:nth-child(8),
#storage-cleanup-jobs td:nth-child(8) {
  width: 13%;
}

#storage-cleanup-revisions th:nth-child(2),
#storage-cleanup-revisions td:nth-child(2),
#storage-cleanup-revisions th:nth-child(3),
#storage-cleanup-revisions td:nth-child(3),
#storage-cleanup-revisions th:nth-child(4),
#storage-cleanup-revisions td:nth-child(4),
#storage-cleanup-revisions th:nth-child(7),
#storage-cleanup-revisions td:nth-child(7) {
  width: 12%;
}

#storage-cleanup-revisions th:nth-child(5),
#storage-cleanup-revisions td:nth-child(5),
#storage-cleanup-revisions th:nth-child(6),
#storage-cleanup-revisions td:nth-child(6) {
  width: 17%;
}

.watermark-preview-card {
  display: grid;
  gap: 14px;
}

.watermark-preview {
  position: relative;
  min-height: 260px;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(32, 33, 36, 0.18), rgba(26, 115, 232, 0.2)),
    url("https://picsum.photos/900/560?blur=1") center/cover;
  border: 1px solid var(--md-sys-color-outline);
}

.watermark-ai-preview {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 6px 12px;
  border-radius: 4px;
  color: #fff;
  background: rgba(0, 0, 0, 0.46);
  font-weight: 500;
  letter-spacing: 0;
}

.watermark-brand-preview {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.watermark-brand-preview.bottom-right {
  left: auto;
  right: 24px;
  transform: none;
}

#task-governance-editor-error {
  color: #b42318;
  min-height: 20px;
}

#task-governance-diff-panel {
  display: grid;
  gap: 14px;
}

.task-governance-diff-section {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.task-governance-diff-list {
  display: grid;
  gap: 8px;
}

.task-governance-diff-change {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

#task-governance-diff-error {
  color: #b42318;
  min-height: 20px;
}

.task-governance-warnings {
  display: grid;
  gap: 10px;
}

.task-governance-warning {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #fbbc04;
  background: #fff8e1;
  color: #5f4300;
}

.task-governance-warning strong {
  display: block;
  margin-bottom: 4px;
  color: #3c2f00;
}

.task-governance-pool-console {
  display: grid;
  gap: 14px;
}

.task-governance-pool-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.task-governance-pool-toolbar select {
  min-width: min(100%, 220px);
}

#task-governance-pool-items {
  table-layout: fixed;
}

#task-governance-pool-items th,
#task-governance-pool-items td {
  padding: 10px 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

.task-governance-pool-key code {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
}

#task-governance-pool-error {
  color: #b42318;
  min-height: 20px;
}

.task-execution-user {
  display: grid;
  gap: 2px;
}

.task-execution-user strong {
  font-size: 13px;
}

.task-execution-user span {
  color: var(--md-sys-color-secondary);
  font-size: 12px;
}

.task-execution-status {
  display: grid;
  gap: 4px;
}

.task-execution-status small {
  color: var(--md-sys-color-secondary);
  font-size: 12px;
}

.task-execution-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.task-execution-actions button {
  min-width: 64px;
}

.task-execution-media-transfer-panel {
  display: grid;
  gap: 16px;
}

.task-execution-media-transfer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--md-sys-color-secondary);
  font-size: 13px;
}

.task-execution-media-transfer-job-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.task-execution-media-transfer-job-filters input,
.task-execution-media-transfer-job-filters select {
  min-width: min(100%, 180px);
}

.task-execution-media-transfer-meta span,
.task-execution-media-transfer-url-list a {
  overflow-wrap: anywhere;
  min-width: 0;
}

.task-execution-media-transfer-url-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.task-execution-media-transfer-url-grid h3,
.task-execution-media-transfer-panel h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.task-execution-media-transfer-url-list {
  display: grid;
  gap: 8px;
  min-height: 32px;
}

.task-execution-media-transfer-url-list a {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  background: var(--md-sys-color-surface);
  text-decoration: none;
}

.task-execution-media-transfer-url-list span {
  color: var(--md-sys-color-secondary);
  font-size: 12px;
}

#task-execution-media-transfer-jobs {
  table-layout: fixed;
}

#task-execution-media-transfer-jobs th,
#task-execution-media-transfer-jobs td {
  padding: 10px 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

.task-execution-media-transfer-job-error {
  background: #fff8e1;
}

#task-execution-media-transfer-error {
  color: #b42318;
  min-height: 20px;
}

.task-user-concurrency-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 16px 0 20px;
  color: var(--md-sys-color-secondary);
  font-size: 13px;
}

.task-user-concurrency-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef3fd;
  color: var(--md-sys-color-primary);
}

.pricing-tab {
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--md-sys-color-secondary);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
}

.pricing-tab:hover {
  background: #e8f0fe;
  color: var(--md-sys-color-primary);
}

.pricing-tab.active {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-color: var(--md-sys-color-primary);
}

.pricing-section {
  display: none;
}

.pricing-section.active {
  display: grid;
  gap: 24px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cards & Sections */
.card {
  background: var(--md-sys-color-surface);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-1);
  border: 1px solid #e6edf5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: #d5dfeb;
  box-shadow: var(--shadow-2);
}

.card h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: 0;
}

.card h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 24px 0 12px;
  color: var(--md-sys-color-secondary);
}

.card h3:first-child {
  margin-top: 0;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.console-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.console-module-group {
  background: var(--md-sys-color-surface);
  border: 1px solid #e6edf5;
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow-1);
  display: grid;
  gap: 14px;
}

.console-module-heading {
  display: grid;
  gap: 4px;
}

.console-module-heading h2 {
  font-size: 16px;
  line-height: 1.25;
  margin: 0;
}

.console-module-heading span {
  color: var(--md-sys-color-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.console-module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button.console-module-action {
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f8fafc;
  color: #1f2937;
  border: 1px solid var(--md-sys-color-outline);
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
}

button.console-module-action:hover {
  background: #e8f0fe;
  color: var(--md-sys-color-primary);
  border-color: #bfdbfe;
  box-shadow: none;
}

.stat-value {
  font-size: 34px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  margin-top: 8px;
}

/* Forms & Inputs */
.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.form-row.equal-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form-row.equal-cols > * {
  min-width: 0;
}

.action-custom-row input {
  min-width: 260px;
}

.action-custom-row button {
  flex: 0 0 auto;
}

input,
select {
  flex: 1;
  min-width: 200px;
  height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
  background: #ffffff;
}

textarea.input-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  font-family: "Roboto Mono", monospace;
  font-size: 13px;
  box-sizing: border-box;
  resize: vertical;
}

textarea.input-textarea:focus {
  outline: 2px solid var(--md-sys-color-primary);
  border-color: transparent;
}

input:focus,
select:focus {
  outline: 2px solid var(--md-sys-color-primary);
  border-color: transparent;
}

/* Buttons */
button {
  height: 40px;
  padding: 0 18px;
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  transition: background-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

button:hover {
  background-color: #1558b0;
  /* Darker shade */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* Secondary Button (Outlined/Text) */
button.secondary {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  box-shadow: none;
  border: 1px solid var(--md-sys-color-outline);
}

button.secondary:hover {
  background-color: #f1f8ff;
  border-color: var(--md-sys-color-primary);
}

button.danger {
  background-color: #d93025;
}

button.danger:hover {
  background-color: #b31412;
}

button.icon-btn {
  padding: 4px 10px;
  /* Compact */
  height: 30px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: normal;
  border-radius: 999px;
  box-shadow: none;
}

table td .icon-btn {
  margin-right: 8px;
  margin-bottom: 6px;
}

table td .icon-btn:last-child {
  margin-right: 0;
}

#showcase-review-table .action-stack {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}

#showcase-review-table .action-stack .icon-btn {
  margin-right: 0;
  margin-bottom: 0;
}

button.icon-btn.secondary {
  background-color: #ffffff;
}

button.icon-btn.secondary:hover {
  background-color: #f1f8ff;
}

button.icon-btn.danger {
  background-color: #ffffff;
  color: #d93025;
  border: 1px solid #f4b7b3;
}

button.icon-btn.danger:hover {
  background-color: #fce8e6;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

#subscription-plan-table {
  table-layout: fixed;
}

#subscription-plan-table th:nth-child(7),
#subscription-plan-table td:nth-child(7) {
  width: 280px;
  max-width: 280px;
}

th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--md-sys-color-outline);
  font-size: 12px;
  font-weight: 700;
  color: var(--md-sys-color-secondary);
  text-transform: none;
  letter-spacing: 0;
  background: #f8fafc;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--md-sys-color-surface-variant);
  font-size: 14px;
}

.json-preview {
  font-family: 'Roboto Mono', monospace;
  white-space: normal;
  word-break: break-all;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: #f8f9fa;
}

tr.selected-row td {
  background-color: #e8f0fe;
}

#account-table tbody tr.account-row-selected td {
  background: #eef3fd;
}

#showcase-review-table td {
  vertical-align: top;
}

#display-name-review-table td {
  vertical-align: top;
}

#showcase-review-table {
  table-layout: fixed;
  min-width: 960px;
  width: 100%;
}

#display-name-review-table {
  table-layout: fixed;
  min-width: 1120px;
  width: 100%;
}

#showcase-review-table th,
#showcase-review-table td {
  padding: 6px 8px;
  font-size: 12px;
}

#showcase-review-table th {
  font-size: 11px;
  white-space: nowrap;
}

#display-name-review-table th,
#display-name-review-table td {
  padding: 10px 12px;
}

#showcase-review-table th:nth-child(1),
#showcase-review-table td:nth-child(1) {
  width: 56px;
}

#showcase-review-table th:nth-child(2),
#showcase-review-table td:nth-child(2) {
  width: 128px;
}

#showcase-review-table th:nth-child(3),
#showcase-review-table td:nth-child(3) {
  width: 178px;
}

#showcase-review-table th:nth-child(4),
#showcase-review-table td:nth-child(4) {
  width: 104px;
}

#showcase-review-table th:nth-child(5),
#showcase-review-table td:nth-child(5) {
  width: 76px;
}

#showcase-review-table th:nth-child(6),
#showcase-review-table td:nth-child(6) {
  width: 152px;
}

#showcase-review-table th:nth-child(7),
#showcase-review-table td:nth-child(7) {
  width: 60px;
}

#showcase-review-table th:nth-child(8),
#showcase-review-table td:nth-child(8) {
  width: 92px;
}

#showcase-review-table th:nth-child(9),
#showcase-review-table td:nth-child(9) {
  width: 82px;
}

#display-name-review-table th:nth-child(1),
#display-name-review-table td:nth-child(1) {
  width: 64px;
}

#display-name-review-table th:nth-child(2),
#display-name-review-table td:nth-child(2) {
  width: 180px;
}

#display-name-review-table th:nth-child(3),
#display-name-review-table td:nth-child(3) {
  width: 190px;
}

#display-name-review-table th:nth-child(4),
#display-name-review-table td:nth-child(4) {
  width: 130px;
}

#display-name-review-table th:nth-child(5),
#display-name-review-table td:nth-child(5) {
  width: 160px;
}

#display-name-review-table th:nth-child(6),
#display-name-review-table td:nth-child(6) {
  width: 150px;
}

#display-name-review-table th:nth-child(7),
#display-name-review-table td:nth-child(7) {
  width: 136px;
}

#display-name-review-table th:nth-child(8),
#display-name-review-table td:nth-child(8) {
  width: 120px;
}

.showcase-preview-cell {
  width: 128px;
}

.showcase-thumb-wrap {
  width: 100%;
  max-width: 114px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  border: 1px solid var(--md-sys-color-outline);
  overflow: hidden;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.showcase-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #f8f9fa;
}

.showcase-thumb-placeholder {
  color: #9aa0a6;
  font-size: 12px;
  font-weight: 500;
}

.workflow-cover-preview {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 10px;
  background: #fafbfc;
}

.workflow-cover-preview.empty {
  color: #9aa0a6;
}

.workflow-cover-thumb-wrap {
  width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: 1px solid var(--md-sys-color-outline);
  overflow: hidden;
  background: #f1f3f4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.workflow-cover-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.workflow-cover-thumb[hidden] {
  display: none;
}

.workflow-cover-thumb-placeholder {
  color: #9aa0a6;
  font-size: 12px;
  font-weight: 500;
}

.workflow-cover-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.workflow-cover-meta-label {
  font-size: 12px;
  color: #5f6368;
}

.workflow-cover-meta-value {
  font-size: 13px;
  color: #202124;
  word-break: break-all;
}

.showcase-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  line-height: 1.3;
}

.showcase-description {
  font-size: 11px;
  color: #5f6368;
  line-height: 1.32;
  margin-bottom: 2px;
  max-width: 192px;
  word-break: break-word;
}

.showcase-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.showcase-prompt-text {
  margin-top: 3px;
  font-size: 11px;
  color: #3c4043;
  line-height: 1.3;
  max-width: 192px;
  max-height: 76px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.showcase-owner-id {
  margin-top: 2px;
  font-size: 11px;
  color: #6b7280;
  font-family: "Roboto Mono", monospace;
  max-width: 120px;
  word-break: break-all;
}

.showcase-reject {
  margin-top: 3px;
  font-size: 11px;
  color: #c5221f;
  max-width: 162px;
  word-break: break-word;
}

.showcase-review-hint {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

#page-showcase.showcase-review-page {
  width: min(1520px, 100%);
  max-width: 1520px;
  gap: 12px;
  min-width: 0;
}

#page-showcase.showcase-review-page > * {
  min-width: 0;
}

#page-showcase.showcase-review-page .card {
  padding: 14px;
}

#page-showcase.showcase-review-page .card-header {
  margin-bottom: 8px;
}

#page-showcase.showcase-review-page .card h2 {
  margin-bottom: 8px;
}

#page-showcase.showcase-review-page .hint {
  margin-bottom: 6px;
}

#page-showcase.showcase-review-page .showcase-review-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 8px;
  align-items: center;
}

.showcase-review-filter-grid > * {
  min-width: 0;
  margin: 0;
}

.showcase-review-filter-grid select {
  width: 100%;
  min-width: 0;
}

#page-showcase.showcase-review-page .showcase-review-total-row {
  min-height: 0;
  margin-bottom: 0;
}

#page-showcase.showcase-review-page .showcase-review-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

#page-showcase.showcase-review-page .showcase-review-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

#showcase-review-table td > div {
  line-height: 1.3;
}

#showcase-review-table td:nth-child(4),
#showcase-review-table td:nth-child(7),
#showcase-review-table td:nth-child(8),
#showcase-review-table td:nth-child(9) {
  font-size: 11px;
}

#showcase-review-table td:nth-child(7) div,
#showcase-review-table td:nth-child(8) div {
  margin-bottom: 2px;
}

#showcase-review-table td:nth-child(7) div:last-child,
#showcase-review-table td:nth-child(8) div:last-child {
  margin-bottom: 0;
}

#showcase-review-table .action-chip {
  padding: 2px 8px;
  font-size: 11px;
}

#showcase-review-table td .icon-btn {
  margin-right: 6px;
  margin-bottom: 4px;
}

#showcase-review-table .icon-btn {
  padding: 2px 8px;
  height: 28px;
  font-size: 11px;
}

#page-bounty-reviews.bounty-review-page {
  width: min(1520px, 100%);
  max-width: 1520px;
  gap: 12px;
  min-width: 0;
}

#page-bounty-reviews.bounty-review-page > * {
  min-width: 0;
}

#page-bounty-reviews.bounty-review-page .card {
  padding: 14px;
}

#page-bounty-reviews .bounty-review-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 240px));
  gap: 8px;
  align-items: center;
}

#page-bounty-reviews .bounty-review-total-row {
  min-height: 0;
  margin: 8px 0 0;
}

.bounty-review-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

#bounty-review-table {
  min-width: 1320px;
}

#bounty-review-table th,
#bounty-review-table td {
  vertical-align: top;
}

#bounty-review-table th:nth-child(1),
#bounty-review-table td:nth-child(1) {
  width: 280px;
}

#bounty-review-table th:nth-child(5),
#bounty-review-table td:nth-child(5) {
  width: 300px;
}

#bounty-review-table th:nth-child(8),
#bounty-review-table td:nth-child(8) {
  width: 220px;
}

.bounty-review-description {
  max-width: 260px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

.bounty-review-code {
  max-height: 88px;
  overflow: auto;
  margin: 4px 0 8px;
}

.bounty-review-actions {
  display: grid;
  gap: 6px;
  min-width: 190px;
}

.bounty-review-reject-reason {
  width: 100%;
  min-height: 52px;
  resize: vertical;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  padding: 8px;
  font: inherit;
  font-size: 12px;
}

.bounty-review-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.display-name-review-hint {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.display-name-review-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.display-name-review-page {
  width: min(1320px, 100%);
  max-width: 100%;
  gap: 16px;
  min-width: 0;
}

.display-name-review-page > * {
  min-width: 0;
}

.display-name-review-page .card {
  padding: 20px;
}

.display-name-review-page .card-header {
  margin-bottom: 12px;
}

.display-name-review-page .card h2 {
  margin-bottom: 12px;
}

.display-name-review-page .stat-value {
  margin-top: 4px;
  font-size: 30px;
}

.display-name-review-page .hint {
  margin-bottom: 10px;
}

.display-name-review-summary-grid .card {
  min-height: 148px;
}

.display-name-review-filter-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(4, minmax(132px, 0.8fr)) auto;
  gap: 12px;
  align-items: center;
}

.display-name-review-filter-grid > * {
  min-width: 0;
  margin: 0;
}

.display-name-review-filter-grid input,
.display-name-review-filter-grid select {
  width: 100%;
  min-width: 0;
}

.display-name-review-filter-grid button {
  min-width: 96px;
}

.display-name-review-total-row {
  min-height: 0;
  margin-bottom: 10px;
}

.display-name-review-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.display-name-review-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.review-batchbar,
.display-name-review-batchbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.review-select-all,
.display-name-review-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #3c4043;
}

.review-select-all input,
.display-name-review-select-all input {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  margin: 0;
}

.review-selected-count,
.display-name-review-selected-count {
  font-size: 13px;
  font-weight: 600;
  color: #174ea6;
}

.review-checkbox-cell,
.display-name-review-checkbox-cell {
  text-align: center;
}

.review-checkbox,
.display-name-review-checkbox {
  width: 16px;
  height: 16px;
  min-width: 16px;
}

.avatar-review-cell {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.avatar-review-thumb {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 8px;
  border: 1px solid var(--md-sys-color-outline);
  object-fit: cover;
  background: #f8f9fa;
}

.avatar-review-url {
  max-height: 38px;
  overflow: hidden;
}

.avatar-review-drawer-preview {
  display: flex;
  gap: 16px;
  align-items: center;
}

.avatar-review-drawer-preview img {
  width: 112px;
  height: 112px;
  border-radius: 12px;
  border: 1px solid var(--md-sys-color-outline);
  object-fit: cover;
  background: #f8f9fa;
}

.review-primary {
  font-size: 14px;
  font-weight: 600;
  color: #202124;
  line-height: 1.5;
  word-break: break-word;
}

.review-meta,
.review-notes {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: #5f6368;
  word-break: break-word;
}

.review-notes {
  white-space: pre-wrap;
}

.review-badge-stack,
.review-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

@media (max-width: 1024px) {
  :root {
    --nav-width: 232px;
  }

  .top-app-bar {
    padding: 0 20px;
  }

  .scroll-content {
    padding: 20px;
  }

  .nav-link {
    padding: 0 12px;
  }

  .console-module-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1280px) {
  .showcase-review-filter-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .display-name-review-filter-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .display-name-review-filter-grid button {
    justify-self: start;
  }
}

@media (max-width: 900px) {
  .showcase-review-page {
    width: 100%;
  }

  .showcase-review-filter-grid {
    grid-template-columns: 1fr;
  }

  .showcase-review-pagination {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .display-name-review-page {
    width: 100%;
  }

  .display-name-review-filter-grid {
    grid-template-columns: 1fr;
  }

  .display-name-review-pagination {
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

.review-section {
  padding: 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 14px;
  background: #ffffff;
}

.review-section + .review-section {
  margin-top: 14px;
}

.review-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 10px;
}

.review-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.review-kv {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.review-kv-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.review-kv-value {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: #111827;
  word-break: break-word;
}

.review-code {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #111827;
  color: #e5e7eb;
  font-size: 12px;
  font-family: "Roboto Mono", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.ops-drawer {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 60;
}

.ops-drawer.open {
  display: block;
}

.ops-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.ops-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100%;
  background: #f8f9fa;
  box-shadow: -12px 0 32px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
}

.ops-drawer-header,
.ops-drawer-footer {
  padding: 18px 20px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ops-drawer-header {
  border-bottom: 1px solid var(--md-sys-color-outline);
}

.ops-drawer-footer {
  border-top: 1px solid var(--md-sys-color-outline);
  margin-top: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ops-drawer-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.ops-drawer-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

.ops-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.ops-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 70;
}

.ops-modal.open {
  display: block;
}

.ops-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
}

.ops-modal-panel {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(640px, calc(100vw - 32px));
  max-height: min(84vh, 800px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ops-modal-header,
.ops-modal-footer {
  padding: 16px 20px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ops-modal-header {
  border-bottom: 1px solid var(--md-sys-color-outline);
}

.ops-modal-footer {
  border-top: 1px solid var(--md-sys-color-outline);
  justify-content: flex-end;
  flex-wrap: wrap;
}

.ops-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.ops-modal-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

.ops-modal-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

.ops-modal-body .form-row {
  margin-top: 0;
}

.ops-modal-note {
  margin-top: 12px;
  font-size: 12px;
  color: #6b7280;
}

/* Code Blocks */
.code-block {
  background-color: #282c34;
  color: #abb2bf;
  padding: 16px;
  border-radius: 8px;
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
  overflow-x: auto;
  margin: 0;
  max-height: 400px;
}

#page-workflow table input {
  min-width: 80px;
  height: 32px;
  padding: 4px 8px;
  font-size: 12px;
}

#page-workflow table th,
#page-workflow table td {
  font-size: 12px;
}

#page-workflow .input-textarea {
  min-height: 200px;
}

#page-template .template-admin-card {
  max-width: 1280px;
  margin: 0 auto;
}

.template-meta-row {
  margin-bottom: 12px;
}

.template-workbench {
  display: grid;
  grid-template-columns: minmax(360px, 0.42fr) minmax(420px, 0.58fr);
  gap: 16px;
  margin: 18px 0 14px;
  background: #1f1f20;
  border-radius: 10px;
  padding: 10px;
}

.template-generator-panel,
.template-preview-panel {
  background: #282828;
  border: 1px solid #171717;
  border-radius: 8px;
  color: #f5f5f5;
  min-width: 0;
}

.template-generator-panel {
  padding: 18px;
}

.template-generator-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid #383838;
  font-size: 20px;
  font-weight: 700;
}

.template-generator-section {
  margin-top: 18px;
}

.template-generator-label {
  display: block;
  margin-bottom: 10px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
}

.template-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.template-generator-panel select,
.template-generator-panel input,
.template-generator-panel textarea {
  width: 100%;
  min-width: 0;
  background: #1e1e1f;
  border-color: #111111;
  color: #f5f5f5;
}

.template-generator-panel select {
  height: 54px;
  font-size: 16px;
  font-weight: 700;
}

.template-model-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 12px;
  background: #1e1e1f;
  border: 1px solid #111111;
  border-radius: 8px;
}

.template-model-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #4f46e5, #0f766e);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.template-model-card strong {
  display: block;
  font-size: 16px;
}

.template-model-card span {
  display: block;
  margin-top: 2px;
  color: #9ca3af;
  font-size: 12px;
}

.template-model-params {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.template-param-field {
  display: grid;
  gap: 7px;
}

.template-param-field label {
  color: #c9c9c9;
  font-size: 12px;
  font-weight: 600;
}

.template-param-field select,
.template-param-field input {
  height: 38px;
  font-size: 13px;
  font-weight: 500;
}

.template-param-field.wide {
  grid-column: 1 / -1;
}

.template-empty-model {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 1px dashed #4b5563;
  border-radius: 8px;
  color: #aeb4bd;
  font-size: 13px;
}

.template-prompt-input {
  min-height: 310px;
  resize: vertical;
  font-size: 15px;
  line-height: 1.5;
}

.template-reference-box {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 18px 22px;
  border-top: 1px solid #3b3b3b;
  color: #8f8f8f;
}

.template-reference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-reference-item {
  position: relative;
  display: flex;
  width: 84px;
  height: 54px;
  border: 1px solid #3b4658;
  border-radius: 4px;
  overflow: hidden;
  background: #15191f;
}

.template-reference-item img,
.template-reference-item video,
.template-reference-item audio {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template-reference-item audio {
  object-fit: contain;
}

.template-reference-item button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, .82);
  color: #fff;
  cursor: pointer;
}

.template-generator-panel .template-reference-retain {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 50px;
  min-width: 50px;
  height: 18px;
  padding: 0 2px;
  border: 0;
  border-radius: 3px;
  background: rgba(15, 23, 42, .82);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  line-height: 16px;
  cursor: pointer;
}

.template-reference-add {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border-radius: 8px;
  background: #333333;
  color: #777777;
  border: 0;
  box-shadow: none;
  font-size: 32px;
  font-weight: 300;
}

.template-advanced-json {
  margin-top: 16px;
  color: #aeb4bd;
}

.template-advanced-json summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.template-advanced-json textarea {
  margin-top: 10px;
  min-height: 120px;
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
}

.template-generator-actions {
  margin-top: 18px;
}

.template-generator-actions button {
  width: 100%;
  height: 48px;
  border-color: #8a9a1c;
  background: #31351f;
  color: #d7e95a;
}

.template-preview-panel {
  display: grid;
  grid-template-rows: minmax(420px, 1fr) auto;
  gap: 12px;
  padding: 18px;
}

.template-preview-frame {
  display: grid;
  place-items: center;
  min-height: 520px;
  border-radius: 6px;
  background: #202020;
  overflow: hidden;
  color: #777777;
  text-align: center;
}

.template-preview-frame img,
.template-preview-frame video {
  max-width: 100%;
  max-height: 640px;
  border-radius: 6px;
  object-fit: contain;
}

.template-preview-panel .code-block {
  max-height: 180px;
}

@media (max-width: 980px) {
  .template-workbench {
    grid-template-columns: 1fr;
  }

  .template-preview-frame {
    min-height: 320px;
  }
}

#workflow-embed {
  width: 100%;
  height: 640px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  background: #ffffff;
}

/* Utilities */
.hint {
  font-size: 12px;
  color: var(--md-sys-color-secondary);
  margin-bottom: 12px;
}

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

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.field-help {
  font-size: 12px;
  color: var(--md-sys-color-secondary);
}

#page-storyboard h3 {
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  margin: 18px 0 12px;
}

#page-storyboard .form-row.equal-cols {
  gap: 18px;
}

#page-storyboard .field-group {
  background: #f7f9fc;
  border: 1px solid #e3e7f0;
  border-radius: 14px;
  padding: 12px 14px 10px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

#page-storyboard .field-group:focus-within {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12);
  transform: translateY(-1px);
}

#page-storyboard .field-label {
  font-size: 12px;
  font-weight: 600;
  color: #1f2937;
  letter-spacing: 0.2px;
}

#page-storyboard .field-help {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

#page-storyboard .field-group input {
  width: 100%;
  background: #ffffff;
}

.action-dropdown {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.action-dropdown-trigger {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  background: #ffffff;
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
}

.action-dropdown.open .action-dropdown-trigger {
  border-color: #1a73e8;
  box-shadow: 0 0 0 1px #1a73e8;
  background: var(--md-sys-color-primary);
  color: #ffffff;
}

.action-dropdown-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-dropdown-placeholder {
  color: var(--md-sys-color-secondary);
}

.action-dropdown-trigger:hover {
  background: var(--md-sys-color-primary);
  color: #ffffff;
  border-color: var(--md-sys-color-primary);
}

.action-dropdown-trigger:hover .action-dropdown-placeholder,
.action-dropdown.open .action-dropdown-placeholder {
  color: #ffffff;
}

.action-dropdown-trigger:hover .action-dropdown-caret,
.action-dropdown.open .action-dropdown-caret {
  color: #ffffff;
}

.action-dropdown-caret {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.action-dropdown.open .action-dropdown-caret {
  transform: rotate(180deg);
}

.action-dropdown-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #ffffff;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  box-shadow: var(--shadow-1);
  padding: 8px;
  display: none;
  max-height: 220px;
  overflow: auto;
  z-index: 20;
}

.action-dropdown.open .action-dropdown-menu {
  display: block;
}

.action-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.action-dropdown-item:hover {
  background: var(--md-sys-color-primary);
  color: #ffffff;
}

.action-dropdown-item input {
  margin: 0;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  min-width: 14px;
  padding: 0;
}

.action-dropdown-empty {
  padding: 6px 8px;
  font-size: 12px;
  color: var(--md-sys-color-secondary);
}

.param-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.param-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 180px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f3f4;
  color: #3c4043;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.param-chip .param-key {
  color: #174ea6;
  font-weight: 600;
}

.param-builder {
  padding: 12px;
  border: 1px dashed var(--md-sys-color-outline);
  border-radius: 8px;
  background: #ffffff;
  margin-bottom: 12px;
}

.param-builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 500;
}

.param-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--md-sys-color-secondary);
}

.param-quick-label {
  font-weight: 500;
}

.param-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.param-quick-groups {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.param-quick-groups .param-quick-actions-value + .param-quick-actions-value {
  border-left: 1px dashed #d9e2f0;
  padding-left: 8px;
  margin-left: 2px;
}

.param-quick-item {
  height: 26px;
  border: 1px solid #d7dbe1;
  background: #f7f9fc;
  color: #2f3a4a;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.param-quick-item:hover {
  background: #eef4ff;
  border-color: #c5d7ff;
  color: #1a73e8;
  box-shadow: 0 2px 5px rgba(26, 115, 232, 0.12);
  transform: translateY(-0.5px);
}

.param-quick-item:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(26, 115, 232, 0.12);
}

.param-quick-item:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}

.param-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.param-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.benefit-row {
  flex-wrap: nowrap;
  gap: 8px;
}

.benefit-row.dragging {
  opacity: 0.55;
}

.benefit-drag-handle {
  flex: 0 0 auto;
  min-width: 56px;
  height: 34px;
  padding: 0 10px;
  cursor: move;
}

.param-row.benefit-row .param-key {
  flex: 1;
  min-width: 260px;
}

.param-row.benefit-row .param-remove {
  flex: 0 0 auto;
}

.param-row .param-key {
  flex: 0 0 180px;
  min-width: 160px;
}

.param-row .param-values {
  flex: 1;
  min-width: 240px;
}

@media (max-width: 900px) {
  .benefit-row {
    flex-wrap: wrap;
  }

  .benefit-row .benefit-drag-handle {
    min-width: 72px;
  }

  .param-row.benefit-row .param-key {
    min-width: 180px;
  }
}

.model-preview {
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed var(--md-sys-color-outline);
  border-radius: 8px;
  background: var(--md-sys-color-surface-variant);
}

.preview-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12px;
  color: var(--md-sys-color-secondary);
  margin-bottom: 12px;
}

.preview-sub {
  font-size: 11px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.preview-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-label {
  font-size: 12px;
  color: var(--md-sys-color-secondary);
}

.preview-value {
  font-size: 14px;
  font-weight: 500;
}

.preview-block {
  margin-top: 10px;
}

.action-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.action-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: #1a73e8;
  background: #e8f0fe;
}

.preview-empty {
  color: #888888;
  font-size: 12px;
}

.preview-code {
  margin: 6px 0 0;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--md-sys-color-outline);
  background: #ffffff;
  font-family: "Roboto Mono", monospace;
  font-size: 12px;
  max-height: 160px;
  overflow: auto;
}

.pricing-preview {
  background: var(--md-sys-color-surface-variant);
}

.pricing-preview .preview-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px 16px;
}

.pricing-preview .preview-label {
  color: #5f6368;
}

.pricing-preview .preview-value {
  font-weight: 600;
}

.pricing-preview .preview-code {
  min-height: 36px;
  max-height: 80px;
  white-space: pre-wrap;
}

.subscription-preview .preview-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 16px;
}

.subscription-preview .preview-code {
  max-height: 100px;
}

.account-feedback {
  min-height: 20px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid transparent;
  background: #eef3fd;
  color: #174ea6;
}

.account-feedback.success {
  background: #e6f4ea;
  border-color: #cce7d0;
  color: #137333;
}

.account-feedback.error {
  background: #fce8e6;
  border-color: #f4b7b3;
  color: #c5221f;
}

.account-feedback.info {
  background: #e8f0fe;
  border-color: #c7dafc;
  color: #174ea6;
}

.account-feedback.subtle {
  background: #f8f9fa;
  border-color: var(--md-sys-color-outline);
  color: #5f6368;
}

.account-benefit-card-header {
  align-items: flex-start;
}

.account-benefit-card-copy {
  flex: 1;
  min-width: 260px;
}

.account-benefit-card-header .account-feedback {
  flex: 0 1 420px;
  min-height: auto;
}

.account-benefit-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.account-primary-grid,
.account-ops-grid {
  display: grid;
  gap: 24px;
  align-items: start;
}

.account-primary-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 1fr);
}

.account-ops-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
}

.account-benefit-panel {
  padding: 18px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.account-detail-stack {
  display: grid;
  gap: 14px;
  margin: 16px 0 20px;
}

.account-detail-block {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #e6ebf2;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.account-detail-block h3 {
  margin: 0 0 12px;
}

.account-section-divider {
  margin: 4px 0 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #5f6368;
  text-transform: uppercase;
}

.account-password-panel {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px dashed #d9e2f0;
}

.account-subsection-header {
  margin-top: 0;
}

.account-password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.account-password-row input {
  min-width: 0;
}

.account-password-row button {
  white-space: nowrap;
}

.account-subscription-panel {
  display: grid;
  gap: 16px;
}

.account-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.account-inline-code.account-inline-code-muted {
  background: #f8f9fa;
  color: #5f6368;
  border: 1px solid var(--md-sys-color-outline);
}

.invite-code {
  margin-left: 6px;
  padding: 1px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #1a73e8;
  background: #e8f0fe;
  border-radius: 6px;
  white-space: nowrap;
}

.account-subscription-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.account-guide-item {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #e6ebf2;
  background: #f7f9fc;
}

.account-guide-index {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #174ea6;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.account-guide-copy {
  display: grid;
  gap: 4px;
}

.account-guide-copy strong {
  font-size: 13px;
}

.account-guide-copy span {
  font-size: 12px;
  color: #5f6368;
  line-height: 1.5;
}

.account-subscription-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-field-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #dde3ea;
  background: #ffffff;
  min-width: 0;
}

.account-field-card-wide {
  grid-column: 1 / -1;
}

.account-field-card-inline {
  padding: 0;
  border: 0;
  background: transparent;
}

.account-field-label {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
}

.account-field-hint {
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280;
}

.account-field-card input,
.account-field-card select {
  width: 100%;
}

.account-info-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.account-info-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--md-sys-color-surface-variant);
}

.account-info-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.account-info-item span {
  font-size: 12px;
  color: #5f6368;
  line-height: 1.5;
}

.account-preview-panel {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--md-sys-color-outline);
  background: #f8fbff;
}

.account-preview-panel.empty {
  color: #6b7280;
}

.account-plan-preview-panel {
  display: grid;
  gap: 14px;
}

.account-plan-preview-empty {
  color: #6b7280;
  line-height: 1.6;
}

.account-plan-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.account-plan-preview-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.account-plan-preview-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

.account-plan-preview-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.account-plan-stat {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #d9e5fb;
  background: #ffffff;
}

.account-plan-stat .summary-label,
.account-plan-stat .summary-value {
  margin: 0;
}

.account-plan-preview-benefits {
  display: grid;
  gap: 10px;
}

.account-benefits-chips.compact {
  margin: 0;
}

.account-plan-json-toggle {
  border-top: 1px dashed #d7dee8;
  padding-top: 10px;
}

.account-plan-json-toggle summary {
  cursor: pointer;
  color: #174ea6;
  font-size: 12px;
  font-weight: 600;
}

.account-advanced-toggle {
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}

.account-advanced-toggle summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  list-style: none;
}

.account-advanced-toggle summary::-webkit-details-marker {
  display: none;
}

.account-advanced-toggle[open] summary {
  border-bottom: 1px solid var(--md-sys-color-outline);
  background: #f8f9fa;
}

.account-advanced-toggle-inline {
  margin-top: 0;
}

.account-advanced-toggle-body {
  padding: 16px;
}

.account-advanced-toggle > .hint,
.account-advanced-toggle > .form-row,
.account-advanced-toggle > .account-override-editor {
  padding: 16px;
}

#account-override-table {
  width: calc(100% - 32px);
  margin: 0 16px 16px;
}

.account-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.account-summary-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.summary-tile {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--md-sys-color-outline);
  background: #ffffff;
}

.summary-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #5f6368;
}

.summary-value {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  word-break: break-word;
}

.account-benefits-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.account-inline-code {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f1f3f4;
  color: #3c4043;
  font-family: "Roboto Mono", monospace;
  font-size: 12px;
}

.account-benefits-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.account-benefit-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d7e3fd;
  background: #eef3fd;
  color: #174ea6;
  font-size: 12px;
}

.account-benefit-chip strong {
  font-weight: 700;
}

.account-current-benefits-json,
#account-current-benefits-json {
  max-height: 180px;
  margin-top: 6px;
}

.account-override-section {
  margin-top: 18px;
}

.account-benefit-actions {
  margin-top: 4px;
}

.account-override-editor {
  display: grid;
  gap: 12px;
}

.account-override-selected td {
  background: #eef3fd;
}

.table-subtle {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .account-primary-grid,
  .account-ops-grid {
    grid-template-columns: 1fr;
  }

  .account-benefit-card-header,
  .account-panel-heading,
  .account-plan-preview-head {
    flex-direction: column;
  }

  .account-benefit-card-header .account-feedback {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .account-subscription-form-grid {
    grid-template-columns: 1fr;
  }

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

  .account-guide-item {
    padding: 12px;
  }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.rich-editor {
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 16px;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--md-sys-color-outline);
  background: var(--md-sys-color-surface-variant);
}

.editor-body {
  min-height: 180px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.editor-body:focus {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: -2px;
}

/* Notification composer and grouped list */
.notification-composer-heading h2,
.notification-list-card h2 {
  margin-bottom: 4px;
}

.notification-composer-heading p,
.notification-list-card .card-header p {
  margin: 0;
  color: var(--md-sys-color-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.notification-edit-state {
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--md-sys-color-primary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.notification-template-manager {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.notification-template-form {
  display: grid;
  gap: 13px;
  min-width: 0;
}

.notification-template-form > label,
.notification-template-form-grid > label {
  display: grid;
  gap: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.notification-template-form input,
.notification-template-form select,
.notification-template-form textarea {
  width: 100%;
  min-width: 0;
}

.notification-template-form textarea {
  min-height: 126px;
  padding: 10px 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  resize: vertical;
}

.notification-template-form textarea:focus {
  outline: 2px solid var(--md-sys-color-primary);
  border-color: transparent;
}

.notification-template-form-grid {
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) minmax(220px, 1.2fr) minmax(112px, 0.65fr) auto;
  gap: 10px;
  align-items: end;
}

.notification-template-form-grid .notification-template-enabled {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  white-space: nowrap;
}

.notification-template-enabled input {
  width: auto;
  min-width: 0;
  height: auto;
}

.notification-template-variables {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid #e4ebf4;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--md-sys-color-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.notification-template-variables > span {
  font-weight: 700;
}

.notification-template-variables button {
  height: 26px;
  padding: 0 8px;
  border: 1px solid #d7e3f3;
  border-radius: 6px;
  background: #fff;
  color: var(--md-sys-color-primary);
  box-shadow: none;
  font: 12px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.notification-templates-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 7px;
  max-height: 390px;
  overflow: auto;
  padding: 0 2px;
}

.notification-template-list-shell {
  min-width: 0;
  padding-top: 18px;
  border-top: 1px solid #e6edf5;
}

.notification-template-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 2px 10px;
}

.notification-template-list-heading > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}

.notification-template-list-heading strong {
  color: #1e3a5f;
  font-size: 13px;
}

.notification-template-list-heading span {
  color: #94a3b8;
  font-size: 11px;
}

.notification-template-count {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b !important;
  font-size: 11px !important;
  font-weight: 600;
}

.notification-template-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 86px;
  padding: 10px 11px;
  border: 1px solid #e4ebf4;
  border-radius: 9px;
  background: #fff;
}

.notification-template-list-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.notification-template-list-title strong {
  color: #334155;
  font-size: 13px;
}

.notification-template-list-key {
  margin-top: 5px;
  color: #94a3b8;
  font: 11px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.notification-template-list-item p {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--md-sys-color-secondary);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notification-compose-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.38fr) minmax(0, 1fr);
  gap: 22px;
}

.notification-template-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e4ebf4;
  border-radius: 10px;
  background: #f8fafc;
}

.notification-panel-eyebrow {
  color: var(--md-sys-color-primary);
  font-size: 11px;
  font-weight: 700;
}

.notification-template-panel h3 {
  margin: 4px 0 0;
  color: var(--md-sys-color-on-surface);
  font-size: 15px;
  font-weight: 700;
}

.notification-template-panel p {
  margin: 6px 0 0;
  color: var(--md-sys-color-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.notification-template-slots {
  display: grid;
  gap: 8px;
}

button.notification-template-slot {
  display: grid;
  height: auto;
  min-height: 62px;
  padding: 11px 12px;
  border: 1px solid #dce5f0;
  border-radius: 8px;
  background: #fff;
  color: var(--md-sys-color-on-surface);
  box-shadow: none;
  text-align: left;
}

button.notification-template-slot strong {
  font-size: 13px;
}

button.notification-template-slot span {
  margin-top: 3px;
  color: var(--md-sys-color-secondary);
  font-size: 12px;
  font-weight: 400;
}

button.notification-template-slot.active {
  border-color: var(--md-sys-color-primary);
  background: #eef4ff;
  color: var(--md-sys-color-primary);
}

.notification-template-note {
  padding-top: 12px;
  border-top: 1px solid #e4ebf4;
  color: var(--md-sys-color-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.notification-editor-panel {
  min-width: 0;
}

.notification-field-label {
  display: block;
  margin-bottom: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.notification-editor-panel > input {
  width: 100%;
  min-width: 0;
}

.notification-type-input {
  display: none;
}

.notification-publish-fields {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.notification-publish-fields label {
  display: grid;
  gap: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.notification-publish-fields select,
.notification-publish-fields input {
  width: 100%;
  min-width: 0;
}

.notification-editor-panel .hint {
  margin: 7px 0 14px;
}

.notification-editor-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.notification-editor-heading span {
  color: var(--md-sys-color-secondary);
  font-size: 12px;
}

.notification-editor-heading .notification-field-label {
  margin-bottom: 7px;
}

.notification-editor-panel .rich-editor {
  margin-bottom: 10px;
}

.notification-editor-panel .editor-body {
  min-height: 150px;
}

.notification-content-slots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.notification-content-slots > span {
  color: var(--md-sys-color-secondary);
  font-size: 12px;
  font-weight: 600;
}

button.notification-content-slot {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #dbe5f1;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  box-shadow: none;
  font-size: 12px;
}

button.notification-content-slot:hover {
  border-color: #93c5fd;
  background: #eef4ff;
  color: var(--md-sys-color-primary);
}

.notification-editor-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.notification-list-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(2, minmax(160px, 0.52fr));
  gap: 12px;
  margin-bottom: 16px;
}

.notification-list-filters input,
.notification-list-filters select {
  min-width: 0;
  width: 100%;
}

.notification-list {
  display: grid;
  gap: 16px;
}

.notification-list-group {
  border: 1px solid #e6edf5;
  border-radius: 10px;
  overflow: hidden;
}

.notification-list-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  background: #f8fafc;
  border-bottom: 1px solid #e6edf5;
}

.notification-list-group-heading strong {
  color: #334155;
  font-size: 13px;
}

.notification-list-group-heading span {
  color: var(--md-sys-color-secondary);
  font-size: 12px;
}

.notification-list-group-entries {
  display: grid;
}

.notification-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px;
  border-bottom: 1px solid #edf2f7;
}

.notification-list-item:last-child {
  border-bottom: 0;
}

.notification-list-copy {
  min-width: 0;
}

button.notification-list-title {
  display: block;
  height: auto;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  background: transparent;
  color: #1e3a5f;
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.notification-list-title:hover {
  color: var(--md-sys-color-primary);
}

.notification-list-copy p {
  max-width: 760px;
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--md-sys-color-secondary);
  font-size: 12px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-list-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: #94a3b8;
  font-size: 12px;
}

.notification-list-meta .status-badge {
  flex: 0 0 auto;
}

.notification-list-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.notification-list-actions .icon-btn {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.notification-list-empty {
  padding: 34px 16px;
  border: 1px dashed #d9e1ec;
  border-radius: 10px;
  color: var(--md-sys-color-secondary);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 860px) {
  .notification-template-manager {
    grid-template-columns: 1fr;
  }

  .notification-template-list-heading,
  .notification-templates-list {
    padding-left: 0;
  }

  .notification-templates-list {
    grid-template-columns: 1fr;
  }

  .notification-template-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .notification-compose-layout {
    grid-template-columns: 1fr;
  }

  .notification-template-slots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .notification-list-filters {
    grid-template-columns: 1fr 1fr;
  }

  .notification-list-filters input {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .notification-template-form-grid {
    grid-template-columns: 1fr;
  }
  .notification-publish-fields,
  .notification-list-filters,
  .notification-template-slots {
    grid-template-columns: 1fr;
  }

  .notification-list-item,
  .notification-composer-heading,
  .notification-list-card .card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .notification-list-actions {
    width: 100%;
  }

  .notification-list-actions .icon-btn {
    flex: 1;
  }
}

#showcase-review-table .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.status-badge.draft {
  background: #f1f3f4;
  color: #5f6368;
}

.status-badge.scheduled {
  background: #fef7e0;
  color: #b06000;
}

.status-badge.published {
  background: #e6f4ea;
  color: #137333;
}

.status-badge.archived {
  background: #fce8e6;
  color: #c5221f;
}

.status-badge.active {
  background: #e6f4ea;
  color: #137333;
}

.status-badge.disabled {
  background: #f1f3f4;
  color: #5f6368;
}

.status-badge.success {
  background: #e6f4ea;
  color: #137333;
}

.status-badge.error {
  background: #fce8e6;
  color: #c5221f;
}

.status-badge.pending {
  background: #fff7e0;
  color: #b06000;
}

.status-badge.processing {
  background: #e8f0fe;
  color: #1a73e8;
}

.status-badge.review {
  background: #f3e8fd;
  color: #7b1fa2;
}

.status-badge.replaced {
  background: #fce8e6;
  color: #c5221f;
}

.status-badge.superseded {
  background: #f1f3f4;
  color: #5f6368;
}
