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

body {
    font-family: "Kanit", serif !important;
    background: #fff;
    min-height: 100vh;
    padding: 2rem 1rem;
}


.container {
    max-width: 800px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
    align-items: center;
}

.header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #000;
    letter-spacing: 0.06em;
}

.header p {
    font-size: 0.88rem;
    color: #737373;
    margin-top: 0.4rem;
    letter-spacing: 0.08em;
}

.logo-head {
    width: 100%;
    text-align: center;
}

.logo-head img {
    width: 180px;
}

.bar {
    height: 3px;
    background: linear-gradient(90deg, #483c41, rgba(72, 60, 65, 0.4), #483c41);
    border-radius: 2px;
    margin: 0.8rem auto;
    width: 90px;
}

.card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(72, 60, 65, 0.1);
    padding: 8px;
    margin-bottom: 1.2rem;
    box-shadow: 0 2px 12px rgba(72, 60, 65, 0.08);
}

.drop-zone {
    border: 2px dashed rgba(169, 0, 0, 0.3);
    border-radius: 16px;
    padding: 2.4rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(121, 25, 25, 0.05);
}

.drop-zone.drag-over {
    border-color: #000;
    background: rgba(72, 60, 65, 0.1);
}

.drop-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 1rem;
    background: #D00003;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-text {
    font-size: 1rem;
    color: #000000;
    margin-bottom: 0.3rem;
}

.drop-sub {
    font-size: 0.78rem;
    color: rgba(51, 42, 46, 0.5);
}

.browse-btn {
    margin-top: 1rem;
    display: inline-block;
    font-family: "Kanit", serif !important;
    padding: 0.48rem 1.4rem;
    background: #D00003;
    color: white;
    border-radius: 30px;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.browse-btn:hover {
    background: #8f0002;
}

#fileInput {
    display: none;
}

.srow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(72, 60, 65, 0.1);
}

.card .srow {
    padding: 12px;
}

.srow:last-child {
    border-bottom: none;
}

.slabel {
    font-size: 0.85rem;
    color: #000000;
    font-weight: 500;
}

.ssub {
    font-size: 0.74rem;
    color: rgba(72, 60, 65, 0.5);
    margin-top: 2px;
}

select {
    font-family: "Kanit", serif !important;
    border: 1px solid rgba(72, 60, 65, 0.25);
    border-radius: 8px;
    padding: 8px 35px 8px 12px;
    font-size: 12px;
    background: rgba(72, 60, 65, 0.06);
    color: #2f2f2f;
    cursor: pointer;

    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23483c41' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
}

select::-ms-expand {
    display: none;
}


input[type=range] {
    accent-color: #361e1e;
    cursor: pointer;
}

input[type=text] {
    width: 150px;
    border-radius: 8px;
    border: 1px solid rgba(72, 60, 65, 0.25);
    padding: 8px 12px 8px 12px;
    font-size: 14px;
    background: rgba(72, 60, 65, 0.06);
    color: #2f2f2f;
}

.qwrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qval {
    font-size: 0.83rem;
    color: #361e1e;
    font-weight: 600;
    min-width: 38px;
    text-align: right;
}

.ph {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
    margin-top: 0.9rem;
    padding: 0 8px;
}

.stitle {
    font-size: 0.77rem;
    color: #000;
    text-transform: uppercase;
}

.badge {
    display: inline-block;
    background: #ffcdce;
    color: rgb(150, 0, 0);
    font-size: 0.74rem;
    padding: 2px 10px;
    border-radius: 20px;
    margin-left: 8px;
}

.sort-btn {
    font-size: 0.74rem;
    border: none;
    padding: 0.26rem 0.85rem;
    border-radius: 20px;
    background: #D00003;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.18s;
}

.sort-btn:hover {
    background: #990003;
}

.notice {
    font-size: 0.75rem;
    color: #483c41;
    background: rgba(72, 60, 65, 0.08);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    margin-bottom: 0.8rem;
    border: 1px solid rgba(72, 60, 65, 0.18);
    display: none;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.pitem {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1.5px solid rgba(72, 60, 65, 0.2);
    aspect-ratio: 3/4;
    background: rgba(72, 60, 65, 0.06);
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s;
    user-select: none;
}

.pitem:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(72, 60, 65, 0.2);
}

.pitem.dragging {
    opacity: 0.38;
    transform: scale(0.95);
}

.pitem.dtarget {
    border-color: #483c41;
    box-shadow: 0 0 0 3px rgba(72, 60, 65, 0.2);
}

.pitem img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pnum {
    position: absolute;
    top: 4px;
    left: 5px;
    background: rgba(72, 60, 65, 0.72);
    color: white;
    font-size: 0.66rem;
    padding: 1px 6px;
    border-radius: 10px;
    pointer-events: none;
}

.pname {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(87, 0, 4, 0.62);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.59rem;
    padding: 3px 5px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    font-family: monospace;
}

.rbtn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(72, 60, 65, 0.75);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 0.68rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.rbtn:hover {
    background: rgba(72, 60, 65, 1);
}

.tips {
    display: flex;
    gap: 10px;
    margin-top: 0.8rem;
}

.tip {
    flex: 1;
    background: rgba(72, 60, 65, 0.05);
    border-radius: 10px;
    padding: 0.65rem;
    font-size: 0.74rem;
    color: rgba(72, 60, 65, 0.5);
    text-align: center;
    border: 1px solid rgba(72, 60, 65, 0.1);
}

.tip strong {
    color: #000;
    display: block;
    margin-bottom: 3px;
    font-size: 0.76rem;
}

.cvt-btn {
    width: 100%;
    padding: 0.95rem;
    background: #D00003;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    font-family: "Kanit", serif;
}

.cvt-btn:hover:not(:disabled) {
    background: #8a0002;
    transform: translateY(-1px);
}

.cvt-btn:disabled {
    opacity: 0.35;
    cursor: default;
    transform: none;
}

.prog {
    margin-top: 1rem;
    display: none;
}

.pbg {
    height: 6px;
    background: rgba(72, 60, 65, 0.12);
    border-radius: 3px;
    overflow: hidden;
}

.pfill {
    height: 100%;
    background: #483c41;
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s;
}

.ptxt {
    font-size: 0.8rem;
    color: rgba(72, 60, 65, 0.6);
    margin-top: 0.5rem;
    text-align: center;
}

/* ===== Footer ===== */
.site-footer {
    margin-top: 2rem;
    padding-bottom: 1.5rem;
    border-top: 1px solid rgba(72, 60, 65, 0.1);
    padding-top: 1.5rem;
}

.footer-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    background: rgba(208, 0, 3, 0.04);
    border: 1px solid rgba(208, 0, 3, 0.12);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.2rem;
}

.footer-disclaimer-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.footer-disclaimer strong {
    display: block;
    font-size: 0.82rem;
    color: #2a0001;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.footer-disclaimer p {
    font-size: 0.75rem;
    color: rgba(72, 60, 65, 0.65);
    line-height: 1.6;
    letter-spacing: 0.01em;
}

.footer-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-contact-label {
    font-size: 0.75rem;
    color: rgba(72, 60, 65, 0.45);
}

.footer-email {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #D00003;
    text-decoration: none;
    border: 1px solid rgba(208, 0, 3, 0.2);
    border-radius: 20px;
    padding: 0.28rem 0.8rem;
    transition: background 0.18s, color 0.18s;
    font-weight: 500;
}

.footer-email:hover {
    background: #D00003;
    color: #fff;
}

.footer-bottom {
    text-align: center;
    font-size: 0.7rem;
    color: rgba(72, 60, 65, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.footer-sep {
    opacity: 0.4;
}