/* 101Tools UI kit: shared look for native tools. Uses the --t101-* variables from core.css. */
.t101k { border: 1px solid var(--t101-border); border-radius: var(--t101-radius); background: var(--t101-surface); padding: 20px; box-shadow: 0 1px 3px rgba(0, 0, 0, .04); color: var(--t101-text); }
.t101k *, .t101k *::before, .t101k *::after { box-sizing: border-box; }
.t101k [hidden] { display: none !important; } /* layout rules must never un-hide a toggled control */
.t101k-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin: 12px 0; }
.t101k-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .t101k-split { grid-template-columns: 1fr; } }
.t101k-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.t101k-label { font-weight: 600; font-size: .925rem; }
.t101k-hint { color: var(--t101-muted); font-size: .8rem; }
.t101k-text, .t101k-input, .t101k-select { width: 100%; font: inherit; color: var(--t101-text); background: var(--t101-surface); border: 1px solid var(--t101-border); border-radius: 10px; }
.t101k-text { display: block; min-height: 220px; padding: 12px 14px; font: 14px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; resize: vertical; }
.t101k-text[readonly] { background: var(--t101-soft); }
.t101k-input, .t101k-select { padding: 8px 10px; min-height: 40px; }
.t101k-input[type="number"] { width: 130px; }
.t101k-text:focus, .t101k-input:focus, .t101k-select:focus { outline: 2px solid var(--t101-accent); outline-offset: 1px; border-color: transparent; }
.t101k-check { display: inline-flex; align-items: center; gap: 6px; font-size: .925rem; cursor: pointer; min-height: 40px; }
.t101k-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.t101k-btn { appearance: none; border: 1px solid var(--t101-border); background: var(--t101-surface); color: var(--t101-text); border-radius: 8px; padding: 9px 15px; font: inherit; font-weight: 600; font-size: .925rem; cursor: pointer; line-height: 1.2; }
.t101k-btn:hover:not(:disabled) { border-color: var(--t101-accent); }
.t101k-btn:focus-visible { outline: 2px solid var(--t101-accent); outline-offset: 2px; }
.t101k-btn:disabled { opacity: .5; cursor: not-allowed; }
.t101k-btn.is-primary { background: var(--t101-accent); border-color: var(--t101-accent); color: #fff; }
.t101k-btn.is-primary:hover:not(:disabled) { filter: brightness(1.08); }
.t101k-btn.is-active { border-color: var(--t101-accent); background: color-mix(in srgb, var(--t101-accent) 10%, var(--t101-surface)); color: var(--t101-accent); }
.t101k-btn.is-small { padding: 6px 11px; font-size: .85rem; font-weight: 500; }
.t101k-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.t101k-status { margin: 12px 0; padding: 10px 14px; border-radius: 8px; background: var(--t101-soft); }
.t101k-status.is-ok { background: #dcfce7; color: #14532d; }
.t101k-status.is-warn { background: #fef3c7; color: #78350f; }
.t101k-status.is-error { background: #fee2e2; color: #7f1d1d; }
.t101k-drop { position: relative; border: 2px dashed var(--t101-border); border-radius: var(--t101-radius); background: var(--t101-soft); text-align: center; transition: border-color .15s, background .15s; }
.t101k-drop.is-over { border-color: var(--t101-accent); background: color-mix(in srgb, var(--t101-accent) 8%, var(--t101-soft)); }
.t101k-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.t101k-drop-label { display: flex; flex-direction: column; gap: 4px; padding: 26px 16px; cursor: pointer; }
.t101k-drop-label strong { color: var(--t101-accent); }
.t101k-drop-label span { color: var(--t101-muted); font-size: .9rem; }
.t101k-file:focus-visible + .t101k-drop-label { outline: 2px solid var(--t101-accent); outline-offset: -4px; border-radius: var(--t101-radius); }
.t101k-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--t101-muted); font-size: .85rem; margin: 6px 0 0; }
.t101k-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.t101k-table th, .t101k-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--t101-border); vertical-align: middle; }
.t101k-table th { background: var(--t101-soft); font-weight: 600; }
.t101k-note { margin: 16px 0 0; font-size: .85rem; color: var(--t101-muted); }
.t101k-pane-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.t101k-range-wrap { display: flex; align-items: center; gap: 10px; }
.t101k-range { flex: 1; min-width: 0; accent-color: var(--t101-accent); }
.t101k-range-value { min-width: 3.4em; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
/* Checkerboard behind transparent images. */
.t101k-checker { background-color: #fff; background-image: linear-gradient(45deg, #e5e7eb 25%, transparent 25%), linear-gradient(-45deg, #e5e7eb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e5e7eb 75%), linear-gradient(-45deg, transparent 75%, #e5e7eb 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.t101k-stage { display: flex; justify-content: center; align-items: center; min-height: 220px; border-radius: 10px; overflow: hidden; background: var(--t101-soft); }
.t101k-stage canvas, .t101k-stage img { display: block; max-width: 100%; height: auto; }
.t101k-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
/* Workspace: main panel + options sidebar. */
.t101k.is-work { border: 0; background: none; box-shadow: none; padding: 0; }
.t101k-work { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
/* Phones and narrow tablets: options first, then the work area, then the action buttons. */
@media (max-width: 900px) {
  .t101k-work { display: flex; flex-direction: column; align-items: stretch; }
  .t101k-work > .t101k-side { display: contents; }
  .t101k-side > .t101k-panel:first-child { order: -1; }
  .t101k-actions-panel { order: 2; }
  .t101k-main .t101k-text { min-height: 180px; }
}
.t101k-pane-head { flex-wrap: wrap; }
.t101k-main, .t101k-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.t101k-panel { border: 1px solid var(--t101-border); border-radius: var(--t101-radius); background: var(--t101-surface); padding: 16px; box-shadow: 0 1px 3px rgba(0, 0, 0, .04); }
.t101k-side .t101k-panel { display: flex; flex-direction: column; gap: 12px; }
.t101k-side .t101k-check { min-height: 0; }
.t101k-actions-panel { flex-direction: row !important; flex-wrap: wrap; gap: 8px !important; }
.t101k-actions-panel .t101k-btn { flex: 1 1 auto; }
.t101k-pane-extras { display: inline-flex; align-items: center; gap: 10px; color: var(--t101-muted); font-size: .825rem; }
.t101k-filebtn { display: inline-flex; }
.t101k-text.is-over { outline: 2px dashed var(--t101-accent); outline-offset: 2px; }
.t101k-section-title { font-weight: 600; font-size: .9rem; margin: 4px 0 0; }
.t101k-panel .t101k-status { margin: 0; }
.t101k-main .t101k-text { min-height: 260px; border: 0; padding: 4px 0; background: transparent; }
.t101k-main .t101k-text:focus { outline: none; }
.t101k-main .t101k-text[readonly] { background: transparent; }
.t101k-main .t101k-panel:focus-within { border-color: var(--t101-accent); }
@media (max-width: 600px) { .t101k { padding: 14px; } .t101k-actions .t101k-btn { flex: 1 1 auto; } }
