.ct-app {
  --ct-bg: #f4f4f2;
  --ct-card: #fff;
  --ct-text: #171717;
  --ct-muted: #6d6d68;
  --ct-line: #deded9;
  --ct-accent: #8a6527;
  --ct-danger: #ad3442;
  --ct-success: #23764d;
  width: min(100%, 720px);
  margin: 24px auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ct-line);
  border-radius: 12px;
  color: var(--ct-text);
  background: var(--ct-card);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .07);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
}

.ct-app *, .ct-app *::before, .ct-app *::after { box-sizing: border-box; }
.ct-app [hidden] { display: none !important; }
.ct-app button, .ct-app input { font: inherit; }

.ct-header { padding: 21px 22px 14px; }
.ct-brand-row { display: flex; align-items: center; gap: 9px; }
.ct-title { margin: 0 !important; padding: 0 !important; color: var(--ct-text) !important; font-size: 23px !important; font-weight: 900 !important; letter-spacing: .08em; line-height: 1.25 !important; }
.ct-subtitle { margin: 2px 0 0 !important; color: var(--ct-muted); font-size: 11px; }
.ct-pro-badge { padding: 3px 7px; border-radius: 999px; color: #fff; background: var(--ct-accent); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.ct-intro { margin: 0 22px 16px !important; padding: 10px 12px; border-left: 3px solid var(--ct-accent); color: #4f4739; background: #f8f5ed; font-size: 12px; }

.ct-engines { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 0 22px 16px; padding: 0; border: 0; }
.ct-engines legend { grid-column: 1 / -1; width: 100%; margin-bottom: 1px; color: var(--ct-muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.ct-engines label { position: relative; margin: 0; }
.ct-engines input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ct-engines span { display: block; padding: 8px 4px; border: 1px solid var(--ct-line); border-radius: 7px; color: var(--ct-muted); background: #fff; text-align: center; font-size: 11px; font-weight: 800; cursor: pointer; }
.ct-engines input:checked + span { border-color: #222; color: #fff; background: #222; }
.ct-engines input:focus-visible + span { outline: 2px solid var(--ct-accent); outline-offset: 2px; }

.ct-tabs { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0 22px; border-bottom: 1px solid var(--ct-line); }
.ct-tab { padding: 11px 5px; border: 0; border-bottom: 2px solid transparent; color: var(--ct-muted); background: transparent; font-size: 13px; font-weight: 800; cursor: pointer; }
.ct-tab.is-active { border-bottom-color: var(--ct-accent); color: var(--ct-text); }
.ct-tab:focus-visible { outline: 2px solid var(--ct-accent); outline-offset: -2px; }

.ct-panel { padding: 18px 22px 10px; background: var(--ct-bg); }
.ct-dropzone { display: grid; place-items: center; min-height: 180px; margin: 0; padding: 22px; border: 1px dashed #aaa79f; border-radius: 9px; background: #fff; cursor: pointer; text-align: center; }
.ct-dropzone.is-dragover { border-color: var(--ct-accent); background: #fbf8f1; }
.ct-dropzone > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ct-plus { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 7px; border: 1px solid var(--ct-line); border-radius: 50%; color: var(--ct-accent); font-size: 21px; }
.ct-dropzone > strong { font-size: 15px; font-weight: 900; }
.ct-dropzone > small { color: var(--ct-muted); font-size: 11px; }
.ct-preview { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; }
.ct-preview img { width: 112px; height: 112px; flex: 0 0 auto; border-radius: 7px; object-fit: cover; background: #eee; }
.ct-preview > div { min-width: 0; }
.ct-preview strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-preview small { display: block; margin-top: 4px; color: var(--ct-muted); }
.ct-main-button { width: 100%; margin-top: 10px; padding: 12px 16px; border: 0; border-radius: 7px; color: #fff; background: #222; font-weight: 900; cursor: pointer; }
.ct-main-button:hover:not(:disabled) { background: #000; }
.ct-main-button:disabled { cursor: not-allowed; opacity: .42; }
.ct-note { margin: 7px 0 0 !important; color: var(--ct-muted); font-size: 10px; }
.ct-input-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 800; }
.ct-url-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.ct-url-row input { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--ct-line); border-radius: 7px; outline: 0; color: var(--ct-text); background: #fff; }
.ct-url-row input:focus { border-color: var(--ct-accent); box-shadow: 0 0 0 2px rgba(138, 101, 39, .12); }
.ct-url-row .ct-main-button { width: auto; margin: 0; white-space: nowrap; }
.ct-status { min-height: 24px; margin: 0 !important; padding: 6px 22px 10px; color: var(--ct-muted); background: var(--ct-bg); font-size: 11px; }
.ct-status.is-error { color: var(--ct-danger); }
.ct-status.is-success { color: var(--ct-success); }

.ct-ad { position: relative; margin: 14px 22px; padding: 12px; overflow: hidden; border: 1px solid var(--ct-line); border-radius: 8px; background: #fafaf8; text-align: center; }
.ct-ad-label { display: block; margin-bottom: 6px; color: #93938e; font-size: 8px; letter-spacing: .14em; }
.ct-ad-code { min-width: 0; }
.ct-ad-code img, .ct-ad-code iframe { max-width: 100%; }
.ct-ad-placeholder { display: grid; place-items: center; min-height: 76px; border-style: dashed; color: #8c8c87; }
.ct-ad-placeholder span { font-size: 10px; font-weight: 900; letter-spacing: .09em; }
.ct-ad-placeholder small { font-size: 9px; }

.ct-pro-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 16px 22px; padding: 16px; border: 1px solid #d6c49d; border-radius: 9px; background: #f8f5ed; }
.ct-pro-cta strong { font-size: 14px; }
.ct-pro-cta p { margin: 3px 0 0 !important; color: #655b49; font-size: 11px; }
.ct-pro-cta a { flex: 0 0 auto; padding: 9px 13px; border-radius: 6px; color: #fff !important; background: var(--ct-accent); font-size: 11px; font-weight: 900; text-decoration: none !important; }
.ct-pro-cta a:hover { filter: brightness(.92); }

.ct-footer { padding: 13px 22px 16px; border-top: 1px solid var(--ct-line); color: var(--ct-muted); background: #fff; font-size: 9px; }
.ct-is-pro { border-top: 3px solid var(--ct-accent); }

@media (max-width: 560px) {
  .ct-app { margin: 16px auto; border-radius: 9px; }
  .ct-header { padding: 18px 16px 12px; }
  .ct-intro, .ct-engines, .ct-tabs, .ct-ad, .ct-pro-cta { margin-left: 16px !important; margin-right: 16px !important; }
  .ct-panel { padding: 15px 16px 9px; }
  .ct-status { padding-left: 16px; padding-right: 16px; }
  .ct-url-row { grid-template-columns: 1fr; }
  .ct-url-row .ct-main-button { width: 100%; }
  .ct-preview img { width: 90px; height: 90px; }
  .ct-pro-cta { display: block; }
  .ct-pro-cta a { display: block; margin-top: 11px; text-align: center; }
  .ct-footer { padding-left: 16px; padding-right: 16px; }
}

