:root {
  --bg: #eef0f3;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --line: rgba(17, 17, 17, 0.12);
  --text: #101010;
  --muted: #69707a;
  --accent: #ff6a00;
  --accent-2: #7c4dff;
  --accent-soft: rgba(255, 106, 0, 0.14);
  --violet-soft: rgba(124, 77, 255, 0.14);
  --green: #34c779;
  --green-soft: #ddf7e9;
  --amber: #ffc700;
  --amber-soft: #fff0ba;
  --rose-soft: #ffe1dc;
  --ink: #111111;
  --shadow: 0 22px 60px rgba(24, 26, 29, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 86% 10%, rgba(255, 106, 0, 0.16), transparent 28%),
    radial-gradient(circle at 12% 84%, rgba(124, 77, 255, 0.13), transparent 30%),
    linear-gradient(180deg, #f9fafb 0%, var(--bg) 100%);
}

.local-runtime-message {
  max-width: 680px;
  margin: 12vh auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.local-runtime-message h1 {
  margin: 0 0 12px;
}

.local-runtime-message p {
  color: var(--muted);
  line-height: 1.5;
}

.local-runtime-message a {
  color: var(--accent);
  font-weight: 800;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-card {
  width: min(460px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.auth-brand-mark {
  margin-bottom: 18px;
}

.auth-card h1 {
  margin: 0 0 10px;
  font-size: 2rem;
}

.auth-card p {
  color: var(--muted);
  line-height: 1.5;
}

.auth-message {
  padding: 10px 12px;
  border: 1px solid #ffd0bf;
  border-radius: 10px;
  background: #fff3ee;
  color: var(--accent) !important;
}

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

.shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 28px 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: white;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 106, 0, 0.18), transparent 28%),
    linear-gradient(180deg, #151515 0%, #0d0d0f 100%);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 0;
  display: grid;
  place-items: center;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand h1,
.workspace-header h2,
.editor-copy h3,
.editor-copy h4,
.insight-block h4,
.score-card h3 {
  margin: 0;
}

.brand h1 {
  font-size: 25px;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.brand:hover h1 {
  color: #ffffff;
}

.eyebrow,
.helper-text,
.board-meta,
.article-meta,
.block-title span,
.timeline span,
.timeline strong,
.stat-triplet span {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.nav-item,
.ghost-button,
.dark-button,
.primary-button,
.tool-group button,
.editor-toolbar button,
.tab-row button {
  border: 0;
  cursor: pointer;
}

.nav-item {
  padding: 12px 14px;
  border-radius: 14px;
  text-align: left;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
}

.nav-item.active {
  background: white;
  color: var(--text);
  box-shadow: var(--shadow);
}

.nav-divider {
  height: 1px;
  margin: 12px 0 8px;
  background: rgba(255, 255, 255, 0.12);
}

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

.nav-admin.is-hidden {
  display: none;
}

.nav-item.is-hidden {
  display: none;
}

.nav-admin summary {
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

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

.nav-admin summary::after {
  float: right;
  color: rgba(255, 255, 255, 0.56);
  content: "⌄";
}

.nav-admin[open] summary {
  background: rgba(255, 255, 255, 0.08);
}

.nav-subitem {
  margin-left: 10px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.64);
  cursor: pointer;
  text-align: left;
  font-weight: 700;
}

.nav-subitem:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.intake-card,
.mini-stats {
  padding: 18px;
}

.intake-card h2,
.mini-stats h3 {
  margin: 0 0 14px;
  font-size: 24px;
  line-height: 1.1;
}

.input-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
}

textarea {
  resize: vertical;
  min-height: 110px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
  margin: 14px 0;
}

.primary-button,
.dark-button {
  color: white;
  background: linear-gradient(135deg, #111111, var(--accent));
  box-shadow: 0 16px 32px rgba(255, 106, 0, 0.18);
}

.primary-button,
.ghost-button,
.dark-button {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  font-weight: 700;
}

.ghost-button {
  width: auto;
  background: white;
  color: var(--text);
  border: 1px solid var(--line);
}

.dark-button {
  width: auto;
}

.helper-text {
  margin-bottom: 0;
  line-height: 1.5;
}

.mini-stats {
  margin-top: 18px;
}

.user-directory {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.user-add-button {
  justify-self: start;
  margin-top: 8px;
}

.user-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  table-layout: fixed;
}

.user-table th,
.user-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.user-table th {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.user-table th:nth-child(1),
.user-table td:nth-child(1) {
  width: 19%;
}

.user-table th:nth-child(2),
.user-table td:nth-child(2) {
  width: 27%;
}

.user-table th:nth-child(3),
.user-table td:nth-child(3) {
  width: 14%;
}

.user-table th:nth-child(4),
.user-table td:nth-child(4) {
  width: 26%;
}

.user-table th:nth-child(5),
.user-table td:nth-child(5) {
  width: 14%;
}

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

.user-table a {
  color: var(--text);
  text-decoration: none;
}

.user-edit-button {
  min-width: 132px;
}

.role-pill {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 900;
  text-transform: capitalize;
}

.user-edit-button {
  white-space: nowrap;
}

.user-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.user-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.danger-button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  color: #fff;
  background: #c9342d;
  cursor: pointer;
  font-weight: 900;
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.small-danger-button {
  padding: 9px 12px;
  border-radius: 12px;
  white-space: nowrap;
}

.project-access-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
}

.project-access-option {
  display: grid;
  grid-template-columns: 20px 24px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}

.project-access-option:hover {
  background: rgba(255, 106, 0, 0.08);
}

.project-access-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.project-access-option input:disabled {
  cursor: not-allowed;
}

.access-checkmark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: transparent;
  background: rgba(111, 101, 89, 0.12);
  font-size: 13px;
  font-weight: 900;
}

.project-access-option input:checked + .access-checkmark {
  color: white;
  background: var(--accent);
}

.user-card {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

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

.user-card span {
  margin: 4px 0;
  color: var(--muted);
  text-transform: capitalize;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 12px;
}

.timeline li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.timeline li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.workspace {
  position: relative;
  z-index: 1;
  padding: 26px;
  background:
    radial-gradient(circle at 86% 10%, rgba(255, 106, 0, 0.12), transparent 28%),
    radial-gradient(circle at 12% 84%, rgba(124, 77, 255, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(249, 250, 251, 0.92) 0%, rgba(238, 240, 243, 0.94) 100%);
}

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

.project-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  padding: 9px 12px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 38px rgba(17, 17, 17, 0.08);
  overflow: hidden;
}

.project-switcher::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.08), rgba(124, 77, 255, 0.08));
}

.project-switcher::after {
  position: absolute;
  right: 14px;
  top: 50%;
  pointer-events: none;
  color: var(--ink);
  content: "⌄";
  transform: translateY(-54%);
}

.project-switcher span {
  position: relative;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.project-switcher select {
  position: relative;
  appearance: none;
  width: auto;
  min-width: 175px;
  padding: 7px 34px 7px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.project-switcher select:focus {
  outline: 2px solid rgba(255, 106, 0, 0.28);
  outline-offset: 2px;
}

.profile-menu {
  position: relative;
}

.profile-button {
  min-width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.03em;
  box-shadow: 0 16px 34px rgba(255, 106, 0, 0.22);
}

.profile-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 12;
  display: none;
  width: 280px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.profile-popover.visible {
  display: grid;
  gap: 10px;
}

.profile-summary {
  display: grid;
  gap: 4px;
  color: var(--ink);
}

.profile-summary-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-summary strong {
  font-size: 15px;
}

.profile-summary span:not(.profile-summary-label),
.profile-summary small {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.dashboard-panel {
  padding: 20px;
  margin-bottom: 22px;
}

.dashboard-view {
  display: grid;
  gap: 18px;
}

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

.dashboard-focus-card {
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 30px rgba(16, 24, 40, 0.06);
}

.dashboard-focus-card span,
.dashboard-focus-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.dashboard-focus-card span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-focus-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 34px;
  line-height: 1;
}

.dashboard-focus-card.is-danger {
  border-color: rgba(211, 47, 47, 0.32);
  background: rgba(255, 241, 239, 0.88);
}

.dashboard-focus-card.is-ok {
  border-color: rgba(57, 163, 110, 0.3);
  background: rgba(237, 251, 244, 0.88);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.dashboard-side {
  display: grid;
  gap: 18px;
}

.dashboard-next-panel {
  display: grid;
  gap: 16px;
}

.dashboard-next-link {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 106, 0, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 244, 237, 0.82));
  color: var(--text);
  text-decoration: none;
}

.dashboard-next-link:hover {
  border-color: rgba(255, 106, 0, 0.56);
  background: white;
}

.dashboard-next-link span,
.dashboard-next-link small,
.dashboard-next-meta small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.dashboard-next-link span {
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-next-link strong {
  display: block;
  margin-bottom: 4px;
  font-size: 22px;
  line-height: 1.2;
}

.dashboard-next-meta {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 8px;
  min-width: 150px;
}

.week-progress {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.week-progress-ring {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  border: 10px solid rgba(255, 106, 0, 0.18);
  background: white;
  color: var(--text);
  font-weight: 900;
}

.week-progress strong,
.week-progress span {
  display: block;
}

.week-progress span {
  margin-top: 5px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.4;
}

.dashboard-badges {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.mini-badge {
  display: block;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
}

.mini-badge strong,
.mini-badge small,
.mini-badge em {
  display: block;
}

.mini-badge strong {
  color: var(--text);
}

.mini-badge em {
  margin-top: 2px;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.mini-badge.earned {
  border-color: rgba(102, 85, 202, 0.28);
  background: rgba(246, 244, 255, 0.82);
}

.dashboard-kanban {
  display: grid;
  gap: 10px;
}

.kanban-status-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.kanban-status-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.kanban-status-card span,
.kanban-status-card small {
  color: var(--muted);
  font-weight: 800;
}

.kanban-status-card strong {
  font-size: 22px;
}

.kanban-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
}

.kanban-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff6a00, #6655ca);
}

.briefing-view {
  padding: 22px;
  margin-bottom: 22px;
}

.briefing-generator-card {
  max-width: 860px;
}

.briefing-search-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr);
  gap: 12px;
}

.briefing-search-row {
  display: grid;
  grid-template-columns: auto;
  gap: 12px;
  justify-content: start;
  margin-top: 12px;
}

.briefing-generator-status {
  min-height: 24px;
  margin-top: 16px;
  color: var(--muted);
  font-weight: 700;
}

.loading-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--blue);
  animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.75);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.button-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.button-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin-button 0.8s linear infinite;
}

@keyframes spin-button {
  to {
    transform: rotate(360deg);
  }
}

.briefing-result-card {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

#briefing-generator-output {
  width: 100%;
  min-height: 420px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.82);
  font: 500 14px/1.55 "Manrope", sans-serif;
  color: var(--text);
}

.briefing-history {
  margin-top: 26px;
}

.briefing-history-item {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.dashboard-task-list {
  display: grid;
  gap: 10px;
}

.dashboard-task {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-decoration: none;
}

.dashboard-task:hover {
  border-color: rgba(255, 106, 0, 0.34);
  background: white;
}

.dashboard-task strong,
.dashboard-task span,
.dashboard-task small {
  display: block;
}

.dashboard-task span,
.dashboard-task small,
.empty-state span {
  color: var(--muted);
}

.dashboard-list-note {
  padding: 8px 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.empty-state {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.view-hidden {
  display: none;
}

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

.workspace-header h2 {
  max-width: 900px;
  font-size: 38px;
  line-height: 1.05;
}

.workspace-header h2.editable-title {
  cursor: text;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(255, 106, 0, 0.38);
  text-underline-offset: 8px;
}

.workspace-header h2.editable-title:hover {
  text-decoration-color: rgba(255, 106, 0, 0.88);
}

.workspace-title-input {
  width: min(1120px, 100%);
  min-height: 128px;
  padding: 16px 18px;
  border: 2px solid var(--accent);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-family: inherit;
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 800;
  line-height: 1.12;
  resize: vertical;
  box-shadow: 0 0 0 5px rgba(255, 106, 0, 0.16), var(--shadow);
}

.header-actions {
  display: flex;
  gap: 12px;
}

.board {
  padding: 18px;
  margin-bottom: 22px;
}

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

.board-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.table-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(210px, 0.55fr) auto;
  gap: 10px;
  align-items: end;
}

.table-filter-input {
  max-width: none;
}

.table-filter-select {
  min-width: 0;
  min-height: 116px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.table-filter-select[multiple] {
  background: rgba(255, 255, 255, 0.82);
}

.table-filter-select:not([multiple]) {
  min-height: 50px;
  padding-top: 0;
  padding-bottom: 0;
}

.filter-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.filter-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reset-filters-button {
  align-self: end;
  min-width: 150px;
}

.tab-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-row button {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
}

.tab-row button.active {
  background: var(--accent);
  color: white;
}

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

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

.pagination-summary,
.pagination-actions span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination-actions a,
.pagination-disabled {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.pagination-actions a {
  cursor: pointer;
}

.pagination-disabled {
  opacity: 0.45;
}

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

tbody tr.selected-row {
  background: rgba(255, 106, 0, 0.07);
}

tbody tr[data-action="open-item"] {
  cursor: pointer;
}

tbody tr[data-action="open-item"]:hover {
  background: rgba(255, 106, 0, 0.05);
}

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

th {
  font-size: 13px;
  color: var(--muted);
}

th[data-sort-key] {
  cursor: pointer;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.sort-indicator {
  min-width: 12px;
  color: rgba(255, 106, 0, 0.72);
  font-size: 12px;
}

th.sort-active .sort-button {
  color: var(--ink);
}

td strong {
  display: block;
  margin-bottom: 4px;
}

.action-cell {
  min-width: 172px;
}

.row-actions {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.row-edit-button {
  min-width: 124px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px 0 0 14px;
  background: white;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.row-menu-details {
  position: relative;
}

.row-menu-toggle {
  width: 42px;
  min-height: 100%;
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
  border-radius: 0 14px 14px 0;
  background: white;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  font-weight: 900;
}

.row-menu-toggle::-webkit-details-marker {
  display: none;
}

.row-action-menu {
  position: absolute;
  right: 0;
  z-index: 15;
  display: grid;
  min-width: 180px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: var(--shadow);
}

.row-action-menu button {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.row-action-menu button:hover {
  background: rgba(255, 106, 0, 0.1);
}

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

.country-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.country-de {
  background: rgba(255, 215, 84, 0.25);
  color: #8a5a00;
}

.country-at {
  background: rgba(255, 74, 74, 0.16);
  color: #b4232f;
}

.content-row-link {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.content-row-link:hover {
  color: var(--accent);
}

.progress {
  width: 140px;
  height: 8px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.1);
  overflow: hidden;
  margin-top: 6px;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.status-published {
  background: var(--green-soft);
  color: #2c6b36;
}

.status-briefing {
  background: var(--violet-soft);
  color: var(--accent-2);
}

.status-final {
  background: var(--amber-soft);
  color: #946213;
}

.status-reoptimization {
  background: var(--rose-soft);
  color: #9b4b43;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 420px);
  gap: 22px;
}

.editor-grid.cds-wide-mode {
  grid-template-columns: minmax(720px, 980px);
}

.editor-grid.cds-wide-mode .insights-panel {
  max-width: 980px;
}

.editor-grid.editor-hidden {
  display: none;
}

.cds-subnav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.cds-subnav.editor-hidden {
  display: none;
}

.cds-tab {
  padding: 12px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.cds-tab.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.surfer-frame-shell {
  margin-top: 16px;
}

.surfer-link-only {
  display: flex;
  min-height: 240px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  border: 1px dashed rgba(17, 17, 17, 0.18);
  border-radius: 22px;
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 106, 0, 0.12), transparent 30%),
    rgba(255, 255, 255, 0.72);
}

.surfer-link-only span {
  max-width: 560px;
  color: var(--muted);
  line-height: 1.5;
}

.surfer-open-button {
  display: inline-flex;
  width: auto;
  text-decoration: none;
}

.item-workflow-add-form input[type="date"],
.workflow-due-date {
  cursor: pointer;
}

.editor-panel,
.insights-panel {
  padding: 20px;
}

.editor-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tool-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-group button {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
}

.article-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.research-banner {
  display: none;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 245, 214, 0.92);
  color: #80520e;
  border: 1px solid rgba(179, 126, 20, 0.18);
  line-height: 1.5;
}

.research-banner.visible {
  display: block;
}

.editor-copy {
  font-family: "Source Serif 4", serif;
  line-height: 1.65;
}

.editor-copy .kicker {
  color: var(--muted);
  font-family: "Manrope", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.editor-copy h3 {
  font-size: 52px;
  line-height: 0.98;
  max-width: 12ch;
  margin-bottom: 24px;
}

.editor-copy h4 {
  font-family: "Manrope", sans-serif;
  font-size: 32px;
  margin: 34px 0 10px;
}

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

.score-card h3 {
  font-size: 52px;
}

.score-card h3 span {
  font-size: 20px;
  color: var(--muted);
}

.meter {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 8px;
  background: conic-gradient(#5bb86b 0deg 266deg, #dcefe0 266deg 360deg);
}

.meter-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--panel-strong);
}

.stat-triplet {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.stat-triplet div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.stat-triplet strong,
.alert-step strong {
  display: block;
}

.insight-block {
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-edit-form {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.assignment-form {
  display: grid;
  gap: 10px;
}

.assignment-button {
  margin-top: 6px;
}

.detail-save-status {
  color: var(--muted);
  font-size: 12px;
}

.assignment-button.loading {
  position: relative;
  padding-left: 42px;
}

.assignment-button.loading::before {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid rgba(255, 106, 0, 0.18);
  border-top-color: var(--accent);
  border-radius: 999px;
  content: "";
  animation: spin 0.8s linear infinite;
}

.briefing-status {
  display: none;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 106, 0, 0.24);
  border-radius: 14px;
  background: rgba(255, 106, 0, 0.08);
  color: var(--muted);
}

.briefing-status:not(:empty) {
  display: flex;
}

.briefing-status strong {
  color: var(--text);
}

.spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid rgba(255, 106, 0, 0.18);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.briefing-editor-loading {
  background:
    linear-gradient(90deg, rgba(255, 106, 0, 0.04), rgba(255, 106, 0, 0.14), rgba(255, 106, 0, 0.04)),
    rgba(255, 255, 255, 0.74);
  background-size: 220% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

.content-edit-form {
  display: grid;
  gap: 10px;
}

.comment-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.comment-list {
  display: grid;
  gap: 10px;
}

.comment-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.comment-item strong,
.comment-item span,
.comment-item p,
.comment-item small {
  display: block;
}

.comment-item p {
  margin: 8px 0;
  line-height: 1.5;
}

.detail-card,
.link-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.detail-card span,
.link-card span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.detail-card strong,
.link-card strong,
.link-card a {
  display: block;
  color: var(--text);
  word-break: break-word;
}

.link-card-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--text);
  font: inherit;
}

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

.history-list {
  display: grid;
  gap: 10px;
}

.mail-preview-list {
  display: grid;
  gap: 12px;
}

.mail-preview-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

.mail-preview-meta,
.mail-preview-subject {
  display: grid;
  gap: 4px;
}

.mail-preview-meta span,
.mail-preview-subject span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mail-preview-meta small {
  color: var(--muted);
}

.mail-preview-details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  overflow: hidden;
}

.mail-preview-details summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 800;
}

.mail-preview-frame {
  display: block;
  width: 100%;
  height: 520px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #f6f2ee;
}

.mail-preview-details pre {
  margin: 0;
  padding: 14px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.mail-preview-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
}

.history-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.history-item strong,
.history-item span,
.history-item small {
  display: block;
}

.history-item span {
  margin: 4px 0;
  color: var(--muted);
}

.block-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
}

.signal-list {
  padding-left: 18px;
  margin: 0;
}

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

.chip {
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 14px;
  background: var(--green-soft);
}

.chip.warning {
  background: var(--amber-soft);
}

.chip.missing {
  background: var(--rose-soft);
}

.fact-card,
.alert-step {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.fact-card h5 {
  margin: 0 0 8px;
  font-size: 18px;
}

.fact-snippet {
  padding: 14px;
  border-radius: 16px;
  background: rgba(238, 240, 243, 0.92);
}

.alert-flow {
  display: grid;
  gap: 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: rgba(17, 17, 17, 0.42);
}

@media (min-width: 1181px) {
  .modal-backdrop {
    left: 320px;
  }
}

.nested-modal {
  z-index: 30;
  background: rgba(17, 17, 17, 0.5);
}

.modal-backdrop.visible {
  display: flex;
}

.settings-modal {
  width: min(1420px, 100%);
  max-height: min(860px, calc(100vh - 52px));
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
  box-shadow: 0 28px 80px rgba(24, 26, 29, 0.22);
}

.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.settings-header h2 {
  margin: 0;
  font-size: 28px;
}

.confirm-modal {
  max-width: 520px;
}

.confirm-content {
  display: grid;
  gap: 18px;
  padding-top: 18px;
}

.confirm-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  padding-top: 22px;
}

.settings-section {
  min-width: 0;
}

.admin-section-hidden {
  display: none;
}

.project-admin-list {
  display: grid;
  gap: 10px;
}

.project-admin-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.project-admin-card span {
  color: var(--muted);
}

.mail-admin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.mail-admin-card,
.mail-test-form,
.mail-template-form,
.mail-template-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.mail-status-head {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.mail-status-head strong,
.mail-status-head small {
  display: block;
}

.mail-status-head small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.mail-status-dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 999px;
  background: #d92d20;
  box-shadow: 0 0 0 5px rgba(217, 45, 32, 0.12);
}

.mail-status-dot.is-configured {
  background: #259b66;
  box-shadow: 0 0 0 5px rgba(37, 155, 102, 0.14);
}

.mail-status-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.mail-status-list div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.mail-status-list dt,
.mail-status-list dd {
  margin: 0;
}

.mail-status-list dt {
  color: var(--muted);
  font-weight: 800;
}

.mail-status-list dd {
  word-break: break-word;
  font-weight: 800;
}

.mail-test-form {
  display: grid;
  gap: 10px;
}

.mail-template-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.mail-template-list {
  display: grid;
  gap: 12px;
}

.mail-template-card {
  display: grid;
  gap: 10px;
}

.mail-template-card h5 {
  margin: 0;
  font-size: 1rem;
}

.mail-template-card textarea {
  min-height: 92px;
  resize: vertical;
}

.mail-template-help {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.mail-test-result {
  min-height: 44px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-weight: 800;
  line-height: 1.4;
}

.mail-test-result.is-success {
  border-color: rgba(37, 155, 102, 0.26);
  background: rgba(237, 251, 244, 0.9);
  color: #176b45;
}

.mail-test-result.is-error {
  border-color: rgba(217, 45, 32, 0.24);
  background: rgba(255, 241, 239, 0.92);
  color: #9f1d14;
}

.audit-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.audit-toolbar strong,
.audit-toolbar span {
  display: block;
}

.audit-toolbar span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.audit-log-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.audit-log-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.4fr);
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.audit-log-main,
.audit-log-meta {
  display: grid;
  gap: 4px;
}

.audit-log-main strong {
  font-size: 0.98rem;
}

.audit-log-main span,
.audit-log-main small,
.audit-log-meta span,
.audit-log-meta time,
.audit-empty {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.audit-log-main small {
  word-break: break-word;
}

.audit-log-meta {
  text-align: right;
}

.audit-empty {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.project-form {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px dashed rgba(255, 106, 0, 0.34);
  border-radius: 16px;
  background: rgba(255, 106, 0, 0.06);
}

.project-form-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
}

.workflow-preview {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.workflow-admin-form,
.workflow-admin-list,
.workflow-admin-tasks,
.workflow-custom-task {
  display: grid;
  gap: 12px;
}

.workflow-admin-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  position: relative;
  margin: 12px 0 18px;
  padding: 14px 6px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.workflow-admin-tabs::before {
  content: "";
  position: absolute;
  top: 26px;
  left: 25%;
  right: 25%;
  height: 3px;
  background: #d2d6de;
  z-index: 0;
}

.workflow-admin-tab {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 72px;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.workflow-admin-tab span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 4px solid #d2d6de;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 18px;
}

.workflow-admin-tab.active {
  color: var(--text);
  background: transparent;
  box-shadow: none;
}

.workflow-admin-tab.active span {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.workflow-admin-tab-muted {
  cursor: default;
  opacity: 0.75;
}

.workflow-admin-help {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid rgba(255, 106, 0, 0.2);
  border-radius: 10px;
  color: var(--accent);
  background: rgba(255, 106, 0, 0.1);
  font-weight: 700;
}

.info-dot {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.workflow-status-section {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.workflow-status-section h5 {
  margin: 0;
  font-size: 17px;
}

.workflow-stage-title-input {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 900;
}

.workflow-stage-title-input:focus,
.workflow-task-name-input:focus {
  outline: 2px solid rgba(255, 106, 0, 0.26);
  outline-offset: 4px;
}

.workflow-task-list {
  display: grid;
  gap: 0;
  padding: 14px;
  border: 14px solid #edf0f4;
  background: white;
}

.workflow-task-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 10px 0;
}

.workflow-template-task-row {
  cursor: grab;
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease,
    transform 0.16s ease;
}

.workflow-template-task-row:active {
  cursor: grabbing;
}

.workflow-template-task-row.dragging {
  opacity: 0.55;
  transform: scale(0.995);
}

.workflow-template-task-row.workflow-template-drop-target,
.workflow-task-list.workflow-template-drop-target {
  border-radius: 12px;
  background: rgba(255, 106, 0, 0.08);
  box-shadow: inset 0 0 0 2px rgba(255, 106, 0, 0.44);
}

.workflow-task-row + .workflow-task-row {
  border-top: 1px solid rgba(63, 51, 38, 0.08);
}

.workflow-task-check {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 2px solid #7f93a8;
  color: #51667a;
  font-size: 12px;
  font-weight: 900;
}

.workflow-task-name-input {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #607086;
  font-size: 17px;
}

.workflow-task-delete {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(63, 51, 38, 0.1);
  border-radius: 999px;
  color: #53677c;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  font-size: 18px;
}

.workflow-template-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.workflow-task-clock {
  min-width: 54px;
  height: 38px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 106, 0, 0.26);
  border-radius: 999px;
  background: rgba(255, 106, 0, 0.08);
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.workflow-stage-heading {
  font-weight: 900;
}

.workflow-assignment-task {
  grid-template-columns: 22px minmax(180px, 0.4fr) minmax(280px, 1fr);
  align-items: start;
}

.assignment-dropdown {
  position: relative;
}

.assignment-dropdown summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  cursor: pointer;
  list-style: none;
}

.assignment-dropdown summary::-webkit-details-marker {
  display: none;
}

.assignment-menu {
  position: absolute;
  z-index: 2000;
  display: grid;
  gap: 6px;
  min-width: 340px;
  max-height: none;
  overflow: visible;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: left;
}

.assignment-menu-options {
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.assignment-option {
  display: grid;
  grid-template-columns: 18px 28px minmax(0, 1fr) 18px;
  gap: 10px;
  align-items: center;
  justify-items: start;
  width: 100%;
  direction: ltr;
  text-align: left;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  white-space: normal;
  cursor: pointer;
}

.assignment-option:hover {
  background: rgba(255, 106, 0, 0.06);
  border-color: rgba(255, 106, 0, 0.2);
}

.assignment-option:has(input:checked) {
  background: rgba(255, 106, 0, 0.1);
  border-color: rgba(255, 106, 0, 0.3);
}

.assignment-option-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

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

.assignment-option-text small {
  color: var(--muted);
  font-size: 12px;
}

.assignment-option-check {
  color: var(--accent);
  font-weight: 900;
  opacity: 0;
}

.assignment-option:has(input:checked) .assignment-option-check {
  opacity: 1;
}

.assignment-empty {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
  padding: 6px 2px;
}

.assignment-option input[type="checkbox"] {
  justify-self: center;
  margin: 0;
}

.assignment-menu-save {
  margin-top: 6px;
  justify-self: stretch;
}

.item-assignment-dropdown .assignment-menu {
  left: 0;
  min-width: 300px;
  max-height: 270px;
  overflow: visible;
  padding-bottom: 10px;
  transform: translateY(0);
}

.item-assignment-dropdown .assignment-menu-options {
  max-height: 190px;
  overscroll-behavior: contain;
}

.item-assignment-dropdown .assignment-option {
  width: 100%;
  color: var(--text);
}

.user-bubble {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: #7b61d1;
  font-size: 12px;
  font-weight: 900;
}

.unassigned-label {
  color: var(--muted);
}

.task-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workflow-admin-form.show-assignments .workflow-custom-task {
  display: none;
}

.workflow-custom-task {
  margin-top: 8px;
  padding: 14px;
  border: 1px dashed rgba(255, 106, 0, 0.34);
  border-radius: 16px;
  background: rgba(255, 106, 0, 0.06);
}

.workflow-stage {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: start;
}

.stage-marker {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 106, 0, 0.28);
  border-radius: 999px;
  color: var(--accent);
  background: white;
  font-weight: 800;
}

.workflow-stage strong {
  display: block;
  margin-bottom: 8px;
}

.workflow-task {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(140px, 0.7fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.workflow-task small {
  color: var(--muted);
}

.compact-modal {
  width: min(560px, 100%);
}

.add-content-form {
  display: grid;
  gap: 12px;
  padding-top: 22px;
}

.item-workflow {
  display: grid;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.item-workflow-stage {
  display: grid;
  gap: 8px;
  position: relative;
}

.item-workflow-stage > strong {
  color: var(--text);
}

.item-workflow-task {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(210px, 1fr) minmax(150px, 0.72fr) minmax(156px, 0.56fr) minmax(132px, 0.58fr) minmax(100px, auto);
  gap: 12px;
  align-items: center;
  min-width: 860px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.item-workflow-task:has(.item-assignment-dropdown[open]) {
  z-index: 60;
  opacity: 1;
  background: #fff;
}

.item-workflow-table-head {
  display: grid;
  grid-template-columns: 24px minmax(210px, 1fr) minmax(150px, 0.72fr) minmax(156px, 0.56fr) minmax(132px, 0.58fr) minmax(100px, auto);
  gap: 12px;
  min-width: 860px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.item-workflow-table-head span:first-child {
  grid-column: 2;
}

.workflow-due-date {
  min-width: 150px;
}

.workflow-completed-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.completed-by-bubble {
  width: 26px;
  height: 26px;
  font-size: 11px;
  flex: 0 0 auto;
}

.item-workflow-task.completed {
  background: var(--green-soft);
}

.item-workflow-task.locked {
  opacity: 0.78;
}

.workflow-check {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  margin-top: 2px;
  padding: 0;
  border: 1px solid rgba(255, 106, 0, 0.36);
  border-radius: 4px;
  background: white;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.workflow-check:disabled {
  cursor: default;
  opacity: 0.8;
}

.workflow-row-tools {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.workflow-feedback-button,
.workflow-move-button,
.workflow-delete-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.workflow-feedback-button:disabled,
.workflow-move-button:disabled,
.workflow-delete-button:disabled {
  cursor: default;
  opacity: 0.4;
}

.workflow-delete-button {
  color: #b4232f;
}

.feedback-form {
  display: grid;
  gap: 14px;
  padding-top: 18px;
}

.publish-form {
  display: grid;
  gap: 14px;
  padding-top: 18px;
}

.comment-thread-modal {
  width: min(760px, 100%);
}

.workflow-comment-thread {
  display: grid;
  gap: 16px;
  padding: 20px 0 10px;
}

.workflow-comment-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
}

.workflow-comment-content {
  min-width: 0;
}

.workflow-comment-item p {
  margin: 8px 0 0;
  line-height: 1.5;
  white-space: pre-wrap;
}

.workflow-comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.workflow-comment-meta > div:first-child {
  display: grid;
  gap: 2px;
}

.workflow-comment-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tiny-button {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.danger-text-button {
  color: #c9342d;
}

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

.workflow-comment-edit-form textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
}

.workflow-comment-meta small,
.workflow-comment-empty span {
  color: var(--muted);
}

.workflow-comment-empty {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.workflow-comment-form {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.feedback-task {
  cursor: pointer;
}

.workflow-task-title[data-action="workflow-comments"] {
  cursor: pointer;
}

.workflow-task-title[data-action="workflow-comments"]:hover strong {
  color: var(--accent);
}

.item-workflow-task strong,
.item-workflow-task small {
  display: block;
}

.item-workflow-task small {
  margin-top: 4px;
  color: var(--muted);
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    min-height: auto;
  }

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

  .workspace-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-filters {
    grid-template-columns: minmax(260px, 1fr) minmax(210px, 0.55fr) auto;
  }

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

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

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

@media (max-width: 760px) {
  .workspace {
    padding: 16px;
  }

  .sidebar {
    padding: 18px 16px;
  }

  .workspace-header h2 {
    font-size: 28px;
  }

  .editor-copy h3 {
    font-size: 38px;
  }

  .form-grid,
  .stat-triplet,
  .detail-grid {
    grid-template-columns: 1fr;
  }

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

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

  .dashboard-next-link,
  .dashboard-task {
    flex-direction: column;
  }

  .dashboard-next-meta {
    justify-items: start;
  }

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

  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }

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