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

        :root {
            /* Danish Construction Professional Palette */
            --primary: #1a3a52;
            --primary-light: #2c5070;
            --secondary: #546e7a;
            --accent: #d84315;

            /* Severity Colors */
            --severity-critical: #c62828;
            --severity-significant: #f9a825;
            --severity-minor: #2e7d32;

            /* Status Colors */
            --success: #2e7d32;
            --warning: #f9a825;
            --error: #c62828;

            /* Neutral & Backgrounds */
            --background: #f5f5f5;
            --surface: #ffffff;
            --text-primary: #212121;
            --text-secondary: #616161;
            --border: #e0e0e0;

            /* Shadows */
            --shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
            --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.16);
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                         'Helvetica Neue', Arial, sans-serif;
            background: var(--background);
            color: var(--text-primary);
            line-height: 1.5;
            overflow-x: hidden;
        }

        /* Screen Management */
        .screen {
            display: none;
            min-height: 100vh;
        }

        .screen.active {
            display: block;
        }

        /* App Container */
        .app-container {
            max-width: 600px;
            margin: 0 auto;
            background: var(--background);
            min-height: 100vh;
        }

        /* Header Styles */
        .app-header {
            background: var(--primary);
            color: white;
            padding: 12px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: var(--shadow);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .header-title {
            font-size: 18px;
            font-weight: 600;
        }

        .back-button, .menu-button, .add-button, .save-button {
            background: none;
            border: none;
            color: white;
            font-size: 24px;
            padding: 8px;
            cursor: pointer;
            min-width: 44px;
            min-height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            transition: background 0.2s;
        }

        .back-button:hover, .menu-button:hover, .add-button:hover, .save-button:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        /* Navigation Arrow Buttons */
        .header-right {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .nav-arrow-button {
            background: rgba(255, 255, 255, 0.15);
            border: none;
            color: white;
            font-size: 28px;
            font-weight: 300;
            padding: 4px 12px;
            cursor: pointer;
            min-width: 44px;
            min-height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            transition: all 0.2s;
        }

        .nav-arrow-button:hover:not(:disabled) {
            background: rgba(255, 255, 255, 0.25);
            transform: scale(1.05);
        }

        .nav-arrow-button:disabled {
            opacity: 0.3;
            cursor: not-allowed;
        }

        .defect-counter {
            color: white;
            font-size: 14px;
            font-weight: 500;
            padding: 0 8px;
            white-space: nowrap;
            user-select: none;
        }

        /* Content Area */
        .content {
            padding: 20px;
        }

        /* Buttons */
        .btn-primary {
            width: 100%;
            padding: 16px;
            font-size: 17px;
            font-weight: 600;
            letter-spacing: 0.5px;
            background: var(--accent);
            color: white;
            border: none;
            border-radius: 12px;
            cursor: pointer;
            min-height: 56px;
            box-shadow: var(--shadow);
            transition: all 0.2s;
            margin-bottom: 12px;
            text-transform: uppercase;
        }

        .btn-primary:hover {
            background: #c63912;
            transform: translateY(-1px);
            box-shadow: var(--shadow-lg);
        }

        .btn-primary:disabled {
            background: #bdbdbd;
            cursor: not-allowed;
            opacity: 0.6;
        }

        .btn-primary.loading {
            position: relative;
            color: transparent;
            pointer-events: none;
        }

        .btn-primary.loading::after {
            content: '';
            position: absolute;
            width: 20px;
            height: 20px;
            top: 50%;
            left: 50%;
            margin-left: -10px;
            margin-top: -10px;
            border: 3px solid rgba(255, 255, 255, 0.3);
            border-top-color: white;
            border-radius: 50%;
            animation: spinner 0.8s linear infinite;
        }

        @keyframes spinner {
            to { transform: rotate(360deg); }
        }

        .btn-secondary {
            width: 100%;
            padding: 14px;
            font-size: 16px;
            font-weight: 600;
            background: var(--surface);
            color: var(--primary);
            border: 2px solid var(--primary);
            border-radius: 10px;
            cursor: pointer;
            min-height: 52px;
            transition: all 0.2s;
            margin-bottom: 12px;
            text-transform: uppercase;
        }

        .btn-secondary:hover {
            background: var(--primary);
            color: white;
            transform: translateY(-1px);
        }

        .btn-danger {
            width: 100%;
            padding: 14px;
            font-size: 16px;
            font-weight: 600;
            background: var(--surface);
            color: var(--error);
            border: 2px solid var(--error);
            border-radius: 10px;
            cursor: pointer;
            min-height: 52px;
            transition: all 0.2s;
            margin-bottom: 12px;
            text-transform: uppercase;
        }

        .btn-danger:hover {
            background: var(--error);
            color: white;
            transform: translateY(-1px);
        }

        /* Form Styles */
        .form-group {
            margin-bottom: 20px;
        }

        .form-label {
            display: block;
            font-size: 15px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 8px;
        }

        .form-input, .form-select, .form-textarea {
            width: 100%;
            padding: 12px 16px;
            font-size: 16px;
            border: 2px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            transition: border-color 0.2s;
            font-family: inherit;
        }

        .form-input:focus, .form-select:focus, .form-textarea:focus {
            outline: none;
            border-color: var(--primary);
        }

        .form-textarea {
            resize: vertical;
            min-height: 100px;
        }

        .form-hint {
            font-size: 13px;
            color: var(--text-secondary);
            margin-top: 6px;
            display: block;
        }

        .form-checkbox {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 16px;
        }

        .form-checkbox input[type="checkbox"] {
            width: 20px;
            height: 20px;
            cursor: pointer;
            accent-color: var(--primary);
        }

        .form-checkbox label {
            font-size: 14px;
            cursor: pointer;
            user-select: none;
            color: var(--text-primary);
        }

        /* Cards */
        .card {
            background: var(--surface);
            border-radius: 12px;
            padding: 20px;
            box-shadow: var(--shadow);
            margin-bottom: 16px;
            cursor: pointer;
            transition: all 0.2s;
        }

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

        /* Welcome Section */
        .welcome-section {
            text-align: center;
            padding: 40px 20px;
        }

        .welcome-icon {
            width: 80px;
            height: 80px;
            margin: 0 auto 20px;
            background: var(--primary);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .welcome-icon::before {
            content: '';
            position: absolute;
            width: 36px;
            height: 30px;
            background: white;
            clip-path: polygon(50% 0%, 100% 35%, 100% 100%, 0% 100%, 0% 35%);
        }

        .welcome-title {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 12px;
        }

        .welcome-text {
            font-size: 16px;
            color: var(--text-secondary);
            line-height: 1.6;
        }

        /* Project Cards */
        .project-card {
            display: flex;
            align-items: center;
            gap: 16px;
            background: var(--surface);
            padding: 16px;
            border-radius: 12px;
            box-shadow: var(--shadow);
            margin-bottom: 12px;
            cursor: pointer;
            transition: all 0.2s;
        }

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

        .project-icon {
            width: 48px;
            height: 48px;
            background: var(--primary);
            border-radius: 12px;
            position: relative;
            flex-shrink: 0;
        }

        .project-icon::before {
            content: '';
            position: absolute;
            width: 24px;
            height: 20px;
            background: white;
            clip-path: polygon(50% 0%, 100% 35%, 100% 100%, 0% 100%, 0% 35%);
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

        .project-info {
            flex: 1;
        }

        .project-name {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 4px;
        }

        .project-address {
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 4px;
        }

        .project-meta {
            font-size: 13px;
            color: var(--text-secondary);
        }

        .status-badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 600;
            margin-left: 8px;
        }

        .status-badge.active {
            background: rgba(46, 125, 50, 0.1);
            color: var(--success);
        }

        /* Defect Cards */
        .defect-card {
            background: var(--surface);
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 12px;
            box-shadow: var(--shadow);
            border-left: 4px solid transparent;
            cursor: pointer;
            transition: all 0.2s;
        }

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

        .defect-card.critical {
            border-left-color: var(--severity-critical);
        }

        .defect-card.significant {
            border-left-color: var(--severity-significant);
        }

        .defect-card.minor {
            border-left-color: var(--severity-minor);
        }

        .defect-header {
            display: flex;
            align-items: flex-start;
            gap: 12px;
        }

        .defect-severity {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: 700;
            color: white;
            flex-shrink: 0;
        }

        .defect-severity.critical {
            background: var(--severity-critical);
        }

        .defect-severity.significant {
            background: var(--severity-significant);
        }

        .defect-severity.minor {
            background: var(--severity-minor);
        }

        .defect-info {
            flex: 1;
        }

        .defect-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 4px;
        }

        .defect-location {
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 8px;
        }

        .defect-actions {
            display: flex;
            gap: 8px;
        }

        .action-icon {
            width: 32px;
            height: 32px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--background);
            border: 2px solid var(--border);
            position: relative;
        }

        .action-icon.completed {
            background: var(--success);
            border-color: var(--success);
            color: white;
        }

        /* FAB Button */
        .fab {
            position: fixed;
            bottom: 24px;
            right: 24px;
            width: 64px;
            height: 64px;
            background: var(--accent);
            color: white;
            border: none;
            border-radius: 50%;
            font-size: 32px;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
            transition: all 0.2s;
            z-index: 50;
        }

        .fab:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
        }

        /* Photo Box */
        .photo-box {
            width: 100%;
            height: 200px;
            background: var(--surface);
            border: 2px dashed var(--border);
            border-radius: 12px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
            overflow: hidden;
        }

        .photo-box:hover {
            border-color: var(--primary);
            background: #f8f9fa;
        }

        .photo-box.has-photo {
            border-style: solid;
            padding: 0;
        }

        .photo-box-icon {
            width: 60px;
            height: 60px;
            background: var(--primary);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 12px;
            position: relative;
        }

        .photo-box-icon::before {
            content: '';
            width: 30px;
            height: 24px;
            border: 3px solid white;
            border-radius: 4px;
            position: absolute;
        }

        .photo-box-icon::after {
            content: '';
            width: 12px;
            height: 12px;
            border: 3px solid white;
            border-radius: 50%;
            position: absolute;
        }

        .photo-box-text {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .photo-box-hint {
            font-size: 14px;
            color: var(--text-secondary);
        }

        .photo-thumbnail {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .photo-edit-overlay {
            position: absolute;
            top: 8px;
            right: 8px;
            background: rgba(0, 0, 0, 0.6);
            color: white;
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 600;
        }

        .pin-count-badge {
            position: absolute;
            bottom: 8px;
            right: 8px;
            background: var(--accent);
            color: white;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: 600;
        }

        /* Modal */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            z-index: 1000;
            overflow: auto;
            padding: 20px 0;
        }

        .modal.active {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .modal-header {
            background: var(--primary);
            color: white;
            padding: 12px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .modal-title {
            font-size: 18px;
            font-weight: 600;
        }

        .modal-close {
            background: none;
            border: none;
            color: white;
            font-size: 28px;
            padding: 4px;
            cursor: pointer;
            min-width: 44px;
            min-height: 44px;
            line-height: 1;
        }

        .modal-content {
            padding: 20px;
            max-width: 800px;
            margin: 0 auto;
        }

        .annotation-container {
            position: relative;
            width: 100%;
            margin-bottom: 20px;
            background: var(--surface);
            border-radius: 12px;
            overflow: hidden;
        }

        .annotation-image {
            width: 100%;
            height: auto;
            min-height: 200px;
            display: block;
            user-select: none;
        }

        .annotation-pins {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }

        .pin {
            position: absolute;
            width: 32px;
            height: 32px;
            background: var(--accent);
            border: 3px solid white;
            border-radius: 50% 50% 50% 0;
            transform: translate(-50%, -100%) rotate(-45deg);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: 700;
            color: white;
        }

        .pin-number {
            transform: rotate(45deg);
            margin-top: -6px;
            margin-left: 2px;
        }

        .modal-actions {
            display: flex;
            gap: 12px;
            margin-top: 20px;
        }

        .modal-btn {
            flex: 1;
            padding: 14px;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

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

        .modal-btn-primary:hover:not(:disabled) {
            background: var(--primary-light);
        }

        .modal-btn-primary:disabled {
            background: #cbd5e1;
            color: #94a3b8;
            cursor: not-allowed;
            opacity: 0.6;
            box-shadow: none !important;
        }

        .modal-btn-secondary {
            background: var(--surface);
            color: var(--text-primary);
            border: 2px solid var(--border);
        }

        .modal-btn-secondary:hover:not(:disabled) {
            background: #f8f9fa;
        }

        .modal-btn-secondary:disabled {
            background: #f1f5f9;
            color: #cbd5e1;
            border-color: #e2e8f0;
            cursor: not-allowed;
            opacity: 0.6;
        }

        .floor-plan-container {
            position: relative;
            width: 100%;
            margin-bottom: 20px;
            background: var(--surface);
            border-radius: 12px;
            overflow: hidden;
        }

        .floor-plan-canvas {
            width: 100%;
            display: block;
        }

        .floor-plan-pins {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }

        .file-input {
            display: none;
        }

        .info-box {
            background: rgba(46, 125, 50, 0.1);
            border-left: 4px solid var(--success);
            padding: 12px 16px;
            border-radius: 4px;
            margin-bottom: 20px;
        }

        .info-text {
            font-size: 14px;
            color: var(--text-primary);
            line-height: 1.5;
        }

        .template-list {
            margin-bottom: 16px;
        }

        .template-card {
            background: var(--surface);
            border: 2px solid var(--border);
            border-radius: 8px;
            padding: 12px 16px;
            margin-bottom: 8px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .template-card:hover {
            border-color: var(--primary);
        }

        .template-card.selected {
            border-color: var(--primary);
            background: rgba(26, 58, 82, 0.05);
        }

        .template-text {
            font-size: 14px;
            line-height: 1.5;
            color: var(--text-primary);
        }

        .empty-state {
            text-align: center;
            padding: 60px 20px;
        }

        .empty-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .empty-text {
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 24px;
        }

        .link-group {
            text-align: center;
            padding: 16px 0;
        }

        .text-link {
            color: var(--primary);
            text-decoration: none;
            font-weight: 600;
            transition: opacity 0.2s;
        }

        .text-link:hover {
            opacity: 0.8;
        }

        /* Severity Selector */
        .severity-selector {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
        }

        .severity-btn {
            flex: 1;
            padding: 12px;
            border: 2px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            cursor: pointer;
            transition: all 0.2s;
            font-size: 14px;
            font-weight: 600;
        }

        .severity-btn.critical {
            border-color: var(--severity-critical);
        }

        .severity-btn.significant {
            border-color: var(--severity-significant);
        }

        .severity-btn.minor {
            border-color: var(--severity-minor);
        }

        .severity-btn.selected.critical {
            background: var(--severity-critical);
            color: white;
        }

        .severity-btn.selected.significant {
            background: var(--severity-significant);
            color: white;
        }

        .severity-btn.selected.minor {
            background: var(--severity-minor);
            color: white;
        }

        /* Responsive */
        @media (max-width: 480px) {
            .content {
                padding: 16px;
            }

            /* Photo annotation modal - fuld skærm på mobil */
            .modal.active {
                padding: 0;
                justify-content: flex-start;
            }

            .modal-header {
                width: 100%;
            }

            .modal-content {
                padding: 16px;
                width: 100%;
                flex: 1;
                display: flex;
                flex-direction: column;
            }

            .annotation-container {
                flex: 1;
                display: flex;
                align-items: center;
                justify-content: center;
            }
        }
    </style>
