:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d8dee8;
  --brand: #14213d;
  --action: #166534;
  --warn: #92400e;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--brand);
  cursor: pointer;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  color: #ffffff;
  background: var(--brand);
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.topbar p {
  margin: 5px 0 0;
  color: #d8dee8;
}

.user-picker {
  width: min(280px, 40vw);
}

.user-picker label {
  display: block;
  margin-bottom: 6px;
  color: #d8dee8;
  font-size: 13px;
}

.role-hint {
  min-height: 18px;
  margin-top: 6px;
  color: #d8dee8;
  font-size: 12px;
}

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 0;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #eef2f6;
  overflow: auto;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #eef2f6;
}

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

.status-filters,
.answer-filters {
  display: grid;
  gap: 8px;
  padding: 12px 14px 0;
}

.status-filters {
  grid-template-columns: repeat(3, 1fr);
}

.answer-filters {
  grid-template-columns: repeat(2, 1fr);
}

.status-filter,
.answer-filter {
  min-height: 34px;
  padding: 0 8px;
  color: var(--brand);
  background: #d8dee8;
  font-size: 13px;
}

.status-filter.active,
.answer-filter.active {
  color: #ffffff;
  background: var(--brand);
}

#newIssueButton,
#submitIssueButton,
#submitSolutionButton,
#resolveButton {
  background: var(--action);
}

#cancelIssueButton,
#refreshButton {
  color: var(--brand);
  background: #d8dee8;
}

.issue-list {
  padding: 12px;
}

.issue-card {
  display: block;
  width: 100%;
  min-height: 112px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  color: var(--ink);
  background: var(--panel);
}

.issue-card.active {
  border-color: var(--brand);
  box-shadow: inset 3px 0 0 var(--brand);
}

.issue-card h3 {
  margin: 8px 0;
  font-size: 16px;
  line-height: 1.35;
}

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

.issue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.content {
  min-width: 0;
  overflow: auto;
  padding: 22px;
}

.empty-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.detail-panel {
  max-width: 1040px;
}

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

.detail-head h2 {
  margin: 10px 0 6px;
  color: var(--brand);
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0;
}

.detail-head p {
  margin: 0;
  color: var(--muted);
}

.description {
  margin: 18px 0;
  white-space: pre-wrap;
  line-height: 1.65;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.status.open {
  color: var(--warn);
  background: #fef3c7;
}

.status.resolved {
  color: var(--action);
  background: #dcfce7;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin: 16px 0 28px;
}

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

.media-card img,
.media-card video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #111827;
}

.media-card span {
  display: block;
  overflow: hidden;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.updates,
.update-form,
.solutions,
.solution-form {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.updates h3,
.update-form h3,
.solutions h3,
.solution-form h3 {
  margin: 0 0 14px;
  color: var(--brand);
  font-size: 18px;
}

.update-card,
.solution-card {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.update-card .meta,
.solution-card .meta {
  color: var(--muted);
  font-size: 13px;
}

.update-card .content,
.solution-card .content {
  padding: 0;
  margin-top: 10px;
  white-space: pre-wrap;
  line-height: 1.55;
}

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

.update-form,
.solution-form {
  display: grid;
  gap: 12px;
}

dialog {
  width: min(680px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
}

.dialog-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-head h2 {
  margin: 0;
  color: var(--brand);
}

#closeDialogButton {
  width: 38px;
  padding: 0;
  color: var(--brand);
  background: #e5e7eb;
  font-size: 24px;
}

.dialog-card label {
  display: grid;
  gap: 8px;
  color: var(--brand);
  font-weight: 700;
}

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

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 360px;
  border-radius: 8px;
  padding: 12px 14px;
  color: #ffffff;
  background: #111827;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.24);
}

.placeholder {
  color: var(--muted);
}

@media (max-width: 860px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .user-picker {
    width: 100%;
  }

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

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