  .tw-trigger-wrap { display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; color: #555; }
  .tw-trigger-wrap { min-width: 240px; max-width: 420px; }
  .tw-trigger {
    width: 100%; min-width: 0;
    cursor: pointer; text-align: left;
    padding: 6px 8px; font-family: monospace; font-size: 0.85rem;
    background: var(--color-input-bg); border: 1px solid #ccc; color: #111;
    border-radius: 3px;
  }
  .tw-trigger:hover { border-color: #888; }
  .tw-trigger:focus { outline: 1px solid #888; border-color: #888; }
  .tw-modal {
    position: fixed; inset: 0; z-index: 11000;
    display: none; align-items: center; justify-content: center;
    padding: 16px;
    background: rgba(40, 40, 40, 0.35);
  }
  .tw-modal.open { display: flex; }
  .tw-modal-panel {
    background: var(--color-bg); color: #111; border-radius: 10px;
    border: 1px solid var(--color-border-soft); box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    max-width: min(1120px, 100vw - 32px);
    width: 100%;
    padding: 16px 18px 14px;
  }
  .tw-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 12px;
  }
  .tw-modal-panel h2 {
    font-size: 0.95rem; font-weight: 600; margin: 0; color: #2c2c2c;
  }
  .tw-modal-close-btn {
    flex-shrink: 0;
    width: 32px; height: 32px; padding: 0; line-height: 1;
    font-size: 1.4rem; font-family: monospace;
    background: #e8e4dc; border: 1px solid #bbb; border-radius: 4px;
    color: #333; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }
  .tw-modal-close-btn:hover { background: #d8d4cc; }
  .tw-modal-body {
    width: 100%;
    display: flex; flex-direction: column; gap: 16px;
  }
  .tw-manual-range {
    padding: 12px 14px; border: 1px solid var(--color-border-soft); border-radius: 8px; background: #fff;
  }
  .tw-manual-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px 14px; align-items: end;
  }
  .tw-input-label {
    display: flex; flex-direction: column; gap: 5px; font-size: 0.72rem; color: #555;
  }
  .tw-date-input {
    width: 100%; background: #f8f6f2; border: 1px solid #c9c4ba; color: #111;
    padding: 7px 9px; font-family: monospace; font-size: 0.86rem; border-radius: 5px;
  }
  .tw-date-input:focus { outline: 1px solid #777; border-color: #777; }
  .tw-date-input-wrap.tw-flash .tw-date-input {
    animation: tw-input-flash 500ms ease-out;
  }
  @keyframes tw-input-flash {
    0%   { background-color: #fff3a0; }
    100% { background-color: var(--color-input-bg, #f8f6f2); }
  }
  @media (prefers-reduced-motion: reduce) {
    .tw-date-input-wrap.tw-flash .tw-date-input {
      animation: none;
      background-color: #fff3a0;
      transition: background-color 500ms;
    }
  }
  .tw-format-hint { margin-top: 8px; font-size: 0.72rem; color: #777; }
  .tw-validation {
    display: none; margin-top: 8px; font-size: 0.76rem; color: #a00;
  }
  .tw-validation.visible { display: block; }
  .tw-preset-groups {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 14px; max-height: min(58vh, 560px); overflow: auto; padding-right: 2px;
  }
  .tw-preset-col {
    display: flex; flex-direction: column; gap: 10px;
    min-width: 0;
  }
  .tw-preset-col h4 {
    font-size: 0.65rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: #666; margin: 0 0 2px 0;
  }
  .tw-preset-col .tw-preset-grid {
    display: flex; flex-direction: column; gap: 4px;
  }
  .tw-preset-btn {
    text-align: left;
    padding: 6px 8px; font-family: monospace; font-size: 0.72rem;
    line-height: 1.35;
    background: var(--color-surface-muted); border: 1px solid var(--color-border); color: #222;
    border-radius: 5px; cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
  }
  .tw-preset-btn:hover { background: #dedad2; border-color: #999; }
  .tw-modal-footer {
    display: flex; gap: 10px; justify-content: flex-end;
    margin-top: 14px; padding-top: 12px;
    border-top: 1px solid #e0ddd8;
  }
  .tw-modal-footer .btn { align-self: center; }
