:root {
  --bg: #dfe8fa;
  --bg-strong: #e9effd;
  --surface: #f8f8f8;
  --surface-strong: #ffffff;
  --surface-soft: #eef2fb;
  --text: #181818;
  --muted: #757575;
  --line: rgba(24, 24, 24, 0.12);
  --line-soft: rgba(24, 24, 24, 0.08);
  --blue: #3f63e0;
  --blue-strong: #3154d5;
  --danger: #bf3b33;
  --shadow: 0 18px 40px rgba(58, 76, 122, 0.16);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "SF Pro Text", "Helvetica Neue", sans-serif;
  background: linear-gradient(180deg, #dfe8fa 0%, #d8e3fb 100%);
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.landing-body {
  min-height: 100vh;
}

.landing-shell {
  width: min(100%, 430px);
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  align-content: start;
  justify-items: center;
  padding: 36px 18px 28px;
}

.top-auth-island {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(29, 29, 31, 0.86);
  box-shadow: 0 6px 16px rgba(20, 20, 24, 0.12);
  backdrop-filter: blur(14px);
  text-decoration: none;
}

.top-auth-island,
.top-auth-island a,
#topAuthLink,
#topUserEmail {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.92rem;
  font-weight: 600;
}

.top-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.top-user-avatar,
.top-user-initial,
.profile-avatar,
.profile-initial {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  object-fit: cover;
}

.top-user-initial,
.profile-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.brand-block {
  text-align: center;
  margin-bottom: 22px;
}

.brand-mark {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(2.5rem, 9vw, 4rem);
  letter-spacing: -0.06em;
  text-transform: lowercase;
}

.brand-subline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.upload-stage {
  width: 100%;
}

.account-card,
.my-shares-card {
  width: 100%;
  margin-bottom: 12px;
  padding: 16px;
  border-radius: var(--radius-xl);
  background: rgba(248, 248, 248, 0.96);
  box-shadow: var(--shadow);
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-grid-single {
  grid-template-columns: 1fr;
}

.auth-form,
.account-panel {
  display: grid;
  gap: 10px;
}

.auth-form h2,
.account-panel h2,
.my-shares-card h2 {
  font-size: 1.2rem;
}

.auth-button {
  justify-content: center;
}

.account-ads-button {
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
}

.account-top,
.inline-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.profile-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: start;
}

.profile-avatar-wrap {
  display: grid;
  place-items: center;
}

.profile-avatar,
.profile-initial {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

.profile-meta {
  display: grid;
  gap: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(63, 99, 224, 0.08);
  display: grid;
  gap: 4px;
}

.stat-card strong {
  font-size: 1rem;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.ad-item .ad-preview {
  margin-top: 10px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(63, 99, 224, 0.08);
}

.ad-item .ad-preview img {
  width: 100%;
  display: block;
  max-height: 180px;
  object-fit: cover;
}

.ad-caption-preview {
  margin: 10px 0 0;
  color: var(--muted);
  white-space: pre-wrap;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.toggle-password-button {
  width: 44px;
  min-height: 44px;
  border-radius: 12px;
  background: rgba(63, 99, 224, 0.12);
  color: #3557d6;
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.background-ad-overlay {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(24, 24, 28, 0.76);
  color: #fff;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 24px rgba(15, 15, 18, 0.18);
}

.background-ad-label {
  margin-bottom: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.78;
}

.background-ad-text,
.background-ad-text a {
  color: #fff;
  line-height: 1.5;
}

.background-ad-link {
  display: inline-flex;
  margin-top: 10px;
  color: #fff;
  text-decoration: underline;
}

.account-top p,
.account-note,
.my-shares-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.edit-dialog {
  border: none;
  border-radius: 22px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.edit-dialog::backdrop {
  background: rgba(18, 18, 20, 0.22);
  backdrop-filter: blur(4px);
}

.edit-dialog .auth-form {
  min-width: min(92vw, 420px);
  padding: 20px;
  border: none;
  border-radius: 22px;
  background: rgba(248, 248, 248, 0.98);
  box-shadow: 0 12px 28px rgba(20, 20, 24, 0.1);
}

.stage-tabs {
  width: calc(100% - 42px);
  margin: 0 auto -10px;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px 20px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.65), rgba(244,246,252,0.95));
  color: var(--muted);
  box-shadow: var(--shadow);
}

.stage-tab {
  padding: 6px 10px;
  border-radius: 999px;
}

.stage-tab.active {
  color: var(--text);
  font-weight: 600;
}

.upload-card,
.detail-card,
.admin-card,
.legal-card {
  width: 100%;
  background: rgba(248, 248, 248, 0.96);
  border: 1px solid rgba(255,255,255,0.75);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.upload-card {
  padding: 12px;
}

.upload-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.option-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  background: var(--surface-soft);
  width: 100%;
  text-align: left;
  border: none;
  appearance: none;
}

.option-card.secondary {
  background: #eef1fa;
}

.option-card strong,
.option-card p {
  margin: 0;
}

.option-card p {
  color: var(--muted);
  font-size: 0.92rem;
}

.option-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-self: start;
  background: var(--blue);
  color: #fff;
}

.option-icon svg {
  width: 16px;
  height: 16px;
}

.upload-form,
.download-form,
.admin-login,
.admin-panel {
  display: grid;
  gap: 12px;
}

.upload-form > .primary-button {
  margin-top: 26px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

input,
textarea,
select {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 2px;
  background: transparent;
  color: var(--text);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--blue);
}

textarea {
  resize: vertical;
  min-height: 64px;
}

.drop-zone {
  display: block;
  padding: 14px;
  border: 1px dashed rgba(63, 99, 224, 0.28);
  border-radius: var(--radius-md);
  background: #f4f7ff;
  cursor: pointer;
  min-height: 84px;
}

.drop-zone.hidden {
  display: none !important;
}

.drop-zone input {
  display: none;
}

.drag-over {
  background: #edf2ff;
  border-color: var(--blue);
}

.selected-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
  min-height: 22px;
}

.file-chip {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(63, 99, 224, 0.1);
  color: #3557d6;
  font-size: 0.86rem;
}

button,
.primary-button,
.secondary-button,
.danger-button,
.share-item button,
.admin-share-links button {
  border: none;
  cursor: pointer;
}

.primary-button {
  position: relative;
  overflow: hidden;
  min-height: 54px;
  border-radius: 18px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}

.button-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, #456ef0 0%, #7090ff 100%);
}

.button-label {
  position: relative;
  z-index: 1;
}

.progress-meta {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.result-panel,
.error-panel,
.note-box,
.empty-state {
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.error-panel {
  color: var(--danger);
  background: #fff1ef;
}

.hidden {
  display: none !important;
}

.share-results,
.admin-list {
  display: grid;
  gap: 12px;
}

.main-share-item {
  margin-bottom: 12px;
}

.share-item,
.admin-share {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.share-item-top,
.admin-share-top,
.admin-actions,
.admin-share-links,
.admin-share-meta,
.copy-row,
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.site-footer {
  width: 100%;
  margin-top: 18px;
  justify-content: center;
  flex-wrap: wrap;
  color: var(--muted);
}

.site-footer a {
  text-decoration: none;
}

.result-grid,
.meta-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.compact-grid {
  grid-template-columns: 1fr;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 600;
}

.checksum {
  word-break: break-all;
  font-size: 0.85rem;
}

.detail-body,
.legal-body {
  min-height: 100vh;
  background: linear-gradient(180deg, #dfe8fa 0%, #d8e3fb 100%);
}

.detail-shell,
.legal-shell,
.admin-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  align-content: start;
  padding: 32px 18px;
}

.detail-card,
.admin-card,
.legal-card {
  padding: 24px;
}

.detail-download-card {
  max-width: 420px;
  margin: 0 auto;
  overflow: hidden;
  padding: 0;
}

.detail-preview-wrap {
  padding: 18px 18px 0;
}

.media-preview {
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #eef1fa;
}

.media-preview-fallback {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--muted);
  font-size: 1.1rem;
}

.media-preview-group {
  background: linear-gradient(180deg, #eef2fb, #e7ecfa);
}

.media-preview-group span {
  font-size: 1.35rem;
  font-weight: 700;
  color: #2d2d31;
}

.media-preview img,
.media-preview video {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #e9edf8;
}

.detail-headline {
  padding: 18px 18px 12px;
  text-align: center;
}

.detail-headline h1 {
  font-size: clamp(2rem, 6vw, 2.6rem);
}

.detail-headline p {
  margin: 6px 0 0;
  color: var(--muted);
}

.detail-file-row {
  margin: 0 0 10px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: rgba(24, 24, 24, 0.05);
  border-top: 1px solid rgba(24, 24, 24, 0.06);
  border-bottom: 1px solid rgba(24, 24, 24, 0.06);
}

.detail-file-main {
  display: grid;
  gap: 4px;
}

.detail-file-main strong {
  font-size: 1rem;
}

.detail-file-main span {
  color: var(--muted);
  font-size: 0.92rem;
}

.detail-download-card .note-box,
.detail-download-card .detail-code-form,
.detail-download-card .detail-actions {
  margin: 0 18px 14px;
}

.detail-group-card .detail-actions {
  margin-bottom: 16px;
}

.group-files-list {
  display: grid;
  gap: 0;
  margin: 0 0 16px;
}

.group-file-item {
  padding: 14px 18px;
  border-top: 1px solid rgba(24, 24, 24, 0.08);
}

.group-file-item:last-child {
  border-bottom: 1px solid rgba(24, 24, 24, 0.08);
}

.group-file-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.group-actions {
  margin-top: 0;
}

.scan-box {
  margin: 0 18px 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(24,24,24,0.04);
}

.scan-box strong {
  display: block;
  margin-bottom: 4px;
}

.scan-box p {
  margin: 0;
  color: var(--muted);
}

.scan-clean {
  background: rgba(28, 150, 88, 0.08);
}

.scan-malicious {
  background: rgba(191, 59, 51, 0.1);
}

.detail-actions,
.detail-code-form {
  display: grid;
  gap: 12px;
}

.secondary-link-button,
.detail-download-card .download-form button,
.detail-download-card .detail-actions button,
.detail-download-card .detail-code-form button {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  text-decoration: none;
  font-weight: 600;
}

.compact-link-button {
  min-height: 42px;
  padding: 10px 14px;
}

.secondary-link-button {
  background: #4a6cf0;
  color: #fff;
}

.detail-download-card .download-form button,
.detail-download-card .detail-code-form button {
  background: #fff;
  color: #4a6cf0;
  border: 1px solid #4a6cf0;
}

.back-link,
.admin-link-inline {
  text-decoration: none;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "SF Pro Display", "Helvetica Neue", sans-serif;
  letter-spacing: -0.05em;
}

h1 {
  font-size: clamp(2.3rem, 7vw, 3.6rem);
}

.intro,
.admin-share p,
.admin-note,
.legal-card p,
.legal-card li {
  color: var(--muted);
  line-height: 1.55;
}

.legal-card h2 {
  margin-top: 20px;
  font-size: 1.35rem;
}

.legal-card ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.secondary-button,
.danger-button,
.share-item button,
.admin-share-links button {
  width: auto;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(63, 99, 224, 0.12);
  color: #3557d6;
}

.danger-button {
  background: #bf3b33;
  color: #fff;
}

@media (max-width: 560px) {
  .landing-shell,
  .detail-shell,
  .legal-shell,
  .admin-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .upload-copy-row,
  .share-item-top,
  .admin-share-top,
  .admin-actions,
  .admin-share-links,
  .admin-share-meta,
  .copy-row,
  .site-footer,
  .progress-meta,
  .result-grid,
  .meta-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .upload-options {
    grid-template-columns: 1fr;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }
}
