.tct-app {
    width: 100%;
    max-width: 720px;
    margin: 24px auto;
    padding: 16px;
    border: 2px solid #ffbdc6;
    border-radius: 16px;
    background: #fff8f9;
    box-sizing: border-box;
}

.tct-app,
.tct-app * {
    box-sizing: border-box;
}

.tct-toolbar,
.tct-footer,
.tct-crop-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tct-toolbar { margin-bottom: 14px; }
.tct-footer { margin-top: 14px; }

.tct-button {
    appearance: none;
    border: 0;
    border-radius: 10px;
    min-height: 46px;
    padding: 10px 16px;
    background: #ececec;
    color: #333;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    touch-action: manipulation;
}

.tct-button-primary {
    background: #f36f7f;
    color: #fff;
}

.tct-file { display: none !important; }

.tct-canvas-shell,
.tct-crop-stage-shell {
    width: 100%;
    overflow: hidden;
    border: 2px solid #e7a3ad;
    border-radius: 10px;
    background: #fff;
    line-height: 0;
}

.tct-canvas,
.tct-crop-canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    cursor: grab;
}

.tct-controls {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.tct-control-row,
.tct-crop-scale-row {
    display: grid;
    grid-template-columns: minmax(130px, 180px) 1fr;
    gap: 12px;
    align-items: center;
    font-size: 14px;
}

.tct-scale,
.tct-crop-scale { width: 100%; }

.tct-bg {
    width: 54px;
    height: 38px;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
}

.tct-help,
.tct-crop-guide {
    margin: 12px 0 0;
    color: #555;
    font-size: 14px;
    line-height: 1.7;
}

.tct-message {
    min-height: 1.5em;
    margin: 10px 0 0;
    text-align: center;
    color: #555;
    font-size: 14px;
}

.tct-crop-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.68);
}

.tct-crop-modal.is-open { display: flex; }

.tct-crop-dialog {
    width: min(620px, 100%);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 16px;
    border-radius: 16px;
    background: #fff8f9;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.tct-crop-title {
    margin: 0;
    text-align: center;
    font-size: 20px;
}

.tct-crop-guide { margin: 8px 0 12px; }
.tct-crop-scale-row { margin-top: 14px; }
.tct-crop-buttons { margin-top: 14px; }

body.tct-modal-open { overflow: hidden; }

@media (max-width: 520px) {
    .tct-app {
        padding: 12px;
        border-radius: 12px;
    }

    .tct-toolbar {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .tct-toolbar .tct-button,
    .tct-footer .tct-button,
    .tct-crop-buttons .tct-button {
        width: 100%;
    }

    .tct-control-row,
    .tct-crop-scale-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .tct-crop-modal { padding: 8px; }
    .tct-crop-dialog { padding: 12px; border-radius: 12px; }
}
.tct-crop-canvas { cursor: crosshair; }
