:root {
  --ink: #111827;
  --ink-2: #1f2937;
  --muted: #64748b;
  --line: #dbe4ee;
  --panel: #ffffff;
  --soft: #f4f7fb;
  --soft-2: #eef4f8;
  --teal: #00c2a8;
  --blue: #246bfe;
  --red: #dc2626;
  --amber: #b7791f;
  --green: #047857;
  --shadow: 0 16px 38px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  perspective: 1400px;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px;
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 194, 168, 0.18), transparent 28%),
    linear-gradient(180deg, #111827 0%, #0d1423 100%);
  color: #fff;
  box-shadow: 14px 0 40px rgba(17, 24, 39, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #fff;
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: #a8b3c4;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-group {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 10px;
}

.nav-group summary {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  list-style: none;
  border-radius: 8px;
  padding: 9px;
  background: linear-gradient(135deg, rgba(0, 194, 168, 0.14), rgba(36, 107, 254, 0.13));
  color: #fff;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.nav-group summary:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(0, 194, 168, 0.2), rgba(36, 107, 254, 0.18));
}

.nav-group summary strong,
.nav-group summary small {
  display: block;
}

.nav-group summary strong {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-group summary small {
  margin-top: 2px;
  color: #a8b3c4;
  font-size: 11px;
  font-weight: 700;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 9px;
  border-radius: 8px;
  padding: 9px 10px;
  color: #d7deea;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.095);
  color: #fff;
}

.nav-item:hover {
  transform: translateX(3px);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--teal);
}

.nav-item.active::after {
  content: "";
  position: absolute;
  right: 10px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(0, 194, 168, 0.12);
}

.nav-group .nav-item {
  margin-left: 0;
}

.group-icon,
.nav-icon {
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.group-icon {
  width: 34px;
  height: 34px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--blue));
}

.nav-icon {
  width: 30px;
  height: 30px;
  color: #9fb0c9;
  background: rgba(255, 255, 255, 0.055);
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  color: #fff;
  background: rgba(36, 107, 254, 0.28);
  transform: translateZ(8px);
}

.group-icon svg,
.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-card {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-card strong,
.sidebar-card small {
  display: block;
}

.sidebar-card small {
  margin-top: 6px;
  color: #a8b3c4;
}

.workspace {
  min-width: 0;
  width: min(1240px, calc(100vw - 304px));
  margin: 0 auto;
  padding: 26px 20px 42px;
}

.app-shell,
.workspace,
.page-content {
  transform-style: preserve-3d;
}

.topbar,
.module-heading,
.actions,
.overview-grid,
.publish-grid,
.diagnosis-grid,
.settings-grid {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar {
  justify-content: space-between;
  margin-bottom: 18px;
}

.eyebrow,
.tiny-label {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.page-content {
  min-width: 0;
}

.tiny-label {
  display: block;
  color: var(--muted);
}

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

h1 {
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.12;
}

h2 {
  margin-bottom: 0;
  font-size: 21px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

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

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

.module {
  scroll-margin-top: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

.module-heading {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: #f8fafc;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.success {
  border-color: rgba(0, 194, 168, 0.28);
  background: rgba(0, 194, 168, 0.1);
  color: var(--green);
}

.badge.warning {
  border-color: rgba(183, 121, 31, 0.28);
  background: rgba(183, 121, 31, 0.1);
  color: var(--amber);
}

.badge.neutral {
  color: var(--muted);
}

.overview-grid {
  align-items: stretch;
}

.profile-card {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  flex: 1.05;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, #fff, #f9fbfd);
}

.avatar {
  width: 82px;
  height: 82px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-card h3 {
  margin-bottom: 3px;
  font-size: 18px;
}

.muted,
.profile-handle {
  color: var(--muted);
}

.profile-handle {
  margin-bottom: 8px;
  font-weight: 800;
}

#profileBio {
  margin-bottom: 8px;
  line-height: 1.45;
}

.text-link {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  flex: 1;
}

.wide-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.metric-card,
.panel-card,
.calendar-card,
.media-card,
.guidance-card,
.permission-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.depth-card,
.module {
  transform-style: preserve-3d;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.depth-card:hover {
  border-color: rgba(36, 107, 254, 0.28);
  box-shadow: 0 22px 48px rgba(17, 24, 39, 0.12);
  transform: translateY(-2px) rotateX(1deg) rotateY(-1deg);
}

.card-icon,
.permission-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  border-radius: 8px;
  color: var(--blue);
  background: rgba(36, 107, 254, 0.08);
}

.card-icon svg,
.permission-icon svg {
  width: 18px;
  height: 18px;
}

.metric-card {
  padding: 14px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 7px;
  font-size: 24px;
  line-height: 1;
}

.alerts {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.alert {
  border: 1px solid rgba(36, 107, 254, 0.18);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(36, 107, 254, 0.06);
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 700;
}

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

.media-card {
  overflow: hidden;
}

.media-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--soft-2);
}

.media-body {
  padding: 12px;
}

.media-caption {
  display: -webkit-box;
  min-height: 57px;
  margin-bottom: 10px;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.45;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.media-meta,
.media-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.media-stats {
  margin-top: 9px;
}

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

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

.quick-card {
  display: block;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 15px;
  color: var(--ink);
  text-decoration: none;
}

.quick-card:hover {
  border-color: rgba(36, 107, 254, 0.45);
}

.quick-card strong,
.quick-card span {
  display: block;
}

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

.permission-card {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  align-items: start;
  color: var(--ink);
  text-decoration: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.permission-card .permission-icon {
  margin: 0;
}

.permission-card.accepted {
  border-color: rgba(0, 194, 168, 0.28);
}

.permission-card.accepted .permission-icon {
  color: var(--green);
  background: rgba(0, 194, 168, 0.1);
}

.permission-card.pending {
  border-color: rgba(220, 38, 38, 0.2);
}

.permission-card.pending .permission-icon {
  color: var(--red);
  background: rgba(220, 38, 38, 0.08);
}

.permission-card strong,
.permission-card span,
.permission-card p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.permission-card strong {
  display: block;
  margin-bottom: 4px;
}

.permission-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.permission-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.permission-card em {
  border-radius: 999px;
  padding: 5px 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.permission-card.accepted em {
  background: rgba(0, 194, 168, 0.1);
  color: var(--green);
}

.permission-card.pending em {
  background: rgba(220, 38, 38, 0.08);
  color: var(--red);
}

.quick-card span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.quick-card.static:hover {
  border-color: var(--line);
}

.calendar-card {
  padding: 14px;
  border-left: 4px solid var(--teal);
}

.calendar-card:nth-child(2) {
  border-left-color: var(--blue);
}

.calendar-card:nth-child(3) {
  border-left-color: var(--ink);
}

.calendar-card strong {
  display: block;
  margin-bottom: 5px;
}

.calendar-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.publish-grid,
.diagnosis-grid,
.settings-grid,
.permission-detail-grid {
  align-items: stretch;
}

.publish-form,
.guidance-card,
.panel-card {
  flex: 1;
  min-width: 0;
  padding: 16px;
}

.publish-form {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
}

input[type="file"] {
  padding: 9px;
  background: #f8fafc;
}

textarea {
  resize: vertical;
}

.guidance-card ul,
.check-list,
.warning-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.result-box {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.upload-preview {
  border: 1px dashed rgba(36, 107, 254, 0.28);
  border-radius: 8px;
  background: rgba(36, 107, 254, 0.05);
  padding: 11px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.upload-preview a {
  color: var(--blue);
  font-weight: 800;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.status-strip.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 12px 0;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  min-width: 0;
}

.status-pill strong,
.status-pill span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.status-pill strong {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 12px;
}

.status-pill span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status-pill.ok {
  border-color: rgba(0, 194, 168, 0.28);
  background: rgba(0, 194, 168, 0.08);
}

.status-pill.pending {
  border-color: rgba(220, 38, 38, 0.18);
  background: rgba(220, 38, 38, 0.05);
}

.permission-detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: 14px;
}

.permission-focus-card {
  background:
    linear-gradient(135deg, rgba(0, 194, 168, 0.08), transparent 42%),
    #fff;
}

.permission-icon.ok {
  color: var(--green);
  background: rgba(0, 194, 168, 0.1);
}

.permission-icon.danger {
  color: var(--red);
  background: rgba(220, 38, 38, 0.08);
}

.permission-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

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

.step-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.step-card strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
}

.step-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.secure-note {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid rgba(36, 107, 254, 0.18);
  border-radius: 8px;
  background: rgba(36, 107, 254, 0.06);
  padding: 12px;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.secure-note svg {
  width: 22px;
  height: 22px;
  color: var(--blue);
}

.config-form {
  display: grid;
  gap: 14px;
}

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

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

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

.readonly-field {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.readonly-field strong,
.readonly-field span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.readonly-field strong {
  margin-bottom: 5px;
  font-size: 12px;
}

.readonly-field span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.permission-config-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.modal-open {
  overflow: hidden;
}

.permission-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.permission-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.58);
  backdrop-filter: blur(10px);
}

.permission-dialog {
  position: relative;
  width: min(980px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 12px;
  background:
    radial-gradient(circle at 8% 0%, rgba(0, 194, 168, 0.14), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
  box-shadow: 0 34px 90px rgba(17, 24, 39, 0.34);
  padding: 20px;
  transform-style: preserve-3d;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-head {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: start;
  padding-right: 52px;
}

.modal-head .permission-icon {
  width: 44px;
  height: 44px;
  margin: 0;
}

.modal-head h2 {
  margin-bottom: 4px;
}

.modal-head p,
.modal-description {
  margin: 0;
  color: var(--muted);
}

.modal-description {
  margin: 14px 0;
  line-height: 1.5;
}

.modal-grid {
  margin-top: 12px;
}

.modal-steps {
  grid-template-columns: 1fr;
  margin-top: 14px;
}

.summary-list,
.capability-list,
.insight-list {
  display: grid;
  gap: 9px;
}

.summary-row,
.capability-row,
.insight-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
}

.summary-row strong,
.capability-row strong,
.insight-row strong {
  min-width: 0;
  color: var(--ink);
}

.summary-row span,
.capability-row span,
.insight-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.insight-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(80px, 0.4fr) minmax(0, 1.7fr);
}

.insight-row small {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.chart-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

details {
  margin-top: 10px;
}

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

pre {
  max-width: 100%;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  padding: 13px 14px;
  font-size: 13px;
  font-weight: 800;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: #f8fafc;
  font-weight: 700;
}

.loading-module {
  min-height: 280px;
}

.skeleton-row,
.skeleton-card {
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(90deg, #edf2f7, #f8fafc, #edf2f7);
  background-size: 220% 100%;
  animation: shimmer 1.3s infinite linear;
}

.skeleton-row {
  width: 42%;
  height: 32px;
  margin-bottom: 18px;
}

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

.skeleton-card {
  height: 160px;
}

svg {
  display: block;
}

@keyframes shimmer {
  from {
    background-position: 220% 0;
  }
  to {
    background-position: -220% 0;
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .workspace {
    width: min(100%, 980px);
  }

  .overview-grid,
  .publish-grid,
  .diagnosis-grid,
  .settings-grid,
  .permission-detail-grid,
  .quick-grid,
  .permission-grid,
  .wide-metrics,
  .status-strip,
  .permission-steps,
  .config-grid,
  .config-grid.two-cols,
  .readonly-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 680px) {
  .workspace {
    padding: 18px 12px 34px;
  }

  .topbar,
  .module-heading {
    display: grid;
  }

  .actions,
  .nav,
  .nav-group {
    grid-template-columns: 1fr;
  }

  .profile-card,
  .metrics-grid,
  .media-grid,
  .calendar-grid,
  .quick-grid,
  .permission-grid,
  .wide-metrics,
  .overview-grid,
  .publish-grid,
  .diagnosis-grid,
  .settings-grid,
  .permission-detail-grid,
  .status-strip,
  .permission-steps,
  .config-grid,
  .config-grid.two-cols,
  .readonly-grid {
    grid-template-columns: 1fr;
  }

  .permission-modal {
    padding: 10px;
  }

  .permission-dialog {
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .modal-head {
    grid-template-columns: 40px 1fr;
    padding-right: 44px;
  }

  .modal-head .badge {
    grid-column: 2;
    justify-self: start;
  }

  .permission-card {
    grid-template-columns: 34px 1fr;
  }

  .permission-card em {
    grid-column: 2;
    justify-self: start;
  }

  .summary-row,
  .capability-row,
  .insight-row {
    display: grid;
    gap: 4px;
  }

  .summary-row span,
  .capability-row span,
  .insight-row span {
    text-align: left;
  }
}
