@font-face {
  font-family: "Cabin";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/Cabin-Bold.ttf") format("truetype");
}

:root {
  --ink-primary: #1c1f24;
  --ink-secondary: #4b4f57;
  --ink-muted: #6b6f78;
  --ink-heading: #0f1320;
  --accent-blue: #33509f;
  --accent-blue-dark: #14161c;
  --brand-check-start: #46e7c0;
  --brand-check-mid: #2c52fc;
  --brand-check-end: #9b61fc;
  --success: #26694a;
  --success-bg: #eef6f1;
  --danger: #96261f;
  --danger-bg: #fbeeed;
  --surface-page: #f4f6fb;
  --surface-glass: rgba(255, 255, 255, 0.88);
  --radius-md: 8px;
  --radius-lg: 10px;
}

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

html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-primary);
  background: var(--surface-page);
  min-height: 100vh;
  padding-bottom: 120px;
}

.page-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 24px;
}

@media (min-width: 480px) {
  .page-wrap { padding: 28px 20px 32px; }
}

.header {
  margin-bottom: 20px;
}

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

.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
  display: block;
}

.brand-copy {
  min-width: 0;
}

.brand-wordmark {
  display: flex;
  align-items: baseline;
  font-family: "Cabin", "Segoe UI", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

.brand-letter {
  color: var(--ink-heading);
}

.brand-check {
  margin-left: 0.08em;
  background: linear-gradient(90deg, var(--brand-check-start) 0%, var(--brand-check-mid) 50%, var(--brand-check-end) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header-lead {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}

h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #0f1320;
}

.subtitle {
  margin: 0 0 20px;
  font-size: 14.5px;
  color: var(--ink-secondary);
  line-height: 1.55;
}

.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 20px;
}

.session-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

#fileInput { display: none; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s ease;
}

[hidden] {
  display: none !important;
}

.btn-primary {
  background: var(--accent-blue-dark);
  color: #fff;
  box-shadow: 0 1px 2px rgba(12, 18, 42, 0.28);
}

.btn-primary:hover:not(:disabled) { background: #2a4488; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
  background: #fff;
  color: var(--ink-primary);
  box-shadow: inset 0 0 0 1px #d9d7d2;
  margin-top: 10px;
}

.btn-secondary:hover { background: #f6f5f3; }

.btn-ghost {
  background: transparent;
  color: var(--accent-blue);
  min-height: 44px;
  font-size: 14px;
}

.file-count {
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-muted);
  margin: 12px 0 4px;
  min-height: 20px;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 16px;
}

@media (min-width: 480px) {
  .thumb-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 600px) {
  .thumb-grid { grid-template-columns: repeat(4, 1fr); }
}

.thumb-tile {
  position: relative;
  background: var(--surface-glass);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(28, 36, 66, 0.05);
  overflow: hidden;
}

.thumb-preview {
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
  display: block;
  background: #eeedea;
}

.thumb-pdf {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #f4f6fd;
  color: var(--accent-blue);
  font-size: 11px;
  padding: 8px;
  text-align: center;
}

.thumb-pdf svg { width: 32px; height: 32px; }

.thumb-name {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid #f0efec;
}

.thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 22, 28, 0.72);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (pointer: coarse) {
  .thumb-remove {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}

.thumb-remove:hover { background: #96261f; }

.status {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  display: none;
}

.status.visible { display: block; }
.status.error { background: var(--danger-bg); color: var(--danger); }
.status.success { background: var(--success-bg); color: var(--success); }
.status.info { background: #f4f6fd; color: var(--accent-blue); }

.fixed-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
  background: linear-gradient(180deg, rgba(244, 246, 251, 0) 0%, rgba(244, 246, 251, 0.92) 24%, #f4f6fb 100%);
  backdrop-filter: blur(12px);
}

.fixed-bar-inner {
  max-width: 520px;
  margin: 0 auto;
}

.progress-wrap {
  display: none;
  margin-bottom: 10px;
}

.progress-wrap.visible { display: block; }

.progress-track {
  height: 6px;
  border-radius: 3px;
  background: #dfe4f0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-blue);
  border-radius: 3px;
  transition: width 0.2s ease;
}

.progress-label {
  font-size: 12px;
  color: var(--ink-muted);
  text-align: center;
  margin-top: 4px;
}

.privacy-note {
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.5;
}

.success-panel {
  display: none;
  text-align: center;
  padding: 32px 16px;
}

.success-panel.visible { display: block; }

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-main.hidden { display: none; }

.choose-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: none;
}
