/* Tablet */
@media (max-width: 1024px) {
    .panel {
        width: 280px;
    }

    .hover-card-inner {
        min-width: 180px;
        padding: 18px 22px;
    }

    .hover-id {
        font-size: 24px;
    }
}

/* Mobile Landscape & Small Tablets */
@media (max-width: 768px) {
    .header {
        height: 48px;
        padding: 0 12px;
    }

    .logo-text {
        font-size: 11px;
    }

    .header-actions {
        gap: 4px;
    }

    .btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .btn span {
        display: none;
    }

    .main {
        flex-direction: column;
        height: calc(100vh - 48px);
        margin-top: 48px;
    }

    .viewer-wrap {
        flex: 1;
        min-height: 50vh;
        height: calc(100% - 60px);
    }

    .panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        max-height: 70vh;
        border-left: none;
        border-top: 1px solid var(--border);
        border-radius: 16px 16px 0 0;
        transform: translateY(calc(100% - 60px));
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 400;
    }

    .panel.expanded {
        transform: translateY(0);
    }

    /* Panel handle - hidden on desktop */
    .panel-handle {
        display: flex !important;
        justify-content: center;
        align-items: center;
        padding: 12px;
        cursor: grab;
    }

    .panel-handle-bar {
        width: 40px;
        height: 4px;
        background: var(--border);
        border-radius: 2px;
    }

    .toolbar {
        left: 8px;
        bottom: 70px;
        top: auto;
        transform: none;
        flex-direction: row;
        padding: 6px;
        gap: 2px;
    }

    .tool-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .tool-btn[data-tooltip]:hover::after {
        display: none;
    }

    .tool-divider {
        width: 1px;
        height: 24px;
        margin: 0 2px;
    }

    .status-bar {
        bottom: 70px;
        right: 8px;
        left: auto;
        gap: 4px;
    }

    .status-badge {
        font-size: 10px;
        padding: 4px 8px;
    }

    .instructions {
        top: 8px;
        padding: 8px 12px;
        font-size: 11px;
        max-width: 90%;
    }

    .hover-card {
        display: none !important;
    }

    .panel-section {
        padding: 12px;
    }

    .panel-title {
        font-size: 9px;
        margin-bottom: 8px;
    }

    .form-input {
        padding: 8px 10px;
        font-size: 12px;
    }

    .hotspot-list {
        padding: 8px;
        max-height: 35vh;
    }

    .hotspot-item {
        padding: 10px;
    }

    /* Mobile info card when tapping hotspot */
    .mobile-info-card {
        display: flex !important;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .header {
        height: 44px;
    }

    .logo-mark {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .logo-text {
        font-size: 10px;
        letter-spacing: 0;
    }

    .btn {
        padding: 6px 8px;
        font-size: 10px;
    }

    .main {
        margin-top: 44px;
        height: calc(100vh - 44px);
    }

    .viewer-wrap {
        min-height: 45vh;
    }

    .panel {
        height: 50vh;
    }

    .toolbar {
        left: 4px;
        padding: 4px;
        border-radius: 8px;
    }

    .tool-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
        border-radius: 6px;
    }

    .tool-divider {
        margin: 2px 0;
    }

    .dropzone-content {
        padding: 20px;
    }

    .dropzone-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .dropzone-title {
        font-size: 16px;
    }

    .dropzone-subtitle {
        font-size: 12px;
    }

    .modal {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .tool-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .hotspot-action {
        min-height: 36px;
        font-size: 12px;
    }

    .btn {
        min-height: 40px;
    }

    .form-input {
        min-height: 44px;
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    select.form-input {
        font-size: 16px;
    }
}