:root {
  --primary: #075ea8;
  --primary-dark: #064b84;
  --primary-soft: #eaf4ff;
  --accent: #f2b544;
  --surface: #ffffff;
  --page: #f5f7fa;
  --text: #172033;
  --muted: #667085;
  --border: #d6deea;
  --danger: #b42318;
  --success: #087443;
  --shadow: 0 12px 32px rgba(19, 43, 73, 0.1);
  --radius: 14px;
  --header-height: 62px;
  --sidebar-width: 250px;
}

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

html { color-scheme: light; scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-family: "Noto Sans JP", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  line-height: 1.6;
}

button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

:focus-visible {
  outline: 3px solid rgba(7, 94, 168, 0.28);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.app-container { width: min(calc(100% - 40px), 1320px); margin-inline: auto; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(214, 222, 234, 0.9);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}

.header-inner { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 16px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #0b73c9, #064b84);
  box-shadow: 0 5px 12px rgba(7, 94, 168, 0.22);
}

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid #b8d5ef;
  border-radius: 999px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 0.75rem;
  font-weight: 800;
}

.local-badge > span { color: var(--success); font-size: 0.62rem; }

.privacy-note { border-bottom: 1px solid #eee0bd; color: #72551d; background: #fff9e9; }
.privacy-note-inner { display: flex; min-height: 38px; align-items: center; gap: 9px; font-size: 0.78rem; }
.privacy-note p { margin: 0; }

.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 101px); }
.sidebar { position: sticky; top: 101px; align-self: start; height: calc(100vh - 101px); padding: 22px 16px; overflow-y: auto; border-right: 1px solid var(--border); background: #f8f9fb; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding: 0 8px; }
.sidebar-heading h2 { margin: 0; color: #344054; font-size: .82rem; font-weight: 900; }
.sidebar-heading span { display: grid; min-width: 25px; height: 25px; place-items: center; padding: 0 6px; border-radius: 999px; color: var(--primary-dark); background: var(--primary-soft); font-size: .7rem; font-weight: 900; }
.category-nav { display: grid; gap: 5px; }
.category-button { display: flex; width: 100%; min-height: 42px; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; color: #475467; text-align: left; background: transparent; }
.category-button:hover, .category-button:focus-visible { border-color: #c9d3e2; background: #fff; }
.category-button.is-active { border-color: #9eb4ef; color: var(--primary-dark); background: #eef4ff; box-shadow: inset 3px 0 0 var(--primary); }
.category-button-name { min-width: 0; overflow: hidden; font-size: .84rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.category-button-count { flex: 0 0 auto; color: #8490a1; font-size: .7rem; font-weight: 800; }
.category-button.is-active .category-button-count { color: var(--primary); }
.category-row { display: grid; grid-template-columns: minmax(0,1fr) 28px; gap: 2px; align-items: center; }
.category-row[draggable="true"] { cursor: grab; }
.category-row.is-category-dragging { cursor: grabbing; opacity: .48; }
.category-row.is-category-drag-before { box-shadow: 0 -3px 0 var(--primary); }
.category-row.is-category-drag-after { box-shadow: 0 3px 0 var(--primary); }
.category-action-button { display: grid; width: 28px; height: 30px; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 8px; color: #7a8493; background: transparent; font-size: .78rem; }
.category-action-button:hover, .category-action-button:focus-visible { border-color: #c9d3e2; color: var(--primary-dark); background: #eef4ff; }
.sidebar-category-editor { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; padding: 8px; border: 1px solid #a8c7ee; border-radius: 10px; background: #f8fbff; }
.sidebar-category-editor > input { width: 100%; min-width: 0; height: 34px; padding: 6px 8px; border: 1px solid #c9d3e2; border-radius: 7px; color: var(--text); background: #fff; }
.sidebar-category-editor-actions { display: flex; gap: 3px; }
.sidebar-category-editor-button { display: grid; width: 29px; height: 34px; place-items: center; padding: 0; border: 1px solid #c9d3e2; border-radius: 7px; color: #667085; background: #fff; font-weight: 900; }
.sidebar-category-editor-button.is-save { border-color: var(--primary); color: #fff; background: var(--primary); }
.sidebar-category-editor-button.is-danger { color: var(--danger); }
.sidebar-category-editor-button:disabled { cursor: not-allowed; opacity: .38; }
.sidebar-note { margin: 18px 8px 0; color: var(--muted); font-size: .68rem; line-height: 1.6; }
.main-panel { min-width: 0; padding: 0 28px 56px; }
.board-toolbar { position: sticky; top: 62px; z-index: 20; display: flex; min-height: 112px; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 0 14px; border-bottom: 1px solid var(--border); background: rgba(245,247,250,.94); backdrop-filter: blur(10px); }
.page-heading { min-width: 0; }
.primary-actions { display: flex; flex: 0 0 auto; gap: 8px; }

.eyebrow, .dialog-kicker {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

h1 { margin: 0; font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.25; letter-spacing: -0.03em; }
.lead { margin: 7px 0 0; color: var(--muted); font-size: 0.94rem; }

.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 800;
  line-height: 1.25;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.button:hover { transform: translateY(-1px); }
.button-primary { border-color: var(--primary); color: #fff; background: var(--primary); box-shadow: 0 6px 14px rgba(7, 94, 168, 0.18); }
.button-primary:hover { border-color: var(--primary-dark); background: var(--primary-dark); }
.button-secondary { border-color: var(--border); color: #344054; background: #fff; }
.button-secondary:hover { border-color: #a9bad0; background: #f9fbfd; }
.add-button { flex: 0 0 auto; padding-inline: 20px; }

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 16px 0 10px;
  border-bottom: 1px solid var(--border);
}

.field-label { display: block; margin-bottom: 5px; color: #475467; font-size: 0.74rem; font-weight: 800; }
.search-input-wrap { position: relative; display: flex; align-items: center; }
.search-input-wrap > span { position: absolute; left: 13px; color: #7d8a9d; font-size: 1.35rem; transform: rotate(-12deg); pointer-events: none; }

.search-field input, .filter-field select, .form-field input, .form-field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c7d1df;
  border-radius: 9px;
  color: var(--text);
  background: #fff;
}

.search-field input { padding: 9px 42px 9px 42px; }
.filter-field select { padding: 8px 34px 8px 12px; }
.search-field input::placeholder, .form-field input::placeholder, .form-field textarea::placeholder { color: #98a2b3; }
.search-field input:focus, .filter-field select:focus, .form-field input:focus, .form-field textarea:focus { border-color: var(--primary); outline: 3px solid rgba(7, 94, 168, 0.12); }

.clear-search {
  position: absolute;
  right: 7px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #667085;
  background: transparent;
}

.clear-search:hover { background: #eef2f7; }
.mobile-category-field { display: none; }
.button-filter { border-color: var(--border); color: #475467; background: #fff; }
.button-filter[aria-pressed="true"] { border-color: #e5b136; color: #765312; background: #fff7dc; }
.button-filter[aria-pressed="true"] > span:first-child { color: #d99300; }

.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 17px 2px 10px; color: var(--muted); font-size: 0.78rem; }
.result-bar p { margin: 0; }
.result-bar [data-result-count] { color: #344054; font-weight: 800; }

.snippet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; align-items: stretch; }

.snippet-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 238px;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(19, 43, 73, 0.045);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.snippet-card:hover, .snippet-card:focus-within { border-color: #aecce8; box-shadow: var(--shadow); transform: translateY(-2px); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-heading { min-width: 0; }
.category-chip { display: inline-block; max-width: 100%; overflow: hidden; color: var(--primary-dark); font-size: 0.7rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.card-title { margin: 2px 0 0; overflow-wrap: anywhere; font-size: 1rem; line-height: 1.45; }
.card-actions { display: flex; flex: 0 0 auto; gap: 3px; }

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: #667085;
  background: transparent;
  font-size: 1.05rem;
}

.icon-button:hover { color: var(--primary); background: var(--primary-soft); }
.delete-button:hover { color: var(--danger); background: #fff0ef; }

.snippet-body {
  display: -webkit-box;
  min-height: calc(1.65em * 4);
  margin: 0;
  overflow: hidden;
  color: #475467;
  font-size: 0.86rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.snippet-card.is-expanded .snippet-body { display: block; max-height: none; }
.expand-button { align-self: flex-start; margin: 7px 0 12px; padding: 4px 0; border: 0; color: var(--primary); background: transparent; font-size: 0.76rem; font-weight: 800; }
.expand-button:hover { text-decoration: underline; }
.card-spacer { flex: 1; min-height: 14px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 13px; border-top: 1px solid #edf0f4; }
.updated-at { color: #8490a1; font-size: 0.68rem; white-space: nowrap; }
.copy-button { min-width: 122px; }
.copy-button.is-copied { border-color: var(--success); background: var(--success); }

.empty-state { display: grid; min-height: 330px; place-items: center; align-content: center; gap: 7px; padding: 28px; border: 1px dashed #b8c5d5; border-radius: var(--radius); color: var(--muted); text-align: center; background: rgba(255,255,255,0.7); }
.empty-state h2, .empty-state p { margin: 0; }
.empty-state h2 { color: #344054; font-size: 1.05rem; }
.empty-state p { margin-bottom: 10px; font-size: 0.85rem; }
.empty-icon { font-size: 2rem; color: #9cb5cd; }

.toast {
  position: fixed;
  top: 76px;
  right: 18px;
  z-index: 100;
  display: flex;
  max-width: min(390px, calc(100% - 36px));
  align-items: center;
  gap: 14px;
  padding: 11px 12px 11px 15px;
  border: 1px solid #a8dcc5;
  border-radius: 11px;
  color: #065c37;
  background: #edfcf5;
  box-shadow: var(--shadow);
  font-size: 0.83rem;
  font-weight: 700;
}

.toast.is-error { border-color: #f2bbb5; color: #8f1d14; background: #fff1f0; }
.toast button { width: 30px; height: 30px; border: 0; border-radius: 7px; color: inherit; background: transparent; font-size: 1.1rem; }

.app-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: min(90dvh, 820px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: 0 28px 80px rgba(15, 32, 55, 0.28);
}

.app-dialog::backdrop { background: rgba(13, 25, 42, 0.52); backdrop-filter: blur(2px); }
.dialog-card { display: flex; max-height: min(90dvh, 820px); flex-direction: column; background: #fff; }
.dialog-card-small { max-width: 520px; margin-inline: auto; }
.dialog-header { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 19px 21px; border-bottom: 1px solid #e5eaf0; }
.dialog-header h2 { margin: 0; font-size: 1.18rem; }
.dialog-close { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 9px; color: #667085; background: #f2f4f7; font-size: 1.35rem; }
.dialog-close:hover { color: #344054; background: #e7ebf0; }
.dialog-body { display: grid; gap: 17px; padding: 20px 21px; overflow-y: auto; }
.dialog-footer { display: flex; flex: 0 0 auto; justify-content: flex-end; gap: 9px; padding: 14px 21px; border-top: 1px solid #e5eaf0; background: #fbfcfd; }

.form-field { display: block; }
.form-field > span { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; color: #344054; font-size: 0.82rem; font-weight: 800; }
.form-field strong { color: var(--primary); font-size: 0.68rem; }
.form-field input, .form-field textarea { display: block; padding: 10px 12px; }
.form-field textarea { min-height: 190px; resize: vertical; line-height: 1.6; }
.form-field small, .data-action small, .import-option small { display: block; margin-top: 4px; color: var(--muted); font-size: 0.72rem; font-weight: 400; }
.form-error { margin: 0; padding: 9px 11px; border-radius: 8px; color: #8f1d14; background: #fff1f0; font-size: 0.78rem; }

.data-help { margin: 0; color: var(--muted); font-size: 0.82rem; }
.data-actions { display: grid; gap: 9px; }
.data-action { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 11px; align-items: center; width: 100%; min-height: 68px; padding: 11px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-align: left; background: #fff; }
.data-action:hover { border-color: #9fc4e5; background: #f8fbff; }
.data-action-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: 1.25rem; font-weight: 900; }
.data-action strong { font-size: 0.86rem; }

.import-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0; }
.import-summary div { padding: 10px; border: 1px solid var(--border); border-radius: 9px; text-align: center; background: #f9fbfd; }
.import-summary dt { color: var(--muted); font-size: 0.68rem; }
.import-summary dd { margin: 2px 0 0; color: var(--primary-dark); font-weight: 900; }
.import-options { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.import-options legend { margin-bottom: 6px; color: #344054; font-size: 0.8rem; font-weight: 800; }
.import-option { display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding: 11px; border: 1px solid var(--border); border-radius: 9px; }
.import-option:has(input:checked) { border-color: #82b6e3; background: #f1f8ff; }
.import-option input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.import-option-danger:has(input:checked) { border-color: #e1a7a1; background: #fff4f3; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 200px minmax(0, 1fr); }
  .main-panel { padding-inline: 20px; }
  .board-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .primary-actions { width: 100%; }
  .primary-actions .button { flex: 1; }
}

@media (max-width: 680px) {
  .app-container { width: min(calc(100% - 28px), 1320px); }
  .header-inner { min-height: 56px; }
  .brand { font-size: 0.94rem; }
  .brand-mark { width: 31px; height: 31px; }
  .local-badge { padding: 4px 8px; font-size: 0.68rem; }
  .privacy-note-inner { align-items: flex-start; padding-block: 7px; line-height: 1.45; }
  .app-shell { display: block; min-height: auto; }
  .sidebar { display: none; }
  .main-panel { padding: 0 14px 42px; }
  .board-toolbar { position: static; min-height: auto; padding: 18px 0 14px; }
  .lead { font-size: 0.84rem; }
  .primary-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .primary-actions .button { min-width: 0; padding-inline: 9px; font-size: .78rem; }
  .toolbar { grid-template-columns: minmax(0, 1fr) auto; padding-top: 12px; }
  .search-field { grid-column: 1 / -1; }
  .mobile-category-field { display: block; }
  .button-filter { align-self: end; }
  .filter-field select { width: 100%; }
  .sort-note { display: none; }
  .snippet-grid { grid-template-columns: minmax(0, 1fr); }
  .snippet-card { min-height: 245px; padding: 15px; }
  .card-header { gap: 6px; }
  .card-footer { align-items: stretch; flex-direction: column-reverse; }
  .copy-button { width: 100%; min-height: 48px; }
  .updated-at { text-align: right; }
  .toast { top: 68px; right: 14px; }
  .app-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
  .dialog-card { max-height: calc(100dvh - 20px); }
  .dialog-header, .dialog-body { padding-inline: 16px; }
  .dialog-footer { padding: 12px 16px; }
  .dialog-footer .button { flex: 1; min-width: 0; }
  .form-field textarea { min-height: 220px; }
}

/* Linkboard browser edition visual system */
.linkboard-style-header {
  position: sticky;
  min-height: 60px;
  border-bottom: 1px solid rgba(255,255,255,.18);
  background: #1b1012;
  backdrop-filter: none;
}

.linkboard-style-header .header-inner {
  width: 100%;
  min-height: 60px;
  padding: 0 28px;
}

.linkboard-style-header .brand {
  gap: 10px;
  color: #f5f5f5;
}

.linkboard-style-header .brand-title {
  display: inline-flex;
  align-items: center;
  padding: 0 16px 0 0;
  font-family: "Yomogi", "Noto Sans JP", sans-serif;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .02em;
  text-shadow: 0 2px 0 rgba(0,0,0,.36);
}

.linkboard-style-header .local-badge {
  padding: 4px 9px;
  border-color: rgba(255,255,255,.25);
  color: #e5e7eb;
  background: transparent;
  font-family: "Noto Sans JP", sans-serif;
  font-size: .68rem;
}

.top-nav { display: flex; align-items: center; gap: 14px; }
.top-nav a { padding-bottom: 2px; border-bottom: 2px solid transparent; color: #d1d5db; font-size: 1rem; font-weight: 700; text-decoration: none; }
.top-nav a:hover, .top-nav a:focus-visible { color: #fff; }

.app-shell { grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.sidebar { top: 60px; height: calc(100vh - 60px); padding: 15px 14px; background: #f8f9fb; }
.category-sidebar-title { margin: 0 0 12px; padding: 2px 0 8px 9px; border-bottom: 1px solid var(--border); border-left: 3px solid var(--primary); color: #475467; font-size: .84rem; }
.category-button { min-height: 40px; padding: 7px 10px; }
.category-add-divider { position: relative; height: 34px; margin-top: 10px; }
.category-add-divider::before { position: absolute; top: 50%; right: 0; left: 0; height: 1px; background: var(--border); content: ""; }
.category-add-icon-button { position: absolute; top: 50%; left: 50%; display: grid; width: 26px; height: 26px; place-items: center; padding: 0; border: 2px solid #fff; border-radius: 50%; color: #fff; background: var(--primary); box-shadow: 0 1px 3px rgba(16,24,40,.2); font-weight: 900; transform: translate(-50%,-50%); }
.main-panel { padding: 0 22px 48px; }
.board-toolbar { position: sticky; top: 60px; min-height: 58px; align-items: center; flex-direction: row; gap: 14px; padding: 9px 0 8px; }
.view-switch, .toolbar-actions { display: flex; align-items: center; gap: 7px; }
.view-switch { margin-right: auto; }
.tool-button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; border: 1px solid #c9d3e2; border-radius: 8px; color: #344054; background: #fff; font-weight: 800; white-space: nowrap; }
.tool-button:hover, .tool-button:focus-visible, .tool-button.is-active { border-color: #9eb4ef; color: var(--primary-dark); background: #eef4ff; }
.zoom-control { display: inline-flex; align-items: center; overflow: hidden; border: 1px solid #c9d3e2; border-radius: 8px; background: #fff; }
.zoom-button, .zoom-reset { min-height: 38px; padding: 0; border: 0; color: #344054; background: #fff; font-weight: 900; }
.zoom-button { width: 38px; font-size: 1.15rem; }
.zoom-reset { min-width: 58px; padding-inline: 8px; border-right: 1px solid #dbe2eb; border-left: 1px solid #dbe2eb; font-size: .78rem; }
.zoom-button:hover, .zoom-button:focus-visible, .zoom-reset:hover, .zoom-reset:focus-visible { color: var(--primary-dark); background: #eef4ff; }
.zoom-button:disabled { background: #f5f6f8; }
.mobile-category-row { display: none; padding: 10px 0 0; }
.snippet-grid { --card-min-width: 270px; --card-height: 252px; --card-padding: 16px; --card-title-size: 1.05rem; --card-body-size: .86rem; grid-template-columns: repeat(auto-fill,minmax(var(--card-min-width),1fr)); gap: 14px; padding-top: 20px; }
.snippet-grid[data-zoom="75"] { --card-min-width: 220px; --card-height: 210px; --card-padding: 12px; --card-title-size: .92rem; --card-body-size: .76rem; }
.snippet-grid[data-zoom="125"] { --card-min-width: 330px; --card-height: 300px; --card-padding: 20px; --card-title-size: 1.18rem; --card-body-size: .96rem; }
.snippet-grid[data-zoom="150"] { --card-min-width: 390px; --card-height: 348px; --card-padding: 24px; --card-title-size: 1.3rem; --card-body-size: 1.05rem; }
.snippet-card { height: var(--card-height); min-height: var(--card-height); padding: var(--card-padding); overflow: visible; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.05); cursor: grab; }
.snippet-card:hover, .snippet-card:focus-within { border-color: #a8c7ee; box-shadow: 0 8px 18px rgba(22,32,51,.09); transform: translateY(-1px); }
.snippet-card.is-snippet-dragging { cursor: grabbing; opacity: .5; transform: scale(.985); }
.snippet-card.is-snippet-drag-before { border-color: var(--primary); box-shadow: inset 4px 0 0 var(--primary); }
.snippet-card.is-snippet-drag-after { border-color: var(--primary); box-shadow: inset -4px 0 0 var(--primary); }
.category-row.is-snippet-category-target { border-radius: 8px; background: #e8f2ff; box-shadow: inset 0 0 0 2px var(--primary); }
.snippet-copy-surface { display: grid; width: 100%; min-width: 0; min-height: 0; flex: 1; grid-template-rows: auto minmax(0,1fr); gap: 12px; padding: 0 48px 0 0; overflow: hidden; color: inherit; text-align: left; }
.snippet-copy-surface .card-title { display: -webkit-box; max-height: 2.8em; margin: 0; overflow: hidden; overflow-wrap: anywhere; font-size: var(--card-title-size); font-weight: 900; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.snippet-body-preview { display: -webkit-box; min-height: 0; overflow: hidden; color: #475467; font-size: var(--card-body-size); line-height: 1.65; overflow-wrap: anywhere; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 5; }
.snippet-drag-handle, .snippet-list-header { display: none; }
.snippet-list-actions { display: none; }
.snippet-card > .snippet-body, .snippet-card > .expand-button { display: none; }
.snippet-card > .card-footer { display: flex; justify-content: flex-end; margin-top: auto; padding-top: 13px; border-top: 1px solid #edf0f4; }
.card-menu { position: absolute; top: 7px; right: 6px; opacity: 1; pointer-events: auto; }
.menu-button { display: inline-grid; width: 30px; height: 30px; place-items: center; padding: 0; border: 0; color: #7a8493; background: transparent; cursor: pointer; list-style: none; }
.menu-button::-webkit-details-marker { display: none; }
.menu-button:hover, .menu-button:focus { color: var(--primary-dark); background: #eef4ff; outline: none; }
.card-menu-items { position: absolute; top: 46px; right: 0; z-index: 30; display: grid; min-width: 100px; padding: 5px; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.card-menu-item { padding: 7px 10px; border: 0; border-radius: 5px; color: #344054; text-align: left; background: transparent; font-size: .78rem; font-weight: 700; }
.card-menu-item:hover { background: #eef4ff; }
.card-menu-item.is-danger { color: var(--danger); }
.snippet-add-control { align-self: stretch; justify-self: stretch; display: inline-grid; min-height: var(--card-height); place-items: center; width: 100%; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; color: #667085; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.snippet-add-icon { display: grid; width: 64px; height: 64px; place-items: center; border-radius: 14px; background: #f2f4f7; font-size: 1.75rem; }
.snippet-add-control:hover, .snippet-add-control:focus-visible { border-color: #a8c7ee; color: var(--primary-dark); background: #f8fbff; box-shadow: 0 8px 18px rgba(22,32,51,.09); }
.snippet-add-control:hover .snippet-add-icon, .snippet-add-control:focus-visible .snippet-add-icon { background: #eef4ff; }
.snippet-add-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.snippet-grid.is-list-view { display: block; overflow-x: auto; border-top: 1px solid var(--border); }
.snippet-grid.is-list-view .snippet-list-header { display: grid; grid-template-columns: minmax(140px,.7fr) minmax(360px,2.3fr) 280px; gap: 16px; align-items: center; min-width: 820px; padding: 9px 12px; border-bottom: 1px solid var(--border); color: #667085; font-size: .76rem; font-weight: 800; }
.snippet-grid.is-list-view .snippet-list-header span { padding-inline: 8px; text-align: center; }
.snippet-grid.is-list-view .snippet-list-header span + span { border-left: 1px solid var(--border); }
.snippet-grid.is-list-view .snippet-card { display: grid; grid-template-columns: minmax(140px,.7fr) minmax(360px,2.3fr) 280px; gap: 16px; align-items: center; min-width: 820px; height: auto; min-height: 62px; padding: 8px 12px; border-width: 0 0 1px; border-style: solid; border-color: var(--border); border-radius: 0; background: #fff; box-shadow: none; }
.snippet-grid.is-list-view .snippet-card { min-height: 54px; background: #eef6ff; }
.snippet-grid.is-list-view .snippet-card:hover, .snippet-grid.is-list-view .snippet-card:focus-within { background: #e3f0ff; box-shadow: none; transform: none; }
.snippet-grid.is-list-view .snippet-card.is-snippet-drag-before { box-shadow: inset 0 4px 0 var(--primary); }
.snippet-grid.is-list-view .snippet-card.is-snippet-drag-after { box-shadow: inset 0 -4px 0 var(--primary); }
.snippet-grid.is-list-view .snippet-copy-surface { grid-column: 1; grid-row: 1; align-items: center; flex-direction: row; padding: 0; text-align: left; }
.snippet-grid.is-list-view .snippet-copy-surface { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 8px; overflow: visible; }
.snippet-grid.is-list-view .snippet-drag-handle { display: inline-grid; width: 18px; place-items: center; color: #98a2b3; cursor: grab; }
.snippet-grid.is-list-view .snippet-copy-surface .card-title { display: block; min-height: 0; overflow: hidden; font-size: .94rem; text-overflow: ellipsis; white-space: nowrap; }
.snippet-grid.is-list-view .snippet-body-preview { display: none; }
.snippet-grid.is-list-view .snippet-body { display: block; grid-column: 2; grid-row: 1; min-height: 0; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; -webkit-line-clamp: 1; }
.snippet-grid.is-list-view .expand-button, .snippet-grid.is-list-view .card-spacer { display: none; }
.snippet-grid.is-list-view .card-menu, .snippet-grid.is-list-view .card-footer { display: none; }
.snippet-grid.is-list-view .snippet-list-actions { display: flex; grid-column: 3; grid-row: 1; justify-self: end; gap: 6px; }
.list-action-button { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 5px; padding: 0 9px; border: 1px solid #0d6efd; border-radius: 6px; color: #0d6efd; background: transparent; font-size: .8rem; font-weight: 700; }
.list-action-button:hover, .list-action-button:focus-visible { color: #fff; background: #0d6efd; }
.list-action-button.is-copy { border-color: var(--primary); color: #fff; background: var(--primary); }
.list-action-button.is-copy:hover, .list-action-button.is-copy:focus-visible { border-color: var(--primary-dark); background: var(--primary-dark); }
.list-action-button.is-copy.is-copied { border-color: var(--success); background: var(--success); }
.list-action-button.is-delete { border-color: #dc3545; color: #dc3545; }
.list-action-button.is-delete:hover, .list-action-button.is-delete:focus-visible { color: #fff; background: #dc3545; }
.snippet-grid.is-list-view .snippet-add-control { position: relative; display: flex; width: 100%; height: 34px; min-width: 820px; min-height: 34px; align-items: center; justify-content: center; margin-top: 10px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.snippet-grid.is-list-view .snippet-add-control::before { position: absolute; top: 50%; right: 0; left: 0; height: 1px; background: var(--border); content: ""; }
.snippet-grid.is-list-view .snippet-add-icon { position: relative; z-index: 1; width: 26px; height: 26px; border: 2px solid #fff; border-radius: 50%; color: #fff; background: var(--primary); font-size: .72rem; }
.snippet-grid.is-list-view .snippet-add-control:hover, .snippet-grid.is-list-view .snippet-add-control:focus-visible { border: 0; background: transparent; box-shadow: none; }
.preview-dialog .dialog-card { max-height: min(88dvh,760px); }
.preview-body { margin: 0; color: #344054; font-size: .94rem; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 210px minmax(0,1fr); }
  .board-toolbar { align-items: center; flex-direction: row; }
  .linkboard-style-header .brand-title { font-size: 28px; }
}

@media (max-width: 680px) {
  .linkboard-style-header .header-inner { padding-inline: 14px; }
  .linkboard-style-header .brand-title { padding-right: 6px; font-size: 23px; }
  .top-nav { display: none; }
  .app-shell { display: block; }
  .main-panel { padding-inline: 14px; }
  .board-toolbar { position: static; flex-wrap: nowrap; gap: 6px; }
  .view-switch, .toolbar-actions { flex: 0 0 auto; gap: 5px; }
  .view-switch { width: auto; margin-right: 0; }
  .tool-button { width: 36px; min-height: 38px; padding: 0; }
  .tool-button-label { display: none; }
  .zoom-control { flex: 0 0 auto; order: initial; }
  .zoom-button { width: 32px; }
  .zoom-reset { min-width: 48px; padding-inline: 5px; }
  .toolbar-actions { width: auto; }
  .mobile-category-row { display: block; }
  .mobile-category-field { display: block; }
  .mobile-category-field > span { display: block; margin-bottom: 4px; color: #475467; font-size: .74rem; font-weight: 800; }
  .snippet-grid { --mobile-card-min-height: 160px; grid-template-columns: minmax(0,1fr); gap: 10px; padding-top: 14px; }
  .snippet-grid[data-zoom="75"] { --mobile-card-min-height: 145px; }
  .snippet-grid[data-zoom="125"] { --mobile-card-min-height: 176px; }
  .snippet-grid[data-zoom="150"] { --mobile-card-min-height: 192px; }
  .snippet-card { height: auto; min-height: var(--mobile-card-min-height); padding: 12px; }
  .snippet-copy-surface { flex: 0 1 auto; gap: 6px; padding-right: 40px; }
  .snippet-body-preview { line-height: 1.55; -webkit-line-clamp: 2; }
  .snippet-card > .card-footer { margin-top: 10px; padding-top: 8px; }
  .copy-button { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
.header-action-form { display: inline; margin: 0; }
.top-nav .header-action-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.top-nav .header-action-link:hover,
.top-nav .header-action-link:focus-visible { background: rgba(255, 255, 255, .14); }

@media (max-width: 760px) {
  .top-nav { gap: 2px; }
  .top-nav .header-action-link { padding-inline: 7px; font-size: .84rem; }
}

/* Issue #207: board appearance and category navigation preferences */
:root { --sidebar-background: #f8f9fb; }

:root[data-copyboard-theme="blue"] {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #dbeafe;
  --page: #eff6ff;
  --border: #bfdbfe;
  --sidebar-background: #e8f2ff;
}

:root[data-copyboard-theme="green"] {
  --primary: #15803d;
  --primary-dark: #166534;
  --primary-soft: #dcfce7;
  --page: #f0fdf4;
  --border: #bbf7d0;
  --sidebar-background: #e8f8ee;
}

:root[data-copyboard-theme="beige"] {
  --primary: #9a5b13;
  --primary-dark: #7c4710;
  --primary-soft: #fef3c7;
  --page: #faf6ed;
  --border: #e7d8bb;
  --sidebar-background: #f5ecdc;
}

.copyboard-trial-page {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
}

.copyboard-trial-page .app-shell {
  width: 100%;
  min-height: 0;
  flex: 1 0 auto;
}

.copyboard-trial-page .sidebar,
.copyboard-trial-page .sidebar-resizer {
  height: auto;
  align-self: stretch;
}

.app-shell { grid-template-columns: var(--sidebar-width) 10px minmax(0, 1fr); }
.sidebar { border-right: 0; background: var(--sidebar-background); }
.board-toolbar { background: var(--page); }
.sidebar-resizer {
  position: sticky;
  top: 60px;
  z-index: 12;
  width: 10px;
  height: calc(100vh - 60px);
  align-self: start;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--border);
  border-left: 1px solid transparent;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}
.sidebar-resizer::after { position: absolute; top: 50%; left: 50%; width: 4px; height: 42px; border-radius: 999px; background: #a8b4c5; content: ""; transform: translate(-50%, -50%); }
.sidebar-resizer:hover, .sidebar-resizer:focus-visible, .sidebar-resizer.is-resizing { border-color: var(--primary); background: var(--primary-soft); }
.sidebar-resizer:hover::after, .sidebar-resizer:focus-visible::after, .sidebar-resizer.is-resizing::after { background: var(--primary); }
.is-resizing-sidebar { cursor: col-resize; user-select: none; }

.theme-control { display: inline-flex; min-height: 40px; align-items: center; gap: 7px; color: #475467; font-size: .76rem; font-weight: 800; }
.theme-control select { min-height: 38px; padding: 0 30px 0 10px; border: 1px solid #c9d3e2; border-radius: 7px; color: #344054; background: #fff; font-size: .78rem; font-weight: 700; }

.category-all-section { margin-bottom: 7px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.category-button-all { border-color: #b7c7da; background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
.category-button-all:hover, .category-button-all:focus-visible { border-color: var(--primary); background: var(--primary-soft); }
.category-button-all.is-active { border-color: var(--primary); background: var(--primary-soft); }
.category-button-icon { width: 18px; flex: 0 0 auto; color: var(--primary); text-align: center; }
.category-button-all .category-button-name { flex: 1; }

.menu-button:hover, .menu-button:focus-visible, .card-menu[open] .menu-button { color: var(--primary-dark); background: var(--primary-soft); }

.preview-dialog .dialog-card { width: 100%; max-width: none; margin-inline: 0; }

@media (max-width: 680px) {
  .app-shell { display: block; }
  .sidebar-resizer { display: none; }
  .board-toolbar { flex-wrap: wrap; }
  .theme-control { margin-left: 0; }
  .theme-control > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .theme-control select { width: 108px; padding-inline: 7px; }
}
