
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background: #ffffff;
            min-height: 100vh;
            padding: 40px 20px;
        }

        .container {
            max-width: 600px;
            margin: 0 auto;
        }

        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 40px;
            flex-wrap: wrap;
            gap: 20px;
        }

        h1 {
            font-size: 24px;
            font-weight: 600;
            color: #111827;
            letter-spacing: -0.5px;
        }

        .mode-selector {
            display: flex;
            gap: 8px;
            background: #f9fafb;
            padding: 4px;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
        }

        .mode-btn {
            padding: 8px 16px;
            background: transparent;
            border: none;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 500;
            color: #6b7280;
            cursor: pointer;
            transition: all 0.2s;
        }

        .mode-btn:hover {
            color: #374151;
        }

        .mode-btn.active {
            background: #ffffff;
            color: #111827;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }

        .tabs {
            display: flex;
            gap: 0;
            margin-bottom: 40px;
            border-bottom: 1px solid #e5e7eb;
        }

        .tab {
            flex: 1;
            padding: 12px 16px;
            background: transparent;
            border: none;
            border: 1px solid transparent;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            color: #6b7280;
            transition: all 0.2s;
        }

        .tab.active {
            color: #111827;
            border-color: #e9e9e9;
            background-color: #f9fafb;
        }

        .tab:hover:not(.active) {
            color: #374151;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        .input-group {
            margin-bottom: 24px;
        }

        label {
            display: block;
            margin-bottom: 8px;
            color: #374151;
            font-weight: 500;
            font-size: 14px;
        }

        input[type="text"],
        textarea {
            width: 100%;
            padding: 12px 14px;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            font-size: 15px;
            color: #111827;
            transition: all 0.2s;
            background: #ffffff;
        }

        input[type="text"]:focus,
        textarea:focus {
            outline: none;
            border-color: #111827;
            box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.05);
        }

        textarea {
            resize: vertical;
            min-height: 100px;
            font-family: 'Courier New', monospace;
            line-height: 1.6;
        }

        .buttons {
            display: flex;
            gap: 12px;
            margin-bottom: 24px;
        }

        button {
            flex: 1;
            padding: 12px 20px;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            background: #ffffff;
            color: #111827;
        }

        .btn-primary {
            background: #111827;
            color: #ffffff;
            border-color: #111827;
        }

        .btn-primary:hover {
            background: #1f2937;
            border-color: #1f2937;
        }

        .btn-secondary {
            background: #ffffff;
            color: #374151;
        }

        .btn-secondary:hover {
            background: #f9fafb;
        }

        .result {
            background: #f9fafb;
            padding: 16px;
            border-radius: 6px;
            margin-top: 24px;
            border: 1px solid #e5e7eb;
        }

        .result-label {
            font-size: 12px;
            color: #6b7280;
            margin-bottom: 8px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .result-value {
            font-family: 'Courier New', monospace;
            font-size: 16px;
            color: #111827;
            word-break: break-all;
            line-height: 1.6;
        }

        .calculator-display {
            background: #f9fafb;
            color: #111827;
            padding: 24px;
            border-radius: 6px;
            font-family: 'Courier New', monospace;
            font-size: 32px;
            text-align: right;
            margin-bottom: 24px;
            min-height: 80px;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            word-break: break-all;
            border: 1px solid #e5e7eb;
            font-weight: 500;
        }

        .calc-buttons {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
        }

        .calc-btn {
            padding: 24px;
            font-size: 18px;
            font-weight: 500;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
            background: #ffffff;
            color: #111827;
        }

        .calc-btn:hover {
            background: #f9fafb;
            border-color: #9ca3af;
        }

        .calc-btn:active {
            transform: scale(0.98);
        }

        .calc-btn.number {
            background: #ffffff;
            color: #111827;
        }

        .calc-btn.operator {
            background: #f3f4f6;
            color: #111827;
        }

        .calc-btn.special {
            background: #ffffff;
            color: #ef4444;
        }

        .calc-btn.equals {
            background: #111827;
            color: #ffffff;
            grid-column: span 2;
            border-color: #111827;
        }

        .calc-btn.equals:hover {
            background: #1f2937;
            border-color: #1f2937;
        }

        .info {
            background: #f9fafb;
            padding: 12px 16px;
            border-radius: 6px;
            margin-top: 24px;
            font-size: 13px;
            color: #6b7280;
            border: 1px solid #e5e7eb;
        }

        .converter-container {
            display: grid;
            grid-template-columns: 1fr 280px;
            gap: 40px;
            align-items: start;
        }

        .converter-left {
            flex: 1;
        }

        .converter-right {
            background: #f9fafb;
            border: 1px solid #e5e7eb;
            border-radius: 6px;
            padding: 24px;
            position: sticky;
            top: 20px;
        }

        .selector-group {
            margin-bottom: 24px;
        }

        .selector-label {
            font-size: 14px;
            font-weight: 500;
            color: #374151;
            margin-bottom: 12px;
        }

        .selector-options {
            display: flex;
            gap: 8px;
        }

        .selector-btn {
            flex: 1;
            padding: 10px 16px;
            background: #ffffff;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            color: #6b7280;
            cursor: pointer;
            transition: all 0.2s;
        }

        .selector-btn:hover {
            border-color: #9ca3af;
            color: #374151;
        }

        .selector-btn.active {
            background: #111827;
            color: #ffffff;
            border-color: #111827;
        }

        .realtime-result {
            font-family: 'Courier New', monospace;
            font-size: 36px;
            font-weight: 600;
            color: #111827;
            margin: 16px 0;
            word-break: break-all;
            line-height: 1.3;
            min-height: 50px;
        }

        .result-type {
            font-size: 13px;
            color: #6b7280;
            font-weight: 500;
        }

        @media (max-width: 768px) {
            body {
                padding: 0;
                overflow: hidden;
                position: fixed;
                width: 100%;
                height: 100%;
            }

            .container {
                height: 100dvh;
                display: flex;
                flex-direction: column;
                margin: 0;
                max-width: 100%;
            }

            .header {
                padding: 12px 16px;
                margin-bottom: 0;
                background: #fff;
                flex-direction: row;
                justify-content: space-between;
                flex-shrink: 0;
            }

            h1 {
                font-size: 18px;
            }

            .mode-selector {
                transform: scale(0.9);
                transform-origin: right center;
            }

            .tabs {
                margin-bottom: 0;
                border-bottom: 1px solid #e5e7eb;
                background: #fff;
                flex-shrink: 0;
                overflow-x: auto;
            }

            .tab {
                padding: 14px 10px;
                font-size: 13px;
                white-space: nowrap;
            }

            .tab-content {
                display: none;
                flex: 1;
                overflow-y: auto;
                padding: 20px;
                padding-bottom: 80px;
            }

            .tab-content.active {
                display: block;
            }

            #calculator.active {
                display: flex;
                flex-direction: column;
                padding: 0;
                overflow: hidden;
            }

            #calculator .calculator-display {
                flex-grow: 1;
                margin: 0;
                border: none;
                border-radius: 0;
                font-size: 48px;
                padding: 20px;
                align-items: flex-end;
                background: #ffffff;
            }

            #calculator .info {
                display: none;
            }

            #calculator .calc-buttons {
                flex-shrink: 0;
                gap: 1px;
                background: #e5e7eb;
                padding: 0;
                padding-bottom: env(safe-area-inset-bottom);
                border-top: 1px solid #e5e7eb;
            }

            #calculator .calc-btn {
                border-radius: 0;
                border: none;
                padding: 0;
                height: 70px;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 24px;
                background: #fff;
            }
            
            #calculator .calc-btn:active {
                background: #f3f4f6;
            }

            #calculator .calc-btn.equals {
                background: #111827;
                color: #fff;
            }

            .converter-container {
                grid-template-columns: 1fr;
                gap: 20px;
            }

            .converter-right {
                position: static;
                margin-top: 0;
                background: #f3f4f6;
            }

            .input-group label {
                font-size: 16px;
            }

            input[type="text"], textarea {
                font-size: 16px;
                padding: 16px;
            }
        }