body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #1e1e1e;
    color: #ddd;
}

/*=========================================================
    Top Bar
=========================================================*/

#topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #2a2a2a;
    border-bottom: 1px solid #444;
}

.branding {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.title-group {
    display: flex;
    flex-direction: column;
}

.title {
    font-size: 1.6em;
    font-weight: bold;
    color: white;
}

.subtitle {
    font-size: 0.9em;
    color: #9fa6ad;
}

/*=========================================================
    Main Layout
=========================================================*/

#main {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
}

.panel {
    background: #252525;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px;
}

/*=========================================================
    Controls
=========================================================*/

#analysisOutput {
    background: #111;
    padding: 10px;
    height: 200px;
    overflow: auto;
    border-radius: 4px;
}

button {
    margin: 5px 0;
    padding: 8px;
    width: 100%;
    background: #3a3a3a;
    color: #ddd;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
}

button:hover:not(:disabled) {
    background: #444;
}

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

input[type="file"] {
    margin-top: 10px;
}

/*=========================================================
    About Dialog
=========================================================*/

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.70);

    display: none;
    align-items: center;
    justify-content: center;

    z-index: 999;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 20px;
    width: 420px;
    max-width: 90vw;
    color: #ddd;
}

.about-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.about-body {
    font-size: 14px;
}

.about-footer {
    margin-top: 15px;
    text-align: right;
}

hr {
    border: 0;
    border-top: 1px solid #444;
}

.embedded-tools-box {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
}

.embedded-tools-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.embedded-tools-text {
    opacity: 0.8;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.embedded-tools-actions {
    display: flex;
    gap: 10px;
}

.footer-minimal {
    margin-top: 20px;
    padding: 12px 0;
    text-align: center;
    font-size: 0.85em;
    opacity: 0.7;
}

.footer-minimal a {
    color: inherit;
    text-decoration: none;
}

.footer-minimal a:hover {
    text-decoration: underline;
}

/* Web Tools */
.tool-button {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
    border: 1px solid transparent;
    transition: 0.15s ease;
}

.tool-button.primary {
    background: #2d7dff;
    color: white;
}

.tool-button.primary:hover {
    background: #1f66d6;
}

.tool-button.secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: inherit;
}

.tool-button.secondary:hover {
    border-color: rgba(255,255,255,0.4);
}

/*=========================================================
    Responsive Layout
=========================================================*/

@media (max-width: 900px) {

    #main {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 700px) {

    #topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .branding {
        width: 100%;
    }

    .menu {
        width: 100%;
    }

    .menu button {
        width: 100%;
    }

}