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

:root {
  --blue-950: #042C53;
  --blue-800: #0C447C;
  --blue-600: #185FA5;
  --blue-400: #378ADD;
  --blue-200: #85B7EB;
  --blue-100: #B5D4F4;
  --blue-50:  #E6F1FB;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  font-family: var(--font);
  background: linear-gradient(135deg, #e6f1fb, #f8fbff);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-size: 16px;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

/* ── Header ── */
.kb-header {
  backdrop-filter: blur(10px);
  background: rgba(4,44,83,0.92);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: clamp(8px, 3vw, 14px) clamp(12px, 5vw, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 12px;
}
.kb-logo { display: flex; align-items: center; gap: 8px; }
.kb-logo-mark {
  width: clamp(28px, 8vw, 34px);
  height: clamp(28px, 8vw, 34px);
  background: var(--blue-400);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kb-logo-text { font-size: clamp(12px, 3vw, 15px); font-weight: 600; color: #fff; }
.kb-logo-sub  { font-size: clamp(9px, 2vw, 11px); color: var(--blue-200); letter-spacing: .04em; }

.kb-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kb-ghost-btn,
.link-button {
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.08);
  color: var(--blue-100);
  padding: 7px 12px;
  font-size: 12px;
}

.user-chip {
  color: var(--blue-50);
  font-size: 12px;
  font-weight: 600;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid var(--blue-100);
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 24px 70px rgba(4,44,83,0.18);
}

.auth-logo {
  margin-bottom: 22px;
}

.auth-card .kb-logo-text {
  color: var(--blue-950);
}

.auth-card h1 {
  margin-bottom: 10px;
  color: var(--blue-950);
  font-size: 28px;
}

.auth-card p {
  margin-bottom: 20px;
  color: var(--blue-600);
  line-height: 1.55;
}

.auth-form label,
.workspace-bar label,
.project-bar label {
  display: grid;
  gap: 6px;
  color: var(--blue-600);
  font-size: 12px;
  font-weight: 700;
}

.auth-form input,
.workspace-bar input,
.workspace-bar select,
.project-bar input,
.project-bar select {
  min-height: 38px;
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--blue-950);
  padding: 8px 10px;
  outline: none;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-submit {
  min-height: 42px;
  margin-top: 4px;
  animation: none;
}

.auth-card .link-button {
  width: 100%;
  margin-top: 12px;
  border-color: var(--blue-100);
  background: var(--blue-50);
  color: var(--blue-800);
}

.workspace-bar,
.project-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 28px;
  background: rgba(230,241,251,0.92);
  border-bottom: 1px solid rgba(4,44,83,0.08);
  flex-wrap: wrap;
}

.project-bar {
  background: rgba(255,255,255,0.72);
}

.inline-form {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.inline-form input {
  width: 190px;
}

.inline-form button,
.mode-switch button,
.details-actions button,
.comment-form button {
  min-height: 38px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--blue-600);
  color: #fff;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
}

.member-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--blue-950);
  color: var(--blue-50);
  font-size: 11px;
  font-weight: 800;
}

.member-chip em {
  color: var(--blue-200);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
}

.kb-lang-select {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  color: var(--blue-100);
  padding: 5px 10px;
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  outline: none;
  transition: background .15s;
}
.kb-lang-select:hover { background: rgba(255,255,255,0.14); }
.kb-lang-select option { background: var(--blue-950); color: #fff; }

.kb-add-btn {
  background: var(--blue-600);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: clamp(5px, 1.5vw, 8px) clamp(10px, 3vw, 18px);
  font-size: clamp(11px, 2.5vw, 13px);
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  animation: pulse 2.5s infinite;
  white-space: nowrap;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(55,138,221,0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(55,138,221,0); }
  100% { box-shadow: 0 0 0 0 rgba(55,138,221,0); }
}
.kb-add-btn:hover { background: var(--blue-400); }

/* ── Toolbar ── */
.kb-toolbar {
  backdrop-filter: blur(10px);
  background: rgba(12,68,124,0.85);
  padding: clamp(6px, 2vw, 9px) clamp(12px, 4vw, 28px);
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
  flex-wrap: wrap;
}

.mode-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--blue-600);
  border-radius: var(--radius-md);
  background: var(--blue-950);
}

.mode-switch button {
  min-height: 28px;
  background: transparent;
  color: var(--blue-200);
  padding: 5px 10px;
}

.mode-switch button.active {
  background: var(--blue-400);
  color: #fff;
}

.workspace-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  min-height: 0;
}
.kb-search, .kb-filter {
  background: var(--blue-950);
  border: 1px solid var(--blue-600);
  border-radius: var(--radius-md);
  color: var(--blue-100);
  padding: clamp(4px, 1vw, 6px) clamp(8px, 2vw, 12px);
  font-size: clamp(11px, 2vw, 13px);
  outline: none;
  font-family: var(--font);
  transition: border-color .15s;
}
.kb-search:focus, .kb-filter:focus { border-color: var(--blue-400); }
.kb-search { flex: 1; min-width: clamp(120px, 40vw, 230px); }
.kb-search::placeholder { color: var(--blue-200); }
.kb-filter { cursor: pointer; }
.kb-filter option { background: var(--blue-950); }

/* ── Counters ── */
.kb-counters {
  margin-left: auto;
  display: flex;
  gap: clamp(4px, 1vw, 8px);
  font-size: clamp(10px, 1.8vw, 12px);
  color: var(--blue-200);
  flex-wrap: wrap;
}
.kb-counter {
  background: var(--blue-950);
  padding: clamp(2px, 0.8vw, 4px) clamp(6px, 1.5vw, 10px);
  border-radius: 4px;
  border-left: 2px solid var(--blue-400);
  white-space: nowrap;
}
.kb-counter-label { opacity: 0.8; }
.kb-counter-value { font-weight: 600; color: var(--blue-100); }

/* ── Board ── */
.kb-board {
  flex: 1;
  width: 100%;
  padding: clamp(12px, 3vw, 20px) clamp(12px, 4vw, 28px) clamp(12px, 3vw, 28px);
  display: flex;
  gap: 20px;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.workspace-layout .kb-board {
  min-width: 0;
}
.kb-board::-webkit-scrollbar { height: 6px; }
.kb-board::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 10px; }

/* ── Column ── */
.kb-col {
  flex: 1;
  min-width: 300px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(15,23,42,0.08), 0 2px 8px rgba(15,23,42,0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  backdrop-filter: blur(12px);
  animation: columnDrop 0.35s ease both;
}
.kb-col:nth-child(1) { animation-delay: 0.07s; }
.kb-col:nth-child(2) { animation-delay: 0.14s; }
.kb-col:nth-child(3) { animation-delay: 0.21s; }

@keyframes columnDrop {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.kb-col:hover {
  box-shadow: 0 15px 40px rgba(0,0,0,0.12);
  transform: translateY(-3px);
}

/* To Do */
.kb-col:nth-child(1) {
  background: linear-gradient(180deg, #bfdbfe 0%, #ffffff 80%);
  border-top: 3px solid #3b82f6;
}
/* In Progress */
.kb-col:nth-child(2) {
  background: linear-gradient(180deg, #fed7aa 0%, #ffffff 80%);
  border-top: 3px solid #f97316;
}
/* Done */
.kb-col:nth-child(3) {
  background: linear-gradient(180deg, #bbf7d0 0%, #ffffff 80%);
  border-top: 3px solid #22c55e;
}

.kb-col-header {
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kb-col-title-row { display: flex; align-items: center; gap: 8px; }
.kb-col-dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-todo   { background: #3b82f6; }
.dot-inprog { background: #f97316; }
.dot-done   { background: #22c55e; }

.kb-col-name  { font-size: 13px; font-weight: 600; color: var(--blue-950); }
.kb-col-count {
  font-size: 11px; font-weight: 600;
  background: var(--blue-400); color: #fff;
  border-radius: 10px; padding: 1px 8px;
}
.kb-col-plus {
  background: none; border: none;
  color: var(--blue-400);
  font-size: 20px; line-height: 1;
  cursor: pointer; border-radius: 4px;
  padding: 0 3px;
  transition: color .12s;
}
.kb-col-plus:hover { color: var(--blue-950); }

.kb-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
  transition: background .15s;
}
.kb-col-body.drag-over { background: rgba(55,138,221,0.1); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.kb-col-empty { flex: 1; min-height: 40px; }

/* ── Card ── */
.kb-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: grab;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.04);
}

.kb-card.selected {
  outline: 2px solid var(--blue-400);
}

.kb-card.priority-high {
  border-left: 4px solid #ef4444;
}

.kb-card.priority-medium {
  border-left: 4px solid #f97316;
}

.kb-card.priority-low {
  border-left: 4px solid #22c55e;
}

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

.priority-pill,
.mini-stat {
  border-radius: 999px;
  background: var(--blue-50);
  color: var(--blue-800);
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.deferred-note {
  margin: 8px 0;
  border-radius: 8px;
  background: #eef2ff;
  color: #3730a3;
  padding: 7px 8px;
  font-size: 11px;
  line-height: 1.4;
}
.kb-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.kb-card.dragging {
  opacity: .4;
  transform: rotate(3deg) scale(1.04);
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  cursor: grabbing;
}

.kb-card-tag {
  display: inline-block;
  font-size: 10px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tag-frontend { background: var(--blue-50);  color: var(--blue-800); }
.tag-backend  { background: var(--blue-100); color: var(--blue-950); }
.tag-design   { background: var(--blue-950); color: var(--blue-200); }
.tag-devops   { background: var(--blue-600); color: #fff; }
.tag-qa       { background: var(--blue-400); color: #fff; }

.kb-card-title {
  font-size: 13px; font-weight: 600;
  color: var(--blue-950);
  margin-bottom: 5px; line-height: 1.4;
}
.kb-card-desc {
  font-size: 12px; color: var(--blue-600);
  line-height: 1.5; margin-bottom: 8px;
}
.kb-card-footer {
  display: flex; align-items: center;
  justify-content: space-between;
}
.kb-card-meta { display: flex; align-items: center; gap: 6px; }
.kb-card-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--blue-400); color: #fff;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kb-card-date { font-size: 11px; color: var(--blue-200); font-weight: 500; }
.kb-card-date.overdue { color: #ef4444; font-weight: 700; }
.kb-card-date.soon    { color: #f97316; font-weight: 600; }

.kb-card-actions {
  display: flex; gap: 4px;
  opacity: 0; transition: opacity .12s;
}

.kb-details {
  min-width: 0;
  max-height: calc(100vh - 178px);
  overflow-y: auto;
  padding: 18px;
  border-left: 1px solid rgba(4,44,83,0.12);
  background: rgba(255,255,255,0.82);
}

.details-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--blue-50);
}

.details-head h2,
.empty-details h2 {
  margin: 8px 0;
  color: var(--blue-950);
  font-size: 22px;
  line-height: 1.2;
}

.details-head p,
.empty-details p,
.muted {
  color: var(--blue-600);
  font-size: 13px;
  line-height: 1.5;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.details-grid div {
  min-width: 0;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--blue-50);
}

.details-grid span {
  display: block;
  color: var(--blue-600);
  font-size: 11px;
  font-weight: 700;
}

.details-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--blue-950);
  font-size: 13px;
}

.details-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.detail-section {
  padding: 14px 0;
  border-top: 1px solid var(--blue-50);
}

.detail-section h3 {
  margin-bottom: 10px;
  color: var(--blue-950);
  font-size: 14px;
}

.check-item {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--blue-950);
  font-size: 13px;
}

.check-item input {
  width: 16px;
  height: 16px;
}

.material-link {
  display: block;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  background: var(--blue-50);
  color: var(--blue-800);
  padding: 9px 10px;
  font-size: 13px;
  text-decoration: none;
}

.comment-list,
.history-list {
  display: grid;
  gap: 8px;
}

.comment-item,
.history-item {
  padding: 10px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--blue-50);
}

.comment-item strong,
.history-item strong {
  color: var(--blue-950);
  font-size: 12px;
}

.comment-item span,
.history-item span {
  float: right;
  color: var(--blue-200);
  font-size: 11px;
}

.comment-item p,
.history-item p {
  clear: both;
  margin-top: 6px;
  color: var(--blue-600);
  font-size: 13px;
  line-height: 1.45;
}

.comment-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.comment-form textarea {
  width: 100%;
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-md);
  padding: 8px;
  resize: vertical;
}
.kb-card:hover .kb-card-actions { opacity: 1; }
.kb-card-btn {
  background: none; border: none;
  cursor: pointer; color: var(--blue-400);
  font-size: 12px; padding: 2px 6px;
  border-radius: 4px; font-family: var(--font);
  transition: background .1s, color .1s;
}
.kb-card-btn:hover     { background: var(--blue-50); color: var(--blue-950); }
.kb-card-btn.del:hover { background: #FEE; color: #A00; }

/* ── Modal ── */
.kb-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(4,44,83,.5);
  backdrop-filter: blur(3px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.kb-overlay.open { display: flex; }
.kb-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--blue-100);
  padding: 24px 28px;
  width: 420px; max-width: 94vw;
  box-shadow: 0 24px 48px rgba(4,44,83,0.18);
  max-height: 90vh;
  overflow-y: auto;
}

.task-modal {
  width: 660px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}
.kb-modal-title {
  font-size: 15px; font-weight: 600;
  color: var(--blue-950); margin-bottom: 18px;
}
.kb-modal label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--blue-600); margin-bottom: 4px;
}
.kb-modal input,
.kb-modal select {
  width: 100%;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-md);
  color: var(--blue-950);
  font-size: 13px; font-family: var(--font);
  padding: 8px 10px;
  margin-bottom: 14px;
  outline: none;
}
.kb-modal textarea {
  width: 100%;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-md);
  color: var(--blue-950);
  font-size: 13px; font-family: var(--font);
  padding: 8px 10px;
  margin-bottom: 14px;
  outline: none;
  resize: vertical;
  min-height: 72px;
}
.kb-modal input[type="date"] {
  cursor: pointer;
  color-scheme: light;
}
.kb-modal input:focus,
.kb-modal textarea:focus,
.kb-modal select:focus { border-color: var(--blue-400); }

.kb-modal-actions {
  display: flex; gap: 8px;
  justify-content: flex-end; margin-top: 4px;
}
.kb-modal-cancel {
  background: none;
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-md);
  color: var(--blue-600);
  padding: 8px 18px; font-size: 13px;
  cursor: pointer; font-family: var(--font);
  transition: background .12s;
}
.kb-modal-cancel:hover { background: var(--blue-50); }
.kb-modal-save {
  background: var(--blue-600);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  padding: 8px 18px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
  transition: background .12s;
}
.kb-modal-save:hover { background: var(--blue-400); }

/* ── Toast ── */
.kb-toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--blue-950);
  color: var(--blue-100);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  z-index: 9999;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
  white-space: nowrap;
}
.kb-toast.show { opacity: 1; }
.kb-toast.error {
  background: #7f1d1d;
  color: #fee2e2;
}

/* ── Loader ── */
.kb-loader {
  text-align: center;
  color: var(--blue-400);
  font-size: 14px;
  padding: 40px 0;
  width: 100%;
}

.tag-add-btn {
    margin-left: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;

    background: linear-gradient(
        180deg,
        rgba(45, 98, 255, 0.9),
        rgba(33, 71, 184, 0.9)
    );

    color: #fff;
    font-size: 20px;
    font-weight: 700;

    cursor: pointer;
    transition: all 0.2s ease;

    box-shadow: 0 2px 10px rgba(45, 98, 255, 0.25);
}

.tag-add-btn:hover {
    background: linear-gradient(
        180deg,
        rgba(60, 115, 255, 1),
        rgba(40, 85, 210, 1)
    );

    box-shadow: 0 4px 15px rgba(45, 98, 255, 0.4);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .kb-board { gap: 12px; }
  .kb-col { min-width: clamp(240px, 85vw, 320px); }
  .workspace-layout {
    grid-template-columns: 1fr;
  }
  .kb-details {
    max-height: none;
    border-left: none;
    border-top: 1px solid rgba(4,44,83,0.12);
  }
  .member-row {
    margin-left: 0;
  }
}
@media (max-width: 480px) {
  .kb-header { padding: 8px 12px; }
  .kb-toolbar { padding: 6px 12px; }
  .kb-board { padding: 10px 10px; }
  .kb-col { min-width: clamp(220px, 90vw, 280px); }
  .kb-counters { display: none; }
  .form-grid,
  .details-grid,
  .details-actions {
    grid-template-columns: 1fr;
  }
  .inline-form,
  .workspace-bar,
  .project-bar {
    width: 100%;
  }
  .inline-form input,
  .workspace-bar select,
  .project-bar select {
    width: 100%;
  }
}
@media (max-width: 360px) {
  .kb-col { min-width: 100%; }
  .kb-board { flex-direction: column; }
}

/* ── Tag Modal ── */
.tag-modal {
  width: 420px;
  max-width: 94vw;
}

.tag-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.tag-modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tag-modal-subtitle {
  font-size: 12px;
  color: var(--blue-600);
  line-height: 1.4;
  margin-top: 2px;
}

.tag-input-wrap {
  margin-bottom: 18px;
}

.tag-name-input {
  width: 100%;
  background: var(--blue-50);
  border: 1.5px solid var(--blue-100);
  border-radius: var(--radius-md);
  color: var(--blue-950);
  font-size: 15px;
  font-family: var(--font);
  font-weight: 500;
  padding: 10px 12px;
  outline: none;
  margin-bottom: 10px;
  transition: border-color .15s, box-shadow .15s;
}

.tag-name-input:focus {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(55,138,221,0.12);
}

.tag-name-input.tag-input-error {
  border-color: #ef4444;
  animation: shake 0.35s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-6px); }
  75%       { transform: translateX(6px); }
}

.tag-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f8fbff;
  border-radius: var(--radius-md);
  border: 1px dashed var(--blue-100);
  min-height: 38px;
}

.tag-preview::before {
  content: "Превью:";
  font-size: 11px;
  color: var(--blue-200);
  font-weight: 600;
  white-space: nowrap;
}

.tag-color-section {
  margin-bottom: 16px;
}

.tag-color-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue-600);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.tag-color-swatches {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.tag-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  flex-shrink: 0;
}

.tag-swatch:hover {
  transform: scale(1.18);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.tag-swatch.selected {
  transform: scale(1.1);
}

.tag-existing-section {
  margin-bottom: 4px;
}

.tag-existing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}
