/* Catppuccin Mocha (default) */
:root {
  color-scheme: dark;
  --base: #1e1e2e;
  --mantle: #181825;
  --crust: #11111b;
  --surface0: #313244;
  --surface1: #45475a;
  --surface2: #585b70;
  --overlay0: #6c7086;
  --overlay1: #7f849c;
  --text: #cdd6f4;
  --subtext0: #a6adc8;
  --subtext1: #bac2de;
  --blue: #89b4fa;
  --lavender: #b4befe;
  --sapphire: #74c7ec;
  --sky: #89dceb;
  --teal: #94e2d5;
  --green: #a6e3a1;
  --yellow: #f9e2af;
  --peach: #fab387;
  --maroon: #eba0ac;
  --red: #f38ba8;
  --mauve: #cba6f7;
  --pink: #f5c2e7;
  --flamingo: #f2cdcd;
  --rosewater: #f5e0dc;
}

/* Catppuccin Latte (light) */
[data-theme='latte'] {
  color-scheme: light;
  --base: #eff1f5;
  --mantle: #e6e9ef;
  --crust: #dce0e8;
  --surface0: #ccd0da;
  --surface1: #bcc0cc;
  --surface2: #acb0be;
  --overlay0: #9ca0b0;
  --overlay1: #8c8fa1;
  --text: #4c4f69;
  --subtext0: #6c6f85;
  --subtext1: #5c5f77;
  --blue: #1e66f5;
  --lavender: #7287fd;
  --sapphire: #209fb5;
  --sky: #04a5e5;
  --teal: #179299;
  --green: #40a02b;
  --yellow: #df8e1d;
  --peach: #fe640b;
  --maroon: #e64553;
  --red: #d20f39;
  --mauve: #8839ef;
  --pink: #ea76cb;
  --flamingo: #dd7878;
  --rosewater: #dc8a78;
}

/* Catppuccin Frappé (medium dark) */
[data-theme='frappe'] {
  color-scheme: dark;
  --base: #303446;
  --mantle: #292c3c;
  --crust: #232634;
  --surface0: #414559;
  --surface1: #51576d;
  --surface2: #626880;
  --overlay0: #737994;
  --overlay1: #838ba7;
  --text: #c6d0f5;
  --subtext0: #a5adce;
  --subtext1: #b5bfe2;
  --blue: #8caaee;
  --lavender: #babbf1;
  --sapphire: #85c1dc;
  --sky: #99d1db;
  --teal: #81c8be;
  --green: #a6d189;
  --yellow: #e5c890;
  --peach: #ef9f76;
  --maroon: #ea999c;
  --red: #e78284;
  --mauve: #ca9ee6;
  --pink: #f4b8e4;
  --flamingo: #eebebe;
  --rosewater: #f2d5cf;
}

/* Catppuccin Macchiato (dark) */
[data-theme='macchiato'] {
  color-scheme: dark;
  --base: #24273a;
  --mantle: #1e2030;
  --crust: #181926;
  --surface0: #363a4f;
  --surface1: #494d64;
  --surface2: #5b6078;
  --overlay0: #6e738d;
  --overlay1: #8087a2;
  --text: #cad3f5;
  --subtext0: #a5adcb;
  --subtext1: #b8c0e0;
  --blue: #8aadf4;
  --lavender: #b7bdf8;
  --sapphire: #7dc4e4;
  --sky: #91d7e3;
  --teal: #8bd5ca;
  --green: #a6da95;
  --yellow: #eed49f;
  --peach: #f5a97f;
  --maroon: #ee99a0;
  --red: #ed8796;
  --mauve: #c6a0f6;
  --pink: #f5bde6;
  --flamingo: #f0c6c6;
  --rosewater: #f4dbd6;
}

/* System: Latte in light mode, Mocha in dark mode */
[data-theme='system'] {
  color-scheme: light dark;
  --base: #eff1f5;
  --mantle: #e6e9ef;
  --crust: #dce0e8;
  --surface0: #ccd0da;
  --surface1: #bcc0cc;
  --surface2: #acb0be;
  --overlay0: #9ca0b0;
  --overlay1: #8c8fa1;
  --text: #4c4f69;
  --subtext0: #6c6f85;
  --subtext1: #5c5f77;
  --blue: #1e66f5;
  --lavender: #7287fd;
  --sapphire: #209fb5;
  --sky: #04a5e5;
  --teal: #179299;
  --green: #40a02b;
  --yellow: #df8e1d;
  --peach: #fe640b;
  --maroon: #e64553;
  --red: #d20f39;
  --mauve: #8839ef;
  --pink: #ea76cb;
  --flamingo: #dd7878;
  --rosewater: #dc8a78;
}
@media (prefers-color-scheme: dark) {
  [data-theme='system'] {
    --base: #1e1e2e;
    --mantle: #181825;
    --crust: #11111b;
    --surface0: #313244;
    --surface1: #45475a;
    --surface2: #585b70;
    --overlay0: #6c7086;
    --overlay1: #7f849c;
    --text: #cdd6f4;
    --subtext0: #a6adc8;
    --subtext1: #bac2de;
    --blue: #89b4fa;
    --lavender: #b4befe;
    --sapphire: #74c7ec;
    --sky: #89dceb;
    --teal: #94e2d5;
    --green: #a6e3a1;
    --yellow: #f9e2af;
    --peach: #fab387;
    --maroon: #eba0ac;
    --red: #f38ba8;
    --mauve: #cba6f7;
    --pink: #f5c2e7;
    --flamingo: #f2cdcd;
    --rosewater: #f5e0dc;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--base);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

nav {
  background: var(--mantle);
  border-bottom: 1px solid var(--surface0);
  padding: 0.75rem 0;
}
nav .container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
nav .brand {
  color: var(--mauve);
  font-weight: 700;
  font-size: 1.1rem;
}
nav a {
  color: var(--subtext1);
  font-size: 0.9rem;
}
nav a:hover {
  color: var(--text);
  text-decoration: none;
}
nav .nav-right {
  margin-left: auto;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.status-badge {
  font-size: 0.75rem;
  color: var(--green);
  background: var(--surface0);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

main {
  padding: 2rem 0;
}

/* Forms */
.form-card {
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 8px;
  padding: 2rem;
  max-width: 480px;
  margin: 2rem auto;
}
.form-card h1 {
  font-size: 1.4rem;
  color: var(--mauve);
  margin-bottom: 0.5rem;
}
.form-card p {
  color: var(--subtext0);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.field {
  margin-bottom: 1.25rem;
}
.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--subtext1);
  margin-bottom: 0.35rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--surface0);
  border: 1px solid var(--surface1);
  border-radius: 6px;
  color: var(--text);
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--blue);
  outline-offset: -1px;
  border-color: transparent;
}
.field textarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}
.field .hint {
  font-size: 0.8rem;
  color: var(--overlay1);
  margin-top: 0.25rem;
}
.field .radio-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  text-align: left;
  cursor: pointer;
}
.field .radio-option:last-child {
  margin-bottom: 0;
}
.field .radio-option input[type='radio'] {
  width: auto;
  flex: 0 0 auto;
  margin-top: 0.2rem;
}
.field .radio-option span {
  flex: 1;
}
.badge-sensitive {
  font-size: 0.7rem;
  background: var(--surface1);
  color: var(--yellow);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.field-help {
  color: var(--overlay1);
  cursor: help;
  font-size: 0.8rem;
}
.field-help:hover,
.field-help:focus {
  color: var(--blue);
}
.badge-required {
  font-size: 0.7rem;
  background: var(--surface1);
  color: var(--red);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.error-banner {
  background: color-mix(in srgb, var(--red) 15%, var(--mantle));
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.success-banner {
  background: color-mix(in srgb, var(--green) 15%, var(--mantle));
  border: 1px solid var(--green);
  color: var(--green);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}
.btn-primary {
  background: var(--blue);
  color: var(--crust);
}
.btn-primary:hover {
  background: var(--sapphire);
  text-decoration: none;
}
.btn-secondary {
  background: var(--surface1);
  color: var(--text);
}
.btn-secondary:hover {
  background: var(--surface2);
  text-decoration: none;
}
.btn-danger {
  background: color-mix(in srgb, var(--red) 20%, var(--surface0));
  color: var(--red);
}

/* Modal dialog */
dialog.modal {
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 8px;
  padding: 2rem;
  max-width: 460px;
  width: 100%;
  color: var(--text);
}
dialog.modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
}
dialog.modal .modal-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.page-header h1 {
  font-size: 1.4rem;
  color: var(--text);
}

/* Cards / list items */
.card {
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.card:hover {
  border-color: var(--surface1);
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.card-meta {
  font-size: 0.82rem;
  color: var(--subtext0);
  margin-top: 0.25rem;
}
.card-summary {
  font-size: 0.9rem;
  color: var(--subtext1);
  margin-top: 0.4rem;
}
.note-icon {
  position: relative;
  width: 1.2rem;
  height: 1.2rem;
  border: 1px solid var(--surface1);
  border-radius: 50%;
  background: var(--surface0);
  color: var(--sky);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  margin: 0 0.25rem;
  padding: 0;
  text-align: center;
}
.note-icon::after {
  content: attr(data-note);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  z-index: 10;
  width: max-content;
  max-width: min(22rem, 80vw);
  transform: translateX(-50%);
  background: var(--crust);
  border: 1px solid var(--surface1);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.35;
  opacity: 0;
  padding: 0.55rem 0.7rem;
  pointer-events: none;
  text-align: left;
  transition: opacity 0.12s ease;
  white-space: normal;
}
.note-icon:hover::after,
.note-icon:focus::after {
  opacity: 1;
}

.tag {
  display: inline-block;
  background: var(--surface0);
  color: var(--mauve);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  font-size: 0.78rem;
  margin: 0.15rem 0.1rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--subtext0);
}
.empty-state h2 {
  color: var(--overlay1);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

/* Detail view */
.detail-section {
  margin-bottom: 2rem;
}
.detail-section h2 {
  font-size: 1rem;
  color: var(--subtext1);
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--surface0);
  padding-bottom: 0.4rem;
}
.detail-row {
  display: flex;
  gap: 1rem;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.detail-label {
  color: var(--subtext0);
  min-width: 140px;
  flex-shrink: 0;
}
.detail-value {
  color: var(--text);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}
.stat-card .stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue);
}
.stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--subtext0);
  margin-top: 0.25rem;
}

/* Status badges */
.badge-ok {
  display: inline-block;
  font-size: 0.75rem;
  background: color-mix(in srgb, var(--green) 20%, var(--surface0));
  color: var(--green);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}
.badge-error {
  display: inline-block;
  font-size: 0.75rem;
  background: color-mix(in srgb, var(--red) 20%, var(--surface0));
  color: var(--red);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}
.badge-running {
  display: inline-block;
  font-size: 0.75rem;
  background: color-mix(in srgb, var(--yellow) 20%, var(--surface0));
  color: var(--yellow);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

/* Data table */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--surface0);
  border-radius: 8px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th {
  background: var(--mantle);
  color: var(--subtext0);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--surface0);
}
.data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--surface0);
  color: var(--text);
  vertical-align: middle;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr:hover td {
  background: var(--mantle);
}

/* Import progress bar */
.import-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--surface1);
  overflow: hidden;
  min-width: 80px;
  position: relative;
}
.import-progress--running::after {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  background: var(--blue);
  border-radius: 3px;
  animation: import-slide 1.4s ease-in-out infinite;
}
@keyframes import-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
.import-progress--done::after {
  content: '';
  display: block;
  height: 100%;
  width: 100%;
  background: var(--green);
}

/* Muted helper */
.muted {
  color: var(--subtext0);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 600px) {
  .form-card {
    margin: 1rem;
    padding: 1.25rem;
  }
  nav .container {
    gap: 0.75rem;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Skill Trees ─────────────────────────────────────────────────────────── */

/* Card grid (skill tree list page) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

/* Skill tree card on list page — must be block so <a> doesn't render inline */
.skill-tree-card {
  display: block;
  color: var(--text);
}
.skill-tree-card:hover {
  text-decoration: none;
  border-color: var(--blue);
}

/* Button size variants */
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}
.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
}
.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
}

/* Base badge */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-success {
  background: color-mix(in srgb, var(--green) 20%, var(--surface0));
  color: var(--green);
}
.badge-easy {
  background: color-mix(in srgb, var(--green) 20%, var(--surface0));
  color: var(--green);
}
.badge-medium {
  background: color-mix(in srgb, var(--yellow) 20%, var(--surface0));
  color: var(--yellow);
}
.badge-hard {
  background: color-mix(in srgb, var(--red) 20%, var(--surface0));
  color: var(--red);
}
.badge-xp {
  background: color-mix(in srgb, var(--blue) 20%, var(--surface0));
  color: var(--blue);
}

/* Difficulty section headings */
.skill-section {
  margin-bottom: 2rem;
}
.skill-section-heading {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--subtext1);
  border-bottom: 1px solid var(--surface0);
  padding-bottom: 0.35rem;
  margin-bottom: 0.75rem;
}

/* Skill card grid */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

/* Skill card — playing card style */
.skill-card-wrap {
  position: relative;
}
.skill-card {
  position: relative;
  background: var(--mantle);
  border: 1px solid var(--surface1);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.skill-card:hover {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 5%, var(--mantle));
}
.skill-card--done {
  opacity: 0.6;
  border-style: dashed;
}
.skill-card--done:hover {
  border-color: var(--teal);
}
.skill-complete-overlay {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  font-size: 1rem;
  color: var(--teal);
  font-weight: 700;
  pointer-events: none;
}
.skill-card-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  line-height: 1.35;
}

/* Whole uncompleted card is draggable (press-and-hold to drag, click to expand). */
.skill-card-wrap:not([data-completed="true"]) .skill-card {
  cursor: grab;
}
.skill-card-wrap:not([data-completed="true"]) .skill-card:active {
  cursor: grabbing;
}

/* Placeholder shown inside an empty tier so users have a drop target */
.skill-grid-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--surface1);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--subtext0);
}
.skill-grid:has(.skill-card-wrap) .skill-grid-empty {
  display: none;
}

/* Sortable.js drag state styles */
.skill-card-wrap.sortable-ghost {
  opacity: 0.35;
}
.skill-card-wrap.sortable-ghost .skill-card {
  border-style: dashed;
  border-color: var(--blue);
}
.skill-card-wrap.sortable-drag {
  cursor: grabbing;
}

/* On the skill detail page, let the main container use more horizontal space
   so the sidebar + tier grid has room to spread out. Other pages keep 960px. */
main > .container:has(.skill-reorder-root--with-sidebar),
main > .container:has(.skills-overview-next) {
  max-width: min(1400px, 95vw);
}

/* "Next to work on" sidebar layout — sidebar on the left, tiers on the right. */
.skill-reorder-root--with-sidebar {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1.5rem;
  align-items: start;
}
.skill-next-sidebar {
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  margin-bottom: 0;
  background: color-mix(in srgb, var(--mauve) 12%, var(--mantle));
  border: 1px solid color-mix(in srgb, var(--mauve) 35%, transparent);
  border-radius: 10px;
  padding: 0.75rem 0.9rem 1rem;
}
.skill-next-sidebar .skill-section-heading {
  color: var(--mauve);
  border-bottom-color: color-mix(in srgb, var(--mauve) 30%, transparent);
}
.skill-grid--next {
  grid-template-columns: 1fr;
}

@media (max-width: 768px) {
  .skill-reorder-root--with-sidebar {
    grid-template-columns: 1fr;
  }
  .skill-next-sidebar {
    position: static;
    max-height: none;
    margin-bottom: 2rem;
  }
}
.skill-card-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: auto;
}

/* "Next to work on" overview on the skill trees list page */
.skills-overview-next {
  margin-bottom: 1.5rem;
}
.skills-overview-heading {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--mauve);
  margin-bottom: 0.6rem;
}
.skills-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.skills-overview-column {
  position: relative;
  background: color-mix(in srgb, var(--mauve) 12%, var(--mantle));
  border: 1px solid color-mix(in srgb, var(--mauve) 35%, transparent);
  border-radius: 10px;
  padding: 0.75rem 0.9rem 0.9rem;
}
.skills-overview-column-handle {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  padding: 0 0.3rem;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--subtext0);
  cursor: grab;
  user-select: none;
  letter-spacing: -0.15em;
}
.skills-overview-column-handle:active {
  cursor: grabbing;
}
.skills-overview-column.sortable-ghost {
  opacity: 0.35;
}
.skills-overview-column.sortable-drag {
  cursor: grabbing;
}
.skills-overview-column-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mauve);
  margin: 0 0 0.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--mauve) 30%, transparent);
  padding-bottom: 0.35rem;
}
.skills-overview-column-title a {
  color: inherit;
  text-decoration: none;
}
.skills-overview-column-title a:hover {
  text-decoration: underline;
}
.skills-overview-skills {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.skills-overview-skill {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  background: var(--mantle);
  border: 1px solid var(--surface1);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.3;
  text-decoration: none;
}
.skills-overview-skill:hover {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 6%, var(--mantle));
  text-decoration: none;
}
.skills-overview-skill {
  cursor: grab;
}
.skills-overview-skill:active {
  cursor: grabbing;
}
.skills-overview-skill.sortable-ghost {
  opacity: 0.35;
  border-style: dashed;
  border-color: var(--blue);
}
.skills-overview-skill.sortable-drag {
  cursor: grabbing;
}

/* Skill detail panel (expands below card on click) */
.skill-detail {
  background: var(--surface0);
  border: 1px solid var(--surface1);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 1rem;
}
.skill-detail-inner h3 {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.skill-detail-section {
  margin-bottom: 1rem;
}
.skill-detail-section h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--subtext0);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.skill-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--surface1);
}

/* Notes UI */
.notes-list {
  margin-bottom: 0.75rem;
}
.note-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--surface0);
}
.note-item:last-child {
  border-bottom: none;
}
.note-body {
  font-size: 0.88rem;
  color: var(--subtext1);
  flex: 1;
  line-height: 1.4;
  white-space: pre-wrap;
}
.note-add-form {
  display: block;
}
.note-textarea {
  width: 100%;
  background: var(--surface0);
  border: 1px solid var(--surface1);
  border-radius: 6px;
  color: var(--text);
  padding: 0.5rem 0.65rem;
  font-size: 0.9rem;
  resize: vertical;
  font-family: inherit;
  min-height: 60px;
}
.note-textarea:focus {
  outline: 2px solid var(--blue);
  outline-offset: -1px;
  border-color: transparent;
}

/* Note count indicator (shown on cards that have notes underneath) */
.note-indicator {
  position: absolute;
  bottom: 0.275rem;
  left: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sky) 18%, var(--surface0));
  border: 1px solid var(--surface1);
  color: var(--sky);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}
.skill-tree-card {
  position: relative;
}

/* Catalog card */
.catalog-card {
  display: block;
  cursor: pointer;
}
.catalog-card:hover {
  border-color: var(--blue);
  text-decoration: none;
}

@media (max-width: 600px) {
  .card-grid,
  .skill-grid {
    grid-template-columns: 1fr;
  }
}
