:root {
  --primary: #e5322d;
  --primary-dark: #c92823;
  --bg: #f5f5f0;
  --card: #ffffff;
  --text: #333333;
  --muted: #666666;
  --border: #e8e8e8;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.logo-mark { width: 32px; height: 32px; display: inline-flex; flex-shrink: 0; }
.logo-mark svg { display: block; width: 32px; height: 32px; }
.logo-text { display: flex; align-items: baseline; gap: 8px; line-height: 1; }
.logo-brand { font-size: 20px; color: #1e293b; }
.logo-product { font-size: 14px; font-weight: 600; color: #64748b; }
.header-nav { flex: 1; display: flex; align-items: center; gap: 18px; flex-wrap: nowrap; min-width: 0; }
.header-nav-link,
.header-nav-cat { color: var(--muted); font-size: 14px; transition: color .15s; white-space: nowrap; background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; }
.header-nav-link:hover,
.header-nav-cat:hover,
.header-nav-link.active,
.header-nav-cat.active { color: var(--primary); }
.header-nav-link.active,
.header-nav-cat.active { font-weight: 600; }
.header-nav-cat::after {
  content: "";
  display: inline-block;
  margin-left: 5px;
  border: 4px solid transparent;
  border-top-color: currentColor;
  border-bottom: 0;
  vertical-align: 2px;
}
.header-nav-group { position: relative; }
.header-nav-group::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
}
.header-nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 148px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
  z-index: 30;
}
.header-nav-group.is-open .header-nav-menu,
.header-nav-group:hover .header-nav-menu { display: block; }
.header-nav-menu .header-nav-link { display: block; padding: 8px 10px; border-radius: 6px; }
.header-nav-menu .header-nav-link:hover,
.header-nav-menu .header-nav-link.active { background: #f3f6fb; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lang-switch { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-size: 13px; }
.lang-btn { color: var(--muted); }
.lang-btn.is-active { color: var(--text); font-weight: 600; }
.lang-sep { color: #ccc; }
.header-link, .user-info { font-size: 14px; color: var(--muted); }
.ml10 { margin-left: 10px; }

main { min-height: calc(100vh - 120px); }

.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer p { margin: 0 0 8px; }
.site-footer p:last-child { margin-bottom: 0; }
.site-icp a { color: var(--muted); }
.site-icp a:hover { color: var(--text); }

.home-wrap { max-width: 1200px; margin: 0 auto; padding: 32px 24px 48px; }
.home-greeting { text-align: center; font-size: 28px; font-weight: 600; margin: 8px 0 24px; }
.category-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.category-tab { border: none; background: #fff; color: var(--muted); padding: 8px 18px; border-radius: 999px; cursor: pointer; font-size: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.category-tab.active { background: #333; color: #fff; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tool-card { position: relative; background: var(--card); border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; cursor: pointer; min-height: 150px; }
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.tool-card-ai { box-shadow: 0 2px 12px rgba(124, 58, 237, 0.12); }
.tool-ai-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}
.tool-card-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 14px; color: #fff; }
.tool-card h3 { margin: 0 0 8px; font-size: 18px; }
.tool-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.icon-white-bg { background: #4caf50; }
.icon-enhance { background: #7c3aed; }
.icon-ocr { background: #0f766e; }
.icon-compress { background: #ff9800; }
.icon-resize { background: #2196f3; }
.icon-convert { background: #9c27b0; }
.icon-detect { background: #00bcd4; }
.icon-watermark { background: #607d8b; }
.icon-crop { background: #795548; }
.icon-border { background: #3f51b5; }
.icon-slice { background: #0f766e; }
.icon-merge { background: #7c3aed; }
.icon-rotate { background: #ea580c; }
.icon-pad { background: #0284c7; }
.icon-width { background: #059669; }

.slice-options {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.slice-options-title {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 10px;
}
.slice-mode-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.slice-mode-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.slice-mode-item:has(input:checked),
.slice-mode-item.is-active {
  border-color: var(--primary);
  background: #eff6ff;
}
.slice-mode-item input {
  margin-top: 3px;
}
.slice-mode-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--text);
}
.slice-mode-text small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.slice-field {
  margin-bottom: 8px;
}
.slice-field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.slice-field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.slice-field input[type="range"] {
  padding: 0;
  border: none;
  height: 28px;
  background: transparent;
}
.rotate-angle-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.rotate-angle-presets button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: inherit;
}
.rotate-angle-presets button.is-active {
  border-color: var(--primary);
  color: var(--primary);
}
.wm-preview {
  margin-bottom: 12px;
  text-align: center;
}
.wm-preview canvas {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  background: #eef2f7;
  border-radius: 8px;
  display: block;
}
.wm-preview canvas.is-zoomable {
  cursor: zoom-in;
}
.slice-options .wm-preview canvas {
  max-height: 420px;
}
.wm-preview-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.wm-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wm-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #cbd5e1;
  padding: 0;
  cursor: pointer;
}
.wm-color-swatch.is-active {
  box-shadow: 0 0 0 2px var(--primary);
}
.border-color-clear {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background:
    linear-gradient(45deg, #d9dde3 25%, transparent 25%),
    linear-gradient(-45deg, #d9dde3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d9dde3 75%),
    linear-gradient(-45deg, transparent 75%, #d9dde3 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
  background-color: #fff;
  font-size: 12px;
  cursor: pointer;
  color: inherit;
}
.border-color-clear.is-active {
  box-shadow: 0 0 0 2px var(--primary);
}
.wm-color-row input[type="color"] {
  width: 36px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}
.wm-stroke-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 2px;
  font-size: 14px;
  cursor: pointer;
}
.wm-stroke-option input {
  width: auto;
  margin: 0;
}
.wm-field-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.slice-field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}
.slice-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tool-page { min-height: calc(100vh - 64px); }
.tool-upload-step { max-width: 760px; margin: 0 auto; padding: 56px 24px; text-align: center; }
.tool-upload-step h1 { font-size: 34px; margin: 0 0 12px; }
.tool-upload-step .desc { color: var(--muted); font-size: 16px; margin-bottom: 36px; }
.upload-zone { border: 2px dashed #ddd; border-radius: var(--radius); padding: 48px 24px; background: #fff; }
.upload-zone.dragover { border-color: var(--primary); background: #fff7f7; }
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 14px 28px; font-size: 16px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.upload-hint { margin-top: 16px; color: var(--muted); font-size: 14px; }
.hidden-input { display: none; }

.tool-preview-step { display: grid; grid-template-columns: 1fr 320px; gap: 0; min-height: calc(100vh - 64px); }
.preview-main { padding: 24px; position: relative; }
.preview-grid { display: flex; flex-wrap: wrap; gap: 18px; }
.preview-card { width: 180px; background: #fff; border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; cursor: grab; position: relative; }
.preview-card.dragging { opacity: .5; }
.preview-card img { width: 100%; height: 220px; object-fit: cover; display: block; background: #fafafa; cursor: zoom-in; }
.preview-card .name { padding: 10px; font-size: 13px; text-align: center; word-break: break-all; }
.preview-card .name-text { color: var(--text); }
.preview-card .meta { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.preview-card .remove { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; }
.preview-sidebar { background: #fff; border-left: 1px solid var(--border); padding: 24px; display: flex; flex-direction: column; }
.preview-sidebar h2 { margin: 0 0 16px; font-size: 22px; }
.info-box { background: #eef6ff; border-radius: 8px; padding: 12px 14px; font-size: 13px; color: #456; line-height: 1.6; margin-bottom: 24px; }
.preview-sidebar .btn-primary { width: 100%; margin-top: auto; padding: 16px; font-size: 17px; }
.floating-add { position: fixed; right: 360px; bottom: 40px; width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #fff; border: none; font-size: 28px; cursor: pointer; box-shadow: 0 4px 16px rgba(229,50,45,.35); }
.floating-add .badge { position: absolute; top: -4px; right: -4px; background: #333; color: #fff; font-size: 12px; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }

.tool-processing-step { max-width: 720px; margin: 0 auto; padding: 80px 24px; text-align: center; }
.processing-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 32px; }
.processing-logo svg { width: 40px; height: 40px; }
.processing-logo-text { font-size: 24px; font-weight: 700; color: #1e293b; }
.processing-percent { font-size: 42px; font-weight: 700; line-height: 1; color: var(--primary); margin: 0 0 16px; }
.processing-text { font-size: 18px; font-weight: 600; margin: 18px 0 0; }
.spinner { width: 64px; height: 64px; border: 5px solid #eee; border-top-color: var(--primary); border-radius: 50%; margin: 28px auto 0; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar { width: min(420px, 100%); height: 10px; background: #eee; border-radius: 999px; margin: 0 auto; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary); transition: width .3s; }

.tool-done-step { max-width: 960px; margin: 0 auto; padding: 56px 24px; text-align: center; }
.tool-done-step h1 { font-size: 28px; margin-bottom: 28px; }
.download-actions { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.result-preview-section { text-align: left; margin: 0 auto 32px; max-width: 820px; }
.result-preview-section h3 { margin: 0 0 14px; font-size: 16px; color: var(--text); text-align: center; }
.result-preview-grid { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.result-preview-item { width: 150px; background: #fff; border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; cursor: zoom-in; transition: transform .15s; }
.result-preview-item:hover { transform: translateY(-2px); }
.result-preview-item img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  display: block;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
    linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.result-preview-name { padding: 8px; font-size: 12px; text-align: center; word-break: break-all; color: var(--muted); }
.result-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.78); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.result-lightbox-inner { position: relative; max-width: min(92vw, 960px); max-height: 92vh; }
.result-lightbox.is-original .result-lightbox-inner { max-width: min(94vw, 1400px); }
.result-lightbox-inner img { max-width: 100%; max-height: calc(92vh - 48px); display: block; margin: 0 auto; background: #fff; border-radius: 8px; }
.result-lightbox.is-original .result-lightbox-inner img { max-height: calc(92vh - 72px); object-fit: contain; }
.result-lightbox-inner p { color: #fff; text-align: center; margin: 12px 0 0; font-size: 13px; word-break: break-all; }
.result-lightbox-close { position: absolute; top: -36px; right: 0; border: none; background: transparent; color: #fff; font-size: 32px; cursor: pointer; line-height: 1; }
.result-lightbox-status { color: rgba(255,255,255,.85); text-align: center; margin: 8px 0 0; font-size: 13px; min-height: 18px; }
.btn-back { width: 44px; height: 44px; border-radius: 50%; border: none; background: #555; color: #fff; cursor: pointer; font-size: 18px; }
.btn-download { padding: 16px 32px; font-size: 17px; }
.continue-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px; text-align: left; max-width: 560px; margin: 0 auto; }
.continue-card h3 { margin: 0 0 16px; font-size: 16px; }
.continue-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.continue-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.continue-item:hover { background: #f7f7f7; }
.continue-item .mini-icon { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; }

.auth-tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.auth-tab { flex: 1; border: none; background: #f5f5f5; color: var(--muted); padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.auth-tab.active { background: var(--primary); color: #fff; }

.auth-wrap, .user-wrap { max-width: 720px; margin: 0 auto; padding: 40px 20px; }
.user-wrap { max-width: 1200px; }
.auth-card, .user-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.auth-card h1, .user-card h1 { margin-top: 0; }
.auth-tip { color: var(--muted); margin-bottom: 16px; }
.auth-error { color: #c92823; margin-bottom: 12px; }
.auth-card label, .user-card label { display: block; margin: 12px 0 6px; font-size: 14px; }
.auth-card input, .user-card input[type="number"], .user-card input[type="password"], .admin-login input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 8px; }
.admin-grid h2 { margin: 0 0 4px; font-size: 18px; }
.admin-field-hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.admin-ok { color: #15803d; margin: 0 0 12px; }
.admin-actions { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.admin-login { max-width: 360px; }
.admin-wrap { max-width: 1180px; }
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 18px; }
.admin-tab { padding: 8px 14px; border-radius: 8px; background: #f5f5f5; color: var(--muted); font-size: 14px; }
.admin-tab.is-active { background: var(--primary); color: #fff; }
.admin-tab-logout { margin-left: auto; }
.admin-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.admin-toolbar input[type="search"],
.admin-toolbar select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff; }
.admin-toolbar input[type="search"] { flex: 1; min-width: 180px; }
.admin-table-wrap { overflow-x: auto; }
.admin-inline-form { display: flex; gap: 6px; align-items: center; margin: 0 0 6px; }
.user-card .admin-days { width: 72px; padding: 6px 8px; }
.admin-actions-cell { min-width: 240px; }
.admin-pager { display: flex; gap: 12px; align-items: center; margin: 0; }
.auth-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.auth-inline input { flex: 1; min-width: 120px; }
.auth-captcha-q { font-size: 16px; font-weight: 600; color: var(--text); white-space: nowrap; padding: 0 4px; }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 14px; cursor: pointer; }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-secondary:disabled { opacity: .55; cursor: not-allowed; }
.btn-inline { white-space: nowrap; flex-shrink: 0; }
.auth-hint { min-height: 18px; margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.auth-error-inline { color: #c92823; }
.auth-btn { width: 100%; margin-top: 18px; }
.auth-foot { margin-top: 16px; font-size: 14px; color: var(--muted); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 24px; }
.data-table th, .data-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.data-table th { background: #fafafa; }

.plan-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.plan-badge-pro { background: #fef3c7; color: #b45309; }
.plan-badge-basic { background: #e2e8f0; color: #475569; }

.user-section { margin-bottom: 28px; overflow-x: auto; }
.user-section h2 { margin: 0 0 12px; font-size: 16px; }
.user-section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.user-section-head h2 { margin: 0; }
.user-plan-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0 0 12px;
}
.user-plan-main {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.user-plan-line { margin: 0; color: var(--muted); font-size: 14px; }
.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.usage-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.usage-item-warn {
  border-color: #fecaca;
  background: #fff7f7;
}
.usage-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.usage-value { font-size: 22px; font-weight: 700; color: #1e293b; line-height: 1.2; }
.usage-unit { font-size: 13px; font-weight: 500; color: var(--muted); }
.usage-sub { margin-top: 4px; font-size: 12px; color: var(--muted); }
.usage-warn-tip {
  margin: 10px 0 0; font-size: 13px; color: #b91c1c;
}
.usage-warn-tip a { color: var(--primary); font-weight: 600; }
.status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.5;
}
.status-paid, .status-done { background: #dcfce7; color: #166534; }
.credit-plus { color: #166534; font-weight: 600; }
.credit-minus { color: #b91c1c; font-weight: 600; }
.status-pending { background: #fef3c7; color: #b45309; }
.status-processing { background: #dbeafe; color: #1d4ed8; }
.status-error { background: #fee2e2; color: #b91c1c; }
.status-idle { background: #f1f5f9; color: #64748b; }
.table-sub { margin-top: 4px; font-size: 12px; color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.order-table td { white-space: nowrap; }
.order-table .mono { word-break: normal; }

/* Pricing page */
.pricing-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 56px;
}
.pricing-header {
  text-align: center;
  margin-bottom: 36px;
}
.pricing-header h1 {
  margin: 0 0 10px;
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
}
.pricing-header p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}
.pricing-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.pricing-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}
.pricing-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  line-height: 1.2;
}
.pricing-card .pricing-price {
  color: #1e293b;
}
.pricing-card-pro {
  border-color: #fcd34d;
  box-shadow: 0 8px 24px rgba(229, 50, 45, 0.08);
}
.pricing-card-pro .pricing-price {
  color: var(--primary);
}
.pricing-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.pricing-features {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  flex: 1;
}
.pricing-features li {
  position: relative;
  padding: 8px 0 8px 22px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  border-bottom: 1px solid #f3f4f6;
}
.pricing-features li:last-child {
  border-bottom: none;
}
.pricing-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #16a34a;
  font-weight: 700;
}
.pricing-card .btn-secondary,
.pricing-card .btn-primary {
  align-self: flex-start;
  min-width: 120px;
  text-align: center;
}
.pricing-note,
.pricing-active {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  padding-top: 4px;
}
.pricing-active {
  color: #15803d;
  font-weight: 500;
}
.pricing-table-wrap {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  border: 1px solid var(--border);
}
.pricing-table-wrap h2 {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}
.pricing-table {
  margin-bottom: 0;
  border-radius: 8px;
  overflow: hidden;
}
.pricing-table th,
.pricing-table td {
  padding: 14px 16px;
  vertical-align: middle;
}
.pricing-table th {
  white-space: nowrap;
}
.pricing-table td:first-child {
  font-weight: 500;
}
.pricing-table .pricing-price-cell {
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}
.pricing-table td:last-child {
  width: 1%;
  white-space: nowrap;
  text-align: center;
}
.pricing-table td:last-child .btn-sm {
  white-space: nowrap;
}
.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 6px;
  display: inline-block;
  white-space: nowrap;
}
.user-profile-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 16px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.user-profile-name {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}
.user-profile-contact {
  font-size: 14px;
  color: var(--muted);
}

.pichub-toast-stack {
  position: fixed;
  top: calc(72px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: min(92vw, 420px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.pichub-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: auto;
}

.pichub-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.pichub-toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
}

.pichub-toast-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  margin-top: 1px;
}

.pichub-toast-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}

.pichub-toast-close {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 4px;
}

.pichub-toast-close:hover {
  color: var(--text);
}

.pichub-toast-error {
  border-color: #fecaca;
  background: #fff5f5;
}

.pichub-toast-error .pichub-toast-icon {
  background: #fee2e2;
  color: #dc2626;
}

.pichub-toast-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.pichub-toast-success .pichub-toast-icon {
  background: #dcfce7;
  color: #16a34a;
}

.pichub-toast-info,
.pichub-toast-warning {
  border-color: #dbeafe;
  background: #eff6ff;
}

.pichub-toast-info .pichub-toast-icon,
.pichub-toast-warning .pichub-toast-icon {
  background: #dbeafe;
  color: #2563eb;
}

.pichub-toast-warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.pichub-toast-warning .pichub-toast-icon {
  background: #fef3c7;
  color: #d97706;
}

@media (max-width: 900px) {
  .tool-preview-step { grid-template-columns: 1fr; }
  .preview-sidebar { border-left: none; border-top: 1px solid var(--border); }
  .floating-add { right: 24px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .pricing-header h1 { font-size: 26px; }
  .pricing-table td:last-child { width: auto; }
  .pichub-toast-stack {
    top: calc(64px + env(safe-area-inset-top, 0px));
    width: min(94vw, 420px);
  }
}
