*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1a1a1a;
  background: #f8f8f6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  padding: 14px 20px;
}

.logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  text-decoration: none;
  letter-spacing: -0.3px;
}

main {
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px 60px;
  flex: 1;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  color: #111;
}

.subheading {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 8px;
  line-height: 1.5;
}

.intro {
  color: #666;
  margin-bottom: 28px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.ad-placeholder {
  background: #f0f0ec;
  border: 1px dashed #ccc;
  border-radius: 6px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  color: #aaa;
  font-size: 0.8rem;
}

.result-ad {
  margin-top: 32px;
  margin-bottom: 0;
}

.ad-placeholder {
  display: none;
}

.upload-form {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
}

.label-note {
  display: block;
  font-weight: 400;
  color: #999;
  font-size: 0.78rem;
  margin-top: 1px;
}

.form-row input[type="file"],
.form-row select,
.form-row input[type="number"] {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fafafa;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}

.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 18px 16px;
  background: #fafafa;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.drop-zone:focus {
  outline: none;
  border-color: #3b82f6;
  background: #fff;
}

.drop-zone.drag-over {
  border-color: #2563eb;
  background: #eff6ff;
}

.drop-zone-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
}

.drop-zone-subtitle {
  margin-top: 4px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: #6b7280;
}

.drop-zone input[type="file"] {
  cursor: pointer;
}

.form-row input[type="file"]:focus,
.form-row select:focus,
.form-row input[type="number"]:focus {
  border-color: #3b82f6;
  background: #fff;
}

.btn-primary {
  padding: 12px 20px;
  background: #2563eb;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-primary:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

.loading {
  text-align: center;
  color: #555;
  font-size: 0.95rem;
  padding: 12px 0;
}

.result {
  margin-top: 24px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 24px;
}

.result-info {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.size-box {
  flex: 1;
  min-width: 120px;
  background: #f8f8f6;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 14px 16px;
  text-align: center;
}

.size-box .label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.size-box .value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
}

.arrow {
  font-size: 1.4rem;
  color: #aaa;
  flex-shrink: 0;
}

.btn-download {
  display: block;
  text-align: center;
  padding: 12px 20px;
  background: #16a34a;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 7px;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-download:hover {
  background: #15803d;
}

.error-msg {
  margin-top: 16px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 12px 16px;
  color: #dc2626;
  font-size: 0.9rem;
}

.internal-links {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #e5e5e5;
}

.internal-links .links-label {
  font-size: 0.9rem;
  font-weight: 400;
  color: #555;
  margin-bottom: 12px;
}

.internal-links ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.internal-links a {
  color: #2563eb;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 5px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  background: #eff6ff;
  transition: background 0.15s, border-color 0.15s;
}

.internal-links a:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

footer {
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
  color: #aaa;
  border-top: 1px solid #e5e5e5;
  background: #fff;
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.4rem;
  }

  .upload-form {
    padding: 20px;
  }

  .drop-zone {
    padding: 16px 14px;
  }

  .result-info {
    flex-direction: column;
    align-items: stretch;
  }

  .arrow {
    text-align: center;
    transform: rotate(90deg);
  }
}
