/* TRACE workflow components. Load after style.css. */
.taxonomy-manager,
.project-edit-grid,
.reminder-form,
.channel-switch-grid,
.attachment-grid { min-width: 0; }

.taxonomy-manager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.taxonomy-column { min-width: 0; background: #fbfcf8; border: 1px solid var(--border, #e5eadd); border-radius: 16px; padding: 19px; }
.taxonomy-column > h3,
.taxonomy-column > .section-title { color: #526a43; font-size: 14px; font-weight: 550; margin: 0 0 13px; }
.taxonomy-column > p { color: #89977b; font-size: 11px; line-height: 1.8; margin-bottom: 16px; }
.taxonomy-list { display: flex; flex-direction: column; gap: 8px; }
.taxonomy-row { display: flex; align-items: center; gap: 7px; padding: 8px; background: #fff; border: 1px solid #e5ebdc; border-radius: 10px; min-width: 0; }
.taxonomy-row > input { flex: 1; min-width: 0; width: 0; padding: 6px 7px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; color: #697d58; background: transparent; outline: none; }
.taxonomy-row > input:hover { background: #f7faf1; }
.taxonomy-row > input:focus { border-color: #a4bf8c; background: #f9fcf5; box-shadow: 0 0 0 2px #edf4e3; }
.taxonomy-row-actions { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.taxonomy-row button { width: 26px; height: 28px; min-height: 28px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #9aab87; display: inline-flex; align-items: center; justify-content: center; }
.taxonomy-row button:hover { background: #eef4e5; color: #68864e; }
.taxonomy-row button .icon { width: 13px; height: 13px; }
.taxonomy-row [data-delete-taxonomy]:hover,
.taxonomy-row .taxonomy-delete:hover { background: #faf0ec; color: #a26f58; }
.taxonomy-row button:disabled { opacity: .3; }
.taxonomy-row [data-tax-delete]:hover { background: #faf0ec; color: #a26f58; }
.taxonomy-row-index { color: #b4c0a6; font-size: 9px; width: 13px; text-align: center; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.taxonomy-add { display: flex; align-items: center; gap: 7px; margin-top: 12px; }
.taxonomy-add input { flex: 1; min-width: 0; padding: 9px 10px; font-size: 11px; border-radius: 8px; border: 1px solid #dce6d0; background: #fff; color: #77935f; outline: none; }
.taxonomy-add input::placeholder { color: #a9bb98; }
.taxonomy-add input:focus { border-color: #a4bf8c; box-shadow: 0 0 0 2px #edf4e3; }
.taxonomy-add .btn { flex-shrink: 0; min-height: 36px; font-size: 11px; }
.taxonomy-note { display: flex; align-items: flex-start; gap: 6px; padding-top: 16px; color: #93a581; font-size: 10px; line-height: 1.8; }
.taxonomy-note .icon { width: 12px; height: 12px; margin-top: 2px; }
.drawer .taxonomy-manager { grid-template-columns: 1fr; gap: 17px; }
.drawer .taxonomy-column { padding: 16px; }

.project-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 13px; margin: 21px 0; }
.project-edit-grid .form-field { margin: 0; min-width: 0; }
.project-edit-grid .full-width { grid-column: 1 / -1; }
.project-edit-grid input,
.project-edit-grid select,
.project-edit-grid textarea { width: 100%; min-width: 0; border-radius: 8px; }
.project-edit-grid .form-field:has(textarea) { grid-column: 1 / -1; }
.project-edit-grid textarea { min-height: 80px; }
.project-edit-grid .field-help { color: #9aae89; font-size: 9px; font-weight: 400; line-height: 1.7; }
.form-grid > .full-width { grid-column: 1 / -1; min-width: 0; }
.project-filter { min-width: 0; }
.project-filter .filter-tabs { min-width: 0; max-width: 100%; flex: 1; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: #c6d6b4 transparent; }
.project-filter .filter-tab { flex-shrink: 0; white-space: nowrap; }
.project-filter .filter-note { flex-shrink: 0; white-space: nowrap; }
.x-import-strip { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid #dfe8d3; border-radius: 12px; padding: 15px 18px; background: #f0f5e9; margin: 0 0 22px; }
.x-import-strip > .icon,
.x-import-strip > [data-icon] { color: #86a06d; flex-shrink: 0; }
.x-import-strip > div { flex: 1; min-width: 0; }
.x-import-strip strong { display: block; color: #67804e; font-size: 12px; font-weight: 500; }
.x-import-strip p,
.x-import-strip small { display: block; color: #8fa67b; font-size: 10px; line-height: 1.8; margin-top: 3px; }
.x-import-strip > .btn { font-size: 11px; flex-shrink: 0; }
.x-import-strip code { color: #6b8d56; font-size: 10px; word-break: break-all; }
.form-grid > .x-import-strip { margin-bottom: 0; padding: 13px; align-items: flex-start; flex-wrap: wrap; }
.form-grid > .x-import-strip > .btn { flex: 0 1 auto; }
.form-grid > .x-import-strip > small { flex: 1 1 150px; min-width: 0; margin-top: 0; overflow-wrap: anywhere; }
#project-logo-preview { border: 1px solid #e2ead8; border-radius: 10px; object-fit: cover; margin-top: 5px; }

.studio-media { border-top: 1px solid #e8eee0; padding: 21px 23px; background: #fdfefb; }
.studio-media > .section-title,
.studio-media h3 { font-size: 12px; color: #76955d; font-weight: 500; }
.studio-media > p { color: #97ab85; font-size: 10px; line-height: 1.8; margin: 5px 0 14px; }
.studio-media > .panel-header { padding: 0 0 14px; gap: 10px; }
.studio-media > .panel-header .section-note { font-size: 9px; white-space: nowrap; margin: 0; }
.studio-media #attachment-list { margin-top: 13px; }
.attachment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 13px; }
.attachment-grid:empty { display: none; }
.attachment-card { min-width: 0; border: 1px solid #e0e9d5; border-radius: 11px; background: #fff; position: relative; overflow: hidden; box-shadow: 0 3px 8px #21341805; }
.attachment-card img,
.attachment-card video { display: block; width: 100%; height: 112px; object-fit: cover; background: #edf2e6; }
.attachment-card video { object-fit: contain; }
.attachment-card .media-name { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; color: #829b6e; font-size: 9px; padding: 9px 10px; min-width: 0; }
.media-name > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.media-name > strong { display: block; width: 100%; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; font-weight: 500; }
.media-name > small { color: #a6b892; font-size: 8px; white-space: nowrap; }
.attachment-file { height: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; background: linear-gradient(135deg, #f7faef, #edf4e3); color: #96af7d; font-size: 10px; }
.attachment-file .icon { width: 28px; height: 28px; color: #a3be88; }
.media-name .icon { width: 11px; height: 11px; color: #a2b68f; flex-shrink: 0; }
.attachment-remove,
.attachment-card > [data-remove-attachment] { display: grid; place-items: center; position: absolute; top: 7px; right: 7px; width: 26px; height: 26px; min-height: 26px; padding: 0; border: 1px solid #fff6; border-radius: 8px; color: #f2f6ed; background: #243d2ccc; backdrop-filter: blur(4px); box-shadow: 0 2px 8px #12251a19; }
.attachment-remove .icon,
.attachment-card > [data-remove-attachment] .icon { width: 12px; height: 12px; }
.attachment-remove:hover,
.attachment-card > [data-remove-attachment]:hover { background: #1e3528; }
.upload-zone { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 20px 16px; min-height: 88px; border: 1px dashed #c9d8b9; border-radius: 10px; background: #f8fbf3; color: #90a97b; text-align: center; position: relative; cursor: pointer; transition: background .15s, border-color .15s; }
.upload-zone:hover { background: #f0f7e7; border-color: #a5c187; }
.upload-zone:focus-within { border-color: #8aac70; outline: 3px solid #c6dbb2; outline-offset: 2px; }
.upload-zone > .icon { width: 20px; height: 20px; color: #9cb788; }
.upload-zone > span { font-size: 11px; }
.upload-zone strong { display: block; color: #7e9e64; font-size: 11px; font-weight: 500; }
.upload-zone small { display: block; color: #acbf9b; font-size: 9px; margin-top: 4px; }
.upload-zone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.media-limits { margin-top: 9px; color: #a7ba95; font-size: 9px; line-height: 1.7; }
.media-error { color: #aa7b60; background: #fbf2e9; border-radius: 7px; padding: 8px 11px; font-size: 10px; margin-top: 10px; }

.delivery-toggles { display: flex; flex-direction: column; gap: 9px; margin: 17px 20px; padding: 15px; background: #f8fbf3; border: 1px solid #e3ecd9; border-radius: 10px; }
.delivery-toggles > strong,
.delivery-toggles > .field-label { font-size: 10px; font-weight: 500; color: #8aab71; margin: 0 0 2px; }
.delivery-toggles label { display: flex; align-items: center; gap: 9px; color: #88a070; font-size: 11px; cursor: pointer; }
.delivery-toggles input[type="checkbox"] { width: 13px; height: 13px; margin: 0; accent-color: #729950; flex-shrink: 0; }
.delivery-toggles small { display: block; margin-left: 22px; font-size: 9px; line-height: 1.8; color: #a3b88e; }

.reminder-card { border: 1px solid #e0e8d5; border-radius: 16px; background: #fff; padding: 21px; margin-top: 22px; box-shadow: 0 4px 15px #243b2006; }
.reminder-card > .panel-header { padding: 0 0 16px; }
.reminder-card > .panel-header > div { flex: 1; min-width: 0; }
.reminder-card > .panel-header > .btn { flex-shrink: 0; font-size: 10px; }
.reminder-card .detail-section-title { margin: 0 0 4px; }
.reminder-card > h3,
.reminder-card .section-title { font-size: 13px; font-weight: 550; color: #718d5b; }
.reminder-card > p { color: #9bb086; font-size: 10px; line-height: 1.85; margin: 5px 0 15px; }
.reminder-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.reminder-item { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid #e5eddb; border-radius: 9px; background: #f9fcf5; min-width: 0; }
.reminder-item > .icon { width: 14px; height: 14px; color: #9dbb7e; flex-shrink: 0; }
.reminder-item > div { min-width: 0; flex: 1; }
.reminder-item strong { color: #7a965f; font-size: 11px; font-weight: 500; display: block; overflow-wrap: anywhere; }
.reminder-item small,
.reminder-item p { color: #a1b78c; font-size: 9px; line-height: 1.8; display: block; margin-top: 2px; }
.reminder-item > .btn { margin-left: auto; flex-shrink: 0; }
.reminder-item > button:not(.btn) { background: transparent; border: 0; border-radius: 6px; padding: 5px; color: #a7bc94; display: grid; place-items: center; }
.reminder-item > button:not(.btn):hover { background: #edf4e2; color: #769954; }
.reminder-item.is-done { opacity: .6; }
.reminder-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding-top: 15px; border-top: 1px solid #e8eee0; }
.reminder-form .form-field { margin: 0; min-width: 0; }
.reminder-form .full-width,
.reminder-form > .offset-picker,
.reminder-form > .delivery-toggles,
.reminder-form > .btn { grid-column: 1 / -1; }
.reminder-form > .delivery-toggles { margin: 0; }
.reminder-form > .btn { width: 100%; }
.reminder-form fieldset { width: 100%; min-width: 0; margin: 0; padding: 12px 13px 13px; border: 1px solid #e1ebd5; border-radius: 10px; background: #fcfef8; }
.reminder-form fieldset legend { color: #8baa73; font-size: 10px; padding: 0 6px; margin: 0; }
.reminder-form fieldset .offset-picker { margin: 0 0 10px; }
.reminder-form fieldset:last-of-type .offset-picker { margin-bottom: 0; }
.reminder-form input,
.reminder-form textarea,
.reminder-form select { min-width: 0; max-width: 100%; }
.reminder-form input[type="datetime-local"] { font-size: 11px; padding-left: 7px; padding-right: 7px; }
.offset-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 2px 0; }
.offset-chip { border: 1px solid #dce8ce; border-radius: 7px; background: #f9fcf3; color: #9ab385; font-size: 10px; padding: 6px 10px; display: inline-flex; align-items: center; gap: 5px; min-height: 30px; cursor: pointer; }
.offset-chip:hover { border-color: #aac88b; background: #f0f7e5; color: #83a769; }
.offset-chip.active,
.offset-chip[aria-pressed="true"],
.offset-chip:has(input:checked) { color: #6d954b; border-color: #adca8d; background: #eaf4dc; }
.offset-chip input { width: 11px; height: 11px; margin: 0; accent-color: #799f54; }
.offset-chip .icon { width: 10px; height: 10px; }
.reminder-caption { color: #a5bc8f; font-size: 9px; line-height: 1.85; margin-top: 12px; }

.channel-switch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; margin: 0 0 24px; }
.channel-switch-card { border: 1px solid #e0e8d5; border-radius: 16px; background: #fff; padding: 21px; display: flex; flex-direction: column; min-width: 0; box-shadow: 0 4px 16px #223a2406; transition: border-color .15s, box-shadow .15s; }
.channel-switch-card:hover { border-color: #bfd2aa; box-shadow: 0 6px 20px #29432b08; }
.channel-switch-card > header,
.channel-switch-head { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.channel-switch-head .connection-icon,
.channel-switch-card > header .connection-icon { width: 35px; height: 35px; border-radius: 10px; }
.channel-switch-head > div,
.channel-switch-card > header > div { min-width: 0; flex: 1; }
.channel-switch-card h3,
.channel-switch-card h2 { font-size: 13px; font-weight: 550; color: #66814e; line-height: 1.5; }
.channel-switch-card header small,
.channel-switch-head small { display: block; color: #a8bc94; font-size: 9px; margin-top: 2px; }
.channel-switch-copy,
.channel-switch-card > p { color: #738767; font-size: 13px; line-height: 1.85; margin: 0 0 14px; }
.channel-switch-card > .btn { margin-top: auto; width: 100%; font-size: 11px; }
.channel-switch-meta { display: flex; align-items: center; gap: 5px; color: #a9bc96; font-size: 9px; padding: 11px 0 15px; border-top: 1px solid #edf2e3; }
.channel-switch-meta .icon { width: 10px; height: 10px; }
.channel-switch-card .connection-state { font-size: 9px; margin: 2px 0 14px; }
.channel-switch-card.is-enabled { border-color: #c8dab7; background: linear-gradient(180deg, #fff 0%, #fcfef8 100%); }
.channel-switch-card.is-enabled .connection-state { color: #8cac6d; }
.channel-switch-card.is-enabled .connection-state::before { background: #9dbd7d; }
.channel-switch-card .switch-toggle { margin: 0 0 0 auto; }
.delivery-preview-tabs { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; border-bottom: 1px solid #e4edda; padding-bottom: 13px; margin: 18px 0 15px; }
.delivery-preview-tabs button { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: #9bb685; border: 1px solid transparent; border-radius: 7px; padding: 7px 10px; background: transparent; }
.delivery-preview-tabs button:hover { background: #f3f8ec; color: #82a767; }
.delivery-preview-tabs button.active,
.delivery-preview-tabs [aria-selected="true"] { border-color: #c7dfb3; background: #ebf6dd; color: #7b9f5a; }
.delivery-preview-tabs .icon { width: 12px; height: 12px; }
.payload-preview { min-width: 0; max-height: min(64vh, 640px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #bfd4a7 #f0f7e8; border: 1px solid #e0ecd3; border-radius: 12px; padding: 18px; background: #f8fcf1; color: #739260; font-size: 12px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; margin: 15px 0; }
.payload-preview > h3 { font-size: 13px; font-weight: 550; color: #6e9256; margin-bottom: 12px; line-height: 1.7; }
.payload-preview > h3 .icon { width: 15px; height: 15px; margin-right: 6px; }
.payload-preview .pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.payload-preview > p { margin: 9px 0; }
.payload-preview img,
.payload-preview video { width: 100%; height: auto; max-height: 250px; object-fit: contain; border-radius: 8px; display: block; margin: 14px 0; }
.payload-preview pre,
.payload-preview code { white-space: pre-wrap; overflow-wrap: anywhere; font: 10px/1.9 Consolas, monospace; margin: 0; color: #8ca779; }
.payload-preview > small { display: block; margin-top: 14px; border-top: 1px solid #e8f0dd; padding-top: 12px; color: #a5bc92; font-size: 9px; }
.workflow-empty { display: flex; flex-direction: column; align-items: center; gap: 7px; border: 1px dashed #d7e4c9; border-radius: 10px; background: #fafdf5; padding: 22px 15px; font-size: 11px; color: #a1b68c; text-align: center; line-height: 1.8; }
.workflow-empty .icon { width: 22px; height: 22px; color: #b5cba0; }
.reminder-card .empty-state,
.taxonomy-column .empty-state { font-size: 11px; color: #93ac7d; border-radius: 10px; padding: 21px 14px; }

@media (max-width: 1200px) {
  .channel-switch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
  .channel-switch-card { padding: 19px; }
  .attachment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .taxonomy-manager { grid-template-columns: 1fr; gap: 15px; }
  .taxonomy-column { padding: 16px; }
  .taxonomy-row { padding: 7px; gap: 4px; }
  .taxonomy-row button { width: 25px; }
  .taxonomy-row > input { font-size: 12px; }
  .project-edit-grid { gap: 13px 11px; }
  .x-import-strip { align-items: flex-start; flex-wrap: wrap; gap: 10px; padding: 16px; }
  .x-import-strip > div { flex-basis: calc(100% - 36px); }
  .x-import-strip > .btn { width: 100%; }
  .form-grid > .x-import-strip > small { flex-basis: 100%; }
  .x-import-strip strong { font-size: 12px; }
  .studio-media { padding: 18px; }
  .attachment-grid { gap: 9px; }
  .attachment-card img,
  .attachment-card video,
  .attachment-file { height: 110px; }
  .attachment-card .media-name { font-size: 9px; padding: 8px; }
  .attachment-remove,
  .attachment-card > [data-remove-attachment] { width: 28px; height: 28px; }
  .upload-zone { padding: 19px 12px; min-height: 87px; }
  .delivery-toggles { margin: 15px 18px; padding: 13px; }
  .reminder-card { padding: 17px; margin-top: 18px; }
  .reminder-form { gap: 12px 10px; }
  .reminder-item { padding: 10px; }
  .reminder-item strong { font-size: 11px; }
  .reminder-item small { font-size: 9px; }
  .offset-chip { padding: 6px 9px; font-size: 10px; }
  .channel-switch-grid { grid-template-columns: 1fr; gap: 14px; }
  .channel-switch-card { padding: 19px; }
  .channel-switch-copy,
  .channel-switch-card > p { font-size: 12px; }
  .channel-switch-card h3,
  .channel-switch-card h2 { font-size: 14px; }
  .delivery-preview-tabs { gap: 3px; }
  .delivery-preview-tabs button { padding: 6px 8px; font-size: 10px; }
  .payload-preview { padding: 16px; font-size: 12px; }
  .project-filter .filter-tabs { margin-bottom: 3px; }
  .project-filter .filter-note { font-size: 8px; }
}
@media (max-width: 380px) {
  .project-edit-grid,
  .reminder-form { grid-template-columns: 1fr; }
  .project-edit-grid .full-width,
  .project-edit-grid .form-field:has(textarea),
  .reminder-form .full-width,
  .reminder-form > .offset-picker,
  .reminder-form > .delivery-toggles,
  .reminder-form > .btn { grid-column: auto; }
  .attachment-grid { grid-template-columns: 1fr; }
  .attachment-card img,
  .attachment-card video,
  .attachment-file { height: 170px; }
}
@media (prefers-reduced-motion: reduce) {
  .channel-switch-card,
  .upload-zone { transition: none; }
}
