.tg-opt { margin-left: 6px; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.tg-raw { min-height: 132px; font-size: 15px; line-height: 1.75; }
.tg-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-top: 14px; }
.tg-split { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tg-in > .hint { margin-top: 14px; }
.tg-out { margin-top: 32px; }
.tg-out-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 8px; }
.tg-out-h { font-size: 20px; }
.tg-count { font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tg-count b { margin-right: 1px; font-size: 24px; font-weight: 750; color: var(--ink); letter-spacing: -0.02em; transition: color 0.15s; }
.tg-max { color: var(--ink-3); }
.tg-count.is-over b { color: var(--red); }
.tg-sum { margin-bottom: 14px; font-size: 15px; color: var(--ink-2); }
.tg-over { margin-bottom: 14px; }
.tg-over .tg-cut { margin-top: 8px; }
.tg-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.tg-add { display: flex; gap: 6px; width: min(340px, 100%); }
.tg-add .input { flex: 1; min-width: 0; height: 34px; padding: 0 12px; font-size: 14.5px; }
.tg-help { margin-bottom: 14px; }
.tg-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tg-chip { display: inline-flex; align-items: center; max-width: 100%; height: 38px; padding: 0 4px 0 2px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 14.5px; font-weight: 600; user-select: none; -webkit-user-select: none; cursor: grab; transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s; }
.tg-chip:hover { border-color: var(--ink-3); }
.tg-grab, .tg-x { display: inline-grid; flex: none; place-items: center; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--ink-3); }
.tg-grab { width: 26px; height: 30px; cursor: grab; touch-action: none; }
.tg-grab .ico { width: 16px; height: 16px; }
.tg-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-hash { margin-right: 1px; color: var(--mks-pink); font-weight: 700; }
.tg-x { width: 28px; height: 28px; margin-left: 3px; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.tg-x:hover { background: var(--surface-2); color: var(--red); }
.tg-x .ico { width: 14px; height: 14px; }
.tg-grab:focus-visible, .tg-x:focus-visible { outline-offset: -2px; border-radius: 999px; }
.tg-chip.is-grab .tg-grab:focus-visible { outline-color: var(--mks-pink); }
.tg-chip.is-over { border-style: dashed; border-color: var(--red); background: var(--red-bg); }
.tg-chip.is-grab { border-color: var(--mks-pink); background: color-mix(in srgb, var(--mk-pink) 34%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mk-pink) 70%, transparent); }
.tg-chip.is-drag { position: fixed; z-index: 1000; top: var(--t); left: var(--l); width: var(--cw); margin: 0; transform: translate(var(--dx, 0), var(--dy, 0)); box-shadow: var(--shadow-2); pointer-events: none; cursor: grabbing; }
.tg-chip.is-new { animation: tg-in 250ms var(--ease-out); }
@keyframes tg-in { from { opacity: 0; transform: scale(0.94); } }
.tg-ph { flex: none; width: var(--pw, 80px); height: 38px; border: 1.5px dashed var(--line-2); border-radius: 999px; background: var(--surface-2); }
.tg-dragging, .tg-dragging * { cursor: grabbing !important; }
.tg-dragging body { user-select: none; -webkit-user-select: none; }
.tg-exp .panel-h { flex-wrap: wrap; }
.tg-preview { min-height: 104px; font-size: 14.5px; line-height: 1.75; background: var(--surface-2); }
.tg-exp-f { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 12px; }
.tg-exp-f > .btn-row { margin-left: auto; }
.tg-chk { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.tg-chk input { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--ink); }
.tg-suggest { margin-top: 16px; }
.tg-suggest > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 16.5px; font-weight: 650; list-style: none; cursor: pointer; }
.tg-suggest > summary::-webkit-details-marker { display: none; }
.tg-suggest > summary::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.25s var(--ease-out); }
.tg-suggest[open] > summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.tg-suggest::details-content { block-size: 0; overflow: hidden; transition: block-size 0.25s var(--ease-out), content-visibility 0.25s allow-discrete; }
.tg-suggest[open]::details-content { block-size: auto; }
.tg-sg-body { display: grid; gap: 12px; padding-top: 16px; }
.tg-body { min-height: 150px; font-size: 15px; line-height: 1.75; }
.tg-sg-chips:empty { display: none; }
.tg-sg-chips .chip { position: relative; height: 32px; padding: 0 11px; font-size: 13.5px; transition: background-color 0.15s, color 0.15s, border-color 0.15s; }
.tg-sg-c { font-size: 11.5px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tg-sg-chips .chip[aria-pressed="true"] .tg-sg-c { color: inherit; opacity: 0.7; }
.tg-nw { white-space: nowrap; }
.doc > section { min-width: 0; }
.doc section > p + .table-wrap { margin-top: 14px; }
.doc section > .table-wrap + p { margin-top: 14px; }
@media (max-width: 720px) {
.tg-bar { flex-direction: column; align-items: stretch; }
.tg-split .seg { align-self: flex-start; }
.tg-out-h { font-size: 18px; }
.tg-tools { flex-direction: column; align-items: stretch; }
.tg-add { width: 100%; }
.tg-exp .panel-h { flex-direction: column; align-items: flex-start; }
.tg-exp-f { flex-direction: column; align-items: flex-start; }
.tg-exp-f > .btn-row { margin-left: 0; }
.tg-chip { font-size: 14px; }
}
@media (max-width: 420px) {
.tg-split .seg { display: flex; align-self: stretch; }
.tg-split .seg button { flex: 1 1 auto; padding: 0 8px; }
.tg-opt { display: block; margin: 2px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
.tg-chip, .tg-x, .tg-count b, .tg-sg-chips .chip { transition: none; }
.tg-chip.is-new { animation: none; }
.tg-suggest::details-content, .tg-suggest > summary::after { transition: none; }
}
