html.ctm-open { overflow: hidden; }
.ctm-dialog {
  width: min(980px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px);
  margin: auto; padding: 0; border: 0; background: transparent; overflow: visible; color: var(--g-text, #0E1A2B);
}
.ctm-dialog::backdrop { background: rgba(14, 26, 43, 0.42); backdrop-filter: blur(3px); }
.ctm-dialog[open] { animation: ctm-in .18s ease-out; }
@keyframes ctm-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }

.ctm {
  position: relative; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr);
  gap: 48px; padding: 44px 48px; background: #fff; border-radius: var(--g-r-card, 18px); text-align: left;
  font-family: var(--g-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif);
  color: var(--g-text, #0E1A2B);
  box-shadow: 0 0 0 1px var(--g-line-soft, rgba(14, 26, 43, 0.08)), 0 1px 2px rgba(14, 26, 43, 0.05);
}
.ctm-dialog .ctm {
  max-height: calc(100dvh - 32px); overflow: auto;
  box-shadow: 0 0 0 1px var(--g-line-soft, rgba(14, 26, 43, 0.08)), 0 28px 70px -28px rgba(14, 26, 43, 0.45);
}
main.ctm-host { display: block; }
.ctm-host .ctm { max-width: 1040px; margin: 0 auto; }

.ctm-x {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--g-muted, rgba(14, 26, 43, 0.74)); cursor: pointer;
}
.ctm-x:hover { background: rgba(14, 26, 43, 0.06); color: var(--g-text, #0E1A2B); }
.ctm-x:focus-visible { outline: none; box-shadow: var(--g-focus, 0 0 0 4px rgba(61, 189, 151, 0.24)); }
.ctm-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ctm-h { margin: 2px 0 14px; font-size: clamp(26px, 2.6vw, 34px); font-weight: 600; line-height: 1.1; letter-spacing: -0.024em; }
.ctm-sub { margin: 0 0 30px; max-width: 38ch; font-size: 15.5px; line-height: 1.6; color: var(--g-muted, rgba(14, 26, 43, 0.74)); }
.ctm-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 16px; }
.ctm-list li { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500; }
.ctm-ico {
  width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: var(--g-t700, #15775C); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.ctm-mail { margin: 34px 0 0; font-size: 13.2px; line-height: 1.5; color: var(--g-dim, rgba(14, 26, 43, 0.63)); }
.ctm-mail a { color: var(--g-t700, #15775C); text-decoration: underline; text-underline-offset: 2px; }
.ctm-form { display: grid; gap: 16px; align-content: start; }
.ctm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ctm-f { display: grid; gap: 7px; font-size: 13.2px; font-weight: 500; color: var(--g-muted, rgba(14, 26, 43, 0.74)); }
.ctm-f :is(input, select, textarea) {
  box-sizing: border-box; width: 100%; height: 42px; padding: 0 13px; margin: 0;
  border: 1px solid var(--g-line, rgba(14, 26, 43, 0.16)); border-radius: var(--g-r-ctl, 12px); background: #fff;
  font: inherit; font-size: 14.3px; font-weight: 400; color: var(--g-text, #0E1A2B);
  box-shadow: var(--g-sh-1, 0 1px 2px rgba(14, 26, 43, 0.05));
}
.ctm-f textarea { height: auto; min-height: 124px; padding: 11px 13px; line-height: 1.5; resize: vertical; }
.ctm-f select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E1A2B' stroke-opacity='.6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 18px;
}
.ctm-f ::placeholder { color: rgba(14, 26, 43, 0.4); }
.ctm-f :is(input, select, textarea):focus {
  outline: none; border-color: var(--g-t500, #3DBD97); box-shadow: var(--g-focus, 0 0 0 4px rgba(61, 189, 151, 0.24));
}
.ctm-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.ctm-submit {
  height: 42px; padding: 0 22px; border: 1px solid rgba(16, 90, 70, 0.18); border-radius: var(--g-r-ctl, 12px);
  background: var(--g-t500, #3DBD97); color: var(--g-text, #0E1A2B); font: inherit; font-size: 14.3px; font-weight: 500;
  cursor: pointer; transition: background-color .16s ease, transform .12s ease;
  box-shadow: var(--g-sh-pri, inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(16, 90, 70, 0.18), 0 6px 16px -8px rgba(21, 119, 92, 0.75));
}
.ctm-submit:hover { background: var(--g-t500-hover, #38AF8C); }
.ctm-submit:active { background: var(--g-t500-press, #35A986); transform: translateY(1px); }
.ctm-submit:focus-visible { outline: none; box-shadow: var(--g-focus, 0 0 0 4px rgba(61, 189, 151, 0.24)); }
.ctm-submit:disabled { opacity: .6; cursor: default; transform: none; }
.ctm-req { font-size: 12.65px; color: var(--g-dim, rgba(14, 26, 43, 0.63)); }
.ctm-status { font-size: 13.2px; line-height: 1.5; }
.ctm-status:empty { display: none; }
.ctm-status[data-kind="error"] { color: #9A2A1E; }
.ctm .hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.ctm-done { display: grid; align-content: center; justify-items: start; gap: 10px; min-height: 280px; }
.ctm-done-h { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.018em; }
.ctm-done p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--g-muted, rgba(14, 26, 43, 0.74)); }

@media (max-width: 760px) {
  .ctm { grid-template-columns: 1fr; gap: 28px; padding: 30px 20px 24px; }
  .ctm-row { grid-template-columns: 1fr; }
  .ctm-sub { margin-bottom: 20px; }
  .ctm-list { gap: 12px; }
  .ctm-mail { margin-top: 20px; }
}
@media (prefers-reduced-motion: reduce) { .ctm-dialog[open] { animation: none; } }
