*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Hiragino Sans', 'Meiryo', sans-serif; background: #f8fafc; color: #1e293b; }
.hidden { display: none !important; }

/* Header */
header { background: #fff; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.4rem; font-weight: 700; color: #2563eb; }
.auth-nav { display: flex; align-items: center; gap: 0.75rem; }
.user-info { font-size: 0.875rem; color: #64748b; }

/* Buttons */
.btn { padding: 0.5rem 1.25rem; border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-outline { background: #fff; color: #2563eb; border: 1.5px solid #2563eb; }
.btn-outline:hover { background: #eff6ff; }
.btn-convert { background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; padding: 0.85rem 2.5rem; font-size: 1.1rem; border-radius: 12px; }
.btn-convert:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-convert:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-success { background: #16a34a; color: #fff; text-decoration: none; display: inline-block; }
.btn-success:hover { background: #15803d; }
.w-full { width: 100%; }

/* Main */
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

/* AdSense */
.ad-slot { background: #f1f5f9; border: 1px dashed #cbd5e1; border-radius: 8px; text-align: center; color: #94a3b8; font-size: 0.8rem; margin: 1rem 0; }
.ad-top { height: 90px; display: flex; align-items: center; justify-content: center; }
.ad-bottom { height: 90px; display: flex; align-items: center; justify-content: center; margin-top: 2rem; }
.ad-placeholder { pointer-events: none; }

/* Hero */
.hero { text-align: center; padding: 3rem 1rem 2rem; }
.hero h1 { font-size: 2.2rem; font-weight: 800; line-height: 1.3; margin-bottom: 1rem; }
.highlight { color: #2563eb; }
.subtitle { color: #64748b; font-size: 1rem; line-height: 1.8; margin-bottom: 1.5rem; }
.usage-badge { display: inline-block; background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; border-radius: 999px; padding: 0.35rem 1rem; font-size: 0.875rem; font-weight: 600; }

/* Converter Card */
.card { background: #fff; border-radius: 16px; padding: 2rem; box-shadow: 0 4px 24px rgba(0,0,0,0.07); }
.upload-area-wrapper { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center; margin-bottom: 2rem; }
.upload-box { border: 2px dashed #cbd5e1; border-radius: 12px; padding: 1.5rem 1rem; width: 240px; text-align: center; transition: border-color 0.2s; }
.upload-box:hover { border-color: #2563eb; }
.output-box { border-color: #a7f3d0; background: #f0fdf4; }
.upload-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.upload-label { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.75rem; line-height: 1.5; }
.upload-sub { font-size: 0.75rem; font-weight: 400; color: #64748b; }
.file-name { font-size: 0.78rem; color: #2563eb; margin-top: 0.5rem; word-break: break-all; }
.arrow { font-size: 1.5rem; color: #94a3b8; flex-shrink: 0; }
.output-placeholder { font-size: 0.85rem; color: #94a3b8; margin-top: 0.5rem; }
.convert-action { text-align: center; }
.convert-note { font-size: 0.8rem; color: #64748b; margin-top: 0.5rem; }

/* Progress */
.progress { text-align: center; padding: 1.5rem; }
.progress-bar { width: 80%; margin: 0 auto 1rem; height: 6px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.progress-bar::after { content: ''; display: block; height: 100%; width: 60%; background: linear-gradient(90deg, #2563eb, #7c3aed); border-radius: 99px; animation: progress 2s ease-in-out infinite; }
@keyframes progress { 0%{transform:translateX(-100%)} 100%{transform:translateX(200%)} }
.progress p { color: #64748b; font-size: 0.9rem; }

/* Error */
.error-msg { background: #fef2f2; border: 1px solid #fca5a5; color: #dc2626; border-radius: 8px; padding: 0.75rem 1rem; margin-top: 1rem; font-size: 0.875rem; }

/* Plans */
.plans { margin-top: 3rem; text-align: center; }
.plans h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; }
.plan-cards { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.plan-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1.5rem; width: 200px; position: relative; }
.plan-recommended { border-color: #2563eb; box-shadow: 0 0 0 2px #bfdbfe; }
.plan-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: #2563eb; color: #fff; font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.75rem; border-radius: 999px; white-space: nowrap; }
.plan-coming { opacity: 0.6; }
.plan-name { font-weight: 700; font-size: 1rem; margin-bottom: 0.5rem; }
.plan-price { font-size: 1.5rem; font-weight: 800; color: #2563eb; margin-bottom: 0.75rem; }
.plan-card ul { text-align: left; list-style: none; font-size: 0.85rem; color: #475569; margin-bottom: 1rem; }
.plan-card ul li::before { content: '✓ '; color: #16a34a; font-weight: 700; }

/* Footer */
footer { text-align: center; padding: 2rem; color: #94a3b8; font-size: 0.85rem; margin-top: 2rem; border-top: 1px solid #e2e8f0; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal { background: #fff; border-radius: 16px; padding: 2rem; width: 100%; max-width: 400px; position: relative; }
.modal h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 1.25rem; }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #64748b; }
.input { width: 100%; padding: 0.7rem 1rem; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 0.95rem; margin-bottom: 0.75rem; outline: none; }
.input:focus { border-color: #2563eb; }
.modal-link { font-size: 0.82rem; color: #64748b; margin-top: 0.75rem; text-align: center; }
.modal-link a { color: #2563eb; text-decoration: none; }
.modal-error { color: #dc2626; font-size: 0.82rem; margin-top: 0.5rem; text-align: center; }

@media (max-width: 600px) {
  .hero h1 { font-size: 1.5rem; }
  .upload-area-wrapper { flex-direction: column; }
  .arrow { transform: rotate(90deg); }
  .upload-box { width: 100%; }
}

/* Lang selector */
.header-right { display: flex; align-items: center; gap: 1rem; }
.lang-selector { position: relative; }
.lang-btn { background: none; border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 0.35rem 0.75rem; font-size: 0.85rem; cursor: pointer; color: #475569; display: flex; align-items: center; gap: 0.25rem; white-space: nowrap; }
.lang-btn:hover { border-color: #2563eb; color: #2563eb; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 300; padding: 0.4rem; display: grid; grid-template-columns: 1fr 1fr; min-width: 280px; gap: 2px; }
.lang-item { background: none; border: none; padding: 0.45rem 0.75rem; border-radius: 6px; font-size: 0.82rem; cursor: pointer; text-align: left; color: #374151; white-space: nowrap; }
.lang-item:hover { background: #eff6ff; color: #2563eb; }
.lang-item.active { background: #dbeafe; color: #2563eb; font-weight: 600; }

/* Sidebar ad layout */
.page-layout { display: flex; align-items: flex-start; gap: 0; max-width: 1400px; margin: 0 auto; }
.ad-sidebar { width: 160px; flex-shrink: 0; position: sticky; top: 160px; }
.ad-sidebar-inner { background: #f1f5f9; border: 1px dashed #cbd5e1; border-radius: 8px; min-height: 600px; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 0.8rem; writing-mode: horizontal-tb; padding: 1rem 0.5rem; text-align: center; }
.ad-left { padding: 1.5rem 0.75rem 0 1rem; }
.ad-right { padding: 1.5rem 1rem 0 0.75rem; }
main { flex: 1; min-width: 0; max-width: 1100px; }

@media (max-width: 1200px) {
  .ad-sidebar { display: none; }
}

/* Fixed top / bottom ad bars */
.ad-top {
  position: fixed;
  top: 60px;
  left: 0; right: 0;
  height: 90px;
  z-index: 90;
  margin: 0;
  border-radius: 0;
  border-left: none; border-right: none;
  display: flex; align-items: center; justify-content: center;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}
.ad-bottom {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  height: 90px;
  z-index: 90;
  margin: 0;
  border-radius: 0;
  border-left: none; border-right: none;
  display: flex; align-items: center; justify-content: center;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
}
/* push content so it's not hidden behind fixed bars */
main { padding-top: 100px; padding-bottom: 140px; }
