html {
  height: 100%;
}

:root {
  color-scheme: light dark;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  background-color: #0b0b0f;
  color: #f5f5f7;
  --vote-real-color: #4ade80;
  --vote-ai-color: #ff0000;
}

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

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(135deg, #11121a 0%, #1b1f2a 60%, #0f1016 100%);
}

header, footer {
  padding: 2rem clamp(1rem, 4vw, 4rem);
  text-align: center;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: 0;
}

h1, h2 {
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

p, label, small {
  color: rgba(240, 240, 245, 0.85);
}

.panel {
  background: rgba(20, 24, 33, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(8, 12, 20, 0.35);
  padding: 2px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

input[type="file"],
input[type="url"],
input[type="text"],
button {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 15, 23, 0.6);
  color: inherit;
  font-size: 1rem;
}

button {
  background: linear-gradient(135deg, #f37000, #e9d545);
  border: none;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button.small {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
}

/*
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(86, 109, 252, 0.35);
}
*/

button.ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.9rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.status {
  margin-top: 1.5rem;
  min-height: 1.5rem;
  color: rgba(255, 255, 255, 0.75);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  padding: 0.1rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 36px rgba(4, 5, 15, 0.45);
}

.site-header__logo-wrap,
.site-header__spacer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.site-header__logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
}

.site-header__spacer {
  justify-content: flex-end;
  visibility: hidden;
}

.share-back-btn {
  margin-left: auto;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #ff9800;
  background: rgba(255, 152, 0, 0.15);
  color: #ff9800;
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1;
  transition: background 0.2s ease, transform 0.2s ease;
}

.share-back-btn:hover,
.share-back-btn:focus-visible {
  background: rgba(255, 152, 0, 0.3);
  transform: translateY(-1px);
}

.site-header__logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.site-header__title {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.4rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #fefefe;
  margin-bottom: .1rem;
  margin-top: .1rem;
}

.site-header__title-text {
  display: inline-block;
}

.site-header__title-logo {
  height: 30px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

.site-header__actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.site-menu-wrapper {
  position: relative;
}

.site-menu-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  padding: 0;
  line-height: 1;
}

.site-menu-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.12);
}

.site-menu-btn:focus-visible {
  outline: 2px solid rgba(121, 147, 255, 0.85);
  outline-offset: 2px;
}

.site-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  display: flex;
  flex-direction: column;
  min-width: 160px;
  padding: 0.35rem;
  border-radius: 12px;
  background: rgba(12, 15, 23, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.3);
  z-index: 20;
}

.site-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: none;
  background: transparent;
  color: #ffffff;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.site-menu-item:hover:not([disabled]) {
  background: rgba(255, 255, 255, 0.08);
}

.site-menu-item:disabled {
  opacity: 0.45;
  cursor: default;
}

.site-menu-item.is-active {
  background: rgba(121, 147, 255, 0.14);
}

.site-submenu {
  position: absolute;
  top: 0;
  right: calc(100% + 10px);
  min-width: 140px;
  padding: 0.35rem;
  border-radius: 12px;
  background: rgba(12, 15, 23, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

.site-menu .site-submenu {
  top: 6px;
}

.share-page-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.1rem;
  padding: 0.1rem;
}

.share-page-header .site-header {
  position: static;
  box-shadow: none;
}

.share-page-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.code-block {
  background: rgba(7, 10, 18, 0.75);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1rem;
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, "Consolas", monospace;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

#share-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.share-summary {
  margin-top: 1.0rem;
  background: rgba(7, 10, 18, 0.75);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.25rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.share-vote-panel {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  background: rgba(7, 10, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 12px 30px rgba(5, 8, 15, 0.35);
}

.chat-share-btn.share-vote-btn {
  min-width: 82px;
  padding: 0.55rem 1rem;
  height: auto;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  line-height: 1.1;
}

.chat-share-btn.share-vote-btn[data-vote="up"] {
  color: var(--vote-real-color);
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.35);
  box-shadow: 0 6px 18px rgba(74, 222, 128, 0.2);
}

.chat-share-btn.share-vote-btn[data-vote="down"] {
  color: var(--vote-ai-color);
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
  box-shadow: 0 6px 18px rgba(248, 113, 113, 0.2);
}

.chat-share-btn.share-vote-btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.chat-share-btn.share-vote-btn:not(:disabled):hover {
  transform: translateY(-2px);
}

.chat-share-btn.share-vote-btn.is-selected {
  box-shadow: 0 0 0 1px currentColor, 0 10px 22px rgba(0, 0, 0, 0.25);
}

.share-vote-count {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  min-width: 76px;
}

.share-vote-count--up {
  text-align: right;
}

.share-vote-count--down {
  text-align: left;
}

.share-vote-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.share-vote-count--up strong {
  color: var(--vote-real-color);
  margin-left: 0.1rem;
}

.share-vote-count--down strong {
  color: var(--vote-ai-color);
  margin-left: 0.1rem;
}

.share-vote-feedback {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: rgba(144, 255, 208, 0.85);
}

.preview {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.preview img {
  max-width: 320px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.share-timeline {
  width: 100%;
  max-width: 320px;
}

.share-timeline .timeline {
  margin-top: 0.75rem;
}

.hidden {
  display: none !important;
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.captcha-row img {
  flex-shrink: 0;
}

.captcha-row input {
  flex: 1;
  min-width: 140px;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-height: 0;
}

.chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.chat-subtitle {
  margin: 0.5rem 0 0;
  color: rgba(240, 240, 245, 0.6);
  font-size: 0.95rem;
}

.chat-history {
  flex: 1 1 320px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(68, 72, 87, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  overflow-y: auto;
}

.chat-empty {
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: rgba(240, 240, 245, 0.65);
}

.chat-empty-title {
  font-weight: 600;
  color: #ffffff;
}

.chat-input {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.chat-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  padding: .2rem 1.25rem 1rem 1.25rem;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 15, 23, 0.6);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.chat-dropzone.dragover {
  border-color: rgba(121, 147, 255, 0.85);
  background: rgba(40, 48, 84, 0.6);
  transform: translateY(-2px);
}

.chat-send-btn {
  min-width: 56px;
  width: 56px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f37000, #e9d545);
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-send-btn:hover:not([disabled]) {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(252, 166, 86, 0.466);
}

.chat-send-btn[disabled] {
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.35);
}

.chat-send-btn svg {
  width: 20px;
  height: 20px;
}

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 360px;
  transition: opacity 0.2s ease;
  margin: 0 auto 0.25rem;
}

.chat-error {
  font-size: 0.85rem;
  color: #ff8585;
  text-align: center;
  margin-top: -0.25rem;
}

.drop-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}

.chat-url-inline {
  min-height: 40px;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  min-width: 0;
  flex: 1 1 0;
  max-width: 100%;
  resize: none;
}

.chat-url-inline:focus {
  outline: 2px solid rgba(121, 147, 255, 0.6);
}

.chat-action-btn {
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.chat-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(86, 109, 252, 0.25);
}

.chat-action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.chat-action-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
}

.chat-menu-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.chat-dropzone.has-selection .drop-content {
  display: none;
}

.drop-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.drop-controls .drop-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
}

.chat-menu-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.chat-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  display: flex;
  flex-direction: column;
  min-width: 140px;
  padding: 0.35rem;
  border-radius: 10px;
  background: rgba(12, 15, 23, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

.chat-menu.hidden {
  display: none;
}

.chat-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
}

.chat-menu-item:hover:not([disabled]) {
  background: rgba(255, 255, 255, 0.08);
}

.chat-menu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chat-selected-preview {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(18, 22, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 480px) {
  .drop-text {
    font-size: 0.95rem;
  }
  .drop-hint {
    font-size: 0.78rem;
  }
  .drop-actions {
    gap: 0.5rem;
    flex-wrap: nowrap;
  }
  .drop-controls {
    gap: 0.5rem;
  }
  .chat-action-btn {
    padding: 0.45rem 0.9rem;
  }
  .chat-url-inline {
    min-width: 0;
  }
}

.chat-hint {
  color: rgba(240, 240, 245, 0.55);
}

.chat-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 20px;
}

.chat-copyright {
  opacity: 0.8;
}

.chat-captcha {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-captcha label {
  font-size: 0.85rem;
  color: rgba(240, 240, 245, 0.7);
}

.captcha-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.captcha-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border: none;
  background: none;
  color: rgba(240, 240, 245, 0.75);
  cursor: pointer;
  line-height: 0;
  box-shadow: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.captcha-refresh:hover {
  color: #ffffff;
  transform: rotate(20deg);
  box-shadow: none;
}

.captcha-refresh:focus-visible {
  outline: 2px solid rgba(121, 147, 255, 0.85);
  outline-offset: 2px;
}

.captcha-refresh svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.chat-bubble {
  max-width: 75%;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  box-shadow: 0 18px 32px rgba(6, 10, 18, 0.35);
  font-size: 0.95rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #4863ff, #7e45ef);
  color: #ffffff;
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: rgba(128, 134, 154, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-bubble.pending {
  opacity: 0.65;
}

.chat-bubble.error {
  background: rgba(110, 20, 20, 0.75);
  border: 1px solid rgba(255, 115, 115, 0.35);
  color: #ffe1e1;
}

.chat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: rgba(240, 240, 245, 0.55);
}

.chat-meta__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.chat-share-btn--share {
  color: rgba(240, 240, 245, 0.75);
}

.chat-share-btn--share:hover {
  color: #ffffff;
}

.chat-meta__time {
  flex: 1;
}

.chat-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border: none;
  background: none;
  color: rgba(240, 240, 245, 0.65);
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.chat-share-btn:not(.chat-vote-btn):not(.share-vote-btn):hover {
  color: #ffffff;
  transform: translateY(-1px);
}

.chat-share-btn:focus-visible {
  outline: 2px solid rgba(121, 147, 255, 0.85);
  outline-offset: 2px;
}

.chat-share-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  pointer-events: none;
}

.chat-vote-block {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.chat-vote-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(240, 240, 245, 0.7);
}

body[data-theme="light"] .chat-vote-label {
  color: #000000;
}

.chat-vote-btn {
  min-width: 46px;
  height: auto;
  padding: 0.25rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.chat-vote-btn[data-vote="up"] {
  color: var(--vote-real-color);
}

.chat-vote-btn[data-vote="down"] {
  color: var(--vote-ai-color);
}

.chat-vote-btn:not(:disabled):hover {
  transform: translateY(-2px);
}

.chat-vote-btn.is-selected {
  box-shadow: 0 0 0 1px currentColor;
  background-color: #473b3b;
}

.chat-vote-count {
  font-size: 0.7rem;
  color: rgba(240, 240, 245, 0.85);
  min-width: 28px;
  text-align: center;
  font-weight: 600;
}

.chat-vote-count--up {
  color: var(--vote-real-color);
}

.chat-vote-count--down {
  color: var(--vote-ai-color);
}

.chat-vote-btn:disabled {
  cursor: default;
  transform: none;
}

@media (max-width: 560px) {
  .chat-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .chat-meta__actions {
    order: 1;
    width: 100%;
    justify-content: flex-start;
  }

  .chat-meta__time {
    order: 2;
    width: 100%;
  }
}

.chat-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  max-width: 100%;
  overflow: hidden;
}

.chat-file-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  font-weight: 600;
  opacity: 0.75;
  flex-shrink: 0;
}

.chat-file-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
}

.chat-file-size {
  white-space: nowrap;
  font-size: 0.85rem;
  opacity: 0.8;
  flex-shrink: 0;
}

.chat-selected-preview.hidden {
  display: none;
}

.preview-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-thumb img,
.preview-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.preview-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.preview-name {
  font-weight: 600;
  color: #ffffff;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-meta {
  font-size: 0.8rem;
  color: rgba(240, 240, 245, 0.6);
}

.preview-remove {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.preview-remove:hover {
  color: #ffffff;
}

.chat-url {
  word-break: break-all;
  font-size: 0.9rem;
  opacity: 0.9;
}

.chat-preview-image {
  max-width: 220px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-video-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: min(420px, 100%);
}

.chat-preview-video {
  width: 100%;
  max-height: 320px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #000000;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.timeline {
  position: relative;
  width: 100%;
  height: 18px;
  margin-top: 0.25rem;
  cursor: pointer;
  user-select: none;
}

.timeline__track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.25), rgba(30, 41, 59, 0.35));
}

.timeline__progress {
  position: absolute;
  left: 0;
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 4px;
  background: linear-gradient(135deg, #60a5fa, #38bdf8);
  pointer-events: none;
}

.timeline__marker {
  position: absolute;
  top: 0;
  width: 2px;
  height: 4px;
  transform: translateX(-1px);
  border-radius: 1px;
  pointer-events: none;
  opacity: 0;
}

.timeline__marker--ai {
  background: #e11d48;
}

.timeline__marker--real {
  background: #22c55e;
}

.timeline__tooltip {
  position: absolute;
  bottom: 100%;
  transform: translate(-50%, -8px);
  background: rgba(10, 12, 20, 0.95);
  color: #f8fafc;
  font-size: 0.7rem;
  line-height: 1.2;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}

.timeline__tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: rgba(10, 12, 20, 0.95) transparent transparent transparent;
}

.timeline__tooltip.hidden {
  display: none;
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 12, 0.75);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: min(420px, 92vw);
  background: rgba(17, 20, 30, 0.97);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  box-shadow: 0 28px 60px rgba(5, 8, 16, 0.55);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  z-index: 1001;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
}

.modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-close:hover {
  color: #ffffff;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.modal-body label {
  font-size: 0.9rem;
  color: rgba(240, 240, 245, 0.75);
}

.modal-body input[type="url"] {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(12, 15, 23, 0.75);
  color: #ffffff;
  font-size: 0.95rem;
}

.modal-error {
  min-height: 1rem;
  color: #ff9090;
  font-size: 0.85rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.policy-modal .modal-card {
  width: min(520px, 94vw);
}

.policy-consent p {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(245, 245, 250, 0.9);
}

.policy-modal-reason {
  margin-top: 0.35rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 184, 120, 0.5);
  background: rgba(255, 184, 120, 0.12);
  color: #ffd9b6;
  font-size: 0.85rem;
}

.policy-modal-reason.hidden {
  display: none;
}

.policy-slider {
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 15, 22, 0.85);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.policy-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.policy-slider-title {
  font-weight: 600;
  color: #f8fafc;
}

.policy-version {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  margin-left: 0.5rem;
}

.policy-link {
  background: none;
  border: none;
  color: #7cb0ff;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.policy-slider-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.policy-slider input[type="checkbox"] {
  display: none;
}

.policy-toggle {
  position: relative;
  width: 68px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.policy-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f8f9ff;
  box-shadow: 0 6px 18px rgba(3, 7, 18, 0.45);
  transition: transform 0.2s ease;
}

.policy-toggle.is-on {
  background: linear-gradient(135deg, #f37000, #e9d545);
  box-shadow: 0 8px 24px rgba(53, 78, 146, 0.35);
}

.policy-toggle.is-on::after {
  transform: translateX(34px);
}

.policy-slider-status {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

.policy-modal-error {
  min-height: 1.25rem;
  font-size: 0.85rem;
  color: #ff9595;
  margin-top: 0.35rem;
}

.policy-doc-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.policy-doc-footer {
  margin-top: 0.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.policy-doc-back {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.policy-doc-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #f5f5f7;
}

.policy-doc-panel textarea {
  width: 100%;
  min-height: 240px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 11, 16, 0.9);
  color: #f8fafc;
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.policy-accept-btn {
  width: 100%;
}

.policy-doc-panel.hidden {
  display: none;
}

.status.hidden {
  display: none;
}

body[data-theme="dark"],
body:not([data-theme]) {
  color-scheme: dark;
}

body[data-theme="light"] {
  color-scheme: light;
  color: #0f172a;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 55%, #f5f7fb 100%);
  background-color: #f8fafc;
}

body[data-theme="light"] p,
body[data-theme="light"] label,
body[data-theme="light"] small {
  color: #334155;
}

body[data-theme="light"] .panel {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] header,
body[data-theme="light"] footer {
  background: #f3f4f6;
}

body[data-theme="light"] .site-header {
  background: #f3f4f6;
  border-color: #e5e7eb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body[data-theme="light"] .site-header__title {
  color: #111827;
}

body[data-theme="light"] .site-menu-btn {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #111827;
}

body[data-theme="light"] .site-menu {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .site-submenu {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

body[data-theme="light"] .site-menu-item {
  color: #111827;
}

body[data-theme="light"] .site-menu-item:hover:not([disabled]) {
  background: #f1f5f9;
}

body[data-theme="light"] .site-menu-item.is-active {
  background: #dbeafe;
}

body[data-theme="light"] .share-page-subtitle {
  color: #4b5563;
}

body[data-theme="light"] .chat-history {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: inset 0 0 0 1px #e5e7eb;
}

body[data-theme="light"] .chat-empty {
  color: #475569;
}

body[data-theme="light"] .chat-empty-title {
  color: #111827;
}

body[data-theme="light"] .chat-dropzone {
  border-color: #d9e0ea;
  background: #f8fafc;
}

body[data-theme="light"] .chat-dropzone.dragover {
  border-color: #93c5fd;
  background: #e5edff;
}

body[data-theme="light"] input[type="file"],
body[data-theme="light"] input[type="url"],
body[data-theme="light"] input[type="text"] {
  border-color: #d1d5db;
  background: #ffffff;
  color: #0f172a;
}

body[data-theme="light"] textarea {
  background: #ffffff;
  border-color: #d1d5db;
  color: #0f172a;
}

body[data-theme="light"] button.ghost {
  background: #eef1f5;
  border: 1px solid #d1d5db;
  color: #111827;
}

body[data-theme="light"] .chat-url-inline {
  background: #ffffff;
  border-color: #d9e0ea;
  color: #0f172a;
}

body[data-theme="light"] .chat-action-btn {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #0f172a;
  box-shadow: none;
}

body[data-theme="light"] .chat-action-btn.secondary {
  background: #e5e7eb;
}

body[data-theme="light"] .chat-menu {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .chat-menu-item {
  color: #111827;
}

body[data-theme="light"] .chat-menu-item:hover:not([disabled]) {
  background: #f1f5f9;
}

body[data-theme="light"] .chat-selected-preview {
  background: #f8fafc;
  border-color: #e5e7eb;
}

body[data-theme="light"] .preview-thumb {
  background: #e5e7eb;
  border-color: #e5e7eb;
}

body[data-theme="light"] .preview img {
  border-color: #e5e7eb;
}

body[data-theme="light"] .chat-preview-image {
  border-color: #e5e7eb;
}

body[data-theme="light"] .chat-preview-video {
  border-color: #d1d5db;
  background: #000000;
}

body[data-theme="light"] .preview-name {
  color: #111827;
}

body[data-theme="light"] .preview-meta {
  color: #475569;
}

body[data-theme="light"] .chat-file-chip {
  background: #f1f5f9;
}

body[data-theme="light"] .chat-file-label {
  color: #475569;
}

body[data-theme="light"] .preview-remove {
  color: #6b7280;
}

body[data-theme="light"] .preview-remove:hover {
  color: #111827;
}

body[data-theme="light"] .chat-hint,
body[data-theme="light"] .chat-meta {
  color: #999999;
}

body[data-theme="light"] .status {
  color: #374151;
}

body[data-theme="light"] .chat-bubble {
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .chat-bubble.user {
  background: #1e1e1e;
  color: #ffffff;
}

body[data-theme="light"] .chat-bubble.assistant {
  background: #e7e7e7;
  color: #000000;
  border: 1px solid #d3d3d3;
}

body[data-theme="light"] .chat-bubble.error {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}

body[data-theme="light"] .chat-send-btn[disabled] {
  background: #e5e7eb;
  color: #9ca3af;
}

body[data-theme="light"] .chat-vote-block {
  background: #f5f5f5;
}

body[data-theme="light"] .chat-vote-btn {
  border-color: #d1d5db;
  background: #000000;
}

body[data-theme="light"] .chat-vote-btn.is-selected {
  background-color: #58c569;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .chat-share-btn {
  color: #ffffff;
}

body[data-theme="light"] .chat-share-btn:not(.chat-vote-btn):not(.share-vote-btn):hover {
  color: #111827;
}

body[data-theme="light"] .chat-share-btn--share {
  color: #1f2937;
}

body[data-theme="light"] .chat-share-btn--share:hover {
  color: #111827;
}

body[data-theme="light"] .chat-share-btn.share-vote-btn {
  color: #0f172a;
  background: #e5e7eb;
  border-color: #d1d5db;
  box-shadow: none;
}

body[data-theme="light"] .chat-share-btn.share-vote-btn[data-vote="up"] {
  color: #ffffff;
  background: #58c569;
  border-color: #a7f3d0;
}

body[data-theme="light"] .chat-share-btn.share-vote-btn[data-vote="down"] {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fecaca;
}

body[data-theme="light"] .chat-vote-count {
  color: #111827;
}

body[data-theme="light"] .code-block {
  background: #f8fafc;
  border-color: #e5e7eb;
  color: #0f172a;
}

body[data-theme="light"] .share-summary {
  background: #f8fafc;
  border-color: #e5e7eb;
  color: #1f2937;
}

body[data-theme="light"] .share-vote-panel {
  background: #f8fafc;
  border-color: #e5e7eb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .share-vote-label {
  color: #4b5563;
}

body[data-theme="light"] .share-vote-count {
  color: #0f172a;
}

body[data-theme="light"] .chat-share-btn.share-vote-btn:disabled {
  opacity: 0.75;
  color: #ffffff;
}

body[data-theme="light"] .modal-backdrop {
  background: rgba(17, 24, 39, 0.35);
}

body[data-theme="light"] .modal-card {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
}

body[data-theme="light"] .modal-header h3 {
  color: #111827;
}

body[data-theme="light"] .modal-body label {
  color: #1f2937;
}

body[data-theme="light"] .modal-close {
  color: #6b7280;
}

body[data-theme="light"] .modal-close:hover {
  color: #111827;
}

body[data-theme="light"] .modal-error,
body[data-theme="light"] .policy-modal-error {
  color: #b91c1c;
}

body[data-theme="light"] .policy-slider {
  background: #f8fafc;
  border-color: #e5e7eb;
}

body[data-theme="light"] .policy-consent p {
  color: #1f2937;
}

body[data-theme="light"] .policy-version {
  background: #e5e7eb;
  color: #111827;
}

body[data-theme="light"] .policy-modal-reason {
  background: #fff1e6;
  border-color: #fdba74;
  color: #9a3412;
}

body[data-theme="light"] .policy-slider-title {
  color: #111827;
}

body[data-theme="light"] .policy-slider-status {
  color: #4b5563;
}

body[data-theme="light"] .policy-toggle {
  background: #e5e7eb;
}

body[data-theme="light"] .policy-doc-back {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #0f172a;
}

body[data-theme="light"] .policy-doc-panel textarea {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #0f172a;
}

body[data-theme="light"] .policy-doc-title {
  color: #111827;
}

body[data-theme="light"] .timeline__tooltip {
  background: #111827;
  color: #f8fafc;
}

body[data-theme="light"] .timeline__tooltip::after {
  border-color: #111827 transparent transparent transparent;
}

body[data-theme="light"] .captcha-refresh {
  color: #475569;
}

body[data-theme="light"] .captcha-refresh:hover {
  color: #111827;
}

@media (max-width: 768px) {
  header, footer {
    text-align: left;
  }

  .chat-bubble {
    max-width: 90%;
  }

  /*
  .chat-dropzone {
     padding: 1.25rem;
  }
  */

  .chat-selected-preview {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-selected-preview .preview-info {
    width: 100%;
  }

  /*.preview-thumb {
    width: 100%;
    max-width: 280px;
    height: auto;
  }*/
}

@media (max-width: 520px) {
  .captcha-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .captcha-row input {
    width: 100%;
    min-width: 140px;
  }
}
