.tfcp-wrap {
  --tfcp-bg: #0b1220;
  --tfcp-bg-2: #111a2d;
  --tfcp-panel: #0f182a;
  --tfcp-border: #263752;
  --tfcp-text: #dfe8fb;
  --tfcp-muted: #8ba0c3;
  --tfcp-accent: #22d3ee;
  --tfcp-accent-2: #0ea5e9;
  --tfcp-success: #34d399;
  --tfcp-error: #f87171;
  --tfcp-warn: #fbbf24;
  background: #0b1220;
  color: var(--tfcp-text);
  border: 1px solid var(--tfcp-border);
  border-radius: 10px;
  overflow: visible;
  font-family: "Segoe UI", Tahoma, sans-serif;
  height: auto;
  min-height: clamp(560px, calc(100vh - 180px), 720px);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.tfcp-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 42px;
  border-bottom: 1px solid var(--tfcp-border);
  background: #0a1120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.tfcp-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tfcp-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #122037;
  border: 1px solid #2b3d5d;
  font-size: 11px;
  font-weight: 700;
}

.tfcp-title {
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.tfcp-status {
  font-size: 11px;
  color: #9ec9ff;
  border: 1px solid #2f4569;
  background: #12233d;
  border-radius: 999px;
  padding: 2px 8px;
}

.tfcp-icon-btn,
.tfcp-btn {
  appearance: none;
  border: 1px solid #334869;
  background: #15243c;
  color: var(--tfcp-text);
  border-radius: 7px;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.tfcp-icon-btn:hover,
.tfcp-btn:hover,
.tfcp-btn:focus-visible,
.tfcp-icon-btn:focus-visible {
  border-color: #4a6796;
  background: #1a2e4c;
}

.tfcp-btn:disabled,
.tfcp-icon-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.tfcp-btn-primary {
  background: linear-gradient(135deg, var(--tfcp-accent-2), var(--tfcp-accent));
  border-color: transparent;
  color: #06213a;
}

.tfcp-btn-primary:hover,
.tfcp-btn-primary:focus-visible {
  filter: brightness(1.07);
}

.tfcp-run.is-loading .tfcp-run-label::after {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 7px;
  border-radius: 50%;
  border: 2px solid rgba(6, 33, 58, 0.3);
  border-top-color: #06213a;
  animation: tfcp-spin 0.7s linear infinite;
  vertical-align: -2px;
}

.tfcp-ico {
  font-size: 12px;
  line-height: 1;
}

.tfcp-toolbar {
  position: sticky;
  top: 42px;
  z-index: 39;
  border-bottom: 1px solid var(--tfcp-border);
  background: #0d1628;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow: visible;
  flex-wrap: wrap;
}

.tfcp-toolbar-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.tfcp-workmode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  border-bottom: 1px solid var(--tfcp-border);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(15, 23, 42, 0.42));
  color: var(--tfcp-text);
  flex-wrap: wrap;
}

.tfcp-workmode-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 240px;
  flex: 1 1 360px;
}

.tfcp-workmode-text strong {
  font-size: 12px;
  line-height: 1.3;
}

.tfcp-workmode-text span {
  color: var(--tfcp-muted);
  font-size: 12px;
  line-height: 1.35;
}

.tfcp-workmode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(125, 164, 255, 0.35);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  color: var(--tfcp-text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.tfcp-workmode-toggle input {
  width: 14px;
  height: 14px;
  accent-color: #3b82f6;
}

.tfcp-clear-web,
.tfcp-code-check,
.tfcp-find-open {
  white-space: nowrap;
}

.tfcp-findbar {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(120px, 1.2fr) auto auto auto auto 34px;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--tfcp-border);
  background: #0b1425;
}

.tfcp-findbar[hidden] {
  display: none !important;
}

.tfcp-findbar input {
  min-width: 0;
  height: 30px;
  border: 1px solid #304866;
  border-radius: 7px;
  background: #071120;
  color: var(--tfcp-text);
  padding: 0 9px;
  font-size: 12px;
  outline: none;
}

.tfcp-findbar input:focus {
  border-color: #4d8ed8;
  box-shadow: 0 0 0 2px rgba(77, 142, 216, 0.18);
}

.tfcp-find-close {
  width: 30px;
  justify-content: center;
  padding: 0;
  font-size: 18px;
}


.tfcp-main {
  min-height: 500px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

.tfcp-editors,
.tfcp-result {
  min-width: 0;
  min-height: 0;
}

.tfcp-editors {
  display: grid;
  grid-template-rows: 38px 1fr;
  border-right: 1px solid var(--tfcp-border);
  background: var(--tfcp-bg);
}

.tfcp-result {
  background: #0f1728;
  display: grid;
  grid-template-rows: auto 1fr;
}

.tfcp-tabs {
  height: 38px;
  border-bottom: 1px solid var(--tfcp-border);
  background: #101a2f;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
}

.tfcp-tab {
  appearance: none;
  border: 0;
  border-right: 1px solid #273954;
  background: transparent;
  color: var(--tfcp-muted);
  padding: 0 14px;
  font-size: 12px;
  font-family: Consolas, "Courier New", monospace;
  cursor: pointer;
}

.tfcp-tab.is-active {
  color: var(--tfcp-text);
  background: #182642;
}

.tfcp-panel {
  display: none;
  min-height: 0;
}

.tfcp-panel.is-active {
  display: block;
  height: 100%;
}

.tfcp-textarea {
  display: block;
}

.tfcp-panel .CodeMirror {
  height: 100%;
  min-height: 0;
  font-size: 13px;
  line-height: 1.45;
  font-family: Consolas, "Courier New", monospace;
}

.tfcp-panel .CodeMirror-gutters {
  background: #070f1c;
  border-right: 1px solid #2a3e5d;
}

.tfcp-panel .CodeMirror-linenumber {
  color: #6f88ad;
}

.tfcp-panel .CodeMirror-activeline-background {
  background: rgba(72, 114, 176, 0.28);
}

.tfcp-panel .CodeMirror-code {
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(2ch - 1px),
    rgba(117, 146, 191, 0.09) calc(2ch - 1px),
    rgba(117, 146, 191, 0.09) 2ch
  );
}

.tfcp-panel .CodeMirror-selected {
  background: rgba(55, 130, 255, 0.38) !important;
  color: #f5f9ff;
}

.tfcp-panel .CodeMirror-focused .CodeMirror-selected {
  background: rgba(64, 143, 255, 0.46) !important;
}

.tfcp-panel .CodeMirror-matchingbracket {
  color: #d5eeff !important;
  background: rgba(70, 177, 255, 0.24);
  border: 1px solid rgba(104, 203, 255, 0.65);
  border-radius: 3px;
  padding: 0 1px;
}

.tfcp-result-head {
  height: 38px;
  border-bottom: 1px solid var(--tfcp-border);
  background: #101a2f;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 650;
  color: var(--tfcp-muted);
  display: flex;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tfcp-preview,
.tfcp-python-output {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  margin: 0;
}

.tfcp-preview {
  background: #edf2f8;
  display: block;
}

.tfcp-preview[hidden] {
  display: none !important;
}

.tfcp-python-output {
  background: #0b1323;
  color: #d8e7ff;
  display: grid;
  grid-template-rows: 1fr;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.tfcp-python-output[hidden] {
  display: none !important;
}

.tfcp-python-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 18px;
  background: radial-gradient(circle at 50% 45%, rgba(31, 58, 102, 0.28), rgba(10, 18, 34, 0.97));
  z-index: 2;
}

.tfcp-python-state[hidden] {
  display: none !important;
}

.tfcp-python-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #1f3558;
  border-top-color: #4ec3ff;
  animation: tfcp-spin 0.85s linear infinite;
}

.tfcp-python-state-title {
  color: #e6f0ff;
  font-size: 15px;
  font-weight: 700;
}

.tfcp-python-state-sub {
  margin: 0;
  color: #9cb1cf;
  font-size: 12px;
}

.tfcp-python-state.is-error .tfcp-python-spinner {
  display: none;
}

.tfcp-python-state.is-idle .tfcp-python-spinner {
  display: none;
}

.tfcp-python-state.is-error .tfcp-python-state-title {
  color: #ff9d9d;
}

.tfcp-python-state.is-error {
  background: radial-gradient(circle at 50% 45%, rgba(132, 23, 23, 0.45), rgba(31, 7, 7, 0.96));
  box-shadow: inset 0 0 32px rgba(255, 71, 71, 0.2);
}

.tfcp-python-retry {
  margin-top: 2px;
}

.tfcp-python-log {
  margin: 0;
  width: 100%;
  height: 100%;
  padding: 12px;
  color: #d8e7ff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  overflow: auto;
  white-space: pre-wrap;
  box-sizing: border-box;
}

.tfcp-python-log[hidden] {
  display: none !important;
}

.tfcp-console-wrap {
  border-top: 1px solid var(--tfcp-border);
  background: #0a1222;
  display: grid;
  grid-template-rows: 36px 0fr;
  transition: grid-template-rows 0.2s ease;
}

.tfcp-console-wrap.is-open {
  grid-template-rows: 36px auto;
}

.tfcp-console-head {
  height: 36px;
  padding: 0 10px;
  background: #0f1a2e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--tfcp-border);
  font-size: 12px;
}

.tfcp-console-actions {
  display: flex;
  gap: 6px;
}

.tfcp-console-body {
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  padding: 0 10px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.tfcp-console-wrap.is-open .tfcp-console-body {
  min-height: 90px;
  max-height: 220px;
  overflow: auto;
  padding: 8px 10px;
}

.tfcp-console-empty {
  color: #7f96b8;
}

.tfcp-console-line {
  margin: 0 0 7px;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  white-space: pre-wrap;
  word-break: break-word;
}

.tfcp-console-log {
  color: #d4e3ff;
  background: linear-gradient(135deg, rgba(44, 70, 110, 0.34), rgba(20, 35, 61, 0.34));
  border-color: rgba(113, 149, 209, 0.36);
}

.tfcp-console-warn {
  color: #ffe48b;
  background: linear-gradient(135deg, rgba(255, 199, 0, 0.24), rgba(91, 59, 0, 0.35));
  border-color: rgba(255, 199, 0, 0.7);
  box-shadow: 0 0 16px rgba(255, 193, 7, 0.24), inset 0 0 0 1px rgba(255, 236, 161, 0.18);
  animation: tfcp-warn-glow 1.2s ease-in-out infinite alternate;
}

.tfcp-console-error {
  color: #ffadad;
  background: linear-gradient(135deg, rgba(255, 59, 59, 0.25), rgba(92, 0, 0, 0.37));
  border-color: rgba(255, 92, 92, 0.78);
  box-shadow: 0 0 18px rgba(255, 82, 82, 0.26), inset 0 0 0 1px rgba(255, 186, 186, 0.18);
  animation: tfcp-error-glow 1s ease-in-out infinite alternate;
}

.tfcp-menu {
  position: relative;
}

.tfcp-menu-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  max-width: min(92vw, 300px);
  min-width: 230px;
  background: #13223b;
  border: 1px solid #304b72;
  border-radius: 8px;
  padding: 6px;
  display: none;
  z-index: 99999;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.tfcp-toolbar-right .tfcp-menu-list {
  left: auto;
  right: 0;
}

.tfcp-menu.is-open .tfcp-menu-list {
  display: block;
}

.tfcp-menu-item {
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 8px 9px;
  background: transparent;
  color: var(--tfcp-text);
  text-align: left;
  font-size: 12px;
  cursor: pointer;
}

.tfcp-menu-item:hover,
.tfcp-menu-item:focus-visible {
  background: #1d3355;
}

.tfcp-toast-layer {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.tfcp-toast {
  background: #122340;
  border: 1px solid #345783;
  color: #e5efff;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: 0.2s ease;
}

.tfcp-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes tfcp-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes tfcp-warn-glow {
  from {
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.17), inset 0 0 0 1px rgba(255, 236, 161, 0.14);
  }
  to {
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.33), inset 0 0 0 1px rgba(255, 236, 161, 0.26);
  }
}

@keyframes tfcp-error-glow {
  from {
    box-shadow: 0 0 11px rgba(255, 82, 82, 0.18), inset 0 0 0 1px rgba(255, 186, 186, 0.13);
  }
  to {
    box-shadow: 0 0 22px rgba(255, 82, 82, 0.36), inset 0 0 0 1px rgba(255, 186, 186, 0.25);
  }
}

.tfcp-wrap.tfcp-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 99998;
  border-radius: 0;
}

.tfcp-wrap .CodeMirror-dialog {
  background: #0f1b32;
  color: #dbe7fc;
  border-bottom: 1px solid #2e4567;
}

.tfcp-wrap .CodeMirror-dialog input {
  background: #0b1425;
  color: #dbe7fc;
  border: 1px solid #355076;
}


/* v2.2.0 — stable containment for large user code and preview documents. */
.tfcp-wrap,
.tfcp-wrap * {
  min-width: 0;
}

.tfcp-wrap {
  max-width: 100%;
  overflow-x: hidden;
}

.tfcp-main,
.tfcp-editors,
.tfcp-result,
.tfcp-panel,
.tfcp-panel .CodeMirror,
.tfcp-panel .CodeMirror-scroll,
.tfcp-panel .CodeMirror-sizer {
  max-width: 100%;
}

.tfcp-editors,
.tfcp-result,
.tfcp-panel {
  overflow: hidden;
}

.tfcp-panel .CodeMirror-scroll {
  overflow: auto !important;
}

.tfcp-preview {
  max-width: 100%;
  contain: layout paint;
}

@media (max-width: 980px) {
  .tfcp-wrap {
    height: auto;
    min-height: 0;
  }

  .tfcp-main {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .tfcp-toolbar {
    overflow-x: auto;
    overflow-y: visible;
    flex-wrap: nowrap;
  }

  .tfcp-editors {
    border-right: 0;
    border-bottom: 1px solid var(--tfcp-border);
  }

  .tfcp-panel .CodeMirror,
  .tfcp-preview,
  .tfcp-python-output {
    min-height: 320px;
  }

  .tfcp-console-wrap.is-open {
    grid-template-rows: 36px auto;
  }

  .tfcp-console-wrap.is-open .tfcp-console-body {
    min-height: 100px;
    max-height: 180px;
  }
}


/* v2.1.2 — responsive and visual polish; runtime logic intentionally unchanged */
.tfcp-wrap {
  border-radius: 12px;
  box-shadow: 0 18px 46px rgba(5, 12, 25, 0.20);
}

.tfcp-topbar {
  background: linear-gradient(180deg, #0c1527 0%, #09111f 100%);
}

.tfcp-toolbar {
  background: #0c1526;
}

.tfcp-main {
  min-height: clamp(420px, 54vh, 560px);
}

.tfcp-panel .CodeMirror-code {
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(2ch - 1px),
    rgba(117, 146, 191, 0.038) calc(2ch - 1px),
    rgba(117, 146, 191, 0.038) 2ch
  );
}

.tfcp-panel .CodeMirror-activeline-background {
  background: rgba(64, 103, 161, 0.22);
}

.tfcp-console-wrap.is-open .tfcp-console-body {
  min-height: 58px;
}

.tfcp-console-wrap.is-open:has(.tfcp-console-line) .tfcp-console-body {
  min-height: 138px;
  max-height: 220px;
}

.tfcp-console-warn,
.tfcp-console-error {
  animation: none;
}

.tfcp-toast-layer {
  max-width: min(340px, calc(100vw - 28px));
}

/* Tablet: panels stack without becoming excessively tall. */
@media (max-width: 980px) {
  .tfcp-wrap {
    border-radius: 10px;
    min-height: 0;
    box-shadow: none;
  }

  .tfcp-topbar,
  .tfcp-toolbar {
    position: static;
  }

  .tfcp-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .tfcp-editors {
    height: clamp(270px, 42vh, 360px);
    flex: 0 0 auto;
  }

  .tfcp-result {
    height: clamp(220px, 34vh, 300px);
    flex: 0 0 auto;
  }

  .tfcp-panel .CodeMirror,
  .tfcp-preview,
  .tfcp-python-output {
    min-height: 0;
    height: 100%;
  }

  .tfcp-console-wrap.is-open .tfcp-console-body {
    min-height: 54px;
    max-height: 128px;
  }

  .tfcp-console-wrap.is-open:has(.tfcp-console-line) .tfcp-console-body {
    min-height: 96px;
    max-height: 150px;
  }
}

/* Phone layout: compact controls, readable editor, preview and console in one flow. */
@media (max-width: 640px) {
  .tfcp-wrap {
    border-radius: 8px;
    margin: 0;
  }

  .tfcp-topbar {
    height: 42px;
    padding: 0 9px;
  }

  .tfcp-top-left {
    gap: 7px;
  }

  .tfcp-brand-icon {
    width: 25px;
    height: 25px;
  }

  .tfcp-title {
    font-size: 12.5px;
  }

  .tfcp-status {
    font-size: 10px;
    padding: 2px 7px;
  }

  .tfcp-toolbar {
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    overflow: visible;
  }

  .tfcp-toolbar-group {
    width: 100%;
    gap: 6px;
  }

  .tfcp-toolbar-left {
    display: grid;
    grid-template-columns: 1.18fr 1fr 1fr;
  }

  .tfcp-toolbar-right {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.18fr;
  }

  .tfcp-toolbar .tfcp-btn,
  .tfcp-toolbar .tfcp-menu,
  .tfcp-toolbar .tfcp-menu-trigger {
    min-width: 0;
    width: 100%;
  }

  .tfcp-toolbar .tfcp-btn {
    height: 36px;
    padding: 0 6px;
    gap: 4px;
    justify-content: center;
    font-size: 11px;
    white-space: nowrap;
  }

  .tfcp-toolbar .tfcp-ico svg {
    width: 12px;
    height: 12px;
  }

  .tfcp-fs-label {
    font-size: 0;
  }

  .tfcp-fs-label::after {
    content: "Tam Ekran";
    font-size: 10.5px;
  }

  .tfcp-wrap[data-lang="en"] .tfcp-fs-label::after {
    content: "Fullscreen";
  }

  .tfcp-findbar {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 7px 8px;
  }

  .tfcp-findbar .tfcp-btn,
  .tfcp-findbar input {
    width: 100%;
    height: 32px;
    font-size: 11px;
  }

  .tfcp-find-close {
    grid-column: span 2;
    width: 100%;
  }

  .tfcp-tabs,
  .tfcp-result-head {
    height: 34px;
  }

  .tfcp-tab {
    flex: 1 1 25%;
    min-width: max-content;
    padding: 0 10px;
    font-size: 11px;
  }

  .tfcp-editors {
    height: clamp(245px, 38vh, 305px);
  }

  .tfcp-result {
    height: clamp(195px, 29vh, 250px);
  }

  .tfcp-result-head {
    padding: 0 10px;
    font-size: 11px;
  }

  .tfcp-panel .CodeMirror {
    font-size: 12px;
    line-height: 1.42;
  }

  .tfcp-panel .CodeMirror-code {
    background-image: repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(2ch - 1px),
      rgba(117, 146, 191, 0.025) calc(2ch - 1px),
      rgba(117, 146, 191, 0.025) 2ch
    );
  }

  .tfcp-console-head {
    height: 34px;
    padding: 0 8px;
    font-size: 11px;
  }

  .tfcp-console-actions {
    gap: 5px;
  }

  .tfcp-console-actions .tfcp-btn {
    height: 29px;
    padding: 0 8px;
    font-size: 10px;
  }

  .tfcp-console-wrap.is-open .tfcp-console-body {
    min-height: 48px;
    max-height: 100px;
    padding: 7px 8px;
    font-size: 11px;
  }

  .tfcp-console-wrap.is-open:has(.tfcp-console-line) .tfcp-console-body {
    min-height: 80px;
    max-height: 120px;
  }

  .tfcp-menu-list {
    position: fixed;
    left: 12px !important;
    right: 12px !important;
    top: auto;
    bottom: 16px;
    max-width: none;
    min-width: 0;
    border-radius: 12px;
    padding: 8px;
  }

  .tfcp-menu-item {
    font-size: 13px;
    padding: 11px 10px;
  }

  .tfcp-toast-layer {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }

  .tfcp-toast {
    font-size: 11px;
    padding: 7px 9px;
  }
}

@media (max-width: 380px) {
  .tfcp-title {
    font-size: 12px;
  }

  .tfcp-status {
    display: none;
  }

  .tfcp-toolbar .tfcp-btn {
    font-size: 10px;
    padding: 0 4px;
  }

  .tfcp-tab {
    padding: 0 8px;
    font-size: 10px;
  }
}


/* v2.1.3 — strict mobile viewport fit; no runtime changes */
.tfcp-wrap,
.tfcp-wrap *,
.tfcp-wrap *::before,
.tfcp-wrap *::after {
  box-sizing: border-box;
}

@media (max-width: 640px) {
  body .tfcp-wrap,
  .entry-content .tfcp-wrap,
  .tfcp-wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: hidden !important;
    min-height: 0 !important;
  }

  .tfcp-topbar,
  .tfcp-toolbar,
  .tfcp-main,
  .tfcp-editors,
  .tfcp-result,
  .tfcp-console-wrap,
  .tfcp-console-head,
  .tfcp-tabs,
  .tfcp-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .tfcp-topbar {
    height: 40px;
    padding-inline: 8px;
  }

  .tfcp-title {
    max-width: calc(100vw - 125px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tfcp-toolbar {
    padding: 7px;
    gap: 6px;
  }

  .tfcp-toolbar-group {
    min-width: 0;
    max-width: 100%;
  }

  .tfcp-toolbar-left {
    grid-template-columns: minmax(0, 1.06fr) minmax(0, .9fr) minmax(0, .98fr);
  }

  .tfcp-toolbar-right {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tfcp-toolbar .tfcp-btn,
  .tfcp-toolbar .tfcp-menu-trigger {
    min-width: 0 !important;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 10.5px;
    padding-inline: 4px;
    height: 34px;
  }

  .tfcp-toolbar .tfcp-ico {
    flex: 0 0 auto;
  }

  .tfcp-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
  }

  .tfcp-tab {
    min-width: 0 !important;
    width: 100%;
    padding: 0 3px;
    font-size: 9.5px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .tfcp-main {
    display: flex !important;
    flex-direction: column;
    min-height: 0 !important;
    overflow: hidden;
  }

  .tfcp-editors {
    flex: 0 0 218px !important;
    height: 218px !important;
    min-height: 218px !important;
    overflow: hidden;
    border-right: 0;
  }

  .tfcp-result {
    flex: 0 0 194px !important;
    height: 194px !important;
    min-height: 194px !important;
    overflow: hidden;
  }

  .tfcp-panel,
  .tfcp-panel.is-active,
  .tfcp-panel .CodeMirror,
  .tfcp-panel .CodeMirror-scroll,
  .tfcp-panel .CodeMirror-sizer,
  .tfcp-preview,
  .tfcp-python-output {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .tfcp-panel .CodeMirror {
    height: 100% !important;
    font-size: 11.5px;
    line-height: 1.4;
    overflow: hidden;
  }

  .tfcp-panel .CodeMirror-scroll {
    overflow: auto !important;
    margin-right: 0;
    margin-bottom: 0;
  }

  .tfcp-panel .CodeMirror-sizer {
    margin-right: 0 !important;
  }

  .tfcp-result-head {
    height: 31px;
    padding-inline: 9px;
    font-size: 10px;
  }

  .tfcp-console-head {
    height: 33px;
    padding-inline: 7px;
  }

  .tfcp-console-actions {
    min-width: 0;
  }

  .tfcp-console-actions .tfcp-btn {
    height: 27px;
    padding-inline: 6px;
    font-size: 9px;
    min-width: 0;
  }

  .tfcp-console-wrap.is-open .tfcp-console-body {
    min-height: 38px !important;
    max-height: 74px !important;
    padding: 6px 8px;
    font-size: 10px;
  }

  .tfcp-console-wrap.is-open:has(.tfcp-console-line) .tfcp-console-body {
    min-height: 72px !important;
    max-height: 116px !important;
  }

  .tfcp-console-line {
    padding: 5px 6px;
    margin-bottom: 5px;
  }

  .tfcp-toast-layer {
    left: 9px;
    right: 9px;
    bottom: 9px;
    max-width: none;
  }

  .tfcp-toast {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .tfcp-toolbar .tfcp-btn,
  .tfcp-toolbar .tfcp-menu-trigger {
    font-size: 9.5px;
    gap: 3px;
    padding-inline: 3px;
  }

  .tfcp-editors {
    flex-basis: 205px !important;
    height: 205px !important;
    min-height: 205px !important;
  }

  .tfcp-result {
    flex-basis: 180px !important;
    height: 180px !important;
    min-height: 180px !important;
  }
}

@media (max-width: 760px) {
  .tfcp-workmode {
    align-items: stretch;
  }
  .tfcp-workmode-text,
  .tfcp-workmode-toggle,
  .tfcp-clear-web {
    width: 100%;
  }
  .tfcp-workmode-toggle {
    justify-content: center;
  }
}
