.txpt-app {
    --txpt-blue: #287ec6;
    --txpt-blue-dark: #155b9a;
    --txpt-pale: #eef8ff;
    --txpt-line: #b9dff5;
    --txpt-text: #263b4a;
    --txpt-muted: #67808f;
    box-sizing: border-box;
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 18px 12px 40px;
    color: var(--txpt-text);
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    line-height: 1.65;
}

.txpt-app *, .txpt-app *::before, .txpt-app *::after { box-sizing: border-box; }
.txpt-app button, .txpt-app textarea, .txpt-app input { font: inherit; }

.txpt-intro { text-align: center; padding: 12px 8px 22px; }
.txpt-intro h1 { margin: 8px 0 4px; color: var(--txpt-blue-dark); font-size: clamp(26px, 7vw, 38px); line-height: 1.25; }
.txpt-intro p { margin: 0; color: var(--txpt-muted); font-size: 14px; }
.txpt-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: #fff2c9; color: #826000; font-size: 12px; font-weight: 700; }

.txpt-card { margin: 0 0 16px; padding: 18px 15px; border: 1.5px solid var(--txpt-line); border-radius: 22px; background: #fff; box-shadow: 0 7px 24px rgba(42, 112, 155, .07); }
.txpt-step-title { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 16px; }
.txpt-step-title > span { display: grid; flex: 0 0 32px; height: 32px; place-items: center; border-radius: 50%; background: var(--txpt-blue); color: #fff; font-weight: 800; }
.txpt-step-title h2 { margin: 0; color: var(--txpt-blue-dark); font-size: 19px; line-height: 1.4; }
.txpt-step-title p { margin: 2px 0 0; color: var(--txpt-muted); font-size: 12px; }

.txpt-service-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; padding: 5px; border-radius: 15px; background: var(--txpt-pale); }
.txpt-service-switch button { min-height: 44px; border: 0; border-radius: 11px; background: transparent; color: var(--txpt-blue-dark); font-weight: 700; cursor: pointer; }
.txpt-service-switch button.is-active { background: #fff; box-shadow: 0 3px 11px rgba(26, 95, 139, .12); }

.txpt-upload { display: flex; min-height: 150px; flex-direction: column; align-items: center; justify-content: center; padding: 20px; border: 2px dashed #8fc9eb; border-radius: 18px; background: #f8fcff; color: var(--txpt-blue-dark); text-align: center; cursor: pointer; }
.txpt-upload:hover { background: var(--txpt-pale); }
.txpt-upload input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.txpt-upload-icon { display: grid; width: 38px; height: 38px; margin-bottom: 7px; place-items: center; border-radius: 50%; background: var(--txpt-blue); color: #fff; font-size: 25px; line-height: 1; }
.txpt-upload small { color: var(--txpt-muted); }
.txpt-image-preview { position: relative; margin-top: 12px; overflow: hidden; border-radius: 16px; background: #eaf3f8; }
.txpt-image-preview img { display: block; width: 100%; max-height: 520px; object-fit: contain; }
.txpt-image-preview button { position: absolute; right: 10px; bottom: 10px; padding: 7px 12px; border: 0; border-radius: 999px; background: rgba(18, 46, 62, .82); color: #fff; font-size: 12px; cursor: pointer; }
.txpt-future-note { display: grid; gap: 2px; margin-top: 12px; padding: 11px 13px; border-radius: 13px; background: #fff9df; color: #735f1c; font-size: 12px; }

.txpt-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.txpt-type-grid button, .txpt-chip-list button, .txpt-rewrite-grid button { min-height: 44px; padding: 9px 11px; border: 1.5px solid var(--txpt-line); border-radius: 13px; background: #fff; color: var(--txpt-blue-dark); font-weight: 700; cursor: pointer; }
.txpt-type-grid button.is-active, .txpt-chip-list button.is-active { border-color: var(--txpt-blue); background: var(--txpt-blue); color: #fff; }

.txpt-phrase-section + .txpt-phrase-section { margin-top: 19px; }
.txpt-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.txpt-label-row strong { color: var(--txpt-blue-dark); }
.txpt-label-row button { padding: 3px 0; border: 0; background: transparent; color: var(--txpt-muted); font-size: 12px; cursor: pointer; }
.txpt-chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.txpt-chip-list button { min-height: 38px; padding: 7px 11px; font-size: 13px; }

.txpt-manage-toggle { width: 100%; min-height: 46px; margin-top: 20px; border: 1.5px solid var(--txpt-line); border-radius: 13px; background: var(--txpt-pale); color: var(--txpt-blue-dark); font-weight: 800; cursor: pointer; }
.txpt-phrase-manager { margin-top: 12px; padding: 15px 13px; border: 1.5px solid var(--txpt-line); border-radius: 16px; background: #f9fcff; }
.txpt-manager-head { display: grid; gap: 1px; margin-bottom: 15px; color: var(--txpt-blue-dark); }
.txpt-manager-head span, .txpt-manager-block small { color: var(--txpt-muted); font-size: 12px; font-weight: 400; }
.txpt-manager-block + .txpt-manager-block { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--txpt-line); }
.txpt-manager-block > label { display: block; color: var(--txpt-blue-dark); font-weight: 800; }
.txpt-add-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 7px; margin-top: 7px; }
.txpt-add-row input { min-width: 0; height: 44px; padding: 8px 11px; border: 1.5px solid var(--txpt-line); border-radius: 11px; background: #fff; color: var(--txpt-text); outline: none; }
.txpt-add-row input:focus { border-color: var(--txpt-blue); box-shadow: 0 0 0 3px rgba(40, 126, 198, .12); }
.txpt-add-row button { border: 0; border-radius: 11px; background: var(--txpt-blue); color: #fff; font-weight: 800; cursor: pointer; }
.txpt-saved-phrases { display: grid; gap: 6px; margin-top: 10px; }
.txpt-saved-item { display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; gap: 7px; min-height: 38px; padding: 5px 5px 5px 10px; border-radius: 10px; background: #fff; color: var(--txpt-text); font-size: 12px; }
.txpt-saved-item button { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 50%; background: #fff0f0; color: #b83d3d; font-size: 18px; cursor: pointer; }
.txpt-empty-phrases { margin: 4px 0; color: var(--txpt-muted); font-size: 12px; }
.txpt-restore-phrases { display: block; margin: 20px auto 0; padding: 5px 8px; border: 0; background: transparent; color: var(--txpt-muted); font-size: 12px; text-decoration: underline; cursor: pointer; }

.txpt-field { display: grid; gap: 7px; margin-top: 20px; color: var(--txpt-blue-dark); font-weight: 700; }
.txpt-field textarea { width: 100%; padding: 12px 13px; resize: vertical; border: 1.5px solid var(--txpt-line); border-radius: 13px; background: #fbfdff; color: var(--txpt-text); font-weight: 400; outline: none; }
.txpt-field textarea:focus { border-color: var(--txpt-blue); box-shadow: 0 0 0 3px rgba(40, 126, 198, .12); }
.txpt-check { display: flex; align-items: center; gap: 9px; margin-top: 14px; font-size: 14px; cursor: pointer; }
.txpt-check input { width: 19px; height: 19px; accent-color: var(--txpt-blue); }

.txpt-rewrite-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.txpt-rewrite-grid button { background: var(--txpt-pale); }
.txpt-rewrite-grid button:active { transform: translateY(1px); }
.txpt-status { min-height: 24px; margin: 8px 0 0; color: #287149; font-size: 12px; }
.txpt-final-field { margin-top: 8px; }
.txpt-final-field textarea { min-height: 170px; background: #fff; font-size: 16px; }
.txpt-count-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--txpt-muted); font-size: 12px; }
.txpt-count-row strong { color: var(--txpt-blue-dark); }
.txpt-copy-button { width: 100%; min-height: 54px; margin-top: 17px; border: 0; border-radius: 999px; background: linear-gradient(135deg, #2e92d7, #196cad); color: #fff; font-size: 17px; font-weight: 800; box-shadow: 0 8px 18px rgba(29, 112, 172, .24); cursor: pointer; }
.txpt-copy-button.is-copied { background: #2e9c69; }
.txpt-x-link { display: block; margin-top: 10px; color: var(--txpt-blue-dark); font-size: 14px; font-weight: 700; text-align: center; text-decoration: none; }
.txpt-reset { display: block; margin: 22px auto 0; padding: 8px 14px; border: 0; background: transparent; color: var(--txpt-muted); font-size: 13px; text-decoration: underline; cursor: pointer; }

@media (min-width: 620px) {
    .txpt-app { padding-inline: 20px; }
    .txpt-card { padding: 24px; }
    .txpt-type-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .txpt-app *, .txpt-app *::before, .txpt-app *::after { scroll-behavior: auto !important; transition: none !important; }
}
