:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1e222b;
  --border: #2a2f3a;
  --border-strong: #3a4150;
  --text: #e6e8eb;
  --text-secondary: #a3a9b4;
  --text-muted: #6b7280;
  --accent: #4fd8ff;
  --accent-strong: #8ce8ff;
  --accent-text: #04222c;
  --accent-glow: rgba(79, 216, 255, 0.35);
  --success: #52c77e;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.site-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
}

.footer-credit {
  margin: 0;
}

.footer-cgu-btn {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
}

.footer-cgu-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 600px) {
  .site-footer {
    flex-direction: column;
    gap: 10px;
    padding: 16px;
  }

  .footer-cgu-btn {
    position: static;
    transform: none;
  }
}

.auth-error-banner {
  background: rgba(255, 107, 107, 0.15);
  color: #ff6b6b;
  font-size: 13px;
  padding: 10px 16px;
  text-align: center;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
}

.nav-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.header-row-nav {
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.header h1 {
  font-size: 20px;
  margin: 0;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}

.container-wide {
  max-width: 1320px;
}

.page-layout {
  position: relative;
}

.content-main {
  width: 700px;
  max-width: 100%;
  margin: 0 auto;
}

.live-activity-box {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.live-activity-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin: 0 0 12px;
  color: var(--text);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.live-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.live-activity-item {
  display: flex;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.live-activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.live-activity-rank {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.live-activity-body {
  flex: 1;
  min-width: 0;
}

.live-activity-link {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-activity-link:hover {
  color: var(--accent);
}

.live-activity-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.live-activity-count {
  font-size: 11px;
  color: var(--text-muted);
}

.live-activity-last {
  font-size: 11px;
  color: var(--text-muted);
  margin: 4px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-activity-empty {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

@media (max-width: 860px) {
  .live-activity-box {
    width: 100%;
    position: static;
  }

  .content-main {
    width: 100%;
  }

  .status-tabs,
  .toolbar {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

.status-tabs {
  display: flex;
  gap: 8px;
  margin: 0 auto 14px;
  max-width: 700px;
}

.status-tab {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.status-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.status-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 0 12px var(--accent-glow);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 auto 16px;
  max-width: 700px;
}

.search-input {
  flex: 1;
  min-width: 160px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--text);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.category-filter {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--text);
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  color: var(--text);
}

.text-input {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--text);
}

.form-error {
  color: #ff6b6b;
  font-size: 13px;
  min-height: 18px;
}

.login-required {
  text-align: center;
  padding: 60px 0;
  color: var(--text-secondary);
}

.login-required button {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
  box-shadow: 0 0 12px var(--accent-glow);
}

.login-required button:hover {
  background: var(--accent-strong);
}

.proposal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.proposal-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.proposal-row-approved {
  background: linear-gradient(135deg, rgba(82, 199, 126, 0.1), var(--surface));
  border-color: rgba(82, 199, 126, 0.25);
}

.proposal-row-rejected {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), var(--surface));
  border-color: rgba(255, 107, 107, 0.25);
}

.vote-bar {
  width: 36px;
  height: 6px;
  border-radius: 3px;
  background: var(--danger);
  overflow: hidden;
}

.vote-bar-fill {
  height: 100%;
  background: var(--success);
}

.vote-comment-count {
  font-size: 11px;
  color: var(--text-muted);
}

.vote-bar-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0;
}

.vote-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vote-bar-block .vote-bar {
  width: 140px;
}

.vote-count {
  font-size: 12px;
  font-weight: 700;
}

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

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

.proposal-body {
  flex: 1;
  min-width: 0;
}

.proposal-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.proposal-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.category-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
}

.proposal-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.proposal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.proposal-meta-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.proposal-date {
  font-size: 12px;
  color: var(--text-muted);
}

.view-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.view-link:hover {
  color: var(--accent-strong);
}

.auth-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-area button {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
}

.auth-area button:hover {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 0 12px var(--accent-glow);
}

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

.submit-link {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 0 12px var(--accent-glow);
}

.submit-link:hover {
  background: var(--accent-strong);
}

@media (max-width: 600px) {
  .header {
    padding: 12px 16px;
  }

  .header h1 {
    font-size: 17px;
  }

  .container {
    padding: 16px 12px;
  }

  .toolbar {
    flex-direction: column;
  }

  .category-filter {
    width: 100%;
  }

  .proposal-row {
    flex-wrap: wrap;
  }
}

.file-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
}

.file-dropzone:hover,
.file-dropzone.dragover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.file-thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.file-thumbnail {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.file-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-thumbnail-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 11px;
  color: var(--text-muted);
}

.file-thumbnail-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
