:root,
:root.app-theme {
  --bg-app: #f8fafc;
  --bg-panel: #ffffff;
  --bg-muted: #f8fafc;
  --border-default: #dbe5f0;
  --border-strong: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-on-accent: #ffffff;
  --accent-primary: #e66a2c;
  --accent-primary-hover: #c9561f;
  --accent-soft: #fdece0;
  --success: #16a34a;
  --success-bg: #ecfdf3;
  --warning: #b45309;
  --warning-bg: #fff7e6;
  --student-type-marketplace: #c2410c;
  --student-type-marketplace-bg: #fff0e8;
  --student-type-private: #7d4bd6;
  --student-type-private-bg: #f2ebff;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #2563eb;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --shadow-modal: 0 18px 48px rgba(15, 23, 42, 0.2);
  --shadow-accent: 0 8px 18px color-mix(in srgb, var(--accent-primary) 28%, transparent);
  --app-theme-font-family: "Roboto", "Geist", "Noto Sans", sans-serif;
  --app-theme-font-size-multiplier: 1;
  --app-theme-font-size-xs: 13px;
  --app-theme-font-size-sm: 14px;
  --app-theme-font-size-md: 15px;
  --app-theme-font-size-lg: 17px;
  --app-theme-font-size-tooltip: var(--app-theme-font-size-xs);
  --app-theme-font-size-title-base: 18px;
  --app-theme-font-size-title: 20px;
  --app-theme-font-size-page-title: 28px;
}

:root.app-theme--surface-cool {
  --bg-app: #f3f6fb;
  --bg-panel: #ffffff;
  --bg-muted: #f7f9fd;
  --border-default: #dde5f0;
  --border-strong: #cbd7e6;
}

:root.app-theme--surface-gray {
  --bg-app: #f4f5f7;
  --bg-panel: #ffffff;
  --bg-muted: #f7f7f9;
  --border-default: #e0e2e7;
  --border-strong: #c9ced8;
}

:root.app-theme--accent-blue {
  --accent-primary: #2f6fe4;
  --accent-primary-hover: #2459bd;
  --accent-soft: #e3edff;
}

:root.app-theme--accent-green {
  --accent-primary: #2f8f4f;
  --accent-primary-hover: #24733e;
  --accent-soft: #e2f1e7;
}

:root.app-theme--accent-violet {
  --accent-primary: #7d4bd6;
  --accent-primary-hover: #6538b4;
  --accent-soft: #eee6fb;
}

:root.app-theme--font-roboto {
  --app-theme-font-family: "Roboto", "Inter", system-ui, sans-serif;
  --app-theme-font-size-multiplier: 1;
  --app-theme-font-size-xs: 13px;
  --app-theme-font-size-sm: 14px;
  --app-theme-font-size-md: 15px;
  --app-theme-font-size-lg: 17px;
  --app-theme-font-size-tooltip: var(--app-theme-font-size-xs);
  --app-theme-font-size-title-base: 18px;
  --app-theme-font-size-title: 20px;
  --app-theme-font-size-page-title: 28px;
}

:root.app-theme--font-caveat {
  --app-theme-font-family: "Caveat", "Neucha", "Roboto", system-ui, sans-serif;
  --app-theme-font-size-multiplier: 1.45;
  --app-theme-font-size-xs: 20px;
  --app-theme-font-size-sm: 21px;
  --app-theme-font-size-md: 23px;
  --app-theme-font-size-lg: 25px;
  --app-theme-font-size-tooltip: var(--app-theme-font-size-xs);
  --app-theme-font-size-title-base: 26px;
  --app-theme-font-size-title: 28px;
  --app-theme-font-size-page-title: 40px;
}

:root.app-theme--font-neucha {
  --app-theme-font-family: "Neucha", "Roboto", system-ui, sans-serif;
  --app-theme-font-size-multiplier: 1.25;
  --app-theme-font-size-xs: 16px;
  --app-theme-font-size-sm: 17px;
  --app-theme-font-size-md: 19px;
  --app-theme-font-size-lg: 21px;
  --app-theme-font-size-tooltip: var(--app-theme-font-size-xs);
  --app-theme-font-size-title-base: 22px;
  --app-theme-font-size-title: 23px;
  --app-theme-font-size-page-title: 32px;
}

.app-button {
  display: inline-flex;
  min-height: 40px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: var(--text-primary);
  font: 700 var(--app-theme-font-size-sm) / 1.2 var(--app-theme-font-family);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.app-button:hover,
.app-button:focus-visible {
  border-color: var(--accent-primary);
  outline: 0;
  background: var(--accent-soft);
}

.app-button--primary {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  color: var(--text-on-accent);
}

.app-button--primary:hover,
.app-button--primary:focus-visible {
  border-color: var(--accent-primary-hover);
  background: var(--accent-primary-hover);
}

.app-button--danger {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border-default));
  color: var(--danger);
}

.app-button--danger:hover,
.app-button--danger:focus-visible {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.app-button--icon {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
}

.app-button--icon > img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.app-button--close > img {
  transition: transform .18s ease;
}

.app-button--close:hover > img,
.app-button--close:focus-visible > img {
  transform: rotate(90deg);
}

.app-button:disabled,
.app-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .55;
}

.sticky-notes-add-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.platform-sticky-notes-layer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
}

.platform-sticky-notes-layer--container {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 5;
}

.platform-sticky-note {
  position: fixed;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--sticky-note-border, var(--border-default)) 68%, #ffffff);
  border-radius: 3px 3px 18px 3px;
  background:
    radial-gradient(circle at 82% 88%, rgba(255, 255, 255, 0.36), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(15, 23, 42, 0.035) 100%),
    var(--sticky-note-bg, #fff59d);
  box-shadow:
    6px 14px 24px rgba(40, 50, 80, 0.20),
    0 2px 5px rgba(40, 50, 80, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: var(--sticky-note-text, var(--text-primary));
  cursor: grab;
  font-family: "Balsamiq Sans", "Comic Sans MS", cursive;
  overflow: visible;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
}

.platform-sticky-note--container {
  position: absolute;
}

.platform-sticky-note::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), transparent 34%, rgba(15, 23, 42, 0.025));
  opacity: 0.72;
}

.platform-sticky-note::after {
  content: "";
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  width: min(28px, 22%);
  height: min(28px, 22%);
  border-radius: 10px 0 12px 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.70), rgba(255, 255, 255, 0.20) 42%, rgba(15, 23, 42, 0.16) 100%),
    var(--sticky-note-bg, #fff59d);
  clip-path: polygon(100% 0, 100% 100%, 0 100%, 18% 88%, 38% 70%, 58% 48%, 78% 22%);
  box-shadow: -3px -3px 7px rgba(80, 40, 70, 0.11), inset -1px -1px 2px rgba(15, 23, 42, 0.10);
  opacity: 0.94;
  pointer-events: none;
}

.platform-sticky-note:focus-visible {
  outline: 0;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent-primary) 24%, transparent),
    6px 14px 24px rgba(40, 50, 80, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.platform-sticky-note.is-moving,
.platform-sticky-note.is-resizing {
  cursor: grabbing;
}

.platform-sticky-note__tape {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: -18px;
  width: min(92px, 56%);
  height: 30px;
  transform: translateX(-50%) rotate(-0.6deg);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 225, 235, 0.32)),
    color-mix(in srgb, var(--sticky-note-bg, #fff59d) 48%, #ffffff);
  box-shadow: 0 5px 10px rgba(80, 40, 70, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.42), inset 0 -1px 0 rgba(80, 40, 70, 0.08);
  opacity: 0.86;
  pointer-events: none;
}

.platform-sticky-note__text {
  position: absolute;
  z-index: 2;
  inset: 30px 14px 16px;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}

.platform-sticky-note__text.is-empty {
  opacity: 0.58;
}

.platform-sticky-note__resize {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: 0;
  width: 30px;
  height: 30px;
  cursor: nwse-resize;
}

.platform-sticky-note-menu {
  position: fixed;
  z-index: 10040;
  display: grid;
  gap: 4px;
  min-width: 156px;
  padding: 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
  font-family: var(--app-theme-font-family, inherit);
}

.platform-sticky-note-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font: 600 var(--app-theme-font-size-sm, 14px) / 1.2 var(--app-theme-font-family, inherit);
  text-align: left;
}

.platform-sticky-note-menu button img {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  object-fit: contain;
}

.platform-sticky-note-menu button.is-danger {
  color: var(--danger);
}

.platform-sticky-note-menu button:hover,
.platform-sticky-note-menu button:focus-visible {
  outline: 0;
  border-color: var(--accent-primary);
  background: var(--accent-soft);
  color: var(--accent-primary);
}

.platform-sticky-note-menu button.is-danger:hover,
.platform-sticky-note-menu button.is-danger:focus-visible {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}

.platform-sticky-note-editor {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.28);
  font-family: var(--app-theme-font-family, inherit);
}

.platform-sticky-note-editor__panel {
  width: min(520px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--bg-panel);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.20);
}

.platform-sticky-note-editor__header,
.platform-sticky-note-editor__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-default);
}

.platform-sticky-note-editor__footer {
  justify-content: flex-end;
  border-top: 1px solid var(--border-default);
  border-bottom: 0;
}

.platform-sticky-note-editor__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-size: var(--app-theme-font-size-title-base, 18px);
  font-weight: 700;
}

.platform-sticky-note-editor__title img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.platform-sticky-note-editor__close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--bg-panel);
  cursor: pointer;
}

.platform-sticky-note-editor__close img {
  width: 20px;
  height: 20px;
  transition: transform 0.16s ease;
}

.platform-sticky-note-editor__close:hover,
.platform-sticky-note-editor__close:focus-visible {
  outline: 0;
  border-color: var(--accent-primary);
  background: var(--accent-soft);
}

.platform-sticky-note-editor__close:hover img,
.platform-sticky-note-editor__close:focus-visible img {
  transform: rotate(90deg);
}

.platform-sticky-note-editor__body {
  display: grid;
  gap: 16px;
  padding: 20px;
  overflow: auto;
}

.platform-sticky-note-editor__field {
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
  font-size: var(--app-theme-font-size-sm, 14px);
  font-weight: 600;
}

.platform-sticky-note-editor__field textarea {
  min-height: 140px;
  resize: vertical;
  box-sizing: border-box;
  padding: 14px;
  border: 1px solid var(--sticky-note-border, var(--border-default));
  border-radius: 10px;
  background: var(--sticky-note-bg, var(--bg-panel));
  color: var(--sticky-note-text, var(--text-primary));
  font: 700 22px / 1.25 "Balsamiq Sans", "Comic Sans MS", cursive;
}

.platform-sticky-note-editor__field textarea:focus {
  outline: 0;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 18%, transparent);
}

.platform-sticky-note-editor__swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 8px;
}

.platform-sticky-note-editor__swatch {
  height: 42px;
  border: 1px solid var(--sticky-note-swatch-border, var(--border-default));
  border-radius: 8px;
  background: var(--sticky-note-swatch-bg, var(--bg-panel));
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.platform-sticky-note-editor__swatch:hover,
.platform-sticky-note-editor__swatch:focus-visible,
.platform-sticky-note-editor__swatch.is-selected {
  outline: 0;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 18%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.platform-sticky-note-editor__btn {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  cursor: pointer;
  font: 700 var(--app-theme-font-size-sm, 14px) / 1.2 var(--app-theme-font-family, inherit);
}

.platform-sticky-note-editor__btn--secondary {
  border: 1px solid var(--border-default);
  background: var(--bg-panel);
  color: var(--text-primary);
}

.platform-sticky-note-editor__btn--primary {
  border: 1px solid var(--accent-primary);
  background: var(--accent-primary);
  color: var(--text-on-accent);
}

.platform-sticky-note-editor__btn--secondary:hover,
.platform-sticky-note-editor__btn--secondary:focus-visible {
  outline: 0;
  background: var(--accent-soft);
  border-color: var(--accent-primary);
}

.platform-sticky-note-editor__btn--primary:hover,
.platform-sticky-note-editor__btn--primary:focus-visible {
  outline: 0;
  border-color: var(--accent-primary-hover);
  background: var(--accent-primary-hover);
}

@media (max-width: 640px) {
  .platform-sticky-note {
    max-width: calc(100vw - 24px);
  }

  .platform-sticky-note-editor {
    padding: 12px;
  }

  .platform-sticky-note-editor__panel {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }
}

/* Board V2 Pair Dots settings */
.pair-dots-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--text-primary) 42%, transparent);
  font-family: var(--app-theme-font-family, inherit);
}

.pair-dots-modal__panel {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--bg-panel);
  color: var(--text-primary);
  box-shadow: 0 22px 64px color-mix(in srgb, var(--text-primary) 22%, transparent);
}

.pair-dots-modal__header,
.pair-dots-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
}

.pair-dots-modal__header {
  border-bottom: 1px solid var(--border-default);
}

.pair-dots-modal__footer {
  border-top: 1px solid var(--border-default);
}

.pair-dots-modal__footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pair-dots-modal__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--app-theme-font-size-title-base, 18px);
  font-weight: 700;
}

.pair-dots-modal__title img {
  width: 28px;
  height: 28px;
}

.pair-dots-modal__close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--bg-panel);
  cursor: pointer;
}

.pair-dots-modal__close img {
  width: 20px;
  height: 20px;
  transition: transform 0.16s ease;
}

.pair-dots-modal__close:hover,
.pair-dots-modal__close:focus-visible {
  outline: 0;
  border-color: var(--accent-primary);
  background: var(--accent-soft);
}

.pair-dots-modal__close:hover img,
.pair-dots-modal__close:focus-visible img {
  transform: rotate(90deg);
}

.pair-dots-modal__body {
  display: grid;
  gap: 20px;
  padding: 20px;
  overflow: auto;
}

.pair-dots-modal__field {
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
  font-size: var(--app-theme-font-size-sm, 14px);
  font-weight: 600;
}

.pair-dots-modal__field-row,
.pair-dots-modal__color,
.pair-dots-modal__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pair-dots-modal__field output {
  min-width: 48px;
  color: var(--text-primary);
  text-align: right;
}

.pair-dots-modal__field input[type="range"] {
  width: 100%;
  accent-color: var(--accent-primary);
}

.pair-dots-modal__toggle {
  justify-content: space-between;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--bg-muted);
  color: var(--text-primary);
  font-size: var(--app-theme-font-size-sm, 14px);
  font-weight: 600;
  cursor: pointer;
}

.pair-dots-modal__toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.pair-dots-modal__toggle-track {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 48px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-secondary) 20%, var(--bg-panel));
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.pair-dots-modal__toggle-track::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-panel);
  box-shadow: 0 2px 7px color-mix(in srgb, var(--text-primary) 22%, transparent);
  transform: translateY(-50%);
  transition: left 0.18s ease;
}

.pair-dots-modal__toggle-input:checked + .pair-dots-modal__toggle-track {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
}

.pair-dots-modal__toggle-input:checked + .pair-dots-modal__toggle-track::after {
  left: 21px;
}

.pair-dots-modal__toggle-input:focus-visible + .pair-dots-modal__toggle-track {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 28%, transparent);
  outline-offset: 2px;
}

.pair-dots-modal__toggle--scope {
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
}

.pair-dots-modal__color {
  padding: 12px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--bg-muted);
  color: var(--text-primary);
  font-size: var(--app-theme-font-size-sm, 14px);
  font-weight: 600;
}

.pair-dots-modal__swatch {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  border: 2px solid var(--bg-panel);
  border-radius: 50%;
  background: var(--pair-dots-swatch, var(--accent-primary));
  box-shadow: 0 0 0 1px var(--border-strong);
  cursor: pointer;
}

.pair-dots-modal__swatch:hover,
.pair-dots-modal__swatch:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 35%, transparent);
  outline-offset: 2px;
}

.pair-dots-modal__button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  cursor: pointer;
  font: 700 var(--app-theme-font-size-sm, 14px) / 1.2 var(--app-theme-font-family, inherit);
}

.pair-dots-modal__button--secondary {
  border: 1px solid var(--border-default);
  background: var(--bg-panel);
  color: var(--text-primary);
}

.pair-dots-modal__button--primary {
  border: 1px solid var(--accent-primary);
  background: var(--accent-primary);
  color: var(--text-on-accent);
}

.pair-dots-modal__button--secondary:hover,
.pair-dots-modal__button--secondary:focus-visible,
.pair-dots-modal__button--secondary.is-active {
  outline: 0;
  border-color: var(--accent-primary);
  background: var(--accent-soft);
}

.pair-dots-modal__button--primary:hover,
.pair-dots-modal__button--primary:focus-visible {
  outline: 0;
  border-color: var(--accent-primary-hover);
  background: var(--accent-primary-hover);
}

@media (max-width: 640px) {
  .pair-dots-modal {
    padding: 12px;
  }

  .pair-dots-modal__panel {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .pair-dots-modal__color {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .pair-dots-modal__footer {
    align-items: flex-end;
    flex-wrap: wrap;
  }
}
