: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;
    --border-light: #d2d2d7;
    --border-medium: #c6c6c8;
    --shadow-light: 0 1px 2px rgba(0, 0, 0, 0.04);
    --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.8);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    --ruler-bg: rgba(255, 255, 255, 0.9);
    --ruler-tick-color: var(--text-primary);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #000000;
        --bg-secondary: #1c1c1e;
        --bg-tertiary: #2c2c2e;
        --text-primary: #ffffff;
        --text-secondary: #8e8e93;
        --text-tertiary: #98989d;
        --border-light: #38383a;
        --border-medium: #48484a;
        --blur-bg: rgba(28, 28, 30, 0.8);
        --ruler-bg: rgba(28, 28, 30, 0.9);
    }
}

/* Dark Theme Toggle - explicit override */
body[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --text-tertiary: #98989d;
    --border-light: #38383a;
    --border-medium: #48484a;
    --blur-bg: rgba(28, 28, 30, 0.8);
    --ruler-bg: rgba(28, 28, 30, 0.9);
    --ruler-tick-color: #ffffff;
}

body[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #fbfbfd;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #6e6e73;
    --border-light: #d2d2d7;
    --border-medium: #c6c6c8;
    --blur-bg: rgba(255, 255, 255, 0.8);
    --ruler-bg: rgba(255, 255, 255, 0.9);
    --ruler-tick-color: #1d1d1f;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    padding-top: 50px;
    padding-left: 50px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: padding 0.3s ease;
}

body.quick-calibration-active {
    padding-top: 50px;
}

.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: 100;
    display: none;
    border: 1px solid var(--border-light);
    overflow: hidden;
    /* Prevent ticks from overflowing ruler bounds */
}

.ruler.horizontal {
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
}

.ruler.vertical {
    top: 0;
    left: 0;
    width: 50px;
    height: 100%;
}

.ruler.visible {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Style for the body of the popup window */
.popup-body {
    padding-top: 50px;
    padding-left: 50px;
    background-color: transparent;
    /* Makes the rulers float over a clear background */
    overflow: hidden;
    /* Hide scrollbars in the popup itself */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tick {
    position: absolute;
    background-color: var(--ruler-tick-color);
}

.label {
    position: absolute;
    font-size: 11px;
    font-weight: 500;
    color: var(--ruler-tick-color);
    user-select: none;
}

.horizontal .tick.major {
    width: 1px;
    height: 25px;
    bottom: 0;
}

.horizontal .tick.medium {
    width: 1px;
    height: 15px;
    bottom: 0;
}

.horizontal .tick.minor {
    width: 1px;
    height: 8px;
    bottom: 0;
}

.horizontal .label {
    bottom: 28px;
    transform: translateX(-50%);
}

.vertical .tick.major {
    height: 1px;
    width: 25px;
    right: 0;
}

.vertical .tick.medium {
    height: 1px;
    width: 15px;
    right: 0;
}

.vertical .tick.minor {
    height: 1px;
    width: 8px;
    right: 0;
}

.vertical .label {
    right: 28px;
    transform: translateY(-50%);
}

/* Menu Button */
.menu-btn {
    position: fixed;
    top: 60px;
    left: 16px;
    width: 52px;
    height: 52px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: var(--shadow-medium);
    z-index: 99;
    color: var(--text-primary);
}

.menu-btn:hover {
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-heavy);
}

.menu-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.menu-btn .material-symbols-rounded {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.menu-btn.active .material-symbols-rounded {
    transform: rotate(90deg);
}

/* Sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100%;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    z-index: 950;
    display: flex;
    flex-direction: column;
    transition: left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: var(--shadow-heavy);
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 32px 24px 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-tertiary);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.sidebar-logo .material-symbols-rounded {
    font-size: 28px;
    color: var(--accent-blue);
}

.sidebar-nav {
    flex: 1;
    padding: 24px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sidebar-nav a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background: rgba(0, 122, 255, 0.1);
    color: var(--accent-blue);
    border-right: 3px solid var(--accent-blue);
}

.sidebar-nav a .material-symbols-rounded {
    font-size: 24px;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-tertiary);
}

.sidebar-footer p {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}

/* Header Section - positioned above main */
.header-section {
    position: relative;
    margin-top: 100px;
    margin-bottom: 20px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 32px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-blue), #5ac8fa);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-light);
}

.header-icon .material-symbols-rounded {
    font-size: 24px;
    color: white;
}

.header-text h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.header-text h2 {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-secondary);
}

/* Detection Status - same level as h1 */
#detection-status {
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-light);
    margin-bottom: 20px;
}

#detection-status.success {
    color: var(--accent-green);
    background: rgba(48, 209, 88, 0.1);
    border-color: rgba(48, 209, 88, 0.2);
}

#detection-status.warning {
    color: var(--accent-orange);
    background: rgba(255, 149, 0, 0.1);
    border-color: rgba(255, 149, 0, 0.2);
}

#detection-status.error {
    color: var(--accent-red);
    background: rgba(255, 59, 48, 0.1);
    border-color: rgba(255, 59, 48, 0.2);
}

/* Zoom Warning */
.zoom-warning {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.1), rgba(255, 149, 0, 0.05));
    border: 1px solid rgba(255, 149, 0, 0.2);
    border-radius: var(--border-radius-md);
    padding: 16px;
    margin-top: 16px;
    display: none;
    color: var(--accent-orange);
    font-size: 14px;
    font-weight: 500;
}

.zoom-warning.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

.zoom-warning .material-symbols-rounded {
    font-size: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

header {
    position: fixed;
    top: 50px;
    left: 50px;
    width: calc(100% - 50px);
    background: var(--blur-bg);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    z-index: 90;
    border-bottom: 1px solid var(--border-light);
}

.header-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.controls-left {
    display: flex;
    gap: 16px;
    align-items: center;
}

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

.controls-divider {
    width: 1px;
    height: 24px;
    background: var(--border-light);
}

/* Calibrate Button with Text */
.calibrate-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 6px 12px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.calibrate-btn:hover {
    color: var(--accent-blue);
}

.calibrate-btn .material-icons-round {
    font-size: 18px;
}

/* Icon-only Buttons */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.icon-btn .material-icons-round {
    font-size: 22px;
}

/* Text Buttons with Icon */
.text-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.text-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.text-btn .material-icons-round {
    font-size: 18px;
}

/* Keep old styles for modal buttons */
.inline-btn,
.modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    padding: 10px 16px;
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: var(--shadow-light);
    color: var(--text-primary);
    text-decoration: none;
}

.inline-btn:hover,
.modal-btn:hover {
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-medium);
}

.inline-btn:active,
.modal-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-light);
}

.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);
}

.unit-switch input[type="radio"] {
    display: none;
}

.unit-switch label {
    padding: 10px 20px;
    cursor: pointer;
    background: transparent;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    user-select: none;
    font-weight: 500;
    font-size: 15px;
    color: var(--text-secondary);
    position: relative;
}

.unit-switch label:hover {
    background: var(--bg-tertiary);
}

.unit-switch input[type="radio"]:checked+label {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.quick-calibration {
    margin: 20px 0;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    display: none;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-light);
}

.quick-calibration.show {
    display: flex;
    animation: slideIn 0.3s ease-out;
}

.quick-calibration h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-calibration p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.quick-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.quick-input-group input {
    width: 120px;
    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;
    color: var(--text-primary);
    text-align: center;
}

.quick-input-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.quick-input-group label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.quick-calibrate-btn {
    padding: 8px 16px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-calibrate-btn:hover {
    background: #0051d5;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.quick-calibrate-btn:disabled {
    background: var(--border-light);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Main Content */
.main-content {
    padding: 48px 16px;
    max-width: 1280px;
    margin: 0 auto;
}

/* Calibration Status Box */
.calibration-status-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

body[data-theme="dark"] .calibration-status-box {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.3);
}

.status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.status-icon .material-icons-round {
    color: #10b981;
    font-size: 24px;
}

.status-info {
    flex: 1;
    min-width: 200px;
}

.status-info h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.status-info p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.ppi-value {
    font-family: monospace;
    color: #10b981;
    font-weight: 600;
}

.status-action {
    background: transparent;
    border: none;
    color: #10b981;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.status-action:hover {
    text-decoration: underline;
}

/* Hero Section */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    margin-bottom: 96px;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 24px;
}

.hero-highlight {
    color: var(--accent-blue);
}

.hero-description {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.hero-feature .material-icons-round {
    color: #10b981;
    font-size: 20px;
}

.hero-visual {
    background: #e2e8f0;
    border-radius: 24px;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

body[data-theme="dark"] .hero-visual {
    background: #1e293b;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), transparent);
}

.hero-icon {
    font-size: 128px;
    color: #cbd5e1;
    transition: transform 0.5s ease;
}

body[data-theme="dark"] .hero-icon {
    color: #475569;
}

.hero-visual:hover .hero-icon {
    transform: scale(1.1);
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.section-header .material-icons-round {
    color: var(--accent-blue);
    font-size: 32px;
}

.section-header h2 {
    font-size: 30px;
    font-weight: 700;
    margin: 0;
}

/* How to Use Section */
.how-to-section {
    margin-bottom: 96px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

/* Feature Cards */
.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 32px;
    transition: box-shadow 0.3s ease;
}

body[data-theme="dark"] .feature-card {
    background: rgba(30, 41, 59, 0.5);
    border-color: #334155;
}

.feature-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.card-number {
    font-size: 40px;
    font-weight: 900;
    color: #e2e8f0;
    margin-bottom: 16px;
    transition: color 0.3s ease;
}

body[data-theme="dark"] .card-number {
    color: #334155;
}

.feature-card:hover .card-number {
    color: var(--accent-blue);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .material-icons-round {
    color: var(--accent-blue);
    font-size: 24px;
}

.card-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.card-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.card-list .material-icons-round {
    color: var(--accent-blue);
    font-size: 8px;
    margin-top: 6px;
}

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.common-sizes {
    margin-top: 16px;
}

.size-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 8px;
}

.size-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.size-tag {
    padding: 4px 12px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

body[data-theme="dark"] .size-tag {
    background: #334155;
}

.card-action-btn {
    width: 100%;
    padding: 12px;
    margin-top: 24px;
    background: #f1f5f9;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

body[data-theme="dark"] .card-action-btn {
    background: #334155;
}

.card-action-btn:hover {
    background: var(--accent-blue);
    color: white;
}

/* Info Section (Devices & Tips) */
.info-section {
    margin-bottom: 48px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
}

.devices-section .section-header {
    margin-bottom: 32px;
}

.devices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.device-group h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.device-group p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Tips Section */
.tips-section {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 24px;
    padding: 32px;
}

body[data-theme="dark"] .tips-section {
    background: rgba(30, 41, 59, 0.3);
    border-color: #334155;
}

.tips-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 24px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tips-title .material-icons-round {
    color: var(--accent-blue);
    font-size: 24px;
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 14px;
}

.tips-list li:last-child {
    margin-bottom: 0;
}

.tip-emoji {
    font-size: 24px;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-section {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-title {
        font-size: 36px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }
}

/* Steps Section */
.steps-section {
    margin-bottom: 80px;
    position: relative;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 40px;
    position: relative;
}

/* Horizontal connecting line */
.steps-grid::before {
    content: '';
    position: absolute;
    top: 32px;
    left: 5%;
    right: 5%;
    height: 4px;
    background: linear-gradient(90deg,
            rgba(59, 130, 246, 0.15) 0%,
            rgba(59, 130, 246, 0.35) 50%,
            rgba(59, 130, 246, 0.15) 100%);
    border-radius: 2px;
    z-index: 0;
}

.step-card {
    position: relative;
    padding: 28px 24px 24px;
    background: linear-gradient(to bottom right, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 1;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

body[data-theme="dark"] .step-card {
    background: linear-gradient(to bottom right, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.7));
    border-color: rgba(71, 85, 105, 0.4);
}

body[data-theme="dark"] .step-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Large watermark step number */
.step-watermark {
    position: absolute;
    right: -8px;
    bottom: -30px;
    font-size: 120px;
    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.06);
}

/* Gradient blue icon box */
.step-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.25);
    position: relative;
    z-index: 1;
}

.step-icon .material-icons-round {
    color: white;
    font-size: 24px;
}

.step-card h4 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.step-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Pro Tip Box - Amber/Yellow Theme */
.pro-tip-box {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 24px;
    background: rgba(254, 243, 199, 0.5);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 20px;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.08);
}

body[data-theme="dark"] .pro-tip-box {
    background: rgba(120, 53, 15, 0.15);
    border-color: rgba(251, 191, 36, 0.25);
}

.pro-tip-icon {
    width: 48px;
    height: 48px;
    background: rgba(251, 191, 36, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pro-tip-icon .material-icons-round {
    color: #d97706;
    font-size: 24px;
}

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: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #b45309;
    margin-bottom: 4px;
}

body[data-theme="dark"] .pro-tip-label {
    color: #fcd34d;
}

.pro-tip-content p {
    font-size: 14px;
    color: #78350f;
    margin: 0;
    line-height: 1.6;
}

body[data-theme="dark"] .pro-tip-content p {
    color: #fef3c7;
}

.pro-tip-content strong {
    color: #3b82f6;
    font-weight: 600;
}

body[data-theme="dark"] .pro-tip-content strong {
    color: #60a5fa;
}

.pro-tip-close {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #d97706;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    padding: 4px 8px;
    line-height: 1;
}

.pro-tip-close:hover {
    opacity: 1;
}

body[data-theme="dark"] .pro-tip-close {
    color: #fbbf24;
}

/* Responsive Steps Grid */
@media (max-width: 1200px) {
    .steps-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pro-tip-box {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
}

@media (max-width: 768px) {

    /* Reset body padding on mobile by default */
    body {
        padding-left: 0;
    }

    /* Add padding when vertical ruler is visible */
    body.vertical-ruler-active {
        padding-left: 50px;
    }

    /* Fix header position on mobile by default */
    header {
        left: 0;
        width: 100%;
    }

    /* Adjust header when vertical ruler is visible */
    body.vertical-ruler-active header {
        left: 50px;
        width: calc(100% - 50px);
    }

    .main-content {
        padding: 24px 16px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-description {
        font-size: 16px;
    }

    .calibration-status-box {
        flex-direction: column;
        text-align: center;
    }

    .devices-grid {
        grid-template-columns: 1fr;
    }

    .section-header h2 {
        font-size: 24px;
    }
}

footer {
    background: #f1f5f9;
    /* slate-100 light */
    border-top: 1px solid #e2e8f0;
    /* slate-200 */
    margin-top: 40px;
    padding: 48px 32px;
    position: relative;
}

body[data-theme="dark"] footer {
    background: #020617;
    /* slate-950 dark */
    border-top-color: #1e293b;
    /* slate-800 */
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

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

/* Footer Brand/Logo */
.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
    transition: opacity 0.2s ease;
}

.footer-brand:hover {
    opacity: 0.8;
}

.footer-logo {
    width: 24px;
    height: 24px;
}

.footer-brand .material-icons-round,
.footer-logo-icon {
    color: var(--accent-blue);
    font-size: 24px;
}

/* Footer Navigation */
.footer-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Language Dropdown */
.language-dropdown {
    position: relative;
    display: inline-block;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 9999px;
    padding: 8px 16px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.language-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.language-btn .material-symbols-rounded:first-child {
    font-size: 16px;
}

.language-btn .arrow-icon {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.language-dropdown.open .arrow-icon {
    transform: rotate(180deg);
}

.language-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-heavy);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateY(10px);
    z-index: 1000;
    overflow: hidden;
    overflow-y: scroll;
    max-height: 50vh;
    margin-bottom: 8px;
}

.language-dropdown.open .language-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-light);
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.language-option.active {
    background: rgba(0, 122, 255, 0.1);
    color: var(--accent-blue);
}

.language-option .flag {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.footer-link {
    color: #64748b;
    /* slate-500 */
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--accent-blue);
}

body[data-theme="dark"] .footer-link {
    color: #94a3b8;
    /* slate-400 */
}

/* Footer Bottom */
.footer-bottom {
    text-align: center;
}

footer p {
    color: #94a3b8;
    /* slate-400 */
    font-size: 12px;
    margin: 0;
}

body[data-theme="dark"] footer p {
    color: #475569;
    /* slate-600 */
}

/* Floating Theme Toggle */
.theme-toggle-floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 60;
    color: #475569;
    /* slate-600 */
}

body[data-theme="dark"] .theme-toggle-floating {
    color: #cbd5e1;
    /* slate-300 */
}

.theme-toggle-floating:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.theme-toggle-floating .material-symbols-rounded {
    font-size: 24px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

dialog {
    width: 95%;
    max-width: 800px;
    max-height: 90vh;
    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: scroll;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.01em;
}

.modal-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    flex: 1;
}

.close-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.calibration-method {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.calibration-method:hover {
    box-shadow: var(--shadow-medium);
}

.calibration-method summary {
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--bg-secondary);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.calibration-method summary:hover {
    background: var(--bg-tertiary);
}

.calibration-method summary::after {
    content: '＋';
    font-size: 18px;
    font-weight: 300;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    color: var(--text-secondary);
}

.calibration-method[open] summary::after {
    transform: rotate(45deg);
}

.method-content {
    padding: 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--bg-tertiary);
}

#device-selector {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--text-primary);
}

.diagonal-input-group,
.method-footer {
    display: flex;
    gap: 12px;
    align-items: center;
}

.diagonal-input-group input {
    flex-grow: 1;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    padding: 12px 16px;
    background: var(--bg-secondary);
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--text-primary);
}

.diagonal-input-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.modal-btn.primary {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.modal-btn.primary:hover {
    background: #0051d5;
    border-color: #0051d5;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.credit-card-area {
    background: var(--bg-secondary);
    border: 2px dashed var(--border-medium);
    border-radius: var(--border-radius-md);
    padding: 40px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.credit-card-guide {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 122, 255, 0.1);
    color: var(--accent-blue);
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

.credit-card-dimensions {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 11px;
    font-weight: 500;
}

.sizer {
    width: 320px;
    /* Credit card width at ~96 DPI */
    height: 200px;
    /* Credit card height at ~96 DPI */
    background: linear-gradient(135deg, var(--accent-blue), #5ac8fa);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    user-select: none;
    transition: all 0.2s ease-out;
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.25);
    position: relative;
    text-align: center;
    line-height: 1.3;
}

.sizer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 14px;
    pointer-events: none;
}

.sizer-text-main {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.sizer-text-sub {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 400;
}

@media (max-width: 768px) {
    .credit-card-area {
        padding: 20px;
        min-height: 200px;
    }

    .sizer {
        width: 280px;
        height: 175px;
    }
}

@media (max-width: 480px) {
    .credit-card-area {
        padding: 16px;
        min-height: 180px;
    }

    .sizer {
        width: 240px;
        height: 150px;
    }

    .sizer-text-main {
        font-size: 14px;
    }

    .sizer-text-sub {
        font-size: 11px;
    }
}

.slider-container {
    margin-top: 20px;
}

.slider {
    width: 100%;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    outline: none;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slider:hover {
    background: var(--border-medium);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--accent-blue);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.4);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--accent-blue);
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.ppi-display {
    text-align: center;
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
}

.ppi-display strong {
    color: var(--text-primary);
    font-weight: 600;
}

.accuracy-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
}

.accuracy-indicator.excellent {
    background: rgba(48, 209, 88, 0.1);
    color: var(--accent-green);
}

.accuracy-indicator.good {
    background: rgba(0, 122, 255, 0.1);
    color: var(--accent-blue);
}

.accuracy-indicator.fair {
    background: rgba(255, 149, 0, 0.1);
    color: var(--accent-orange);
}

@media (max-width: 768px) {
    body {
        padding-top: 50px;
        padding-left: 0;
    }

    body.quick-calibration-active {
        padding-top: 50px;
    }

    #popup-btn {
        display: none;
    }

    .menu-btn {
        top: 65px;
        left: 16px;
        width: 48px;
        height: 48px;
    }

    .menu-btn .material-symbols-rounded {
        font-size: 24px;
    }

    .sidebar {
        width: 280px;
        left: -280px;
    }

    header {
        top: 50px;
        left: 0;
        width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
    }

    .header-main {
        flex-direction: column;
        padding: 16px 20px;
        gap: 16px;
    }

    .controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-section {
        padding: 0 20px;
        margin-top: 150px;
    }

    .header-content {
        text-align: center;
        flex-direction: column;
        gap: 12px;
    }

    #detection-status {
        padding: 12px 20px;
        font-size: 14px;
    }

    .quick-calibration {
        margin: 8px 0;
        padding: 12px;
    }

    .quick-input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .quick-input-group input {
        width: 100%;
    }

    main {
        padding: 20px;
    }

    .content-card {
        padding: 24px;
    }

    .content-card h2 {
        font-size: 20px;
    }

    .content-card h3 {
        font-size: 16px;
    }

    dialog {
        width: 98%;
        max-height: 95vh;
    }

    .modal-content {
        padding: 16px;
        gap: 16px;
    }

    .modal-header {
        padding: 16px;
    }

    .calibration-method summary {
        padding: 16px 20px;
    }

    .method-content {
        padding: 20px;
        gap: 16px;
    }

    footer {
        padding: 24px 20px;
    }

    .footer-content {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 80%;
        left: -100%;
    }

    .content-card {
        padding: 20px;
    }

    .content-card h2 {
        font-size: 18px;
    }
}

/* ===== EXACT MATCH DESIGN FROM REFERENCE ===== */

/* Content Area - Main Content Wrapper */
.dark-content {
    background-color: #f5f5f5;
    padding: 50px 60px 60px 60px;
}

/* Main Page Heading */
.main-heading {
    text-align: center;
    font-size: 30px;
    font-weight: 600;
    color: #220a01;
    margin: 0 0 15px 0;
    line-height: 40px;
}

/* Content Section Base */
.content-section {
    max-width: 100%;
    margin: 0 0 40px 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.welcome-section {
    text-align: center;
    margin-bottom: 30px;
}

/* Welcome Text Paragraph */
.welcome-text {
    font-size: 17px;
    color: #231f20;
    line-height: 31px;
    margin: 0;
}

/* Info Box with Left Border - Like contentinfo.borderLeft */
.info-box-left-border {
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 5px;
    border-left: 3px solid #ff5500;
    line-height: 28px;
    margin: 30px 0;
}

.info-box-left-border p {
    font-size: 16px;
    color: #231f20;
    line-height: 28px;
    margin: 0;
}

.tip-box {
    margin-top: 25px;
}

/* Section Headings - h2 centered */
.content-section h2 {
    font-size: 30px;
    font-weight: 600;
    text-align: center;
    margin: 20px 0;
    color: #220a01;
    line-height: 30px;
}

/* How-to List - Numbered */
.how-to-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.how-to-list li {
    font-size: 17px;
    color: #231f20;
    line-height: 31px;
    margin: 15px 0;
    position: relative;
    padding-left: 25px;
}

.how-to-list li::before {
    position: absolute;
    left: 0;
    color: #220a01;
    font-weight: 500;
}

.how-to-list li:nth-child(1)::before {
    content: "1.";
}

.how-to-list li:nth-child(2)::before {
    content: "2.";
}

.how-to-list li:nth-child(3)::before {
    content: "3.";
}

.how-to-list li:nth-child(4)::before {
    content: "4.";
}

.how-to-list li:nth-child(5)::before {
    content: "5.";
}

.how-to-list li:nth-child(6)::before {
    content: "6.";
}

.how-to-list li:nth-child(7)::before {
    content: "7.";
}

.how-to-list li:nth-child(8)::before {
    content: "8.";
}

.how-to-list li:nth-child(9)::before {
    content: "9.";
}

.how-to-list li:nth-child(10)::before {
    content: "10.";
}

/* Feature/Uses Lists - Bullet Points */
.feature-list,
.uses-list,
.features-grid {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li,
.uses-list li,
.features-grid li {
    font-size: 17px;
    color: #231f20;
    line-height: 31px;
    margin: 15px 0;
    position: relative;
    padding-left: 20px;
}

.feature-list li::before,
.uses-list li::before,
.features-grid li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #220a01;
}

.feature-list li strong,
.features-grid li strong {
    color: #220a01;
    font-weight: 600;
}

/* Section Text */
.section-text {
    font-size: 17px;
    color: #231f20;
    line-height: 31px;
    margin-top: 20px;
}

.closing-text {
    text-align: center;
    margin-top: 30px;
}

/* FAQ Section */
.faq-section {
    margin-top: 40px;
}

.faq-item {
    margin: 20px 0;
}

.faq-item h3 {
    font-size: 20px;
    font-weight: 500;
    line-height: 30px;
    color: #220a01;
    margin: 0 0 10px 0;
}

.faq-item p {
    font-size: 16px;
    color: #231f20;
    line-height: 27px;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .dark-content {
        padding: 30px 20px;
    }

    .main-heading {
        font-size: 24px;
    }

    .content-section h2 {
        font-size: 24px;
    }

    .welcome-text,
    .how-to-list li,
    .feature-list li,
    .uses-list li,
    .features-grid li,
    .section-text {
        font-size: 15px;
    }

    .info-box-left-border p,
    .faq-item p {
        font-size: 14px;
    }

    .faq-item h3 {
        font-size: 18px;
    }

    /* Footer Responsive */
    .footer-top {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .footer-nav {
        flex-direction: column;
        gap: 12px;
    }

    .footer-brand {
        justify-content: center;
    }

    .language-dropdown {
        width: 100%;
    }

    .language-btn {
        justify-content: center;
        width: 100%;
    }

    .language-menu {
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(10px);
    }

    .language-dropdown.open .language-menu {
        transform: translateX(-50%) translateY(0);
    }

    .theme-toggle-floating {
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .main-heading {
        font-size: 20px;
    }

    .content-section h2 {
        font-size: 20px;
    }
}

/* Dark Theme Content Styles */
body[data-theme="dark"] .dark-content {
    background-color: #0d0f12;
}

body[data-theme="dark"] .main-heading,
body[data-theme="dark"] .content-section h2,
body[data-theme="dark"] .faq-item h3 {
    color: #ffffff;
}

body[data-theme="dark"] .welcome-text,
body[data-theme="dark"] .how-to-list li,
body[data-theme="dark"] .feature-list li,
body[data-theme="dark"] .uses-list li,
body[data-theme="dark"] .features-grid li,
body[data-theme="dark"] .section-text,
body[data-theme="dark"] .info-box-left-border p,
body[data-theme="dark"] .faq-item p {
    color: #b8b8b8;
}

body[data-theme="dark"] .how-to-list li::before,
body[data-theme="dark"] .feature-list li::before,
body[data-theme="dark"] .uses-list li::before,
body[data-theme="dark"] .features-grid li::before,
body[data-theme="dark"] .feature-list li strong,
body[data-theme="dark"] .features-grid li strong {
    color: #ffffff;
}

body[data-theme="dark"] .info-box-left-border {
    background-color: #1a1c21;
}

body:has(:fullscreen) {
    padding: 0 !important;
}

:fullscreen #ruler-horizontal,
:fullscreen #ruler-vertical {
    display: block !important;
}

:fullscreen .menu-btn,
:fullscreen .sidebar,
:fullscreen .sidebar-overlay,
:fullscreen header,
:fullscreen .header-section,
:fullscreen main,
:fullscreen footer {
    display: none;
}

/* Dark Theme - Step Cards Text Visibility Fix */
body[data-theme="dark"] .step-card h4 {
    color: #ffffff;
}

body[data-theme="dark"] .step-card p {
    color: #94a3b8;
}

body[data-theme="dark"] .step-watermark {
    color: rgba(255, 255, 255, 0.08);
}

/* Dark Theme - Section Headers */
body[data-theme="dark"] .section-header h2 {
    color: #ffffff;
}

body[data-theme="dark"] .section-header .material-icons-round {
    color: var(--accent-blue);
}

/* Dark Theme - Feature Cards (Calibration Methods) Text Visibility */
body[data-theme="dark"] .card-title {
    color: #ffffff;
}

body[data-theme="dark"] .card-description {
    color: #94a3b8;
}

body[data-theme="dark"] .card-list li {
    color: #94a3b8;
}

body[data-theme="dark"] .size-label {
    color: #64748b;
}

body[data-theme="dark"] .size-tag {
    color: #e2e8f0;
}

/* Dark Theme - Device Groups */
body[data-theme="dark"] .device-group h4 {
    color: #ffffff;
}

body[data-theme="dark"] .device-group p {
    color: #94a3b8;
}

/* Dark Theme - Tips Section */
body[data-theme="dark"] .tips-title {
    color: #ffffff;
}

body[data-theme="dark"] .tips-list li {
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(51, 65, 85, 0.5);
}

/* Dark Theme - Hero Section */
body[data-theme="dark"] .hero-title {
    color: #ffffff;
}

body[data-theme="dark"] .hero-description {
    color: #94a3b8;
}

body[data-theme="dark"] .hero-feature span {
    color: #94a3b8;
}

/* Dark Theme - Calibration Modal Text Visibility */
body[data-theme="dark"] dialog {
    background: #1e293b;
    border-color: #334155;
}

body[data-theme="dark"] .modal-header {
    background: #0f172a;
    border-color: #334155;
}

body[data-theme="dark"] .modal-header h3 {
    color: #ffffff;
}

body[data-theme="dark"] .calibration-method {
    background: #1e293b;
    border-color: #334155;
}

body[data-theme="dark"] .calibration-method summary {
    color: #ffffff;
    background: #1e293b;
}

body[data-theme="dark"] .calibration-method summary:hover {
    background: #334155;
}

body[data-theme="dark"] .method-content {
    background: #0f172a;
    border-color: #334155;
}

body[data-theme="dark"] .method-content p {
    color: #94a3b8;
}

body[data-theme="dark"] #device-selector {
    background: #334155;
    border-color: #475569;
    color: #ffffff;
}

body[data-theme="dark"] #device-selector option {
    background: #1e293b;
    color: #ffffff;
}

body[data-theme="dark"] #device-selector optgroup {
    background: #0f172a;
    color: #94a3b8;
}

body[data-theme="dark"] .diagonal-input-group input {
    background: #334155;
    border-color: #475569;
    color: #ffffff;
}

body[data-theme="dark"] .diagonal-input-group input::placeholder {
    color: #64748b;
}

body[data-theme="dark"] .diagonal-input-group span {
    color: #94a3b8;
}

body[data-theme="dark"] .credit-card-area {
    background: #0f172a;
    border-color: #475569;
}

body[data-theme="dark"] .credit-card-guide {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.15);
}

body[data-theme="dark"] .credit-card-dimensions {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
}

body[data-theme="dark"] .ppi-display {
    background: #334155;
    color: #94a3b8;
}

body[data-theme="dark"] .ppi-display strong {
    color: #ffffff;
}

body[data-theme="dark"] .close-btn {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}

body[data-theme="dark"] .close-btn:hover {
    background: #475569;
    color: #ffffff;
}