/* mwoya — Shared Design System & mw.js Plugin Theme Sync */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --ink: #0f172a;
  --ink-secondary: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-ink: #ffffff;
  --teal: #0d9488;
  --teal-soft: #f0fdfa;
  --coral: #e11d48;
  --coral-soft: #fff1f2;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --success: #059669;
  --success-soft: #ecfdf5;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.12);
  --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Sync micro-web official plugins (mw.ui, mw.form, mw.grid) */
  --mw-ui-bg: var(--surface);
  --mw-ui-surface: var(--surface-subtle);
  --mw-ui-ink: var(--ink);
  --mw-ui-muted: var(--muted);
  --mw-ui-border: var(--border);
  --mw-ui-accent: var(--accent);
  --mw-ui-toast-bg: #0f172a;
  --mw-ui-toast-ink: #f8fafc;
  --mw-ui-radius: 10px;
  --mw-ui-shadow: var(--shadow-lg);
  --mw-ui-z: 1000;
}

html[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-subtle: #1e293b;
  --ink: #f8fafc;
  --ink-secondary: #cbd5e1;
  --muted: #94a3b8;
  --border: #243044;
  --border-strong: #334155;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-soft: rgba(99, 102, 241, 0.16);
  --accent-ink: #ffffff;
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, 0.12);
  --coral: #fb7185;
  --coral-soft: rgba(251, 113, 133, 0.12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 52px rgba(0, 0, 0, 0.55);

  --mw-ui-bg: var(--surface);
  --mw-ui-surface: var(--surface-subtle);
  --mw-ui-ink: var(--ink);
  --mw-ui-muted: var(--muted);
  --mw-ui-border: var(--border);
  --mw-ui-accent: var(--accent);
  --mw-ui-toast-bg: #1e293b;
  --mw-ui-toast-ink: #f8fafc;
}

/* Multilingual visibility for static SEO sections */
html[lang="ko"] [data-lang="en"] { display: none !important; }
html[lang="en"] [data-lang="ko"] { display: none !important; }

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Container */
.mw-container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 64px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
}

.brand-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s, color 0.15s;
}

.btn:hover {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-ink);
}

.btn-soft {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

.btn-soft:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-danger {
  background: var(--coral-soft);
  border-color: transparent;
  color: var(--coral);
}

.btn-danger:hover {
  border-color: var(--coral);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.82rem;
}

.btn-icon {
  padding: 7px 10px;
  min-width: 36px;
  height: 36px;
}

.kbd-hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}

/* Main & Cards */
.site-main {
  padding: 28px 0 64px;
  min-height: calc(100vh - 220px);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.card-subtle {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

/* Hero */
.hero {
  background: radial-gradient(circle at top right, var(--accent-soft), transparent 55%),
              var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 3.2vw, 2.35rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0 0 22px;
  color: var(--ink-secondary);
  font-size: 1.02rem;
  max-width: 680px;
}

.hero-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.search-input-wrap {
  position: relative;
  flex: 1 1 280px;
  max-width: 460px;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.96rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* Filter Pills */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 22px 0 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* Tool Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.tool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.tool-icon.cat-life { background: var(--accent-soft); color: var(--accent); }
.tool-icon.cat-fun { background: var(--coral-soft); color: var(--coral); }
.tool-icon.cat-game { background: var(--amber-soft); color: var(--amber); }
.tool-icon.cat-file { background: rgba(14, 165, 233, 0.14); color: #0284c7; }
.tool-icon.cat-finance { background: var(--success-soft); color: var(--success); }
.tool-icon.cat-dev { background: var(--teal-soft); color: var(--teal); }

.tool-card-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tool-card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
}

.tool-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-subtle);
  padding: 3px 8px;
  border-radius: 6px;
}

.fav-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.05rem;
  transition: background 0.15s, color 0.15s;
}

.fav-btn:hover { background: var(--surface-subtle); color: var(--amber); }
.fav-btn.is-fav { color: var(--amber); }

/* Tool Page Header */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }

.tool-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.tool-header h1 {
  margin: 0 0 6px;
  font-size: clamp(1.45rem, 2.8vw, 1.95rem);
  letter-spacing: -0.02em;
}

.tool-header p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.96rem;
}

.tool-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Form Controls & Utility Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

.field-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}

.input, .select, .textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.55;
}

.mono { font-family: var(--font-mono); }

/* Stat / KPI Boxes */
.stat-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  word-break: break-word;
}

.stat-box.accent {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

.stat-box.accent .stat-value { color: var(--accent); }

/* AdSense Slot (CLS-safe with clear separation from interactive controls) */
.ad-slot-wrap {
  margin: 32px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ad-slot-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ad-slot-wrap[data-ad-hidden="true"] {
  display: none;
}

.ad-slot-box {
  width: 100%;
  min-height: 90px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--surface-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 12px;
  text-align: center;
}

/* SEO Guide & FAQ Section */
.guide-section {
  margin-top: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.guide-section h2 {
  margin: 0 0 14px;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.guide-section h3 {
  margin: 22px 0 8px;
  font-size: 1.02rem;
}

.guide-section p, .guide-section li {
  color: var(--ink-secondary);
  font-size: 0.94rem;
  line-height: 1.75;
}

.guide-section ul, .guide-section ol {
  padding-left: 20px;
  margin: 8px 0 14px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  background: var(--bg);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}

.faq-item p {
  margin: 10px 0 2px;
}

/* Section Heading */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

/* Lotto Balls */
.lotto-balls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.lotto-ball {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.22), 0 3px 8px rgba(0, 0, 0, 0.12);
}

.ball-1 { background: #eab308; color: #1f2937; }
.ball-2 { background: #3b82f6; }
.ball-3 { background: #ef4444; }
.ball-4 { background: #64748b; }
.ball-5 { background: #22c55e; }

/* Color Swatch */
.swatch-preview {
  height: 112px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 12px 16px;
  font-weight: 700;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 32px 0;
  margin-top: 40px;
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Legal / Info prose page */
.prose-card {
  max-width: 820px;
  margin: 0 auto;
}

.prose-card h1 { margin-top: 0; font-size: 1.75rem; }
.prose-card h2 { margin-top: 26px; font-size: 1.15rem; }
.prose-card p, .prose-card li { color: var(--ink-secondary); line-height: 1.8; }

/* Keep long mw.ui dropdown menus scrollable */
[role="menu"] {
  max-height: 420px;
  overflow-y: auto;
}

/* File Upload Dropzone */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.dropzone-title {
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.dropzone-sub {
  font-size: 0.84rem;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 780px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding: 24px 20px; }
  .brand-sub, .header-nav { display: none; }
  .site-header-inner { height: 58px; }
  .card, .guide-section { padding: 18px; }
}
