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

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f5f5f5;
  color: #222;
}

body {
  line-height: 1.5;
}

#page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#header {
  background-color: #00294d;
  color: #fff;
  border-bottom: 4px solid #b22222;
}

.cluh-coins-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0;
}

.cluh-coin-inline-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.cluh-coins-inline-count {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.header-trailing {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 20px;
  margin-left: auto;
}

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

.site-identity {
  display: flex;
  flex-direction: column;
}

.site-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.site-subtitle {
  font-size: 12px;
  opacity: 0.8;
}

.top-nav {
  display: flex;
  gap: 16px;
  font-size: 14px;
}

.nav-link {
  color: #f0f4ff;
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

.nav-link.active {
  border-bottom-color: #ffffff;
}

#content {
  flex: 1;
  background-color: #f5f5f5;
}

.content-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
  background-color: #fff;
}

.breadcrumb {
  font-size: 12px;
  color: #777;
  margin-bottom: 8px;
}

.page-title {
  font-size: 26px;
  margin: 8px 0 12px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 6px;
}

.intro {
  font-size: 14px;
  color: #444;
  margin-bottom: 20px;
}

.essay-section {
  margin-top: 10px;
}

.essay-meta {
  font-size: 13px;
  color: #555;
  margin-bottom: 12px;
  line-height: 1.4;
}

.essay p {
  margin: 0 0 12px;
  color: #2b2b2b;
}

.code {
  font-family: "Consolas", "Courier New", monospace;
  background-color: #f0f0f0;
  padding: 2px 4px;
  border-radius: 3px;
}

.file-section {
  margin-top: 10px;
}

.section-title {
  font-size: 18px;
  margin-bottom: 10px;
}

.drop-zone {
  border: 2px dashed #999;
  background-color: #fafafa;
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
  color: #555;
}

.drop-zone.dragover {
  border-color: #00294d;
  background-color: #eef4ff;
}

.drop-zone-text {
  font-size: 13px;
}

.drop-zone-hint {
  margin: 8px 0 12px;
  font-size: 12px;
  color: #666;
}

.upload-panel {
  margin-bottom: 12px;
}

.upload-notice {
  font-size: 13px;
  color: #444;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #eef4ff;
  border: 1px solid #b8c9e6;
  line-height: 1.45;
}

.files-signin-hint {
  font-size: 13px;
  color: #444;
  margin: 0 0 16px;
  line-height: 1.45;
}

.google-signin-container {
  min-height: 40px;
}

.google-signin-container--header {
  margin: 0;
  min-height: 40px;
  min-width: 200px;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.google-signin-container--header:has(iframe) {
  line-height: 0;
}

.google-signin-container--header:not(:has(iframe)) {
  font-size: 11px;
  line-height: 1.35;
  padding: 8px 10px;
  color: #333;
  justify-content: flex-start;
}

.google-signin-container--header iframe {
  border-radius: 0 !important;
}

.auth-signed-in--header {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 0;
  max-width: min(360px, 100%);
}

.auth-signed-in--header .auth-user-line {
  margin: 0;
  font-size: 13px;
  color: #222;
  line-height: 1.35;
}

.auth-sign-out-btn--header {
  border-radius: 0;
  margin: 0;
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
  background: #fff;
  color: #222;
  border: 1px solid #222;
}

.auth-sign-out-btn--header:hover {
  background: #f0f0f0;
}

.anonymous-upload-label {
  display: block;
  font-size: 13px;
  color: #333;
  margin: 0 0 10px;
  cursor: pointer;
}

.anonymous-upload-label input {
  margin-right: 8px;
  vertical-align: middle;
}

.drop-zone-disabled {
  opacity: 0.55;
}

.pending-upload-section {
  margin-bottom: 20px;
}

.pending-upload-intro {
  font-size: 13px;
  color: #555;
  margin: 0 0 10px;
}

.col-uploader {
  min-width: 100px;
  max-width: 160px;
}

.col-rating {
  min-width: 168px;
  vertical-align: top;
}

.file-table td.col-rating {
  overflow-x: auto;
  max-width: min(280px, 36vw);
}

.view-rating-mount {
  margin: 0 0 16px;
}

.view-rating-mount[hidden] {
  display: none !important;
}

.file-star-rating {
  font-size: 12px;
  color: #333;
}

.file-star-summary {
  margin-bottom: 6px;
  font-weight: 600;
  color: #00294d;
  line-height: 1.3;
  white-space: normal;
  max-width: 240px;
}

.file-star-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: nowrap;
}

.file-star-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  border-radius: 2px;
  box-sizing: border-box;
}

.file-star-btn:hover .file-star-img {
  transform: scale(1.22);
  opacity: 1;
  filter: none;
  z-index: 1;
}

.file-star-btn:focus-visible {
  outline: 2px solid #00294d;
  outline-offset: 2px;
}

.file-star-static {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  line-height: 0;
  opacity: 0.95;
}

.file-star-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
  opacity: 0.28;
  filter: grayscale(0.35);
  transition: transform 0.14s ease, opacity 0.14s ease, filter 0.14s ease;
  transform-origin: center center;
  pointer-events: none;
}

.file-star-img.is-lit {
  opacity: 1;
  filter: none;
}

.file-star-hint {
  margin-top: 6px;
  font-size: 11px;
  color: #666;
}

.col-preview {
  width: 88px;
}

.col-pending-actions {
  width: 200px;
}

.pending-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.approve-btn {
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  background: #156b15;
  color: #fff;
  border: none;
  border-radius: 3px;
}

.approve-btn:hover {
  background: #1a801a;
}

.reject-btn {
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  background: #8b1a1a;
  color: #fff;
  border: none;
  border-radius: 3px;
}

.reject-btn:hover {
  background: #a42020;
}

.upload-browse-btn {
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
  background: #00294d;
  color: #fff;
  border: none;
  border-radius: 3px;
}

.upload-browse-btn:hover {
  background: #004080;
}

.upload-browse-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.upload-status {
  margin: 12px 0 0;
  font-size: 13px;
  min-height: 1.2em;
}

.upload-status.upload-ok {
  color: #156b15;
}

.upload-status.upload-err {
  color: #b22222;
}

.file-list-wrapper {
  border: 1px solid #ccc;
  background-color: #fdfdfd;
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.file-table thead {
  background-color: #e3e3e3;
}

.file-table th,
.file-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #ddd;
}

.file-table th {
  text-align: left;
  font-weight: 600;
}

.file-table tbody tr:nth-child(even) {
  background-color: #f7f7f7;
}

.file-table tbody tr:hover {
  background-color: #eef4ff;
}

.file-table a {
  color: #0645ad;
  text-decoration: none;
}

.file-table a:hover {
  text-decoration: underline;
}

.col-size {
  width: 110px;
}

.col-date {
  width: 190px;
}

.col-admin {
  width: 110px;
}

.loading-row td {
  text-align: center;
  color: #777;
}

.empty-row td {
  text-align: center;
  color: #777;
}

.viewer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 14px;
}

.button-link {
  display: inline-block;
  padding: 8px 10px;
  border: 1px solid #1f3f66;
  background: #00294d;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
}

.button-link:hover {
  filter: brightness(1.05);
}

.button-link.secondary {
  background: #f2f2f2;
  color: #1a1a1a;
  border-color: #bcbcbc;
}

.viewer {
  border: 1px solid #ccc;
  background: #fafafa;
  padding: 10px;
  min-height: 200px;
}

.viewer-media {
  width: 100%;
  height: auto;
  max-height: 70vh;
  display: block;
  object-fit: contain;
  object-position: center;
  background: #000;
}

.viewer-audio {
  width: 100%;
}

.viewer-frame {
  width: 100%;
  height: 75vh;
  border: 0;
  background: #fff;
}

.viewer-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.4;
  background: #fff;
  border: 1px solid #ddd;
  padding: 10px;
  max-height: 75vh;
  overflow: auto;
}

.viewer-fallback {
  margin-top: 10px;
  font-size: 13px;
  color: #555;
}

.viewer-docx {
  background: #fff;
  border: 1px solid #ddd;
  padding: 12px;
  max-height: 75vh;
  overflow: auto;
  font-size: 14px;
  color: #222;
}

.viewer-docx p {
  margin: 0 0 12px;
}

.newest-file {
  margin: 0 0 10px;
  padding: 8px 10px;
  background: #eef4ff;
  border: 1px solid #c5d7f2;
  font-size: 13px;
}

.redacted-row td {
  filter: blur(3px);
}

.redacted-row:hover td {
  filter: blur(2px);
}

.disabled-link {
  color: #666 !important;
  text-decoration: none !important;
  cursor: not-allowed;
}

.admin-btn {
  border: 1px solid #1f3f66;
  background: #00294d;
  color: #fff;
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
}

.admin-btn:hover {
  filter: brightness(1.07);
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .top-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .col-size,
  .col-date,
  .col-admin {
    width: auto;
  }
}

#footer {
  background-color: #00294d;
  color: #fff;
  margin-top: 12px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  opacity: 0.9;
}

