.clipboard-page {
  box-sizing: border-box;
  overflow-x: hidden;
  padding: 24px !important;
}

.clipboard-page * {
  box-sizing: border-box;
  letter-spacing: 0;
}

body:has(.clipboard-page) .tool-buttons {
  display: none;
}

.clipboard-post-body {
  margin: 0 !important;
}

.clip-board {
  color: var(--text-color);
  margin: 0 auto;
  max-width: 768px;
  min-width: 0;
  width: 100%;
}

.clip-shell {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.1);
  max-width: 100%;
  overflow: hidden;
  width: 100%;
}

.clip-hero {
  background: linear-gradient(135deg, #020617 0%, #0f172a 52%, #172554 100%);
  border-bottom: 1px solid #f1f5f9;
  color: #ffffff;
  padding: 20px;
}

.clip-hero-inner {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: space-between;
}

.clip-title-block {
  min-width: 0;
}

.clip-kicker {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: #dbeafe;
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 8px;
  padding: 5px 10px;
}

.clip-hero h1 {
  color: #ffffff;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

.clip-hero p {
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.7;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

.clip-state {
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(147, 197, 253, 0.3);
  border-radius: 999px;
  color: #dbeafe;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  padding: 6px 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-content {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.clip-meta {
  color: #64748b;
  display: grid;
  font-size: 12px;
  gap: 8px;
  line-height: 1.5;
}

.clip-meta span {
  background: #f8fafc;
  border-radius: 12px;
  padding: 8px 12px;
}

.clip-textarea {
  background: rgba(248, 250, 252, 0.8);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  color: #1e293b;
  display: block;
  font: inherit;
  font-size: 16px;
  height: 360px;
  line-height: 1.75;
  min-height: 360px;
  outline: none;
  padding: 16px;
  resize: vertical;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.clip-textarea:focus {
  background: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px #dbeafe;
}

.clip-textarea::placeholder {
  color: #94a3b8;
}

.clip-toolbar {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.clip-button {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  color: #1e293b;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  min-height: 44px;
  min-width: 0;
  padding: 12px 16px;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.clip-button:hover {
  background: #f8fafc;
}

.clip-button:focus {
  box-shadow: 0 0 0 4px #f1f5f9;
  outline: none;
}

.clip-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.clip-button-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.clip-button-primary:hover {
  background: #1d4ed8;
}

.clip-button-primary:focus {
  box-shadow: 0 0 0 4px #dbeafe;
}

.clip-button-danger {
  background: #fef2f2;
  border-color: #fee2e2;
  color: #dc2626;
}

.clip-button-danger:hover {
  background: #fee2e2;
}

.clip-button-danger:focus {
  box-shadow: 0 0 0 4px #fee2e2;
}

:root[data-theme="dark"] .clipboard-page {
  background: #111827;
}

:root[data-theme="dark"] .clip-shell {
  background: #1f2937;
  border-color: #374151;
}

:root[data-theme="dark"] .clip-meta span {
  background: #111827;
  color: #cbd5e1;
}

:root[data-theme="dark"] .clip-textarea {
  background: #111827;
  border-color: #374151;
  color: #e5e7eb;
}

:root[data-theme="dark"] .clip-textarea::placeholder {
  color: #94a3b8;
}

:root[data-theme="dark"] .clip-button:not(.clip-button-primary):not(.clip-button-danger) {
  background: #111827;
  border-color: #374151;
  color: #e5e7eb;
}

:root[data-theme="dark"] .clip-button:not(.clip-button-primary):not(.clip-button-danger):hover {
  background: #1f2937;
}

:root[data-theme="dark"] .clip-button-danger {
  background: #451a1a;
  border-color: #7f1d1d;
  color: #fecaca;
}

@media (min-width: 640px) {
  .clip-hero {
    padding: 20px 28px;
  }

  .clip-hero-inner {
    align-items: flex-start;
    flex-direction: row;
  }

  .clip-state {
    max-width: 42%;
  }

  .clip-content {
    padding: 24px 28px;
  }

  .clip-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clip-meta span:last-child {
    text-align: right;
  }

  .clip-toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .clipboard-page {
    background: #f8fafc;
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom)) !important;
  }

  .clip-board {
    max-width: calc(100vw - 24px);
    width: calc(100vw - 24px);
  }

  .clip-shell {
    border-radius: 18px;
  }

  .clip-hero {
    padding: 18px 16px;
  }

  .clip-textarea {
    height: min(25vh, 220px);
    min-height: 160px;
  }
}

@media (max-width: 380px) {
  .clip-hero h1 {
    font-size: 20px;
  }

  .clip-hero p {
    font-size: 12px;
    line-height: 1.45;
  }

  .clip-state {
    max-width: 100%;
  }

  .clip-textarea {
    height: min(22vh, 170px);
    min-height: 130px;
  }

  .clip-button {
    padding-left: 10px;
    padding-right: 10px;
  }
}
