:root {
  --bg: #ffffff;
  --text: #222222;
  --muted: #6a6a6a;
  --accent: #ff385c;
  --accent-dark: #e00b41;
  --border: #ebebeb;
  --surface: #f7f7f7;
  --shadow: rgba(0, 0, 0, 0.02) 0 0 0 1px, rgba(0, 0, 0, 0.04) 0 2px 6px, rgba(0, 0, 0, 0.1) 0 4px 8px;
  --danger: #c13515;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Circular, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
a {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 32px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand h1,
.section-header h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
}

.brand p,
.section-header span,
.file-size,
.file-state,
.status-message {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: block;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.topbar-actions,
.user-chip,
.lang-switch {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-link {
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.flag {
  font-size: 16px;
  line-height: 1;
}

.lang-link.active {
  color: var(--text);
  background: var(--surface);
}

.page-shell {
  padding: 32px;
}

.flash-message {
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid #ffd6df;
  border-radius: 8px;
  background: #fff4f7;
  color: var(--text);
}

.flash-message p {
  margin: 0;
}

.login-nudge {
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.login-nudge p {
  margin: 0;
  color: var(--text);
}

.banner-panel {
  position: relative;
  min-height: 280px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.banner-panel img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.banner-copy {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  background: linear-gradient(180deg, rgba(34, 34, 34, 0.08) 0%, rgba(34, 34, 34, 0.62) 100%);
  color: #fff;
}

.banner-copy h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.banner-copy p {
  margin: 0;
  max-width: 720px;
  color: rgba(255, 255, 255, 0.9);
}

.uploader-shell {
  display: block;
}

.panel {
  background: var(--bg);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-uploader {
  padding: 24px;
}

.hidden-image {
  display: none;
}

.dropzone {
  width: 100%;
  border: 2px dashed #d9d9d9;
  background: linear-gradient(180deg, #fff 0%, #fff7f9 100%);
  border-radius: 20px;
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--text);
  cursor: pointer;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: #fff2f5;
}

.content-block {
  margin-top: 20px;
  padding: 20px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.file-list {
  display: grid;
  gap: 12px;
}

.file-list.empty::before {
  content: "No files selected yet.";
  color: var(--muted);
}

.file-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  align-items: center;
}

.file-meta,
.file-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.file-meta {
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
}

.file-name {
  width: 100%;
  overflow-wrap: anywhere;
}

.file-state[data-state="invalid"],
.status-message.error {
  color: var(--danger);
}

.file-state[data-state="success"],
.status-message.success {
  color: #12715b;
}

.remove-link,
.secondary-button,
.primary-button {
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.remove-link,
.secondary-button {
  background: #f2f2f2;
  color: var(--text);
}

.google-login-button {
  gap: 10px;
  min-height: 44px;
  padding: 10px 16px 10px 12px;
  border: 1px solid #dadce0;
  background: #ffffff;
  color: #3c4043;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.google-login-button:hover {
  background: #f8fafd;
  border-color: #c8d7f0;
}

.google-login-button:focus-visible {
  outline: 3px solid rgba(66, 133, 244, 0.24);
  outline-offset: 2px;
}

.google-login-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.google-login-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.google-login-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

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

.options-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-row {
  justify-content: center;
  min-height: 100%;
}

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

.options-grid input[type="number"] {
  width: 100%;
  border: 1px solid #d6d6d6;
  border-radius: 8px;
  padding: 12px 14px;
}

.action-row,
.status-strip {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.progress-panel {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #fff7f9;
  border: 1px solid #ffd6df;
  display: none;
}

.progress-panel.active {
  display: block;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: #ffe4ea;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ff385c 0%, #ff7b8f 100%);
  transition: width 220ms ease;
}

.status-message {
  min-height: 24px;
}

.site-footer {
  padding: 0 32px 32px;
}

.site-footer-inner {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
}

.site-footer-inner h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.2;
}

.site-footer-inner p {
  margin: 0 auto;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
}

.error-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: linear-gradient(180deg, #fff 0%, #f7f7f7 100%);
}

.error-panel {
  width: min(520px, 100%);
  text-align: center;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 32px;
}

.error-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 16px;
}

.error-panel h1 {
  margin: 0 0 10px;
  font-size: 28px;
}

.error-panel p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.6;
}

.progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(34, 34, 34, 0.46);
  backdrop-filter: blur(4px);
}

.progress-overlay.active {
  display: flex;
}

.progress-dialog {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.progress-dialog h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.progress-dialog p {
  margin: 0 0 18px;
  color: var(--muted);
}

.overlay-progress-track {
  height: 14px;
  border-radius: 999px;
  background: #ffe4ea;
  overflow: hidden;
}

.overlay-progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ff385c 0%, #ff7b8f 100%);
  transition: width 180ms ease;
}

.overlay-progress-meta {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
}

@media (max-width: 960px) {
  .topbar,
  .page-shell,
  .site-footer {
    padding: 20px;
  }

  .banner-panel img {
    height: 240px;
  }
}

@media (max-width: 640px) {
  .topbar,
  .brand,
  .topbar-actions,
  .section-header,
  .file-item,
  .file-actions,
  .action-row,
  .login-nudge {
    flex-direction: column;
    align-items: stretch;
  }

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