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

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.user-box {
    padding: 8px 18px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}
.user-box:hover {
    background: #e8e8e8;
    transform: translateY(-1px);
}

.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}
.modal-mask.show { display: flex; }

.modal {
    position: relative;
    width: 420px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: fadeIn .25s ease;
}
@keyframes fadeIn {
    from { transform: scale(.9); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    transition: all .2s;
    padding: 0;
    z-index: 1;
}
.close-btn:hover { background: #e0e0e0; color: #000; }

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a73e8;
    margin-bottom: 18px;
    padding-right: 40px;
}

.modal label {
    display: block;
    font-size: 13px;
    color: #666;
    margin: 12px 0 6px;
    font-weight: 500;
}

.drop-area {
    padding: 26px 16px;
    background: #f8fbff;
    border: 2px dashed #bcd4ff;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    font-size: 14px;
    color: #7a8ba0;
}
.drop-area:hover, .drop-area.active {
    background: #eaf3ff;
    border-color: #1a73e8;
    color: #1a73e8;
}

.glass-btn {
    width: 100%;
    padding: 12px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.glass-btn:hover:not(:disabled) {
    background: #1557b0;
    box-shadow: 0 4px 12px rgba(26, 115, 232, .35);
}
.glass-btn:disabled { background: #ccc; cursor: not-allowed; }

.progress-wrap {
    margin-top: 14px;
    display: none;
}
.progress-wrap.show { display: block; }
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e8ecf2;
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea, #5eb3ff);
    border-radius: 4px;
    transition: width .2s ease;
}
.progress-text {
    margin-top: 6px;
    text-align: center;
    font-size: 13px;
    color: #667eea;
    font-weight: 600;
}

.map-thumb-wrap {
    position: relative;
    width: 100%;
    height: 180px;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    background: #eef1f5;
}
.map-thumb-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #eef1f5 0%, #e2e6ec 50%, #eef1f5 100%);
    background-size: 200% 100%;
    animation: skeleton 1.4s ease-in-out infinite;
    z-index: 1;
}
.map-thumb-wrap.loaded::before { display: none; }
@keyframes skeleton {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.map-thumb-wrap img {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}
.map-thumb-wrap .no-thumb {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #999;
    font-size: 15px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    z-index: 3;
}

.retry-btn {
    padding: 10px 24px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.retry-btn:hover {
    background: #5568d3;
    box-shadow: 0 4px 12px rgba(102, 126, 234, .35);
}

.mdt-red      { color: #ff6b6b; }
.mdt-green    { color: #84f491; }
.mdt-blue     { color: #6bb6ff; }
.mdt-yellow   { color: #ffd37f; }
.mdt-orange   { color: #ffa664; }
.mdt-purple   { color: #bf92f9; }
.mdt-accent   { color: #ffd37f; font-weight: 500; }
.mdt-gray     { color: #8e8e8e; }
.mdt-white    { color: #ffffff; }
.mdt-lightgray{ color: #d0d0d0; }
.mdt-gold     { color: #e1b664; }
.mdt-pink     { color: #ff92f9; }
.mdt-cyan     { color: #6bf4f4; }
.mdt-warning  { color: #ffa664; font-weight: 500; }
.mdt-success  { color: #84f491; font-weight: 500; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%) translateY(100px);
    background: rgba(30,30,40,.9);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: all .3s;
    pointer-events: none;
    z-index: 10002;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 44px;
    height: 44px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 20px;
    z-index: 99;
    transition: all .2s;
}
.back-to-top.show { display: flex; }
.back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, .3);
}

@media (max-width: 768px) {
    .user-box { font-size: 13px; padding: 6px 14px; }
    .back-to-top { right: 16px; bottom: 20px; }
    .map-thumb-wrap { height: 150px; }
}