/**
 * NEXT INNOVATION - Enterprise Cloud Suite & SSO Hub
 * Design System & Component Stylesheet (portal.css)
 * Material Design 3 / Google Stitch Specification Compliant
 * 
 * Rules Enforced:
 * - Rule 68: Zero Tailwind CDN! 100% Pure Custom CSS Variables & Tokens
 * - Rule 57: Font 'Lato', 'M PLUS 1', sans-serif, tabular-nums for numeric/IDs
 * - Rule 58: Floating Grid Card Selector Modal for ALL selections (Zero <select>)
 * - Rule 21: Custom M3 Modals & Drawers (Escape & backdrop close, zero native dialogs)
 * - Rule 50: Optical vertical alignment, shrink-0 whitespace-nowrap, scroll lock
 */

/* ==========================================================================
 * 1. CSS Custom Properties / Design Tokens
 * ========================================================================== */
:root {
  /* Stitch Monochrome High-Contrast Architecture (Pure White & Jet Black) */
  --primary: #09090B;                /* Jet Black */
  --primary-rgb: 9, 9, 11;
  --primary-light: #18181B;
  --primary-container: #F4F4F5;
  --on-primary: #FFFFFF;
  --on-primary-container: #09090B;

  --secondary: #09090B;              /* Monochrome Strict */
  --secondary-light: #F4F4F5;
  --secondary-dark: #000000;

  --tertiary: #18181B;
  --tertiary-container: #E4E4E7;

  /* Surfaces & Backgrounds - Pure White & Crisp Light Gray */
  --bg-body: #FAFAFA;
  --surface: #FFFFFF;
  --surface-subtle: #F4F4F5;
  --surface-hover: #F1F1F3;
  --surface-card: #FFFFFF;
  --surface-overlay: rgba(9, 9, 11, 0.7);

  /* Borders & Outlines - Sharp Zinc */
  --border-subtle: #E4E4E7;
  --border-medium: #D4D4D8;
  --border-strong: #09090B;

  /* Typography Colors - High Contrast Zinc */
  --text-primary: #09090B;
  --text-secondary: #52525B;
  --text-muted: #71717A;
  --text-disabled: #A1A1AA;
  --text-inverse: #FFFFFF;

  /* Status Colors - Minimalist Accent */
  --status-success: #10B981;
  --status-success-bg: #ECFDF5;
  --status-success-border: #A7F3D0;
  --status-success-text: #065F46;

  --status-warning: #F59E0B;
  --status-warning-bg: #FFFBEB;
  --status-warning-border: #FDE68A;
  --status-warning-text: #92400E;

  --status-danger: #EF4444;
  --status-danger-bg: #FEF2F2;
  --status-danger-border: #FECACA;
  --status-danger-text: #991B1B;

  --status-info: #09090B;
  --status-info-bg: #F4F4F5;
  --status-info-border: #E4E4E7;
  --status-info-text: #09090B;

  /* Elevations & Shadows - Sharp Linear Style */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  /* Radii - Sharp 8px ~ 14px */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Layout */
  --header-height: 64px;
  --max-content-width: 1360px;
}

/* Dark Mode Tokens */
[data-theme="dark"] {
  --primary: #9AA0A6;
  --primary-light: #2A324B;
  --primary-container: #23284A;
  --on-primary: #0F1420;
  --on-primary-container: #DDE2FF;

  --secondary: #818CF8;
  --secondary-light: #1E2342;
  --secondary-dark: #6366F1;

  --bg-body: #0B0F19;
  --surface: #131927;
  --surface-subtle: #1A2234;
  --surface-hover: #1F2A40;
  --surface-card: #131927;
  --surface-overlay: rgba(3, 7, 18, 0.8);

  --border-subtle: #243048;
  --border-medium: #334466;
  --border-strong: #4B638F;

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #7E90AA;
  --text-disabled: #4B5A72;
  --text-inverse: #0B0F19;

  --status-success: #34D399;
  --status-success-bg: rgba(16, 185, 129, 0.15);
  --status-success-border: rgba(16, 185, 129, 0.35);
  --status-success-text: #6EE7B7;

  --status-warning: #FBBF24;
  --status-warning-bg: rgba(245, 158, 11, 0.15);
  --status-warning-border: rgba(245, 158, 11, 0.35);
  --status-warning-text: #FCD34D;

  --status-danger: #F87171;
  --status-danger-bg: rgba(239, 68, 68, 0.15);
  --status-danger-border: rgba(239, 68, 68, 0.35);
  --status-danger-text: #FCA5A5;

  --status-info: #38BDF8;
  --status-info-bg: rgba(2, 136, 209, 0.15);
  --status-info-border: rgba(2, 136, 209, 0.35);
  --status-info-text: #7DD3FC;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 30px rgba(0, 0, 0, 0.7);
}

/* ==========================================================================
 * 2. Reset & Base Typography (Rule 57)
 * ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Lato', 'M PLUS 1', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-body);
  color: var(--text-primary);
}

body.modal-open {
  overflow: hidden !important;
}

/* Tabular Numbers for all IDs, metrics, currency */
.tabular-nums, .num, .metric-value, .currency, .price-display, .badge-count {
  font-family: 'Lato', sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Links & Buttons Reset */
a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease-in-out;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Material Symbols optical alignment (Rule 50) */
.material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  user-select: none;
}

/* ==========================================================================
 * 3. Header & Navigation (Rule 50)
 * ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  transition: background-color 0.2s, border-color 0.2s;
}

.header-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: #09090B;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background-color: var(--secondary-light);
  color: var(--secondary);
  border: 1px solid var(--border-subtle);
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Nav Pill Switcher (3 Main Views) */
.header-nav {
  display: flex;
  align-items: center;
  background-color: var(--surface-subtle);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  gap: 2px;
}

.nav-pill {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.nav-pill:hover {
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .nav-pill:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.nav-pill.active {
  background-color: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.nav-pill.admin-pill {
  color: #B45309;
}
[data-theme="dark"] .nav-pill.admin-pill {
  color: #FCD34D;
}
.nav-pill.admin-pill.active {
  color: #B45309;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Impersonation Sticky Warning Bar */
.impersonation-bar {
  background: linear-gradient(90deg, #B45309 0%, #D97706 100%);
  color: #FFFFFF;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.25);
  animation: slideDown 0.2s ease-out;
}

.impersonation-btn-reset {
  background: #FFFFFF;
  color: #B45309;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  box-shadow: var(--shadow-xs);
}
.impersonation-btn-reset:hover {
  background: #FEF3C7;
}

/* Quick SSO Demo Bar (Subheader) */
.sso-demo-bar {
  background-color: var(--surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow-x: auto;
}

.sso-demo-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.sso-demo-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.sso-demo-chip {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background-color: var(--surface);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.sso-demo-chip:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

.sso-demo-chip.active {
  background-color: var(--secondary);
  color: #FFFFFF;
  border-color: var(--secondary);
}

/* ==========================================================================
 * 4. Main App Layout & Grid Containers
 * ========================================================================== */
.app-container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 28px 20px 80px;
  width: 100%;
  flex: 1;
}

.view-section {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.view-section.active {
  display: block;
}

/* Hero Section (Catalog) */
.hero-banner {
  background: linear-gradient(135deg, #181B39 0%, #1F2758 60%, #2A367D 100%);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  color: #FFFFFF;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
}

.hero-title {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero-desc {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  max-width: 720px;
  margin-bottom: 24px;
}

.hero-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 20px;
}

.hero-kpi-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-kpi-val {
  font-size: 18px;
  font-weight: 900;
  color: #FFFFFF;
}

.hero-kpi-lbl {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

/* Featured Apps Section (FS & PleasureMapPrice) */
.section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(540px, 1fr));
  gap: 28px;
  margin-bottom: 48px;
}

@media (max-width: 640px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
}

.featured-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.featured-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

/* Real Screen Browser Frame in Card */
.browser-frame {
  background-color: var(--surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  position: relative;
}

.browser-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
}

.browser-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.browser-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background-color: #EF4444; }
.dot-yellow { background-color: #F59E0B; }
.dot-green { background-color: #10B981; }

.browser-url-pill {
  flex: 1;
  max-width: 380px;
  margin: 0 12px;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px 12px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9.5;
  background-color: #0F172A;
  overflow: hidden;
  cursor: pointer;
}

.browser-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.3s ease;
}

.browser-image-wrap:hover img {
  transform: scale(1.02);
}

.browser-zoom-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  color: #FFFFFF;
  font-weight: 700;
  gap: 6px;
  font-size: 13px;
}

.browser-image-wrap:hover .browser-zoom-overlay {
  opacity: 1;
}

/* Card Content Area */
.featured-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-category-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background-color: var(--surface-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.card-pricing-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.card-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex: 1;
}

.card-features-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.card-feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--surface-subtle);
  color: var(--text-muted);
}

.card-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* Primary, Secondary, Ghost Buttons */
.btn-primary {
  background-color: var(--primary);
  color: var(--on-primary);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background-color: var(--primary-light);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background-color: var(--surface-subtle);
  border-color: var(--border-medium);
}

.btn-accent {
  background: linear-gradient(135deg, #4F46E5 0%, #3730A3 100%);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.btn-accent:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ==========================================================================
 * 5. High Density Data Tables (Admin & Tenant)
 * ========================================================================== */
.table-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  margin-bottom: 24px;
}

.table-toolbar {
  padding: 16px 20px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 320px;
  width: 100%;
}

.search-input-wrap .material-symbols-outlined {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--surface-subtle);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: all 0.15s;
}
.search-input:focus {
  border-color: var(--secondary);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background-color: var(--surface-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  user-select: none;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 0.1s ease;
}

.data-table tbody tr:hover {
  background-color: var(--surface-hover);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-success {
  background-color: var(--status-success-bg);
  border: 1px solid var(--status-success-border);
  color: var(--status-success-text);
}

.badge-warning {
  background-color: var(--status-warning-bg);
  border: 1px solid var(--status-warning-border);
  color: var(--status-warning-text);
}

.badge-danger {
  background-color: var(--status-danger-bg);
  border: 1px solid var(--status-danger-border);
  color: var(--status-danger-text);
}

.badge-info {
  background-color: var(--status-info-bg);
  border: 1px solid var(--status-info-border);
  color: var(--status-info-text);
}

.badge-neutral {
  background-color: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* Role Badges (Rule 40 English Only) */
.role-badge {
  font-family: 'Lato', sans-serif;
  font-weight: 800;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
}

.role-superadmin { background: #181B39; color: #FFFFFF; }
.role-oo { background: #4338CA; color: #FFFFFF; }
.role-om { background: #0284C7; color: #FFFFFF; }
.role-oc { background: #0D9488; color: #FFFFFF; }
.role-rgm { background: #059669; color: #FFFFFF; }
.role-1st { background: #D97706; color: #FFFFFF; }
.role-2nd { background: #EA580C; color: #FFFFFF; }
.role-crew { background: #64748B; color: #FFFFFF; }

/* 2-Tier Permission Toggle Switcher Pill */
.perm-pill-group {
  display: inline-flex;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 2px;
}

.perm-pill-btn {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.perm-pill-btn.active-on {
  background-color: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid var(--status-success-border);
  box-shadow: var(--shadow-xs);
}

.perm-pill-btn.active-admin {
  background-color: #181B39;
  color: #FFFFFF;
  box-shadow: var(--shadow-xs);
}

.perm-pill-btn.active-off {
  background-color: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid var(--status-danger-border);
  box-shadow: var(--shadow-xs);
}

/* ==========================================================================
 * 6. Rule 58: Floating Grid Card Selector Modal
 * ========================================================================== */
.grid-selector-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: var(--surface-overlay);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.15s ease-out;
}

.grid-selector-card {
  background-color: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: scaleUp 0.18s ease-out;
}

.grid-selector-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid-selector-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid-selector-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.grid-selector-item {
  background-color: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  transition: all 0.15s ease;
  text-align: left;
}

.grid-selector-item:hover {
  border-color: var(--secondary);
  background-color: var(--surface);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.grid-selector-item.selected {
  border-color: var(--secondary);
  background-color: var(--secondary-light);
  box-shadow: 0 0 0 2px var(--secondary);
}

[data-theme="dark"] .grid-selector-item.selected {
  background-color: rgba(79, 70, 229, 0.2);
}

.grid-selector-item-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}

.grid-selector-item-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
 * 7. Rule 21: Custom M3 Modals & Drawers
 * ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background-color: var(--surface-overlay);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease-out;
}

.modal-dialog {
  background-color: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: scaleUp 0.18s ease-out;
}

.modal-dialog.modal-lg {
  max-width: 900px;
}

.modal-dialog.modal-xl {
  max-width: 1200px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Right Slide-over Drawer (SuperAdmin Quick Edit) */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  background-color: var(--surface-overlay);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.15s ease-out;
}

.drawer-panel {
  width: 100%;
  max-width: 480px;
  height: 100%;
  background-color: var(--surface);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: slideLeft 0.22s ease-out;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  min-width: 280px;
  max-width: 420px;
  animation: toastIn 0.25s ease-out;
  border: 1px solid transparent;
}

.toast-success {
  background-color: var(--status-success-bg);
  border-color: var(--status-success-border);
  color: var(--status-success-text);
}

.toast-error {
  background-color: var(--status-danger-bg);
  border-color: var(--status-danger-border);
  color: var(--status-danger-text);
}

.toast-info {
  background-color: var(--status-info-bg);
  border-color: var(--status-info-border);
  color: var(--status-info-text);
}

/* ==========================================================================
 * 8. Screenshots Showcase & Lightbox UI (Rule: Real Screenshots)
 * ========================================================================== */
.showcase-container {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
}

.showcase-tabs-bar {
  display: flex;
  align-items: center;
  background-color: var(--surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 12px;
  gap: 6px;
  overflow-x: auto;
}

.showcase-tab {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.showcase-tab:hover {
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.04);
}

.showcase-tab.active {
  background-color: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.showcase-viewport {
  position: relative;
  background-color: #0F172A;
  aspect-ratio: 16 / 9.5;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.showcase-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.showcase-viewport:hover .showcase-img {
  transform: scale(1.015);
}

.showcase-caption {
  padding: 16px 20px;
  background-color: var(--surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.showcase-caption-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Fullscreen Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background-color: rgba(3, 7, 18, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  padding: 20px;
  animation: fadeIn 0.15s ease-out;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #FFFFFF;
  padding-bottom: 12px;
}

.lightbox-title {
  font-size: 16px;
  font-weight: 800;
}

.lightbox-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
 * 9. Pricing Simulator & Contract Form
 * ========================================================================== */
.pricing-sim-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-subtle) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-sm);
}

.pricing-sim-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: center;
}

@media (max-width: 860px) {
  .pricing-sim-grid {
    grid-template-columns: 1fr;
  }
}

.pricing-calc-box {
  background-color: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.pricing-total-amount {
  font-size: 36px;
  font-weight: 900;
  color: var(--primary);
  margin: 12px 0 4px;
}
[data-theme="dark"] .pricing-total-amount {
  color: #818CF8;
}

.pricing-slider-wrap {
  margin: 20px 0;
}

.pricing-slider {
  width: 100%;
  accent-color: var(--secondary);
  height: 6px;
  cursor: pointer;
}

.pricing-exclusion-notice {
  background-color: var(--status-success-bg);
  border: 1px solid var(--status-success-border);
  color: var(--status-success-text);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
}

/* Form Controls (Strict M3 styling, zero standard select) */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--surface);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: all 0.15s;
}

.form-input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.selector-trigger-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s;
}

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

/* ==========================================================================
 * 10. Animations & Utilities
 * ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

@keyframes slideLeft {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.shrink-0 { flex-shrink: 0; }
.whitespace-nowrap { white-space: nowrap; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.text-muted { color: var(--text-muted); }

/* ==========================================================================
 * 11. Additional Enterprise SaaS Components (KPI, Drawer, Invoice, Tabs)
 * ========================================================================== */

/* KPI Summary Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s, box-shadow 0.15s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}

.kpi-unit {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.kpi-subtext {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Tenant Header Banner */
.tenant-banner {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-subtle) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.tenant-banner-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.tenant-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #181B39 0%, #4F46E5 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(24, 27, 57, 0.2);
}

.tenant-company-name {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.tenant-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Tenant SSO App Launcher Cards Grid */
.launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.launcher-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.launcher-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
}

.launcher-card-header {
  padding: 16px 20px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.launcher-card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.launcher-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.launcher-card-footer {
  padding: 16px 20px;
  background-color: var(--surface-subtle);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Sub-nav Tabs inside SuperAdmin & Tenant Views */
.subnav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  overflow-x: auto;
}

.subnav-tab-item {
  padding: 12px 18px;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}

.subnav-tab-item:hover {
  color: var(--text-primary);
}

.subnav-tab-item.active {
  color: var(--secondary);
  border-bottom-color: var(--secondary);
}

/* Invoice Modal Sheet (適格請求書) */
.invoice-sheet {
  background-color: #FFFFFF;
  color: #0F172A;
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid var(--border-subtle);
}

.invoice-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  border-bottom: 2px solid #0F172A;
  padding-bottom: 20px;
}

.invoice-company-box {
  text-align: right;
  font-size: 12px;
  line-height: 1.6;
}

.invoice-total-highlight {
  background-color: #F8FAFC;
  border: 2px solid #0F172A;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  margin: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* User Profile Badge in Header */
.user-badge-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px 12px 4px 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.user-badge-wrap:hover {
  border-color: var(--border-medium);
  background-color: var(--surface);
}

.user-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  overflow: hidden;
}

.user-badge-info {
  display: flex;
  flex-direction: column;
}

.user-badge-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-badge-sub {
  font-size: 10px;
  color: var(--text-muted);
}

/* ==========================================================================
 * 12. Puresuke Inspired Monochrome Landing Page Architecture (Suke Pattern)
 * ========================================================================== */
.lp-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.lp-back-nav {
  margin-bottom: 24px;
}

.lp-hero {
  background: #09090B;
  color: #FFFFFF;
  padding: 56px 24px 64px;
  border-radius: 20px;
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.25);
}

.lp-hero::before {
  content: "";
  position: absolute;
  right: -100px;
  top: -100px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.lp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  font-weight: 800;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px;
  margin-bottom: 16px;
}

.lp-hero h1 {
  font-size: clamp(26px, 5.5vw, 44px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.28;
  margin-bottom: 14px;
}

.lp-hero h1 strong {
  color: #FFFFFF;
  text-decoration: underline;
  text-underline-offset: 6px;
}

.lp-hero p {
  max-width: 680px;
  margin: 14px auto 28px;
  color: #A1A1AA;
  font-size: 15px;
  line-height: 1.7;
}

.lp-hero .cta-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.lp-hero .btn-hero-primary {
  background: #FFFFFF;
  color: #09090B;
  border: 1px solid #FFFFFF;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.12s ease;
}
.lp-hero .btn-hero-primary:hover {
  background: #F4F4F5;
  transform: translateY(-1px);
}

.lp-hero .btn-hero-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.lp-hero .btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.lp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 24px;
}

.lp-chips span {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #E4E4E7;
}

.lp-sec {
  padding: 48px 0;
}

.lp-sec-title {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 900;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.lp-sec-lead {
  text-align: center;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 36px;
  font-size: 14px;
  line-height: 1.6;
}

/* 3 Demo Environments Cards (.cards / .dc) */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.dc {
  background: #FFFFFF;
  border: 1.5px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.12s ease;
  position: relative;
}

.dc:hover {
  border-color: #09090B;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.dc.rec {
  border-color: #09090B;
  border-width: 2px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.09);
}

.dc .badge-rec {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: #09090B;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.dc .tagline {
  font-weight: 800;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 16px 16px 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.shot {
  margin: 10px 14px 0;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  background: #F4F4F5;
  aspect-ratio: 16/10;
  cursor: pointer;
  position: relative;
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.2s ease;
}

.shot:hover img {
  transform: scale(1.03);
}

.shot .shot-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 11, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  gap: 4px;
}
.shot:hover .shot-overlay {
  opacity: 1;
}

.dc .body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.dc h3 {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.dc h3 small {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 6px;
}

.dc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
  flex: 1;
}

.dc li {
  padding: 4px 0 4px 20px;
  position: relative;
  color: var(--text-secondary);
}

.dc li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #09090B;
  font-weight: 900;
}

.dc .price-box {
  background: #F4F4F5;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.dc .price-box b {
  font-family: 'Lato', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: #09090B;
}

.dc .price-box em {
  font-style: normal;
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Worries Section (.worries / .wcard) */
.worries {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.wcard {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-xs);
}

.wcard .wicon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #F4F4F5;
  display: grid;
  place-items: center;
  color: #09090B;
  margin-bottom: 4px;
}

.wcard b {
  font-size: 15px;
  font-weight: 800;
  color: #09090B;
}

.wcard p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.wcard .fix {
  color: #09090B;
  font-weight: 800;
  font-size: 13px;
  border-top: 1px dashed var(--border-subtle);
  padding-top: 10px;
  margin-top: 6px;
}

/* Features Section (.feat / .feat.rev / .frame / .frame.ph / .pair) */
.feat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 56px;
}

@media (max-width: 860px) {
  .feat {
    grid-template-columns: 1fr;
  }
}

.feat.rev {
  direction: rtl;
}
.feat.rev > * {
  direction: ltr;
}

.feat .txt .no {
  display: inline-block;
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  background: #09090B;
  color: #FFFFFF;
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 12px;
  margin-bottom: 8px;
}

.feat .txt .opt {
  display: inline-block;
  background: #F4F4F5;
  color: #09090B;
  font-weight: 800;
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
  margin-left: 6px;
  border: 1px solid var(--border-subtle);
}

.feat .txt h3 {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 10px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.feat .txt p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
}

.feat .txt ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}

.feat .txt li {
  padding: 4px 0 4px 18px;
  position: relative;
  color: var(--text-secondary);
}

.feat .txt li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #09090B;
  font-weight: 900;
  font-size: 16px;
  line-height: 1;
}

.frame {
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.frame:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.frame::before {
  content: "";
  display: block;
  height: 24px;
  background: linear-gradient(90deg, #ff5f57 0 10px, transparent 10px) 12px 7px/10px 10px no-repeat,
              linear-gradient(90deg, #febc2e 0 10px, transparent 10px) 28px 7px/10px 10px no-repeat,
              linear-gradient(90deg, #28c840 0 10px, transparent 10px) 44px 7px/10px 10px no-repeat,
              #F4F4F5;
  border-bottom: 1px solid var(--border-subtle);
}

.frame img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.frame.ph {
  max-width: 260px;
  margin: 0 auto;
  border-radius: 28px;
  border: 7px solid #09090B;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.frame.ph::before {
  display: none;
}

.pair {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: flex-start;
}

.pair .frame.ph {
  max-width: 48%;
}

/* Simulator (.sim / .stp / .result-card / .big / .bd) */
.sim {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
  margin-bottom: 48px;
}

@media (max-width: 860px) {
  .sim {
    grid-template-columns: 1fr;
  }
}

.panel-sim {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
}

.row-sim {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border-subtle);
}

.row-sim:last-child {
  border-bottom: none;
}

.row-sim label.t {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.row-sim small {
  display: block;
  color: var(--text-muted);
  font-weight: 400;
  font-size: 12px;
  margin-top: 2px;
}

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

.stp button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #09090B;
  background: #FFFFFF;
  color: #09090B;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  line-height: 1;
  font-family: 'Lato', sans-serif;
  transition: all 0.12s ease;
}

.stp button:hover {
  background: #09090B;
  color: #FFFFFF;
}

.stp button:active {
  transform: scale(0.92);
}

.stp input {
  box-sizing: border-box;
  width: 72px;
  height: 44px;
  margin: 0;
  padding: 0 4px;
  border: 2px solid var(--border-subtle);
  border-radius: 10px;
  background: #FFFFFF;
  color: #09090B;
  text-align: center;
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
  outline: none;
}

.stp input:focus {
  border-color: #09090B;
}

.result-card {
  background: #09090B;
  color: #FFFFFF;
  border-radius: 16px;
  padding: 28px 24px;
  position: sticky;
  top: 80px;
  box-shadow: var(--shadow-lg);
}

.result-card .big {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: clamp(34px, 5.5vw, 46px);
  color: #FFFFFF;
  line-height: 1.1;
  margin: 12px 0 4px;
}

.result-card .big small {
  font-size: 14px;
  font-family: 'M PLUS 1', sans-serif;
  font-weight: 700;
  color: #A1A1AA;
  margin-left: 6px;
}

.result-card .bd {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.result-card .bd li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #D4D4D8;
}

.result-card .bd li span:last-child {
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  color: #FFFFFF;
}

.result-card .btn-sim-action {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  border-radius: 10px;
  background: #FFFFFF;
  color: #09090B;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.12s;
}
.result-card .btn-sim-action:hover {
  background: #F4F4F5;
  transform: translateY(-1px);
}

/* Tenant & Flow Section (.tenant / .pay / .faq) */
.flow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.flow-step-card {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flow-step-num {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: 24px;
  color: #09090B;
}

.flow-step-title {
  font-size: 16px;
  font-weight: 800;
  color: #09090B;
}

.flow-step-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
