/* Pic2Excel — standalone styles (no CDN dependency, works offline) */
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --border: #e3e8f0;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --green: #059669;
  --green-dark: #047857;
  --green-soft: #ecfdf5;
  --red: #dc2626;
  --amber: #b45309;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

.container { max-width: 980px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; }
.brand h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -.2px; }
.brand p { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 9px; padding: 9px 16px;
  font-size: 14px; font-weight: 600; transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: #c7d2e3; background: #fafbfe; }
.btn-ghost { background: transparent; color: var(--muted); padding: 6px 8px; }
.btn-ghost:hover { color: var(--text); }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; }
.text-btn {
  background: none; border: none; color: var(--muted); font-size: 13px;
  text-decoration: underline; padding: 4px;
}
.text-btn:hover { color: var(--text); }

/* Layout */
main { padding: 28px 0 40px; }
.page-head { text-align: center; margin-bottom: 24px; }
.page-head h2 { font-size: 27px; margin: 0 0 8px; letter-spacing: -.5px; }
.page-head p { color: var(--muted); margin: 0; }

.banner {
  border-radius: 10px; padding: 11px 16px; margin-bottom: 18px;
  font-size: 13px; border: 1px solid transparent;
}
.banner-info { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.banner-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.banner-success { background: var(--green-soft); border-color: #a7f3d0; color: #065f46; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); padding: 22px;
  margin-bottom: 18px;
}
.card-title { font-size: 13px; font-weight: 700; margin: 0 0 14px; color: #374151; }

/* Dropzone */
.dropzone {
  border: 2px dashed #cbd5e1; border-radius: 12px; background: #fbfcff;
  padding: 30px 20px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
  min-height: 168px; display: flex; align-items: center; justify-content: center;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .dz-icon { font-size: 38px; line-height: 1; margin-bottom: 10px; }
.dropzone .dz-main { font-weight: 600; font-size: 15px; }
.dropzone .dz-sub { color: var(--muted); font-size: 12px; margin-top: 6px; }
.dropzone img.preview {
  max-width: 100%; max-height: 150px; border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12); margin-bottom: 10px;
}
.file-meta { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.file-name { font-weight: 600; word-break: break-all; }

/* Options */
.options-grid {
  display: grid; grid-template-columns: 1fr 160px auto; gap: 14px; align-items: end;
  margin-top: 18px;
}
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.input, .select {
  width: 100%; border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 11px; font-size: 14px; background: #fff; color: var(--text);
  outline: none; font-family: inherit;
}
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.checkbox { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; padding-bottom: 9px; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary); }

/* Progress */
.progress-wrap { margin-top: 18px; }
.progress-track { height: 7px; background: #e8edf6; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--primary); border-radius: 99px; transition: width .3s; }
.progress-text { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* Result */
.result-card { background: var(--green-soft); border: 1px solid #a7f3d0; text-align: center; }
.result-card .ok-icon { font-size: 34px; }
.result-card h3 { margin: 6px 0 4px; font-size: 18px; }
.result-card p { color: #047857; margin: 0 0 16px; font-size: 13px; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.table-preview { margin-top: 18px; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.table-preview table { border-collapse: collapse; width: 100%; font-size: 13px; }
.table-preview th, .table-preview td {
  border: 1px solid var(--border); padding: 7px 10px; text-align: left; white-space: nowrap;
}
.table-preview th { background: #f1f5fd; font-weight: 600; }
.table-preview tr:nth-child(even) td { background: #fafbfe; }
.preview-note { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* Auth */
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #e5e7eb; }
.user-name { font-size: 13px; font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 8px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); }
.modal-panel {
  position: relative; z-index: 1; background: #fff; width: min(420px, calc(100vw - 32px));
  margin: 8vh auto 0; border-radius: 16px; padding: 26px;
  box-shadow: 0 24px 60px rgba(0,0,0,.22); max-height: 84vh; overflow-y: auto;
}
.modal-wide { width: min(480px, calc(100vw - 32px)); }
.modal-close {
  position: absolute; top: 14px; right: 14px; background: none; border: none;
  font-size: 22px; color: #9ca3af; line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal h2 { font-size: 20px; margin: 0 0 4px; text-align: center; }
.modal-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
  flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
  padding: 10px 4px; font-size: 14px; font-weight: 600; color: var(--muted);
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.form-row { margin-bottom: 13px; }
.form-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.divider { display: flex; align-items: center; gap: 10px; color: #9ca3af; font-size: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 9px; }
.form-msg { font-size: 13px; margin-top: 12px; text-align: center; min-height: 18px; }
.form-msg.error { color: var(--red); }
.form-msg.ok { color: var(--green); }

/* Account modal */
.profile { text-align: center; margin-bottom: 20px; }
.profile .avatar { width: 66px; height: 66px; margin-bottom: 10px; }
.profile h3 { margin: 0; font-size: 18px; }
.profile p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.membership-card {
  background: linear-gradient(135deg, #eff6ff, #e0ecff);
  border: 1px solid #c7dbff; border-radius: 12px; padding: 16px; margin-bottom: 18px;
}
.membership-card .eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); font-weight: 700; }
.membership-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.membership-tier { font-size: 22px; font-weight: 800; margin: 4px 0 0; }
.membership-expiry { font-size: 12px; color: var(--muted); }
.tx-list { max-height: 190px; overflow-y: auto; }
.tx-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.tx-item:last-child { border-bottom: none; }
.tx-empty { color: var(--muted); text-align: center; padding: 18px 0; font-size: 13px; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; box-shadow: var(--shadow); position: relative;
}
.plan.featured { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.18); }
.plan-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 12px; border-radius: 99px; white-space: nowrap;
}
.plan h3 { margin: 0 0 8px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.plan .price { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.plan .period { font-size: 13px; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 16px 0; font-size: 13px; color: #4b5563; }
.plan li { padding: 4px 0; }
.plan li::before { content: "✓ "; color: var(--green); font-weight: 700; }
.paypal-slot { min-height: 0; margin-top: 8px; }

/* Footer */
.site-footer { text-align: center; color: #9ca3af; font-size: 12px; padding: 20px 0 34px; }
.site-footer a { color: var(--muted); }

/* Simple content pages */
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { font-size: 22px; margin-top: 28px; }
.prose p, .prose li { color: #4b5563; line-height: 1.75; }

@media (max-width: 720px) {
  .options-grid { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .brand p { display: none; }
  .header-inner { flex-wrap: wrap; }
  .page-head h2 { font-size: 22px; }
}
