:root {
  --bg: #f6f3ee;
  --surface: #fffdfa;
  --surface-2: #f0ede7;
  --ink: #171614;
  --muted: #6f6a61;
  --line: #ded8cf;
  --accent: #0f766e;
  --accent-2: #c2410c;
  --accent-3: #1d4ed8;
  --good: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --shadow: 0 16px 40px rgba(30, 25, 18, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.login-page {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
  min-height: 100vh;
  background: #f5f4f0;
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8vw;
  background: #173b36;
  color: #fff;
}

.login-brand .brand-mark {
  margin-bottom: 32px;
  background: #f0b37e;
  color: #173b36;
}

.login-brand p {
  margin: 0 0 12px;
  color: #c9ddd5;
  font-weight: 800;
}

.login-brand h1 {
  max-width: 680px;
  margin: 0 0 24px;
  font-size: 48px;
  line-height: 1.12;
  letter-spacing: 0;
}

.login-brand > span {
  color: #f4c29a;
  font-size: 14px;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 7vw, 100px);
  background: #fffdfa;
}

.login-panel h2 {
  margin: 0;
  font-size: 32px;
}

.login-panel > div > p:last-child,
.login-help {
  color: var(--muted);
}

.service-link {
  align-self: flex-start;
  margin-top: 24px;
  text-decoration: none;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.login-form .btn {
  min-height: 46px;
}

.form-message {
  margin-top: 18px;
  padding: 11px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: var(--bad);
  font-size: 13px;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px;
  background: #191816;
  color: #fffdfa;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 26px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.brand p {
  margin: 4px 0 0;
  color: #bab4aa;
  font-size: 12px;
}

.mobile-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  margin-left: auto;
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.1);
  color: #fff;
  font-size: 20px;
}

.nav {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  color: #d8d2c9;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 253, 250, 0.1);
  color: #fffdfa;
}

.nav-section {
  margin: 14px 10px 4px;
  color: #8f887e;
  font-size: 11px;
  font-weight: 800;
}

.nav-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #f4c29a;
}

.sidebar-foot {
  position: static;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 253, 250, 0.12);
  border-radius: 8px;
  color: #cfc8bd;
  font-size: 12px;
  line-height: 1.5;
}

.account-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.account-summary span {
  color: #fff;
  font-weight: 800;
}

.account-summary strong {
  color: #f4c29a;
  font-size: 11px;
}

.sidebar-logout {
  width: 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 253, 250, 0.12);
  background: transparent;
  color: #cfc8bd;
  text-align: left;
}

.sidebar-logout:hover {
  color: #fff;
}

.main {
  min-width: 0;
  padding: 28px 34px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0;
}

.topbar p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

.btn.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
}

.btn.danger {
  background: var(--bad);
}

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

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.42fr);
}

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

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.issue-list {
  display: grid;
  padding: 8px;
}

.issue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.issue-row:hover,
.issue-row.active {
  background: var(--surface-2);
}

.issue-row.active {
  box-shadow: inset 3px 0 var(--accent);
}

.issue-row > span:first-child {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.issue-row strong,
.issue-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issue-row small,
.activity-strip small,
.check-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.title-line,
.left-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.issue-intro {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.publish-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.publish-link span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.publish-link strong {
  overflow: hidden;
  color: var(--accent);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-stack {
  display: grid;
  gap: 10px;
}

.activity-strip {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.order-index {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.activity-picker {
  display: grid;
  gap: 8px;
}

.check-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 64px;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.check-row input[type="checkbox"],
.consent-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.check-row .order-input {
  min-height: 36px;
  padding: 6px;
  text-align: center;
}

.weekly-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f6f2;
}

.weekly-preview > header {
  padding: 38px 28px;
  background: #173b36;
  color: #fff;
}

.weekly-preview > header p {
  color: #f4c29a;
  font-size: 12px;
  font-weight: 800;
}

.weekly-preview > header h1 {
  margin: 10px 0 12px;
  font-size: 34px;
  letter-spacing: 0;
}

.weekly-preview > header span {
  line-height: 1.7;
}

.weekly-event-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.weekly-event-list article {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.weekly-event-list h2 {
  margin: 3px 0 7px;
  font-size: 18px;
}

.weekly-event-list p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.date-block {
  display: grid;
  gap: 3px;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}

.date-block strong {
  font-size: 20px;
}

.date-block span,
.weekly-event-list small,
.weekly-event-list article > div > span {
  color: var(--muted);
  font-size: 12px;
}

.flow-steps {
  display: grid;
  gap: 12px;
}

.flow-steps > div {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.flow-steps > div > strong {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}

.flow-steps span {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.offline-state,
.success-state {
  display: grid;
  gap: 8px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  text-align: center;
}

.offline-state strong,
.success-state strong {
  font-size: 22px;
}

.offline-state span,
.success-state span {
  color: var(--muted);
}

.consent-row {
  display: flex;
  grid-column: 1 / -1;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.permission-summary {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.permission-summary span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.settings-panel {
  max-width: 820px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-body {
  padding: 18px;
}

.stat {
  padding: 18px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.stat small {
  color: var(--accent);
  font-weight: 700;
}

.category-panel {
  margin-top: 18px;
}

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

.category-filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.category-filter-item:hover,
.category-filter-item.active {
  border-color: var(--accent);
  background: #e8f2ee;
  color: #0c625a;
}

.category-filter-item strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 12px;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e3eee9;
  color: #12665e;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.stacked-title {
  display: block;
  margin: 6px 0 3px;
}

.sequence-label {
  margin-left: 7px;
}

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

.table th,
.table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.table tr:last-child td {
  border-bottom: 0;
}

.row-title {
  display: block;
  color: var(--ink);
  font-weight: 800;
}

.sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.badge.live {
  background: #dcfce7;
  color: var(--good);
}

.badge.draft {
  background: #fef3c7;
  color: var(--warn);
}

.badge.closed {
  background: #fee2e2;
  color: var(--bad);
}

.badge.neutral {
  background: #e5e7eb;
  color: #4b5563;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.search {
  width: 320px;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.readonly-control {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
}

.field textarea {
  min-height: 104px;
  resize: vertical;
}

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

.template-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.template-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.template-visual {
  height: 94px;
  padding: 13px;
  color: #fff;
}

.template-visual.apple {
  background: linear-gradient(135deg, #0f0f10, #8b949e);
}

.template-visual.business {
  background: linear-gradient(135deg, #10352f, #c58f5c);
}

.template-visual.technology {
  background: linear-gradient(135deg, #0b1220, #2563eb);
}

.template-visual.brand {
  background: linear-gradient(135deg, #7c2d12, #0f766e);
}

.template-visual strong {
  display: block;
  font-size: 18px;
}

.template-card footer {
  padding: 12px;
}

.template-card h4 {
  margin: 0 0 4px;
  font-size: 14px;
}

.template-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.preview-hero {
  min-height: 260px;
  padding: 34px;
  color: #fff;
}

.preview-hero h1 {
  max-width: 620px;
  margin: 0 0 14px;
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: 0;
}

.preview-hero p {
  max-width: 660px;
  margin: 0 0 22px;
  line-height: 1.7;
}

.preview-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  padding: 22px;
}

.mini-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.mini-section h4 {
  margin: 0 0 8px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.version-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 92px;
}

.btn.compact {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
}

@media (max-width: 640px) {
  .version-actions {
    padding-left: 0;
  }
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  width: 520px;
  height: 100vh;
  padding: 24px;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.18);
  transform: translateX(110%);
  transition: transform 0.2s ease;
  overflow: auto;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.drawer-head h3 {
  margin: 0;
  font-size: 22px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  padding: 13px 16px;
  border-radius: 8px;
  background: #191816;
  color: #fffdfa;
  box-shadow: var(--shadow);
  transform: translateY(120px);
  transition: transform 0.2s ease;
}

.toast.show {
  transform: translateY(0);
}

.empty {
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.codebox {
  overflow: auto;
  max-height: 360px;
  padding: 14px;
  border-radius: 8px;
  background: #111;
  color: #e7e5e4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

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

.pill-input {
  display: flex;
  gap: 8px;
}

.pill-input input {
  min-width: 0;
}

.link-card {
  display: grid;
  gap: 12px;
}

.activity-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px auto auto;
  gap: 10px;
  margin-bottom: 16px;
}

.activity-filters .search {
  width: 100%;
}

.registration-stats {
  margin-bottom: 18px;
}

.registration-data-panel {
  margin-top: 18px;
}

.registration-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(220px, 1.3fr) repeat(2, minmax(130px, 0.7fr));
  gap: 10px;
  margin-bottom: 16px;
}

.registration-filters .search {
  width: 100%;
}

.registration-filters .btn {
  justify-self: start;
}

.registration-table th:nth-child(2),
.registration-table td:nth-child(2) {
  min-width: 220px;
}

.registration-table th:last-child,
.registration-table td:last-child {
  width: 74px;
}

.inline-link {
  display: block;
  margin-top: 7px;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.activity-table td:last-child {
  min-width: 280px;
}

.row-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-detail {
  display: grid;
  gap: 20px;
}

.activity-detail-topbar {
  align-items: flex-end;
}

.activity-detail-topbar > div:first-child {
  min-width: 0;
}

.activity-detail-topbar h2 {
  overflow-wrap: anywhere;
}

.back-button {
  margin-bottom: 14px;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.activity-overview-band {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.activity-status-line,
.section-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

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

.activity-content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.activity-content-grid article {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
}

.activity-content-grid span,
.publishing-meta-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.activity-content-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.activity-publish-panel,
.activity-versions-panel {
  margin-top: 18px;
}

.publish-panel-head {
  gap: 18px;
}

.section-title-line h3 {
  font-size: 18px;
}

.publishing-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 22px;
  align-items: start;
}

.publishing-preview,
.publishing-controls {
  min-width: 0;
}

.publishing-controls {
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.subsection-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.subsection-heading strong {
  font-size: 14px;
}

.subsection-heading span,
.link-availability {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.link-availability {
  margin: -4px 0 0;
}

.publishing-controls .qr-share-card {
  grid-template-columns: 1fr;
}

.publishing-controls .qr-preview {
  width: min(190px, 100%);
}

.publishing-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.publishing-meta-grid > div {
  min-width: 0;
}

.publishing-meta-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.55;
}

.version-count {
  color: var(--muted);
  font-size: 12px;
}

.activity-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.detail-grid > div {
  min-width: 0;
  padding: 14px;
  background: var(--surface);
}

.detail-grid span,
.detail-copy > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-grid strong {
  overflow-wrap: anywhere;
}

.detail-copy,
.qr-detail-section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.detail-copy p,
.qr-detail-section > div > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.qr-detail-section > div {
  margin-bottom: 14px;
}

.qr-detail-section h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.qr-share-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.qr-preview {
  width: 220px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qr-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-share-content {
  min-width: 0;
}

.qr-share-content > strong {
  display: block;
  font-size: 16px;
}

.qr-share-content > p {
  margin: 7px 0 14px;
  color: var(--muted);
  line-height: 1.65;
}

.qr-share-content > small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.upload-qr-button {
  cursor: pointer;
}

.link-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.link-display input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  outline: 0;
}

.registration-page {
  display: grid;
  gap: 18px;
}

.idea-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

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

.permission-panel,
.account-panel {
  margin-top: 18px;
}

.question-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.idea-link-panel {
  margin-bottom: 18px;
}

.idea-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(130px, auto)) auto;
  gap: 10px;
  margin-bottom: 18px;
}

.idea-filters input,
.idea-filters select,
.comment-form textarea {
  width: 100%;
}

.question-filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(135px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

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

.question-table td:first-child {
  min-width: 280px;
  max-width: 420px;
}

.question-table td:nth-child(4) {
  min-width: 190px;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.table-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.drawer-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.drawer-section h3 {
  margin: 0 0 14px;
}

.idea-thread {
  display: grid;
  gap: 10px;
}

.idea-thread article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.idea-thread article small {
  float: right;
  color: var(--muted);
}

.idea-thread article p {
  margin: 9px 0;
  line-height: 1.7;
  white-space: pre-wrap;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bad);
  cursor: pointer;
}

.comment-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.registration-page .field {
  margin-top: 0;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

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

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 290px;
    padding: 36px 24px;
  }

  .login-brand h1 {
    font-size: 32px;
  }

  .login-panel {
    padding: 36px 24px;
  }

  .sidebar {
    position: sticky;
    z-index: 15;
    top: 0;
    height: auto;
    padding: 12px 16px;
  }

  .brand {
    padding: 0;
  }

  .mobile-nav-toggle {
    display: grid;
    place-items: center;
  }

  .sidebar .nav,
  .sidebar .sidebar-foot {
    display: none;
  }

  .sidebar.menu-open .nav {
    display: grid;
    max-height: calc(100vh - 96px);
    margin-top: 14px;
  }

  .sidebar.menu-open .sidebar-foot {
    display: block;
  }

  .sidebar-foot {
    position: static;
    margin-top: 20px;
  }

  .main {
    padding: 22px 16px;
  }

  .topbar,
  .grid.two,
  .grid.three,
  .workspace-grid,
  .form-grid,
  .preview-body,
  .activity-detail-grid,
  .activity-content-grid,
  .publishing-workspace,
  .publishing-meta-grid {
    grid-template-columns: 1fr;
  }

  .idea-stats,
  .account-stats,
  .idea-filters,
  .question-stats,
  .question-filters,
  .activity-filters,
  .registration-filters,
  .registration-detail-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .publishing-controls {
    padding-top: 20px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .publish-panel-head .actions {
    justify-content: flex-start;
  }

  .activity-danger-zone {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

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

  .qr-preview {
    width: min(220px, 100%);
  }

  .drawer {
    width: 100%;
  }

  .publish-link,
  .activity-strip,
  .weekly-event-list article {
    grid-template-columns: 1fr;
  }

  .date-block {
    padding-right: 0;
    border-right: 0;
  }
}
