/* Minimal, modern, readable */
:root {
  color-scheme: light dark;
  --bg: #0b1220;
  --panel: rgba(255, 255, 255, 0.06);
  --panel2: rgba(255, 255, 255, 0.09);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --accent: #7c5cff;
  --danger: #ff4d6d;
  --dangerBg: rgba(255, 77, 109, 0.14);
  --ok: #33d69f;
  --radius: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7fb;
    --panel: rgba(20, 23, 38, 0.05);
    --panel2: rgba(20, 23, 38, 0.08);
    --text: rgba(12, 14, 22, 0.92);
    --muted: rgba(12, 14, 22, 0.65);
    --border: rgba(12, 14, 22, 0.12);
    --shadow: 0 20px 60px rgba(12, 14, 22, 0.12);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 18px 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  box-shadow: var(--shadow);
}

h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: 0.2px;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.35;
  font-size: 14px;
}

.header h1:only-child {
  margin: 0;
}

.headerActions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.content {
  flex: 1;
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

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

.createTopicSection {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  box-shadow: var(--shadow);
}

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

.createTopicRow input {
  flex: 1;
  min-width: 0;
}

.composer,
.notes {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  box-shadow: var(--shadow);
  padding: 16px;
}

.composerForm {
  display: grid;
  gap: 12px;
}

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

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  outline: none;
}

@media (prefers-color-scheme: light) {
  input,
  textarea,
  select {
    background: rgba(255, 255, 255, 0.7);
  }
}

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

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(124, 92, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}

.fieldLabelRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.topicRow > input,
.topicRow > select {
  flex: 1;
  min-width: 0;
}

fieldset.field {
  border: 0;
  padding: 0;
  margin: 0;
}

legend.fieldLabel {
  padding: 0;
  margin-bottom: 6px;
}

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

.segmentedOption {
  position: relative;
  display: block;
}

.segmentedOption input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmentedPill {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.12);
  font-weight: 650;
  cursor: pointer;
  user-select: none;
}

@media (prefers-color-scheme: light) {
  .segmentedPill {
    background: rgba(255, 255, 255, 0.7);
  }
}

.segmentedOption input:checked + .segmentedPill {
  border-color: rgba(124, 92, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}

.segmentedPillPro {
  color: rgba(51, 214, 159, 0.95);
}

.segmentedPillContra {
  color: rgba(255, 77, 109, 0.95);
}

.segmentedOption input:checked + .segmentedPillPro {
  border-color: rgba(51, 214, 159, 0.45);
  box-shadow: 0 0 0 4px rgba(51, 214, 159, 0.14);
}

.segmentedOption input:checked + .segmentedPillContra {
  border-color: rgba(255, 77, 109, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 77, 109, 0.14);
}

.composerRow {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.14);
}

.btn {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
  user-select: none;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease,
    opacity 120ms ease;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  white-space: nowrap;
}

.btn:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
}

.btn:active {
  transform: translateY(1px);
}

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

.btnPrimary {
  border-color: rgba(124, 92, 255, 0.45);
  background: rgba(124, 92, 255, 0.18);
}

.btnPrimary:hover {
  border-color: rgba(124, 92, 255, 0.6);
  background: rgba(124, 92, 255, 0.24);
}

.btnDanger {
  border-color: rgba(255, 77, 109, 0.45);
  background: var(--dangerBg);
}

.btnDanger:hover {
  border-color: rgba(255, 77, 109, 0.62);
  background: rgba(255, 77, 109, 0.18);
}

.topicSelectField {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.topicSelectField .fieldLabel {
  font-size: 12px;
  color: var(--muted);
}

h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.counter {
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
}

.emptyState {
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 14px;
  line-height: 1.35;
}

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

.boardCols {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.boardCol {
  min-width: 0;
}

.boardColHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
}

.pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: light) {
  .pill {
    background: rgba(255, 255, 255, 0.7);
  }
}

.pillPro {
  border-color: rgba(51, 214, 159, 0.4);
  color: rgba(51, 214, 159, 0.95);
}

.pillContra {
  border-color: rgba(255, 77, 109, 0.5);
  color: rgba(255, 77, 109, 0.95);
}

.argumentPro {
  border-color: rgba(51, 214, 159, 0.35);
}

.argumentContra {
  border-color: rgba(255, 77, 109, 0.35);
}

.argumentActions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.summariesSection {
  margin-bottom: 16px;
}

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

.summariesTitle {
  font-size: 14px;
  margin: 0 0 10px;
  color: var(--muted);
}

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

.summaryCard {
  border-left: 4px solid var(--accent);
}

.summaryDate {
  font-size: 11px;
  margin-bottom: 4px;
}

.summaryText {
  font-size: 13px;
  font-style: italic;
}

.boardLoading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

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

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

.noteCard {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.12);
  padding: 12px 12px 10px;
  display: grid;
  gap: 8px;
}

@media (prefers-color-scheme: light) {
  .noteCard {
    background: rgba(255, 255, 255, 0.7);
  }
}

.noteTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.noteTitle {
  font-weight: 650;
  font-size: 14px;
  margin: 0;
  line-height: 1.25;
}

.noteMeta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
}

.noteBody {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.4;
  font-size: 13px;
}

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

.iconBtn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
}

.iconBtn:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
}

.iconBtnDanger {
  border-color: rgba(255, 77, 109, 0.45);
  background: rgba(255, 77, 109, 0.12);
}

.iconBtnDanger:hover {
  border-color: rgba(255, 77, 109, 0.62);
  background: rgba(255, 77, 109, 0.16);
}

code {
  font-family: var(--mono);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.72);
  color: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

