/* ============================================================
   KNOWLEDGE SPACE — Design System
   Extends the main site's warm cream + teal palette
   ============================================================ */

/* --- Background Grain Texture --- */
.bg-grain {
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-repeat: repeat;
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
}

/* --- Toast --- */
.toast-container {
  position: fixed; top: 1.2rem; right: 1.2rem; z-index: 9999;
  display: flex; flex-direction: column; gap: 0.5rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  max-width: 360px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  animation: toastIn 0.35s cubic-bezier(0.2,0.8,0.2,1);
  backdrop-filter: blur(8px);
}
.toast.success { background: rgba(15,118,110,0.92); }
.toast.error   { background: rgba(220,38,38,0.92); }
.toast.info    { background: rgba(30,64,95,0.92); }
.toast.warning { background: rgba(180,83,9,0.92); }
@keyframes toastIn {
  from { opacity:0; transform: translateX(40px) scale(0.95); }
  to   { opacity:1; transform: translateX(0) scale(1); }
}

/* --- Hero --- */
.ks-hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
}
.ks-hero h1 {
  font-family: 'Noto Serif SC', 'Georgia', serif;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  margin: 0.3rem 0 0.6rem;
  letter-spacing: -0.02em;
}
.ks-hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 1.6rem;
  flex-wrap: wrap;
}
.ks-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ks-stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
}
.ks-stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.25rem;
  letter-spacing: 0.04em;
}

/* --- Main --- */
.ks-main { padding-bottom: 3rem; }

/* --- Sections --- */
.ks-section {
  margin-top: 2rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.ks-section-header {
  margin-bottom: 1.2rem;
}
.ks-section-header h2 {
  margin: 0 0 0.2rem;
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
}
.ks-section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* --- Drop Section --- */
.ks-drop-section {
  margin-top: 1.5rem;
  padding: 0;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ks-drop-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.3rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.5);
  gap: 1rem;
  flex-wrap: wrap;
}
.ks-drop-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.ks-drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  font-size: 0.85rem;
}
.ks-drop-tabs {
  display: flex;
  gap: 0.35rem;
}
.ks-tab {
  padding: 0.4rem 0.85rem;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.ks-tab:hover { background: rgba(15,118,110,0.06); color: var(--ink); }
.ks-tab.active {
  background: rgba(15,118,110,0.1);
  border-color: rgba(15,118,110,0.2);
  color: var(--brand);
  font-weight: 500;
}

/* Tab Panels */
.ks-tab-panel { display: none; padding: 1.3rem; }
.ks-tab-panel.active { display: block; }

/* Drop Zone */
.ks-dropzone {
  border: 2px dashed rgba(15,118,110,0.2);
  border-radius: 14px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(15,118,110,0.02);
}
.ks-dropzone:hover,
.ks-dropzone.dragover {
  border-color: var(--brand);
  background: rgba(15,118,110,0.06);
  transform: scale(1.005);
}
.ks-dropzone-icon {
  color: var(--brand);
  margin-bottom: 0.8rem;
  opacity: 0.7;
}
.ks-dropzone-text {
  font-size: 0.95rem;
  color: var(--ink);
  margin: 0;
}
.ks-dropzone-text strong {
  color: var(--brand);
  cursor: pointer;
  border-bottom: 1.5px dashed var(--brand);
}
.ks-dropzone-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* Input Row */
.ks-input-row {
  display: flex;
  gap: 0.6rem;
}
.ks-input-row .ks-input { flex: 1; }

/* Inputs */
.ks-input, .ks-textarea, .ks-select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-family: 'Noto Sans SC', 'Space Grotesk', sans-serif;
  font-size: 0.88rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.ks-input:focus, .ks-textarea:focus, .ks-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15,118,110,0.08);
}
.ks-textarea { resize: vertical; min-height: 80px; }
.ks-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%234a5a60' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

/* Buttons */
.ks-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.ks-btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.ks-btn-primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15,118,110,0.25);
}
.ks-btn-ghost {
  background: rgba(255,255,255,0.6);
  color: var(--ink);
  border-color: var(--line);
}
.ks-btn-ghost:hover {
  background: rgba(255,255,255,0.9);
  border-color: rgba(15,118,110,0.3);
}
.ks-btn-danger {
  background: rgba(220,38,38,0.08);
  color: #dc2626;
  border-color: rgba(220,38,38,0.2);
}
.ks-btn-danger:hover {
  background: rgba(220,38,38,0.15);
}
.ks-btn-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ks-icon-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
  line-height: 1;
  transition: color 0.2s;
}
.ks-icon-btn:hover { color: var(--ink); }

/* Processing */
.ks-processing {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.3rem;
  font-size: 0.88rem;
  color: var(--brand);
  border-top: 1px solid var(--line);
}
.ks-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(15,118,110,0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Classify Result --- */
.ks-classify-section {
  margin-top: 1rem;
}
.ks-classify-card {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid rgba(15,118,110,0.2);
  box-shadow: 0 8px 30px rgba(15,118,110,0.08);
  padding: 1.5rem;
  animation: slideUp 0.4s cubic-bezier(0.2,0.8,0.2,1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ks-classify-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.ks-classify-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--brand);
}
.ks-classify-preview {
  padding: 1rem;
  background: rgba(255,255,255,0.6);
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1px solid rgba(15,118,110,0.08);
}
.ks-classify-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}
.ks-classify-summary {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ks-classify-source {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--brand);
}
.ks-classify-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}
.ks-classify-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  background: rgba(15,118,110,0.1);
  color: var(--brand);
  border: 1px solid rgba(15,118,110,0.2);
}
.ks-classify-confidence {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 120px;
}
.ks-confidence-track {
  flex: 1;
  height: 5px;
  background: rgba(15,118,110,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.ks-confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.2,0.8,0.2,1);
  width: 0;
}
#classifyConfidenceText {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}
.ks-classify-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.ks-classify-tag {
  padding: 0.2rem 0.6rem;
  background: rgba(217,119,6,0.08);
  border: 1px solid rgba(217,119,6,0.15);
  border-radius: 14px;
  font-size: 0.76rem;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.ks-classify-tag:hover,
.ks-classify-tag.selected {
  background: rgba(217,119,6,0.18);
  border-color: rgba(217,119,6,0.35);
}
.ks-classify-edit {
  margin-bottom: 1rem;
}
.ks-edit-row {
  margin-bottom: 0.6rem;
}
.ks-edit-row label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  font-weight: 500;
}
.ks-classify-actions {
  display: flex;
  gap: 0.6rem;
}

/* --- Toolbar --- */
.ks-toolbar {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}
.ks-search {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.8rem;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.2s;
}
.ks-search:focus-within { border-color: var(--brand); }
.ks-search svg { color: var(--muted); flex-shrink: 0; }
.ks-search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.55rem 0;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  outline: none;
}
.ks-search-input::placeholder { color: var(--muted); }
.ks-filters {
  display: flex;
  gap: 0.5rem;
}
.ks-filters .ks-select { min-width: 120px; width: auto; }
.ks-library-count {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

/* --- Library Grid --- */
.ks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.85rem;
}
.ks-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
}
.ks-empty-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.ks-empty p { color: var(--muted); margin: 0; }
.ks-empty-hint { font-size: 0.82rem; margin-top: 0.3rem !important; }

/* --- Library Item Card --- */
.ks-item {
  padding: 1rem 1.15rem;
  background: rgba(255,255,255,0.75);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: all 0.25s;
  cursor: pointer;
  position: relative;
}
.ks-item:hover {
  border-color: rgba(15,118,110,0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15,118,110,0.08);
}
.ks-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.ks-item-cat {
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
  white-space: nowrap;
  font-weight: 500;
}
.ks-item-cat[data-cat="paper"]    { background: rgba(251,191,36,0.12); color: #b45309; }
.ks-item-cat[data-cat="tech"]     { background: rgba(56,189,248,0.12); color: #0369a1; }
.ks-item-cat[data-cat="note"]     { background: rgba(52,211,153,0.12); color: #047857; }
.ks-item-cat[data-cat="project"]  { background: rgba(251,146,60,0.12); color: #c2410c; }
.ks-item-cat[data-cat="resource"] { background: rgba(167,139,250,0.12); color: #6d28d9; }
.ks-item-cat[data-cat="thought"]  { background: rgba(244,114,182,0.12); color: #be185d; }
.ks-item-cat[data-cat="news"]     { background: rgba(96,165,250,0.12); color: #1d4ed8; }
.ks-item-cat[data-cat="other"]    { background: rgba(148,163,184,0.12); color: #475569; }
.ks-item-del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.15rem;
  opacity: 0;
  transition: all 0.2s;
  line-height: 1;
}
.ks-item:hover .ks-item-del { opacity: 1; }
.ks-item-del:hover { color: #dc2626; }
.ks-item h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ks-item-summary {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0.35rem 0 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ks-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}
.ks-item-tag {
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  background: rgba(217,119,6,0.06);
  border-radius: 10px;
  color: var(--accent);
}
.ks-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid rgba(0,0,0,0.04);
  padding-top: 0.45rem;
}
.ks-item-link a {
  color: var(--brand);
  text-decoration: none;
  font-size: 0.78rem;
}
.ks-item-link a:hover { text-decoration: underline; }

/* --- Categories Grid --- */
.ks-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.ks-cat-card {
  padding: 1.1rem 0.8rem;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
}
.ks-cat-card:hover {
  border-color: rgba(15,118,110,0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(15,118,110,0.06);
}
.ks-cat-card-icon { font-size: 1.8rem; margin-bottom: 0.3rem; }
.ks-cat-card-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.1;
}
.ks-cat-card-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* --- Settings --- */
.ks-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.ks-settings-card {
  padding: 1.2rem;
  background: rgba(255,255,255,0.65);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.ks-settings-card h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
}
.ks-field {
  margin-bottom: 0.85rem;
}
.ks-field label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  font-weight: 500;
}
.ks-field-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 0.8rem;
}
.ks-radio-group {
  display: flex;
  gap: 1.2rem;
}
.ks-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
}
.ks-radio input[type="radio"] { accent-color: var(--brand); }
.ks-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.8rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.ks-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.ks-status-dot.offline { background: #94a3b8; }
.ks-status-dot.online  { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.5); animation: pulse 2s infinite; }
.ks-status-dot.error   { background: #ef4444; }
.ks-status-dot.testing { background: #f59e0b; animation: pulse 1s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --- Links Grid --- */
.ks-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.ks-link-card {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.1rem;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.25s;
}
.ks-link-card:hover {
  border-color: rgba(15,118,110,0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(15,118,110,0.08);
  color: var(--ink);
}
.ks-link-icon { font-size: 1.6rem; margin-bottom: 0.3rem; }
.ks-link-label { font-weight: 600; font-size: 0.92rem; }
.ks-link-desc { font-size: 0.78rem; color: var(--muted); }

/* --- Modal --- */
.ks-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.ks-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20,33,38,0.45);
  backdrop-filter: blur(4px);
}
.ks-modal-content {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  animation: modalIn 0.3s cubic-bezier(0.2,0.8,0.2,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.ks-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.ks-modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
  padding-right: 1rem;
}
.ks-modal-body {
  padding: 1.5rem;
}
.ks-modal-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}
.ks-modal-date { font-size: 0.78rem; color: var(--muted); }
.ks-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 1rem;
}
.ks-modal-tag {
  padding: 0.2rem 0.6rem;
  background: rgba(217,119,6,0.08);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--accent);
}
.ks-modal-summary {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0.8rem;
}
.ks-modal-note {
  padding: 0.8rem;
  background: rgba(217,119,6,0.06);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: 0.8rem;
  font-style: italic;
}
.ks-modal-note:empty { display: none; }
.ks-modal-source {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--brand);
}
.ks-modal-content-block {
  padding: 1rem;
  background: rgba(255,255,255,0.6);
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.04);
}
.ks-modal-content-block h4 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
#modalContent {
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.7;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.ks-modal-footer {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--line);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .ks-hero-stats { gap: 1.5rem; }
  .ks-grid { grid-template-columns: 1fr; }
  .ks-settings-grid { grid-template-columns: 1fr; }
  .ks-categories-grid { grid-template-columns: repeat(2, 1fr); }
  .ks-links-grid { grid-template-columns: repeat(2, 1fr); }
  .ks-toolbar { flex-direction: column; }
  .ks-drop-bar { flex-direction: column; align-items: flex-start; }
  .ks-drop-tabs { overflow-x: auto; width: 100%; }
  .ks-input-row { flex-direction: column; }
  .ks-classify-actions { flex-direction: column; }
  .ks-modal-content { max-height: 90vh; }
  .ks-modal { padding: 0.8rem; }
}
@media (max-width: 480px) {
  .ks-links-grid { grid-template-columns: 1fr; }
  .ks-categories-grid { grid-template-columns: repeat(2, 1fr); }
}
