/* ============================================
   FONT OPTIMIZATION — Add to TOP of style.css
   ============================================ */

/* 
 * System font fallback — renders INSTANTLY while Inter loads async.
 * Inter was designed to match these system fonts, so the swap is barely noticeable.
 */
:root {
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Prevent invisible text during font load (reduces CLS) */
body {
    font-family: var(--font-family);
    font-display: swap;
}

/* FOUT control — hide icons until font loads */
.material-icons-round {
    font-family: 'Material Icons Round';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'liga';
    
    /* Prevent layout shift while icon font loads */
    width: 1em;
    height: 1em;
    overflow: hidden;
}

/* Ensure replaced material-symbols-rounded still works if any missed */
.material-symbols-rounded {
    font-family: 'Material Icons Round' !important;
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'liga';
    width: 1em;
    height: 1em;
    overflow: hidden;
}
/* ============================================
   1. CSS VARIABLES & THEME
   ============================================ */
:root {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #fbfbfd;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #6e6e73;
    --accent-blue: #007aff;
    --accent-green: #30d158;
    --accent-orange: #ff9500;
    --accent-red: #ff3b30;
    --accent-yellow: #ffd60a;
    --accent-purple: #af52de;
    --border-light: #d2d2d7;
    --border-medium: #c6c6c8;
    --shadow-light: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-medium: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-heavy: 0 8px 32px rgba(0,0,0,0.12);
    --blur-bg: rgba(255,255,255,0.85);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    --ruler-bg: rgba(255,255,255,0.92);
    --ruler-tick-color: #1d1d1f;
    --header-height: 56px;
    --ruler-size: 50px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
}

/* Dark Theme */
body[data-theme="dark"] {
    --bg-primary: #0a0a0b;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --text-primary: #f5f5f7;
    --text-secondary: #8e8e93;
    --text-tertiary: #636366;
    --border-light: #38383a;
    --border-medium: #48484a;
    --blur-bg: rgba(20,20,22,0.88);
    --ruler-bg: rgba(28,28,30,0.95);
    --ruler-tick-color: #f5f5f7;
    --shadow-light: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-medium: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-heavy: 0 8px 32px rgba(0,0,0,0.4);
}

/* ============================================
   2. RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    padding-top: calc(var(--ruler-size) + var(--header-height) + 40px);
    padding-left: var(--ruler-size);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
}

/* Accessibility */
.skip-nav {
    position: absolute;
    top: -100px;
    left: 16px;
    padding: 10px 20px;
    background: var(--accent-blue);
    color: white;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    text-decoration: none;
    z-index: 9999;
    transition: top var(--transition-fast);
}
.skip-nav:focus {
    top: 16px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   3. RULERS
   ============================================ */
.ruler {
    position: fixed;
    background: var(--ruler-bg);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    box-shadow: var(--shadow-medium);
    z-index: 200;
    display: none;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.ruler.horizontal {
    top: 0;
    left: 0;
    width: 100%;
    height: var(--ruler-size);
    overflow: visible;
}

.ruler.vertical {
    top: 0;
    left: 0;
    width: var(--ruler-size);
    height: 100%;
    overflow: visible;
}

/* Comparison Rulers */
.ruler-compare {
    opacity: 0.85;
    z-index: 110 !important;
    pointer-events: auto !important;
}

.ruler-compare.horizontal {
    top: calc(var(--ruler-size) + var(--header-height)) !important;
    height: var(--ruler-size) !important;
}

.ruler-compare.vertical {
    left: calc(var(--ruler-size) + 2px);
}

.ruler.visible {
    display: block;
    animation: rulerFadeIn 0.3s ease-out;
}

@keyframes rulerFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Ruler ticks */
.tick {
    position: absolute;
    background-color: var(--ruler-tick-color);
    pointer-events: none;
}

.label {
    position: absolute;
    font-size: 10px;
    font-weight: 600;
    color: var(--ruler-tick-color);
    user-select: none;
    pointer-events: none;
    letter-spacing: 0.02em;
}

/* Horizontal ticks */
.horizontal .tick.major  { width: 1px; height: 26px; bottom: 0; }
.horizontal .tick.medium { width: 1px; height: 16px; bottom: 0; }
.horizontal .tick.minor  { width: 1px; height: 8px;  bottom: 0; }
.horizontal .label       { bottom: 30px; transform: translateX(-50%); white-space: nowrap; }

/* Vertical ticks */
.vertical .tick.major  { height: 1px; width: 26px; right: 0; }
.vertical .tick.medium { height: 1px; width: 16px; right: 0; }
.vertical .tick.minor  { height: 1px; width: 8px;  right: 0; }
.vertical .label       { right: 30px; transform: translateY(-50%); white-space: nowrap; }

/* ============================================
   4. MEASUREMENT MARKERS
   ============================================ */
.measurement-marker {
    position: fixed;
    top: var(--ruler-size);
    height: calc(100vh - var(--ruler-size));
    width: 2px;
    z-index: 150;
    cursor: ew-resize;
    user-select: none;
    touch-action: none;
}

.marker-a { left: 100px; }
.marker-b { left: 300px; }

.marker-a .marker-line {
    background: var(--accent-green);
}

.marker-a .marker-label {
    background: var(--accent-green);
}

.marker-b .marker-line {
    background: var(--accent-red);
}

.marker-b .marker-label {
    background: var(--accent-red);
}

.marker-line {
    width: 2px;
    height: 100%;
    background: var(--accent-red);
    opacity: 0.8;
}

.marker-label {
    position: absolute;
    top: 8px;
    left: 6px;
    background: var(--accent-red);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.marker-distance {
    position: fixed;
    top: calc(var(--ruler-size) + 16px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-medium);
    z-index: 160;
    white-space: nowrap;
    pointer-events: none;
}

/* ============================================
   5. KEYBOARD SHORTCUTS PANEL
   ============================================ */
.shortcuts-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-heavy);
    z-index: 800;
    width: 90%;
    max-width: 480px;
    overflow: hidden;
    animation: modalIn 0.2s ease-out;
}

.shortcuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
}

.shortcuts-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    padding: 16px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    transition: background var(--transition-fast);
}

.shortcut-item:hover {
    background: var(--bg-tertiary);
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 3px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: 5px;
    font-family: monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    box-shadow: 0 2px 0 var(--border-medium);
    flex-shrink: 0;
}

/* ============================================
   6. HEADER / TOOLBAR
   ============================================ */
header {
    position: fixed;
    top: var(--ruler-size);
    left: var(--ruler-size);
    width: calc(100% - var(--ruler-size));
    height: auto;
    min-height: var(--header-height);
    background: var(--blur-bg);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border-bottom: 1px solid var(--border-light);
    z-index: 100;
    transition: left var(--transition-slow), width var(--transition-slow);
}

.header-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* Header Logo */
.header-logo {
    display: flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.02em;
    white-space: nowrap;
    transition: opacity var(--transition-fast);
}

.header-logo:hover { opacity: 0.75; }

.header-logo .material-icons-round {
    color: var(--accent-blue);
    font-size: 22px;
}

.logo-text { color: var(--text-primary); }

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.controls-divider {
    width: 1px;
    height: 22px;
    background: var(--border-light);
    margin: 0 4px;
    flex-shrink: 0;
}

/* Unit Switch */
.unit-switch {
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    padding: 0;
    gap: 0;
}

.unit-switch legend { display: none; }
.unit-switch input[type="radio"] { display: none; }

.unit-switch label {
    padding: 7px 14px;
    cursor: pointer;
    background: transparent;
    transition: all var(--transition-fast);
    user-select: none;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    line-height: 1;
}

.unit-switch label:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.unit-switch input[type="radio"]:checked + label {
    background: var(--accent-blue);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,122,255,0.3);
}

/* Calibrate Button */
.calibrate-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 7px 12px;
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.calibrate-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-blue);
}

.calibrate-btn .material-icons-round { font-size: 18px; }

/* Text Buttons */
.text-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.text-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.text-btn[aria-pressed="true"] {
    background: rgba(0,122,255,0.1);
    color: var(--accent-blue);
}

.text-btn .material-icons-round { font-size: 17px; }

/* Icon Button */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.icon-btn .material-icons-round { font-size: 20px; }

/* ============================================
   7. HEADER SECTION (Status + Quick Cal)
   ============================================ */
.header-section {
    max-width: 960px;
    margin: 32px auto 0;
    padding: 0 24px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.header-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--accent-blue), #5ac8fa);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,122,255,0.25);
}

.header-icon .material-symbols-rounded {
    font-size: 26px;
    color: white;
}

.header-text h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-bottom: 3px;
}

.header-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0;
}

/* Detection Status */
#detection-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-light);
    margin-bottom: 16px;
    transition: all var(--transition-normal);
}

#detection-status .material-symbols-rounded { font-size: 20px; }

#detection-status.success {
    color: var(--accent-green);
    background: rgba(48,209,88,0.08);
    border-color: rgba(48,209,88,0.2);
}

#detection-status.warning {
    color: var(--accent-orange);
    background: rgba(255,149,0,0.08);
    border-color: rgba(255,149,0,0.2);
}

#detection-status.error {
    color: var(--accent-red);
    background: rgba(255,59,48,0.08);
    border-color: rgba(255,59,48,0.2);
}

/* Zoom Warning */
.zoom-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: rgba(255,149,0,0.08);
    border: 1px solid rgba(255,149,0,0.25);
    border-radius: var(--border-radius-md);
    color: var(--accent-orange);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    animation: slideDown 0.3s ease-out;
}

.zoom-warning .material-symbols-rounded { font-size: 18px; flex-shrink: 0; }

/* Quick Calibration */
.quick-calibration {
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    margin-bottom: 16px;
    box-shadow: var(--shadow-light);
    animation: slideDown 0.3s ease-out;
}

.quick-calibration h2 {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.quick-calibration h2 .material-symbols-rounded {
    font-size: 18px;
    color: var(--accent-blue);
}

.quick-calibration p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.5;
}

.quick-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-input-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.quick-input-group input {
    width: 110px;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    background: var(--bg-tertiary);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.quick-input-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0,122,255,0.12);
}

.quick-input-group span {
    font-size: 13px;
    color: var(--text-secondary);
}

.quick-calibrate-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-calibrate-btn:hover:not(:disabled) {
    background: #0056d6;
    box-shadow: 0 4px 12px rgba(0,122,255,0.3);
}

.quick-calibrate-btn:disabled {
    background: var(--border-light);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

.quick-calibrate-btn .material-symbols-rounded { font-size: 16px; }

/* Measurement History Panel */
.history-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    margin-bottom: 16px;
    animation: slideDown 0.3s ease-out;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
}

.history-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

.history-header .material-icons-round {
    font-size: 18px;
    color: var(--accent-blue);
}

.text-btn-sm {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.text-btn-sm:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

.history-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.history-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.history-list li:last-child { border-bottom: none; }
.history-list li:hover { background: var(--bg-tertiary); }

.history-empty {
    color: var(--text-tertiary);
    font-style: italic;
    justify-content: center !important;
}

.history-value {
    font-weight: 700;
    color: var(--accent-blue);
    font-size: 14px;
}

.history-unit {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-left: 4px;
}

.history-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.history-delete {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    line-height: 1;
    transition: color var(--transition-fast);
    font-size: 16px;
}

.history-delete:hover { color: var(--accent-red); }

/* ============================================
   8. ADSENSE AD CONTAINERS
   ============================================ */
.ad-container {
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
}

.ad-container.ad-top {
    margin-top: 24px;
    margin-bottom: 32px;
}

.ad-container.ad-mid {
    margin: 48px auto;
}

.ad-container.ad-bottom {
    margin-top: 48px;
    margin-bottom: 24px;
}

.ad-container ins {
    display: block;
    width: 100%;
}

/* ============================================
   9. GUARANTEE STRIP
   ============================================ */
.guarantee-strip {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 24px;
    margin-bottom: 0;
}

.guarantee-badges {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.guarantee-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.guarantee-badge .material-icons-round {
    font-size: 28px;
    color: var(--accent-blue);
    flex-shrink: 0;
}

.guarantee-badge strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.guarantee-badge small {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ============================================
   10. MAIN CONTENT
   ============================================ */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 64px 24px 80px;
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-header .material-icons-round {
    color: var(--accent-blue);
    font-size: 30px;
    flex-shrink: 0;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
}

.section-intro {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 720px;
}

/* ============================================
   11. HERO SECTION
   ============================================ */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
    margin-bottom: 96px;
}

.hero-title {
    font-size: 52px;
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 24px;
}

.hero-highlight { color: var(--accent-blue); }

.hero-description {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 28px;
}

.hero-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 32px;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.hero-feature .material-icons-round {
    color: var(--accent-green);
    font-size: 18px;
    flex-shrink: 0;
}

/* CTA Buttons */
.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 14px rgba(0,122,255,0.3);
}

.btn-primary:hover {
    background: #0056d6;
    box-shadow: 0 6px 20px rgba(0,122,255,0.4);
    transform: translateY(-1px);
}

.btn-primary .material-icons-round { font-size: 18px; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-light);
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-medium);
}

.btn-secondary .material-icons-round { font-size: 18px; }

/* Hero Visual */
.hero-visual {
    background: linear-gradient(135deg, #e8f0fe, #dbeafe);
    border-radius: var(--border-radius-xl);
    aspect-ratio: 4/3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    gap: 24px;
}

body[data-theme="dark"] .hero-visual {
    background: linear-gradient(135deg, #0f1a2e, #0a1628);
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,122,255,0.08), transparent 60%);
    pointer-events: none;
}

.hero-icon {
    font-size: 96px !important;
    color: rgba(0,122,255,0.25);
    transition: transform 0.5s ease;
}

.hero-visual:hover .hero-icon {
    transform: scale(1.08) rotate(-5deg);
}

.hero-units-preview {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.unit-preview {
    padding: 6px 16px;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(0,122,255,0.15);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-secondary);
    backdrop-filter: blur(8px);
    transition: all var(--transition-fast);
}

body[data-theme="dark"] .unit-preview {
    background: rgba(28,28,30,0.7);
}

.unit-preview.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(0,122,255,0.3);
}

/* ============================================
   12. STEPS SECTION
   ============================================ */
.steps-section {
    margin-bottom: 96px;
}

.steps-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 40px;
    position: relative;
}

.steps-grid::before {
    content: '';
    position: absolute;
    top: 38px;
    left: 8%;
    right: 8%;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(0,122,255,0.15) 20%, rgba(0,122,255,0.3) 50%, rgba(0,122,255,0.15) 80%, transparent);
    border-radius: 2px;
    z-index: 0;
    pointer-events: none;
}

.step-card {
    position: relative;
    padding: 28px 20px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-xl);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
    z-index: 1;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.1);
}

body[data-theme="dark"] .step-card:hover {
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}

.step-watermark {
    position: absolute;
    right: -4px;
    bottom: -28px;
    font-size: 110px;
    font-weight: 900;
    font-style: italic;
    line-height: 1;
    color: rgba(0,0,0,0.04);
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

body[data-theme="dark"] .step-watermark {
    color: rgba(255,255,255,0.05);
}

.step-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-blue), #3b82f6);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 6px 16px rgba(0,122,255,0.25);
    position: relative;
    z-index: 1;
}

.step-icon .material-icons-round {
    color: white;
    font-size: 24px;
}

.step-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.step-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Pro Tip */
.pro-tip-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    background: rgba(255,243,199,0.5);
    border: 1px solid rgba(251,191,36,0.3);
    border-radius: var(--border-radius-lg);
    position: relative;
    max-width: 860px;
}

body[data-theme="dark"] .pro-tip-box {
    background: rgba(120,53,15,0.12);
    border-color: rgba(251,191,36,0.2);
}

.pro-tip-icon {
    width: 44px;
    height: 44px;
    background: rgba(251,191,36,0.18);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.pro-tip-icon .material-icons-round {
    color: #d97706;
    font-size: 22px;
}

body[data-theme="dark"] .pro-tip-icon .material-icons-round {
    color: #fbbf24;
}

.pro-tip-content { flex: 1; }

.pro-tip-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #b45309;
    margin-bottom: 6px;
}

body[data-theme="dark"] .pro-tip-label { color: #fcd34d; }

.pro-tip-content p {
    font-size: 14px;
    color: #78350f;
    line-height: 1.65;
    margin: 0;
}

body[data-theme="dark"] .pro-tip-content p { color: #fef3c7; }

.pro-tip-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: transparent;
    border: none;
    color: #d97706;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
    line-height: 1;
    padding: 4px;
}

.pro-tip-close:hover { opacity: 1; }

/* ============================================
   13. FEATURES SHOWCASE SECTION
   ============================================ */
.features-showcase {
    margin-bottom: 96px;
}

.features-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.feature-showcase-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-xl);
    padding: 32px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-showcase-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.1);
    border-color: var(--accent-blue);
}

body[data-theme="dark"] .feature-showcase-card:hover {
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}

.feature-showcase-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-blue), #5ac8fa);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 6px 18px rgba(0,122,255,0.3);
}

.feature-showcase-icon .material-icons-round {
    color: white;
    font-size: 28px;
}

.feature-showcase-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.feature-showcase-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.feature-try-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.feature-try-btn:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(0,122,255,0.3);
}

.feature-try-btn .material-icons-round {
    font-size: 16px;
}

/* ============================================
   14. CALIBRATION METHODS (existing)
   ============================================ */
.how-to-section { margin-bottom: 96px; }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-xl);
    padding: 32px;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    position: relative;
}

.feature-card:hover {
    box-shadow: 0 16px 40px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

body[data-theme="dark"] .feature-card:hover {
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}

.card-number {
    font-size: 42px;
    font-weight: 900;
    color: var(--border-light);
    margin-bottom: 16px;
    line-height: 1;
    transition: color var(--transition-normal);
}

.feature-card:hover .card-number { color: var(--accent-blue); }

.card-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .material-icons-round {
    color: var(--accent-blue);
    font-size: 22px;
}

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 18px;
}

.card-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.card-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.card-list .material-icons-round {
    color: var(--accent-blue);
    font-size: 8px;
    margin-top: 5px;
    flex-shrink: 0;
}

.common-sizes { margin-top: 16px; }

.size-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    display: block;
    margin-bottom: 10px;
}

.size-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.size-tag {
    padding: 4px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.card-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.card-action-btn:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 14px rgba(0,122,255,0.3);
}

.card-action-btn .material-icons-round { font-size: 18px; }

/* ============================================
   15. RELATED TOOLS SECTION
   ============================================ */
.related-tools-section {
    margin-bottom: 96px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.tool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
    border-color: var(--accent-blue);
}

body[data-theme="dark"] .tool-card:hover {
    box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}

.tool-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(0,122,255,0.1), rgba(0,122,255,0.05));
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.tool-card:hover .tool-icon {
    background: var(--accent-blue);
}

.tool-icon .material-icons-round {
    font-size: 24px;
    color: var(--accent-blue);
    transition: color var(--transition-fast);
}

.tool-card:hover .tool-icon .material-icons-round {
    color: white;
}

.tool-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.tool-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.tool-link-arrow {
    font-size: 20px;
    color: var(--accent-blue);
    transition: transform var(--transition-fast);
}

.tool-card:hover .tool-link-arrow {
    transform: translateX(4px);
}

/* ============================================
   16. BLOG SECTION
   ============================================ */
.blog-section {
    margin-bottom: 96px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    margin-bottom: 32px;
}

.blog-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

body[data-theme="dark"] .blog-card:hover {
    box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}

.blog-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-image img {
    transform: scale(1.05);
}

.blog-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-category {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0,122,255,0.1);
    color: var(--accent-blue);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    width: fit-content;
}

.blog-content h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}

.blog-content h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.blog-content h3 a:hover {
    color: var(--accent-blue);
}

.blog-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.blog-read-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.blog-read-time .material-icons-round {
    font-size: 14px;
}

.blog-cta {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

/* ============================================
   17. REVIEWS SECTION
   ============================================ */
.reviews-section {
    margin-bottom: 96px;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.review-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    transition: all 0.3s ease;
}

.review-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

body[data-theme="dark"] .review-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.review-rating {
    margin-bottom: 12px;
}

.stars {
    color: var(--accent-yellow);
    font-size: 16px;
    letter-spacing: 2px;
}

.review-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
    font-style: italic;
}

.review-author {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.review-author span:first-child {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.review-role {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ============================================
   18. INFO SECTION (Devices & Tips)
   ============================================ */
.info-section { margin-bottom: 96px; }

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
}

.devices-section .section-header { margin-bottom: 12px; }

.devices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.device-group h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 5px;
}

.device-group p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.tips-section {
    background: linear-gradient(135deg, rgba(0,122,255,0.04), rgba(0,122,255,0.02));
    border: 1px solid rgba(0,122,255,0.1);
    border-radius: var(--border-radius-xl);
    padding: 32px;
}

body[data-theme="dark"] .tips-section {
    background: rgba(28,28,30,0.5);
    border-color: var(--border-light);
}

.tips-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tips-title .material-icons-round {
    color: var(--accent-blue);
    font-size: 24px;
}

.tips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    margin: 0;
}

.tips-list li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
}

.tip-emoji {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.tips-list strong { color: var(--text-primary); }

/* ============================================
   19. USE CASES SECTION
   ============================================ */
.usecases-section { margin-bottom: 96px; }

.usecases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.usecase-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    padding: 28px 24px;
    transition: all 0.25s ease;
}

.usecase-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
    border-color: var(--accent-blue);
}

body[data-theme="dark"] .usecase-card:hover {
    box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}

.usecase-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(0,122,255,0.1), rgba(0,122,255,0.05));
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: all var(--transition-fast);
}

.usecase-card:hover .usecase-icon {
    background: var(--accent-blue);
}

.usecase-icon .material-icons-round {
    font-size: 24px;
    color: var(--accent-blue);
    transition: color var(--transition-fast);
}

.usecase-card:hover .usecase-icon .material-icons-round {
    color: white;
}

.usecase-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
}

.usecase-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
}

/* ============================================
   20. FAQ SECTION
   ============================================ */
.faq-section-wrapper { margin-bottom: 80px; }

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 860px;
}

.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: box-shadow var(--transition-fast);
}

.faq-item:hover { box-shadow: var(--shadow-medium); }

.faq-item details summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    background: var(--bg-secondary);
    transition: background var(--transition-fast);
    color: var(--text-primary);
    user-select: none;
}

.faq-item details summary:hover {
    background: var(--bg-tertiary);
}

.faq-item details summary::-webkit-details-marker { display: none; }

.faq-item details summary::after {
    content: '+';
    font-size: 22px;
    font-weight: 300;
    color: var(--text-tertiary);
    transition: transform var(--transition-normal);
    flex-shrink: 0;
    margin-left: 16px;
}

.faq-item details[open] summary::after {
    transform: rotate(45deg);
    color: var(--accent-blue);
}

.faq-answer {
    padding: 0 22px 20px;
    border-top: 1px solid var(--border-light);
}

.faq-answer p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.75;
    margin: 16px 0 0;
}

.faq-answer strong { color: var(--text-primary); }

/* ============================================
   21. FOOTER
   ============================================ */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: 48px 24px;
    position: relative;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.footer-top {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 32px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.02em;
    transition: opacity var(--transition-fast);
}

.footer-brand:hover { opacity: 0.7; }

.footer-logo-icon {
    color: var(--accent-blue);
    font-size: 22px;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-nav-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.footer-link:hover { color: var(--accent-blue); }

.footer-bottom {
    text-align: center;
    padding-top: 32px;
    border-top: 1px solid var(--border-light);
}

.footer-bottom p {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0 0 4px;
}

.footer-tagline {
    font-size: 11px;
    color: var(--text-tertiary);
    opacity: 0.7;
}

.theme-toggle-floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent-blue);
    border: 1px solid var(--accent-blue);
    box-shadow: 0 8px 32px rgba(0,122,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    z-index: 50;
    color: #ffffff;
}

.theme-toggle-floating:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(0,122,255,0.5);
    background: #0056d6;
    color: #ffffff;
}

.theme-toggle-floating .material-icons-round { font-size: 22px; }

/* Language Dropdown */
.language-dropdown {
    position: relative;
    margin-top: 24px;
    text-align: center;
}

.language-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.language-btn:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.language-btn .material-symbols-rounded {
    font-size: 18px;
}

.arrow-icon {
    transition: transform var(--transition-fast);
}

.language-btn:hover .arrow-icon {
    transform: rotate(180deg);
}

.language-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-heavy);
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(10px);
    transition: all var(--transition-fast);
}

.language-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    transition: background var(--transition-fast);
}

.language-option:hover {
    background: var(--bg-tertiary);
}

.flag {
    font-size: 16px;
    line-height: 1;
}

/* ============================================
   22. MODALS (existing + new)
   ============================================ */
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

dialog {
    width: 95%;
    max-width: 760px;
    max-height: 88vh;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-heavy);
    padding: 0;
    margin: auto;
    background: var(--bg-secondary);
    overflow: hidden;
    overflow-y: auto;
    color: var(--text-primary);
}

dialog[open] { animation: modalIn 0.2s ease-out; }

dialog::backdrop {
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.modal-header .material-icons-round,
.modal-header .material-symbols-rounded {
    color: var(--accent-blue);
    font-size: 22px;
}

.modal-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.close-btn:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

/* Modal Buttons */
.modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.modal-btn:hover {
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-light);
}

.modal-btn.primary {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.modal-btn.primary:hover {
    background: #0056d6;
    border-color: #0056d6;
    box-shadow: 0 4px 14px rgba(0,122,255,0.3);
}

.modal-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ============================================
   23. NEW MODALS - Specific Styles
   ============================================ */

/* Save & Share Modal */
.share-preview {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.share-preview canvas {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
}

.share-options {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.share-social p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.social-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: white;
}

.social-btn.whatsapp { background: #25d366; }
.social-btn.twitter { background: #1da1f2; }
.social-btn.facebook { background: #1877f2; }

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.social-btn svg {
    width: 16px;
    height: 16px;
}

/* Unit Converter Modal */
.converter-tool {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.converter-input-group label,
.converter-from label,
.converter-to label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.converter-input-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    background: var(--bg-tertiary);
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.converter-input-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0,122,255,0.12);
}

.converter-select-group {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: end;
}

.converter-select-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    background: var(--bg-tertiary);
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}

.converter-swap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.converter-result {
    padding: 20px;
    background: linear-gradient(135deg, rgba(0,122,255,0.08), rgba(0,122,255,0.04));
    border: 1px solid rgba(0,122,255,0.2);
    border-radius: var(--border-radius-md);
    text-align: center;
}

.result-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.result-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent-blue);
}

.converter-formula {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}

.formula-label {
    font-weight: 600;
    margin-right: 8px;
}

.conversion-table {
    margin-top: 8px;
}

.conversion-table h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}

.conversion-table table {
    width: 100%;
    border-collapse: collapse;
}

.conversion-table th,
.conversion-table td {
    padding: 8px 12px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}

.conversion-table th {
    background: var(--bg-tertiary);
    font-weight: 700;
    color: var(--text-primary);
}

.conversion-table td {
    color: var(--text-secondary);
}

/* Object Presets Modal */
.presets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.preset-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.preset-card:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,122,255,0.3);
}

.preset-card .material-icons-round {
    font-size: 32px;
    color: var(--accent-blue);
    transition: color var(--transition-fast);
}

.preset-card:hover .material-icons-round {
    color: white;
}

.preset-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.preset-card p {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0;
}

.preset-card:hover p {
    color: rgba(255,255,255,0.8);
}

/* Customize Modal */
.customize-section {
    margin-bottom: 24px;
}

.customize-section h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.color-picker-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.color-picker-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-picker-item label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.color-picker-item input[type="color"] {
    width: 100%;
    height: 48px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
}

.style-options {
    display: flex;
    gap: 12px;
}

.style-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.style-option input[type="radio"] {
    display: none;
}

.style-option:has(input:checked) {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.style-option span {
    font-size: 13px;
    font-weight: 600;
}

#opacity-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-blue);
    margin-left: 8px;
}

/* ============================================
   24. PRINT STYLES
   ============================================ */
@media print {
    body {
        padding: 0 !important;
        background: white !important;
    }

    header, footer, .header-section,
    .guarantee-strip, .theme-toggle-floating,
    .shortcuts-panel, .measurement-marker,
    .marker-distance, dialog,
    .hero-section, .steps-section,
    .features-showcase, .how-to-section,
    .related-tools-section, .blog-section,
    .info-section, .usecases-section,
    .reviews-section, .faq-section-wrapper,
    .ad-container {
        display: none !important;
    }

    #ruler-horizontal {
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 50px !important;
        background: white !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        border-bottom: 1px solid #000 !important;
    }

    #ruler-vertical { display: none !important; }

    .tick { background-color: #000 !important; }
    .label { color: #000 !important; }
}

/* ============================================
   25. FULLSCREEN MODE
   ============================================ */
:fullscreen body,
body:fullscreen {
    padding: 0 !important;
}

:fullscreen #ruler-horizontal,
:fullscreen #ruler-vertical {
    display: block !important;
}

:fullscreen header,
:fullscreen .header-section,
:fullscreen .guarantee-strip,
:fullscreen main,
:fullscreen footer,
:fullscreen .theme-toggle-floating {
    display: none !important;
}

/* ============================================
   POPUP MODE
   ============================================ */
body.popup-mode header,
body.popup-mode .header-section,
body.popup-mode .guarantee-strip,
body.popup-mode main,
body.popup-mode footer,
body.popup-mode .theme-toggle-floating,
body.popup-mode .shortcuts-panel,
body.popup-mode .measurement-marker,
body.popup-mode .marker-distance,
body.popup-mode .hero-section,
body.popup-mode .steps-section,
body.popup-mode .features-showcase,
body.popup-mode .how-to-section,
body.popup-mode .related-tools-section,
body.popup-mode .blog-section,
body.popup-mode .info-section,
body.popup-mode .usecases-section,
body.popup-mode .reviews-section,
body.popup-mode .faq-section-wrapper,
body.popup-mode .ad-container {
    display: none !important;
}

body.popup-mode #ruler-horizontal,
body.popup-mode #ruler-vertical,
body.popup-mode #ruler-horizontal-compare,
body.popup-mode #ruler-vertical-compare {
    display: block !important;
}

body.popup-mode {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body.popup-mode .popup-unit-display {
    display: block !important;
}

.popup-unit-display {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ============================================
   26. RESPONSIVE — TABLET (≤1024px)
   ============================================ */
@media (max-width: 1024px) {
    .hero-section {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-bottom: 72px;
    }

    .hero-title { font-size: 40px; }

    .hero-visual { aspect-ratio: 16/6; }

    .cards-grid,
    .features-grid-3col {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .info-grid { grid-template-columns: 1fr; gap: 48px; }

    .steps-grid { grid-template-columns: repeat(3, 1fr); }

    .usecases-grid,
    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
}

/* ============================================
   27. RESPONSIVE — MOBILE (≤768px)
   ============================================ */
@media (max-width: 768px) {
    :root {
        --header-height: auto;
        --ruler-size: 40px;
    }

    * {
        box-sizing: border-box;
    }

    html {
        overflow-x: hidden;
    }

    body {
        padding-top: calc(var(--ruler-size) + 200px);
        padding-left: 0;
        padding-right: 0;
        margin: 0;
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    body.vertical-ruler-active {
        padding-left: var(--ruler-size);
    }

    header {
        top: var(--ruler-size);
        left: 0;
        width: 100%;
        overflow-x: hidden;
    }

    body.vertical-ruler-active header {
        left: var(--ruler-size);
        width: calc(100% - var(--ruler-size));
    }

    .header-main {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 14px;
        gap: 10px;
        overflow-x: auto;
    }

    .controls-left {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .controls-right {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Show text in buttons on mobile */
    #print-btn span:last-child,
    #fullscreen-btn span:last-child,
    #orientation-btn span:last-child,
    #marker-btn span:last-child,
    #save-share-btn span:last-child,
    #converter-btn span:last-child,
    #presets-btn span:last-child,
    #compare-btn span:last-child,
    #customize-btn span:last-child {
        display: inline;
    }

    /* Make buttons larger on mobile */
    .text-btn {
        padding: 8px 12px;
        font-size: 12px;
        gap: 6px;
    }

    .text-btn .material-icons-round {
        font-size: 18px;
    }

    .icon-btn {
        width: 40px;
        height: 40px;
    }

    .icon-btn .material-icons-round {
        font-size: 20px;
    }

    .logo-text { display: none; }

    /* Hide keyboard shortcuts button on mobile */
    #shortcuts-btn {
        display: none !important;
    }

    /* Fix markers on mobile — wider touch area */
    .measurement-marker {
        width: 40px;
        margin-left: -19px;
    }

    .marker-line {
        width: 2px;
        margin: 0 auto;
    }

    .marker-label {
        left: 50%;
        transform: translateX(-50%);
    }

    .marker-distance {
        font-size: 11px;
        padding: 4px 10px;
    }

    .marker-a { left: 100px !important; }
    .marker-b { left: 300px !important; }

    .header-section {
        padding: 0 16px;
        margin-top: 24px;
        overflow-x: hidden;
    }

    .quick-calibration {
        padding: 16px;
        margin-bottom: 16px;
        overflow-x: hidden;
    }

    .quick-calibration h2 {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .quick-calibration p {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-text h1 { font-size: 20px; }

    .main-content {
        padding: 40px 16px 60px;
        overflow-x: hidden;
        width: 100%;
    }

    .quick-input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .quick-input-group label {
        font-size: 12px;
        white-space: normal;
    }

    .quick-input-group input {
        width: 100%;
        padding: 10px 12px;
        font-size: 14px;
    }

    .quick-input-group span {
        font-size: 12px;
        text-align: center;
    }

    .quick-calibrate-btn {
        width: 100%;
        padding: 10px 16px;
        font-size: 13px;
    }

    /* Hero */
    .hero-title { font-size: 32px; }
    .hero-description { font-size: 15px; }
    .hero-visual { display: none; }
    .hero-section { margin-bottom: 56px; }

    /* Steps */
    .steps-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .steps-grid::before { display: none; }

    /* Cards */
    .cards-grid,
    .features-grid-3col,
    .tools-grid,
    .usecases-grid,
    .reviews-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Info */
    .devices-grid { grid-template-columns: 1fr; }
    .info-grid { gap: 36px; }

    /* Section headers */
    .section-header h2 { font-size: 22px; }

    /* Guarantee */
    .guarantee-badges {
        gap: 16px;
        justify-content: flex-start;
    }

    /* Footer */
    footer { padding: 32px 16px; }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* Shortcuts */
    .shortcuts-grid { grid-template-columns: 1fr; }

    /* Theme toggle */
    .theme-toggle-floating {
        bottom: 16px;
        right: 16px;
        width: 46px;
        height: 46px;
    }

    /* Modal */
    dialog { max-height: 92vh; }
    .modal-content { padding: 14px; gap: 12px; }

    .presets-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .color-picker-group {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   28. RESPONSIVE — SMALL MOBILE (≤480px)
   ============================================ */
@media (max-width: 480px) {
    html {
        overflow-x: hidden;
    }

    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
        padding-right: 0;
        margin: 0;
    }

    .main-content {
        overflow-x: hidden;
        width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }

    .header-section {
        overflow-x: hidden;
        width: 100%;
    }

    /* Ensure buttons show text on small mobile */
    .text-btn {
        padding: 8px 10px;
        font-size: 11px;
        gap: 5px;
        white-space: nowrap;
    }

    .text-btn .material-icons-round {
        font-size: 16px;
    }

    .icon-btn {
        width: 38px;
        height: 38px;
    }

    .icon-btn .material-icons-round {
        font-size: 18px;
    }

    .header-main {
        padding: 8px 10px;
        gap: 6px;
    }

    .controls-left,
    .controls-right {
        gap: 6px;
    }

    .steps-grid { grid-template-columns: 1fr; }

    /* Hide keyboard shortcuts button on mobile */
    #shortcuts-btn {
        display: none !important;
    }

    /* Fix markers on mobile — wider touch area */
    .measurement-marker {
        width: 40px;
        margin-left: -19px;
    }

    .marker-line {
        width: 2px;
        margin: 0 auto;
    }

    .marker-label {
        left: 50%;
        transform: translateX(-50%);
    }

    .marker-distance {
        font-size: 11px;
        padding: 4px 10px;
    }

    .marker-a { left: 100px !important; }
    .marker-b { left: 300px !important; }

    .hero-title { font-size: 28px; }

    .section-header h2 { font-size: 20px; }

    .guarantee-badges {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .quick-input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .quick-input-group label {
        font-size: 12px;
        white-space: normal;
    }

    .quick-input-group input {
        width: 100%;
        padding: 10px 12px;
        font-size: 14px;
    }

    .quick-input-group span {
        font-size: 12px;
        text-align: center;
    }

    .quick-calibrate-btn {
        width: 100%;
        padding: 10px 16px;
        font-size: 13px;
    }

    .shortcuts-panel { max-width: 95%; }

    .presets-grid {
        grid-template-columns: 1fr;
    }

    .converter-select-group {
        grid-template-columns: 1fr;
    }

    .converter-swap {
        transform: rotate(90deg);
    }
}

/* ============================================
   29. ANIMATIONS
   ============================================ */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

/* ============================================
   BUG FIXES - Add at bottom of style.css
   ============================================ */

/* ✅ FIX 1: Compare rulers below header */
.ruler-compare {
    z-index: 90 !important;
    pointer-events: none !important;
}

.ruler-compare.horizontal {
    top: 52px !important;
    border-top: 2px dashed rgba(0,122,255,0.5) !important;
    background: rgba(0,122,255,0.04) !important;
}

.ruler-compare.vertical {
    left: 52px !important;
    border-left: 2px dashed rgba(0,122,255,0.5) !important;
    background: rgba(0,122,255,0.04) !important;
}

/* ✅ FIX 2: Preset overlay safe bounds */
#preset-overlay {
    max-width: calc(100vw - 120px) !important;
    max-height: calc(100vh - 200px) !important;
    overflow: hidden;
    z-index: 140 !important;
    pointer-events: none !important;
}

/* ✅ FIX 3: Calibration modal always visible & clickable */
#calibration-modal {
    z-index: 1000 !important;
}

#calibration-modal::backdrop {
    background: rgba(0,0,0,0.5) !important;
    backdrop-filter: blur(6px) !important;
    z-index: 999 !important;
}

/* ✅ FIX 4: Share canvas responsive */
#share-canvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* ✅ FIX 5: Dialog proper stacking */
dialog {
    z-index: 1000 !important;
}

dialog::backdrop {
    z-index: 999 !important;
}

/* ✅ FIX 6: Print - force ticks visible */
@media print {
    .tick {
        background-color: #000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .label {
        color: #000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    #ruler-horizontal {
        display: block !important;
        height: 60px !important;
        background: white !important;
        border-bottom: 1px solid #000 !important;
        position: relative !important;
        overflow: visible !important;
        backdrop-filter: none !important;
    }
}

/* Compare mode indicator */
#compare-btn[aria-pressed="true"] {
    background: rgba(0,122,255,0.1) !important;
    color: var(--accent-blue) !important;
}

/* Preset overlay label */
.preset-label {
    font-family: var(--font-family);
}

.preset-dim {
    font-family: var(--font-family);
}