.board-tiptap {
  display: grid;
  gap: 12px;
}

.board-tiptap__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.board-tiptap__divider {
  width: 1px;
  height: 22px;
  background: rgba(148, 163, 184, 0.32);
  margin: 0 2px;
}

.board-tiptap__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease;
}

.board-tiptap__button--icon {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.board-tiptap__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.board-tiptap__button:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 23, 42, 0.18);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.board-tiptap__button.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.board-tiptap__editor {
  min-height: 480px;
  padding: 20px 18px 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(15, 23, 42, 0.02), transparent 32%),
    #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.05);
}

.board-tiptap__source {
  min-height: 480px;
  width: 100%;
  padding: 20px 18px 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(15, 23, 42, 0.02), transparent 32%),
    #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.05);
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 0.96rem;
  line-height: 1.8;
  letter-spacing: -0.01em;
  resize: vertical;
  outline: none;
}

.board-tiptap__source:focus {
  border-color: rgba(37, 99, 235, 0.36);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08), 0 18px 50px rgba(15, 23, 42, 0.05);
}

.board-tiptap__attachments {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 22px;
  background: rgba(248, 250, 252, 0.9);
}

.board-tiptap__attachments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.board-tiptap__attachments-head h3 {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.board-tiptap__attachments-head p {
  margin: 3px 0 0;
  color: rgba(71, 85, 105, 0.88);
  font-size: 0.88rem;
}

.board-tiptap__attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.board-tiptap__file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.board-tiptap__attachment-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.board-tiptap__attachment-image {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
}

.board-tiptap__attachment-image img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.board-tiptap__attachment-meta {
  color: rgba(15, 23, 42, 0.72);
  font-size: 0.8rem;
  line-height: 1.3;
  word-break: break-all;
}

.board-tiptap__attachment-actions {
  display: flex;
  gap: 8px;
}

.board-tiptap__attachment-action {
  flex: 1 1 auto;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.board-tiptap__attachment-action.is-danger {
  border-color: rgba(225, 29, 72, 0.2);
  color: #be123c;
}

.board-tiptap__editor.ProseMirror,
.board-tiptap__content {
  min-height: 440px;
  outline: none;
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.9;
  letter-spacing: -0.01em;
}

.board-tiptap__content {
  padding: 20px 18px 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(15, 23, 42, 0.02), transparent 32%),
    #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.05);
}

.board-tiptap__editor.ProseMirror > *:first-child,
.board-tiptap__content > *:first-child {
  margin-top: 0;
}

.board-tiptap__editor.ProseMirror > *:last-child,
.board-tiptap__content > *:last-child {
  margin-bottom: 0;
}

.board-tiptap__editor.ProseMirror p,
.board-tiptap__content p {
  margin: 0 0 0.2em;
}

.board-tiptap__editor.ProseMirror h1,
.board-tiptap__content h1 {
  margin: 1.55em 0 0.75em;
  padding: 0.56em 0.85em;
  border-left: 4px solid rgba(37, 99, 235, 0.42);
  border-radius: 0 16px 16px 0;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.02));
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.board-tiptap__editor.ProseMirror h2,
.board-tiptap__content h2 {
  margin: 1.45em 0 0.7em;
  padding: 0.5em 0.78em;
  border-left: 4px solid rgba(14, 116, 144, 0.38);
  border-radius: 0 14px 14px 0;
  background: linear-gradient(90deg, rgba(14, 116, 144, 0.08), rgba(14, 116, 144, 0.02));
  font-size: 1.5rem;
  line-height: 1.28;
  letter-spacing: -0.035em;
}

.board-tiptap__editor.ProseMirror h3,
.board-tiptap__content h3 {
  display: inline-flex;
  align-items: center;
  width: auto;
  max-width: 100%;
  margin: 1.25em 0 0.62em;
  padding: 0.46em 0.72em;
  border-left: 4px solid rgba(15, 23, 42, 0.25);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0.015));
  font-size: 1.18rem;
  line-height: 1.3;
}

.board-tiptap__editor.ProseMirror blockquote,
.board-tiptap__content blockquote {
  margin: 1.1em 0;
  padding: 0.8em 1em;
  border-left: 4px solid rgba(15, 23, 42, 0.2);
  border-radius: 0 14px 14px 0;
  background: rgba(15, 23, 42, 0.04);
  color: rgba(15, 23, 42, 0.82);
}

.board-tiptap__editor.ProseMirror ul,
.board-tiptap__editor.ProseMirror ol,
.board-tiptap__content ul,
.board-tiptap__content ol {
  padding-left: 1.5em;
  margin: 0 0 1em;
}

.board-tiptap__editor.ProseMirror li,
.board-tiptap__content li {
  margin: 0.3em 0;
}

.board-tiptap__editor.ProseMirror a,
.board-tiptap__content a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.board-tiptap__editor.ProseMirror img,
.board-tiptap__content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1em auto;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: none;
}

.board-tiptap__editor.ProseMirror hr,
.board-tiptap__content hr {
  margin: 1.5em 0;
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
}

.board-tiptap__editor.ProseMirror table,
.board-tiptap__content table {
  width: 100%;
  margin: 1.3em 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.board-tiptap__editor.ProseMirror th,
.board-tiptap__editor.ProseMirror td,
.board-tiptap__content th,
.board-tiptap__content td {
  padding: 0.7em 0.8em;
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  vertical-align: top;
  text-align: left;
  word-break: break-word;
}

.board-tiptap__editor.ProseMirror th:last-child,
.board-tiptap__editor.ProseMirror td:last-child,
.board-tiptap__content th:last-child,
.board-tiptap__content td:last-child {
  border-right: 0;
}

.board-tiptap__editor.ProseMirror tr:last-child td,
.board-tiptap__editor.ProseMirror tr:last-child th,
.board-tiptap__content tr:last-child td,
.board-tiptap__content tr:last-child th {
  border-bottom: 0;
}

.board-tiptap__editor.ProseMirror th,
.board-tiptap__content th {
  background: rgba(15, 23, 42, 0.05);
  font-weight: 800;
}

.board-tiptap__help {
  color: rgba(71, 85, 105, 0.9);
  font-size: 0.92rem;
}

.board-tiptap__help--subtle {
  color: rgba(71, 85, 105, 0.74);
}

.board-tiptap__plain-text {
  white-space: pre-wrap;
}

.board-tiptap__content p:last-child {
  margin-bottom: 0;
}

.board-tiptap__content .muted {
  color: rgba(71, 85, 105, 0.92);
}

@media (max-width: 720px) {
  .board-tiptap__editor.ProseMirror,
  .board-tiptap__content {
    font-size: 0.95rem;
    line-height: 1.78;
  }

  .board-tiptap__editor.ProseMirror h1,
  .board-tiptap__content h1 {
    margin: 1.35em 0 0.65em;
    padding: 0.5em 0.72em;
    font-size: 1.65rem;
    line-height: 1.24;
  }

  .board-tiptap__editor.ProseMirror h2,
  .board-tiptap__content h2 {
    margin: 1.25em 0 0.6em;
    padding: 0.44em 0.68em;
    font-size: 1.28rem;
    line-height: 1.28;
  }

  .board-tiptap__editor.ProseMirror h3,
  .board-tiptap__content h3 {
    margin: 1.1em 0 0.5em;
    padding: 0.38em 0.62em;
    font-size: 1.04rem;
    line-height: 1.3;
  }

  .board-tiptap__editor.ProseMirror table,
  .board-tiptap__content table {
    margin: 1em 0;
    font-size: 0.92rem;
  }

  .board-tiptap__editor.ProseMirror th,
  .board-tiptap__editor.ProseMirror td,
  .board-tiptap__content th,
  .board-tiptap__content td {
    padding: 0.55em 0.62em;
  }
}
