:root {
  color-scheme: light;
  --canvas: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #17202c;
  --muted: #667085;
  --quiet: #8b95a7;
  --line: #dce3ee;
  --line-strong: #b8c2d1;
  --blue: #2459e6;
  --blue-dark: #1d4ed8;
  --blue-soft: #eef4ff;
  --green: #0f9f6e;
  --green-soft: #ecfdf3;
  --amber: #b66a16;
  --amber-soft: #fff6e5;
  --red: #b42318;
  --red-soft: #fef3f2;
  --shadow: 0 18px 45px rgba(31, 42, 55, 0.08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.auth-legal {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-legal a {
  color: var(--blue);
  font-weight: 700;
}

.auth-legal-footer {
  margin-top: 14px;
  text-align: center;
}

a {
  color: inherit;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: #ffffff;
  padding: 22px 16px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.product-mark {
  width: 40px;
  height: 40px;
  flex: none;
  background: url("/assets/foplink-icon.svg") center / contain no-repeat;
  color: transparent;
  font-size: 0;
  box-shadow: 0 12px 24px rgba(36, 89, 230, 0.22);
}

.brand-block h1 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 6px;
}

.side-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 0 11px;
  font-size: 14px;
  font-weight: 760;
  text-align: left;
  text-decoration: none;
}

.side-nav-item:hover,
.side-nav-item.is-active {
  background: var(--blue-soft);
  color: var(--blue);
}

.account-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--blue);
  font-weight: 850;
}

.account-card strong,
.account-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-card strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.account-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.account-card .link-button {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.server-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 760;
  text-align: center;
}

.server-status.is-busy {
  border-color: rgba(182, 106, 22, 0.3);
  background: var(--amber-soft);
  color: var(--amber);
}

.server-status.is-ok {
  border-color: rgba(15, 159, 110, 0.28);
  background: var(--green-soft);
  color: var(--green);
}

.server-status.is-error {
  border-color: rgba(180, 35, 24, 0.26);
  background: var(--red-soft);
  color: var(--red);
}

.main-shell {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 24px;
}

.top-bar {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 44px;
}

.workspace-context {
  display: grid;
  justify-items: start;
  min-width: 0;
  margin-right: auto;
}

.workspace-context span,
.workspace-context strong {
  display: block;
  overflow: hidden;
  max-width: 420px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-context span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.workspace-context strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.account-menu {
  position: relative;
}

.account-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  padding: 4px 10px 4px 6px;
  box-shadow: 0 8px 22px rgba(31, 42, 55, 0.05);
}

.account-button:hover,
.account-button[aria-expanded="true"] {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.account-button svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.account-copy {
  display: grid;
  justify-items: start;
  min-width: 0;
}

.account-copy strong,
.account-copy span,
.account-menu-profile strong,
.account-menu-profile span {
  display: block;
  overflow: hidden;
  max-width: 220px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong,
.account-menu-profile strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.account-copy span,
.account-menu-profile span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 4px;
  width: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 8px;
}

.account-menu-profile {
  border-bottom: 1px solid var(--line);
  padding: 8px 8px 12px;
  margin-bottom: 4px;
}

.account-menu-panel button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 0 9px;
  font-size: 13px;
  font-weight: 760;
  text-align: left;
}

.account-menu-panel button:hover {
  background: var(--surface-soft);
}

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

.view[hidden] {
  display: none;
}

.auth-view {
  max-width: none;
}

.auth-route .app-shell {
  display: block;
  min-height: 100vh;
}

.auth-route .sidebar,
.auth-route .top-bar {
  display: none;
}

.auth-route .main-shell {
  min-height: 100vh;
  padding: 0;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  width: min(1080px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 72px);
}

.auth-intro {
  display: grid;
  align-content: center;
  gap: 36px;
}

.auth-brand {
  width: max-content;
}

.auth-intro h2,
.auth-card-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.auth-intro h2 {
  max-width: 560px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.02;
}

.auth-intro p:not(.eyebrow) {
  max-width: 460px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

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

.auth-card-head h2 {
  font-size: 26px;
  line-height: 1.1;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-header h2,
.panel h2,
.project-row h3,
.page-row h3 {
  margin: 0;
  letter-spacing: 0;
}

.page-header h2 {
  font-size: 28px;
  line-height: 1.1;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.project-title-row h2 {
  min-width: 0;
}

.project-actions-wrap {
  flex: 0 0 auto;
}

.project-kebab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.project-kebab:hover,
.project-kebab[aria-expanded="true"] {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(31, 42, 55, 0.08);
}

.project-kebab svg {
  stroke-width: 3.5;
}

.panel h2 {
  font-size: 18px;
  line-height: 1.2;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
  text-decoration: none;
}

.page-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

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

.auth-panel {
  padding: 22px;
}

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

.auth-form[hidden] {
  display: none;
}

.form-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 780;
}

.auth-message {
  margin-top: 16px;
  border: 1px solid rgba(15, 159, 110, 0.24);
  border-radius: var(--radius);
  background: var(--green-soft);
  color: var(--green);
  padding: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.auth-message.is-error {
  border-color: rgba(180, 35, 24, 0.26);
  background: var(--red-soft);
  color: var(--red);
}

.auth-message a {
  color: inherit;
  font-weight: 820;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
}

.list-header {
  border-bottom: 1px solid var(--line);
}

.list-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: min(560px, 55%);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--quiet);
  padding: 0 11px;
}

.search-field:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(36, 89, 230, 0.1);
}

.search-field input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.segmented {
  display: inline-flex;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 3px;
}

.segmented button {
  min-width: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 760;
}

.segmented button.is-active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(31, 42, 55, 0.1);
}

.primary-button,
.secondary-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 13px;
  font-weight: 780;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(36, 89, 230, 0.18);
}

.primary-button:hover {
  background: var(--blue-dark);
}

.secondary-button {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

.secondary-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.icon-only {
  width: 40px;
  padding: 0;
}

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

.metric {
  display: grid;
  gap: 4px;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 10px 26px rgba(31, 42, 55, 0.05);
}

.metric strong {
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.metric.is-blue {
  border-color: rgba(36, 89, 230, 0.22);
  background: var(--blue-soft);
}

.metric.is-blue strong {
  color: var(--blue);
}

.metric.is-amber {
  border-color: rgba(182, 106, 22, 0.24);
  background: var(--amber-soft);
}

.metric.is-amber strong {
  color: var(--amber);
}

.metric.is-green {
  border-color: rgba(15, 159, 110, 0.22);
  background: var(--green-soft);
}

.metric.is-green strong {
  color: var(--green);
}

.latest-result {
  margin: 14px 18px 0;
  padding: 12px;
  border: 1px solid rgba(15, 159, 110, 0.24);
  border-radius: var(--radius);
  background: var(--green-soft);
}

.latest-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 820;
}

.latest-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.latest-links a,
.latest-links button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 780;
  text-decoration: none;
}

.project-table-head,
.project-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) 86px 86px minmax(210px, 0.8fr) 84px;
  gap: 12px;
  align-items: center;
}

.project-table-head {
  min-height: 38px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0 18px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.projects-list,
.pages-list,
.comments-list {
  display: grid;
}

.project-row {
  min-height: 82px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding: 14px 18px;
}

.project-row:last-child {
  border-bottom: 0;
}

.project-row:hover {
  background: #fbfcfe;
}

.project-name-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  text-decoration: none;
}

.project-initial {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(36, 89, 230, 0.18);
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 15px;
  font-weight: 850;
}

.project-title-wrap {
  min-width: 0;
}

.project-row h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-badge,
.role-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0 8px;
  font-size: 10px;
  font-weight: 840;
  line-height: 1;
  text-transform: uppercase;
}

.source-badge.is-live {
  border-color: rgba(15, 126, 85, 0.22);
  background: #ecf8f2;
  color: #0f7e55;
}

.project-meta {
  overflow: hidden;
  margin-top: 4px;
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-status-cell {
  display: grid;
  justify-items: start;
  gap: 2px;
}

.project-status-cell strong {
  font-size: 22px;
  line-height: 1;
}

.project-status-cell span {
  color: var(--quiet);
  font-size: 11px;
  font-weight: 750;
}

.project-status-cell.is-open strong {
  color: var(--amber);
}

.project-status-cell.is-closed strong {
  color: var(--green);
}

.project-activity-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.project-activity-cell > div:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.project-activity-cell strong,
.project-activity-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-activity-cell strong {
  color: var(--ink);
  font-size: 13px;
}

.project-activity-cell > div:last-child span {
  color: var(--quiet);
  font-size: 11px;
}

.avatar-stack {
  display: flex;
  flex: 0 0 auto;
  padding-left: 6px;
}

.avatar-stack > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: -6px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 9px;
  font-weight: 850;
}

.project-comments-cell,
.project-files-cell,
.project-date-cell {
  display: grid;
  gap: 4px;
}

.comment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.comment-badge.has-open {
  border-color: rgba(182, 106, 22, 0.24);
  background: var(--amber-soft);
  color: var(--amber);
}

.comment-detail,
.project-files-cell span,
.project-date-cell span,
.page-row span {
  overflow: hidden;
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-files-cell strong,
.project-date-cell strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.project-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--muted);
  padding: 0;
  text-decoration: none;
}

.row-action:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--ink);
}

.row-action.primary-link {
  border-color: rgba(36, 89, 230, 0.24);
  background: var(--blue-soft);
  color: var(--blue);
}

.accordion-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.project-activity-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(360px, 1.35fr);
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: #f9fbff;
  padding: 20px 24px 24px 72px;
}

.project-activity-panel h4 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 840;
  text-transform: uppercase;
}

.activity-reviewers,
.activity-timeline {
  min-width: 0;
}

.activity-reviewer {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.activity-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 10px;
  font-weight: 850;
}

.activity-reviewer > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.activity-reviewer strong,
.activity-reviewer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-reviewer strong {
  font-size: 13px;
}

.activity-reviewer span {
  color: var(--quiet);
  font-size: 11px;
}

.activity-event {
  position: relative;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 12px;
  padding: 0 0 15px;
}

.activity-event:not(:last-child)::after {
  position: absolute;
  top: 10px;
  bottom: -2px;
  left: 4px;
  width: 1px;
  background: var(--line);
  content: "";
}

.activity-marker {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border: 2px solid #f9fbff;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 1px rgba(182, 106, 22, 0.28);
}

.activity-marker.is-closed {
  background: var(--green);
  box-shadow: 0 0 0 1px rgba(15, 159, 110, 0.28);
}

.activity-event-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.activity-event-top a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.activity-event-top time {
  flex: 0 0 auto;
  color: var(--quiet);
  font-size: 11px;
}

.activity-page-link {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-page-link:hover {
  color: var(--blue);
}

.activity-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
}

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

.reviewers-panel {
  margin-top: 0;
}

.reviewers-header {
  align-items: end;
}

.inline-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-form input {
  width: min(300px, 38vw);
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.inline-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(36, 89, 230, 0.1);
}

.reviewers-list {
  display: grid;
}

.reviewer-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  border-top: 1px solid var(--line);
  padding: 12px 18px;
}

.reviewer-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(36, 89, 230, 0.18);
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 850;
}

.reviewer-row > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.reviewer-row .reviewer-actions {
  display: flex;
  gap: 6px;
}

.reviewers-subheading {
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--quiet);
  padding: 10px 18px;
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.access-description {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 14px 18px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.access-description + .inline-form {
  padding: 12px 18px 18px;
}

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

.notification-settings-head > div {
  display: grid;
  gap: 4px;
}

.notification-settings-head strong { font-size: 13px; }
.notification-settings-head span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.notification-settings-head span.is-warning { color: var(--amber); }
.notification-settings-head span.is-active { color: var(--green); }

.notification-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 780;
  cursor: pointer;
}

.notification-toggle input { width: 17px; height: 17px; accent-color: var(--blue); }

.notification-recipient-form { padding: 0 18px 14px; }

.notification-recipient-row {
  grid-template-columns: 38px minmax(0, 1fr) auto 34px;
}

.annotation-links-heading {
  margin-top: 2px;
}

.access-link-header {
  padding: 12px 18px 18px;
}

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

.reviewer-row > div span {
  color: var(--quiet);
  font-size: 12px;
}

.invite-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: var(--blue-soft);
  padding: 12px 18px;
  color: var(--muted);
  font-size: 13px;
}

.invite-result code {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  border-top: 1px solid var(--line);
  padding: 14px 18px;
}

.page-row h3 {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comments-panel-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.result-count {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 760;
}

.comments-toolbar {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) minmax(170px, auto) 150px;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 12px 18px;
}

.comment-search-field {
  min-width: 0;
}

.comment-status-filter {
  justify-self: start;
}

.select-field select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background: #ffffff;
  color: var(--ink);
  padding: 0 34px 0 11px;
  font-size: 13px;
  font-weight: 700;
}

.select-field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(36, 89, 230, 0.1);
}

.comment-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  padding: 8px 18px;
}

.selection-checkbox,
.comment-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.selection-checkbox input,
.comment-checkbox input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
}

.bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulk-toolbar strong {
  margin-right: 4px;
  color: var(--ink);
  font-size: 12px;
}

.compact-button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

.comment-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 18px;
  scroll-margin: 100px;
}

.comment-row:first-child {
  border-top: 0;
}

.comment-row:target {
  background: var(--blue-soft);
  box-shadow: inset 3px 0 0 var(--blue);
}

.comment-row.resolved {
  background: #fbfcfd;
}

.comment-checkbox {
  padding-top: 4px;
}

.comment-content {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.comment-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.comment-row-head time {
  flex: 0 0 auto;
  color: var(--quiet);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.comment-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.comment-number,
.comment-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 820;
  white-space: nowrap;
}

.comment-number {
  background: var(--blue-soft);
  color: var(--blue);
}

.comment-status.is-open {
  background: var(--amber-soft);
  color: var(--amber);
}

.comment-status.is-closed {
  background: var(--green-soft);
  color: var(--green);
}

.comment-author {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
}

.comment-author strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-author-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  background: #edf1f7;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
}

.comment-page {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(36, 89, 230, 0.16);
  border-radius: var(--radius);
  background: var(--blue-soft);
  padding: 10px 12px;
}

.comment-page > svg {
  color: var(--blue);
}

.comment-page > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.comment-page span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-page a {
  overflow-wrap: anywhere;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.4;
  text-decoration: none;
}

.comment-page a:hover {
  text-decoration: underline;
}

.comment-text {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

.comment-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.comment-attachment {
  display: grid;
  align-content: center;
  min-height: 54px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 740;
  text-decoration: none;
}

.comment-attachment:hover { border-color: #8da8ef; }

.comment-attachment img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
}

.comment-attachment span {
  overflow: hidden;
  padding: 9px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-technical summary {
  width: max-content;
  color: var(--quiet);
  cursor: pointer;
  font-size: 11px;
  font-weight: 760;
}

.comment-technical code {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 8px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  padding: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
}

.comment-actions {
  display: grid;
  gap: 7px;
  justify-items: stretch;
}

.danger-button {
  border-color: rgba(180, 35, 24, .24);
  color: var(--red);
}

.danger-button:hover {
  border-color: rgba(180, 35, 24, .4);
  background: var(--red-soft);
}

.comment-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-top: 2px;
}

.comment-conversation {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.comment-reply {
  display: grid;
  gap: 4px;
  border-left: 3px solid #cbd8ff;
  border-radius: 0 7px 7px 0;
  background: #f8fafc;
  padding: 9px 11px;
}

.comment-reply strong {
  font-size: 11px;
}

.comment-reply span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.comment-reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.comment-reply-form input {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  padding: 0 10px;
}

.comment-reply-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 89, 230, .1);
}

.copy-agent-button {
  color: var(--blue);
}

.project-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.project-tabs button {
  position: relative;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
}

.project-tabs button::after {
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 2px;
  border-radius: 999px 999px 0 0;
  background: transparent;
  content: "";
}

.project-tabs button:hover {
  color: var(--ink);
}

.project-tabs button.is-active {
  color: var(--blue);
}

.project-tabs button.is-active::after {
  background: var(--blue);
}

.menu-wrap {
  position: relative;
}

.action-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: none;
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 6px;
}

.project-actions-menu {
  right: 0;
  min-width: 250px;
}

.action-menu.open {
  display: grid;
  gap: 4px;
}

.action-menu button,
.action-menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 760;
  text-align: left;
  text-decoration: none;
}

.action-menu button:hover,
.action-menu a:hover {
  background: var(--surface-soft);
}

.action-menu-label {
  margin: 3px 10px 2px;
  color: var(--quiet);
  font-size: 10px;
  font-weight: 840;
  text-transform: uppercase;
}

.action-menu-separator {
  height: 1px;
  margin: 4px;
  background: var(--line);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(23, 32, 44, 0.34);
  opacity: 0;
  transition: opacity 160ms ease;
}

.drawer-overlay.open {
  opacity: 1;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 41;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(420px, 100vw);
  height: 100vh;
  border-left: 1px solid var(--line);
  background: #ffffff;
  box-shadow: -18px 0 42px rgba(31, 42, 55, 0.14);
  transform: translateX(100%);
  transition: transform 160ms ease;
}

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

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(23, 32, 44, 0.38);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 51;
  display: grid;
  width: min(440px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(31, 42, 55, 0.18);
  transform: translate(-50%, -50%);
}

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

.modal-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

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

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

.upload-form {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
  padding: 18px;
}

.project-source-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.project-source-option {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  padding: 10px;
  text-align: left;
}

.project-source-option:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.project-source-option.is-active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 89, 230, 0.08);
}

.project-source-option svg {
  width: 22px;
  height: 22px;
}

.project-source-option span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.project-source-option strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
}

.project-source-option small {
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.3;
}

#hostedProjectFields,
#liveProjectFields {
  display: grid;
  gap: 14px;
}

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

.create-project-submit {
  width: 100%;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.field input {
  min-width: 0;
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(36, 89, 230, 0.1);
}

.drop-zone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 160px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  outline: none;
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.is-dragover {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(36, 89, 230, 0.1);
}

.drop-zone strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
}

.drop-zone span {
  font-size: 13px;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(36, 89, 230, 0.18);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--blue);
}

.drop-icon svg {
  width: 24px;
  height: 24px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.link-button {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  font-size: 13px;
}

.file-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  overflow: hidden;
}

.file-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.file-list {
  max-height: 220px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.file-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.file-list li:last-child {
  border-bottom: 0;
}

.file-list .file-empty {
  grid-template-columns: 1fr;
  gap: 2px;
  min-height: 64px;
  text-align: center;
}

.file-meta {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.file-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 23px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--quiet);
  font-size: 11px;
  font-weight: 820;
}

.file-list strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 220px;
  color: var(--muted);
  padding: 28px 14px;
  font-size: 14px;
  text-align: center;
}

.empty-state svg {
  width: 28px;
  height: 28px;
  color: var(--blue);
}

.empty-state strong {
  color: var(--ink);
  font-size: 15px;
}

.empty-state span {
  color: var(--muted);
}

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

  .sidebar {
    position: static;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    align-items: center;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav {
    display: flex;
  }

  .comments-toolbar {
    grid-template-columns: minmax(240px, 1fr) minmax(170px, auto);
  }

}

@media (max-width: 860px) {
  .main-shell {
    padding: 16px;
  }

  .page-header,
  .list-header {
    align-items: stretch;
    flex-direction: column;
  }

  .top-bar {
    align-items: stretch;
    justify-content: space-between;
  }

  .workspace-context {
    grid-column: 1 / -1;
  }

  .page-actions,
  .list-tools {
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
  }

  .search-field {
    flex: 1;
    min-width: 0;
  }

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

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

  .reviewers-header {
    align-items: stretch;
    flex-direction: column;
  }

  .project-table-head {
    display: none;
  }

  .project-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: start;
  }

  .project-name-cell,
  .project-activity-cell,
  .project-actions {
    grid-column: 1 / -1;
  }

  .project-activity-panel {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .project-actions {
    justify-content: flex-start;
  }

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

  .comment-search-field,
  .comments-toolbar .segmented {
    grid-column: 1 / -1;
  }

  .page-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 24px;
  }

  .auth-intro {
    gap: 24px;
  }

  .auth-intro h2 {
    font-size: 34px;
  }
}

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

  .side-nav {
    overflow-x: auto;
  }

  .page-actions,
  .list-tools,
  .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .inline-form,
  .invite-result {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .inline-form input {
    width: 100%;
  }

  .project-source-picker {
    grid-template-columns: 1fr;
  }

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

  .comment-search-field,
  .comments-toolbar .segmented {
    grid-column: auto;
  }

  .comment-selection-bar,
  .bulk-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .comment-row {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .comment-actions {
    grid-column: 2;
    justify-items: start;
  }

  .comment-row-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .comment-identity {
    flex-wrap: wrap;
  }

  .reviewer-row {
    grid-template-columns: 38px minmax(0, 1fr) 34px;
  }

  .reviewer-row .role-badge {
    display: none;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .icon-only {
    width: 100%;
  }

  .top-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workspace-context span,
  .workspace-context strong {
    max-width: 100%;
  }

  .server-status {
    width: 100%;
  }

  .account-button {
    width: 100%;
    justify-content: flex-start;
  }

  .account-menu-panel {
    left: 0;
    right: auto;
    width: 100%;
  }

  .auth-shell {
    padding: 22px;
  }

  .auth-intro h2 {
    font-size: 30px;
  }
}
