:root {
  color-scheme: light;
  --accent: #2f80ed;
  --accent-dark: #1d4ed8;
  --accent-soft: #eaf3ff;
  --background: #f4f8fe;
  --border: #dbe4f0;
  --muted: #65748b;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --text: #172033;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
  line-height: 1.55;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 4%, rgba(54, 197, 240, 0.12), transparent 24rem),
    radial-gradient(circle at 90% 10%, rgba(124, 58, 237, 0.08), transparent 25rem),
    var(--background);
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  align-items: center;
  min-height: 64px;
  padding: 10px 24px;
  border-bottom: 1px solid rgba(80, 100, 140, 0.16);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
}

.brand,
.account-controls a,
.account-controls button {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.brand:hover,
.account-controls a:hover,
.account-controls button:hover {
  color: var(--accent);
}

.topbar-title {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.topbar-product {
  color: var(--text);
}

.litchikin-logo {
  width: 38px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 5px;
  object-fit: contain;
}

.topbar-separator {
  color: #b4c0d0;
}

.mode-switch {
  margin-left: 4px;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.76rem;
  text-decoration: none;
}

.mode-switch:hover {
  background: #dbeaff;
}

.account-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-self: end;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.account-controls a,
.account-controls button {
  color: var(--muted);
  font-size: inherit;
}

.account-controls button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.account-controls button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.account-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-separator {
  color: #b4c0d0;
}

.viewer-shell {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  width: min(calc(100% - 28px), 1480px);
  height: calc(100vh - 92px);
  min-height: 620px;
  margin: 14px auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(39, 72, 126, 0.12);
}

.sidebar {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface-soft);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-title-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.count-badge,
.meta-pill,
.readonly-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 750;
}

.count-badge {
  min-width: 34px;
  min-height: 28px;
  padding: 2px 9px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.78rem;
}

.catalog-view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-bottom: 10px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #edf2f8;
}

.catalog-view-tab {
  min-height: 34px;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 800;
}

.catalog-view-tab:hover {
  color: var(--accent-dark);
}

.catalog-view-tab.active {
  background: var(--surface);
  color: var(--accent-dark);
  box-shadow: 0 2px 7px rgba(39, 72, 126, 0.11);
}

.upload-button,
.catalog-download-all {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
  transition: background 160ms ease, transform 160ms ease;
}

.upload-button:hover,
.catalog-download-all:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.catalog-download-all:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.upload-button input {
  display: none;
}

.privacy-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.problem-list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 6px 0;
  overflow-y: auto;
  list-style: none;
}

.problem-group {
  border-bottom: 1px solid var(--border);
}

.problem-group:last-child {
  border-bottom: 0;
}

.problem-group-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 7px 8px 7px 10px;
  background: #f0f4f9;
}

.problem-group-toggle {
  display: grid;
  min-width: 0;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 5px 3px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.problem-group-toggle:hover .problem-group-name {
  color: var(--accent-dark);
}

.problem-group-indicator {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid var(--muted);
  transform-origin: 2px center;
  transition: transform 140ms ease;
}

.problem-group-indicator.expanded {
  transform: rotate(90deg);
}

.problem-group-name {
  overflow: hidden;
  font-size: 0.73rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.problem-group-count {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
}

.problem-group-export {
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 800;
}

.problem-group-export:hover {
  border-color: #b8c9df;
  background: var(--accent-soft);
}

.problem-group-export:disabled {
  cursor: wait;
  opacity: 0.6;
}

.problem-group-items {
  margin: 0;
  padding: 5px 0;
  list-style: none;
}

.problem-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  align-items: stretch;
  margin: 0 6px;
  border-radius: 9px;
}

.problem-row.removable {
  grid-template-columns: minmax(0, 1fr) 32px;
}

.problem-row:hover {
  background: #edf3fb;
}

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

.problem-select,
.remove-problem {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.problem-select {
  min-width: 0;
  padding: 10px 8px 10px 12px;
  color: var(--text);
  text-align: left;
}

.problem-name,
.problem-origin,
.problem-comment-count {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.problem-name {
  font-size: 0.82rem;
  font-weight: 720;
  line-height: 1.35;
}

.problem-sidebar-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 8px;
  align-items: center;
  margin-top: 3px;
}

.problem-origin,
.problem-comment-count {
  color: var(--muted);
  font-size: 0.66rem;
  white-space: nowrap;
}

.problem-origin {
  min-width: 0;
}

.problem-comment-count {
  color: var(--accent-dark);
  text-align: right;
}

.remove-problem {
  color: #9aa8bb;
  font-size: 1rem;
}

.remove-problem:hover {
  color: #b42318;
}

.list-message {
  padding: 28px 20px;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

.detail-panel {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background: var(--surface);
}

.detail-placeholder {
  display: grid;
  min-height: 100%;
  place-content: center;
  justify-items: center;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

.placeholder-mark {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: white;
  font-size: 1.45rem;
  font-weight: 900;
}

.detail-placeholder p {
  margin: 0;
}

.problem-detail {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 34px;
}

.activity-feed {
  display: grid;
  gap: 18px;
}

.activity-header,
.activity-group-header,
.activity-item-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.activity-header {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.activity-header h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.activity-time-note {
  max-width: 680px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.activity-refresh {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 800;
}

.activity-refresh:hover {
  background: var(--accent-soft);
}

.activity-refresh:disabled {
  cursor: wait;
  opacity: 0.65;
}

.activity-group {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 7px 22px rgba(39, 72, 126, 0.06);
}

.activity-group-header {
  padding: 16px 18px;
  background: var(--surface-soft);
}

.activity-group-header h3 {
  margin: 0;
  font-size: 1rem;
}

.activity-group-time,
.activity-item-details {
  color: var(--muted);
  font-size: 0.72rem;
}

.activity-group-time {
  display: block;
  margin-top: 3px;
}

.activity-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-item + .activity-item {
  border-top: 1px solid var(--border);
}

.activity-catalog-event {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: #fbfcff;
  color: var(--muted);
  font-size: 0.72rem;
}

.activity-catalog-event strong {
  color: var(--accent-dark);
}

.activity-catalog-event + .activity-item,
.activity-item + .activity-catalog-event {
  border-top: 1px solid var(--border);
}

.activity-item-button {
  display: grid;
  width: 100%;
  gap: 6px;
  padding: 14px 18px;
  border: 0;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.activity-item-button:hover {
  background: #f8fbff;
}

.activity-item-title {
  min-width: 0;
  font-size: 0.88rem;
  line-height: 1.4;
}

.activity-item-title.comment-event-title {
  font-weight: 400;
}

.activity-type {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.64rem;
  font-weight: 800;
}

.activity-type.comment {
  background: #eaf8ef;
  color: #167447;
}

.activity-item-details {
  display: block;
}

.activity-comment-author {
  color: var(--text);
  font-weight: 700;
}

.problem-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.problem-header.editing-toolbar {
  padding-bottom: 10px;
}

.problem-header.editing-toolbar .meta-row {
  margin-bottom: 0;
}

.meta-row,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

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

.problem-export,
.problem-edit {
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
}

.problem-export {
  margin-left: auto;
}

.problem-export:hover,
.problem-edit:hover {
  background: var(--accent-soft);
}

.problem-export:disabled,
.problem-edit:disabled {
  cursor: wait;
  opacity: 0.6;
}

.meta-pill,
.readonly-badge {
  min-height: 25px;
  padding: 3px 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.68rem;
}

.problem-header h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.source-statement {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.source-reference {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 16px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.8rem;
}

.source-reference a,
.literature-table a,
.comment-help a {
  color: var(--accent-dark);
  overflow-wrap: anywhere;
}

.tag-list {
  margin-top: 13px;
}

.tag {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.eligible-curators {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}

.eligible-curators-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  align-items: center;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.eligible-curators-label {
  flex: 0 0 auto;
}

.eligible-curators-disclaimer {
  color: #98a4b5;
  font-size: 0.61rem;
  font-weight: 550;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

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

.curator-chip {
  display: inline-flex;
  max-width: 100%;
  gap: 5px;
  align-items: center;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.69rem;
  line-height: 1.25;
}

.curator-name {
  color: var(--muted);
  font-weight: 750;
}

.curator-email {
  color: var(--muted);
  font-size: 0.65rem;
  overflow-wrap: anywhere;
}

.curator-delete {
  min-height: 27px;
  padding: 3px 8px;
  border: 1px solid #efd0d0;
  border-radius: 7px;
  background: white;
  color: #a13b3b;
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 800;
}

.curator-delete:hover {
  background: #fbeaea;
}

.curator-management {
  width: fit-content;
  color: var(--muted);
  font-size: 0.69rem;
}

.curator-management summary {
  cursor: pointer;
  font-weight: 750;
}

.curator-management-list {
  display: grid;
  gap: 5px;
  width: min(500px, calc(100vw - 80px));
  margin-top: 8px;
}

.curator-management-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 7px 6px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.curator-management-identity {
  display: flex;
  min-width: 0;
  gap: 5px;
  align-items: baseline;
}

.curator-management-identity strong {
  color: var(--text);
}

.curator-management-identity span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.curator-form {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(190px, 1.2fr) auto;
  gap: 7px;
  width: min(620px, calc(100vw - 80px));
  margin-top: 8px;
}

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

.content-card,
.section-card {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 7px 22px rgba(39, 72, 126, 0.06);
}

.content-card {
  padding: 17px;
}

.card-label,
.section-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rendered-text {
  margin: 11px 0 0;
  font-size: 0.9rem;
  line-height: 1.72;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.section-card {
  margin-top: 16px;
  padding: 18px;
}

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

.readonly-badge {
  text-transform: none;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.literature-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.8rem;
}

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

.literature-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.literature-year {
  width: 90px;
  white-space: nowrap;
}

.empty-message {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.problem-editor {
  border-color: rgba(47, 128, 237, 0.38);
}

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

.problem-editor-field {
  display: grid;
  gap: 6px;
}

.problem-editor-field:has(textarea) {
  grid-column: 1 / -1;
}

.problem-editor-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.problem-editor-input,
.problem-editor-textarea,
.curator-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 10px;
  background: white;
  color: var(--text);
  font: inherit;
}

.problem-editor-textarea {
  resize: vertical;
  font-size: 0.84rem;
  line-height: 1.5;
}

.problem-editor-textarea.json {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
}

.problem-editor-input:focus,
.problem-editor-textarea:focus,
.curator-input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(47, 128, 237, 0.13);
}

.problem-editor-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 9px;
  justify-content: flex-end;
}

.problem-editor-cancel,
.problem-editor-save,
.curator-add {
  min-height: 35px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
}

.problem-editor-cancel {
  background: white;
  color: var(--muted);
}

.problem-editor-save,
.curator-add {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.problem-editor-save:hover,
.curator-add:hover {
  background: var(--accent-dark);
}

.problem-editor-cancel:disabled,
.problem-editor-save:disabled,
.curator-add:disabled,
.curator-delete:disabled {
  cursor: wait;
  opacity: 0.6;
}

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

.comment-card {
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}

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

.comment-author {
  font-size: 0.82rem;
  font-weight: 800;
}

.comment-time {
  color: var(--muted);
  font-size: 0.68rem;
}

.comment-body {
  font-size: 0.86rem;
  line-height: 1.62;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.comment-body.markdown-body {
  white-space: normal;
}

.comment-body.markdown-body > :first-child {
  margin-top: 0;
}

.comment-body.markdown-body > :last-child {
  margin-bottom: 0;
}

.comment-body.markdown-body p,
.comment-body.markdown-body blockquote,
.comment-body.markdown-body pre,
.comment-body.markdown-body ul,
.comment-body.markdown-body ol {
  margin: 0.65em 0;
}

.comment-body.markdown-body ul,
.comment-body.markdown-body ol {
  padding-left: 1.55em;
}

.comment-body.markdown-body li + li {
  margin-top: 0.35em;
}

.comment-body.markdown-body blockquote {
  padding-left: 0.85em;
  border-left: 3px solid var(--border-strong);
  color: var(--muted);
}

.comment-body.markdown-body code {
  border-radius: 4px;
  padding: 0.08em 0.3em;
  background: rgba(80, 104, 145, 0.1);
  font-size: 0.9em;
}

.comment-body.markdown-body pre {
  overflow-x: auto;
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(80, 104, 145, 0.08);
  white-space: pre;
}

.comment-body.markdown-body pre code {
  padding: 0;
  background: transparent;
}

.comment-body.markdown-body a {
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.comment-composer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.comment-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.comment-help a {
  font-weight: 750;
}

.comment-form {
  display: grid;
  gap: 9px;
}

.comment-form-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.comment-input {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 11px;
  background: white;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.5;
}

.comment-input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(47, 128, 237, 0.13);
}

.comment-form-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.comment-limit {
  color: var(--muted);
  font-size: 0.68rem;
}

.comment-submit {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  padding: 7px 13px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.comment-submit:hover {
  background: var(--accent-dark);
}

.comment-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  max-width: min(420px, calc(100% - 44px));
  padding: 11px 15px;
  border-radius: 10px;
  background: #172033;
  color: white;
  box-shadow: 0 12px 30px rgba(23, 32, 51, 0.24);
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: #9f1c1c;
}

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topbar-title {
    display: none;
  }

  .viewer-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 92px);
  }

  .sidebar {
    max-height: 390px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .problem-list {
    max-height: 220px;
  }

  .detail-panel {
    min-height: 520px;
  }

  .problem-detail {
    padding: 24px 18px;
  }

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

  .problem-editor-form,
  .curator-form {
    grid-template-columns: 1fr;
  }

  .problem-editor-field,
  .problem-editor-field:has(textarea),
  .problem-editor-actions {
    grid-column: 1;
  }

  .activity-header,
  .activity-group-header {
    align-items: stretch;
    flex-direction: column;
  }

}

@media (max-width: 480px) {
  .topbar {
    padding: 10px 15px;
  }

  .account-controls {
    font-size: 0.75rem;
  }

  .viewer-shell {
    width: calc(100% - 16px);
    margin: 8px auto;
    border-radius: 12px;
  }

  .sidebar-header {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
