/* Shared interaction rules. Keep business pages' own layout and colour system. */
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid #245fce;
  outline-offset: 3px;
}
:where(button, summary, a) { touch-action: manipulation; }
:where([id]) { scroll-margin-top: 24px; }
:where(dialog) { overscroll-behavior: contain; }
@media (pointer: coarse) {
  :where(button, summary, select) { min-height: 44px; }
  :where(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), textarea, select) { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.ws-task-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 22px 0 28px; }
.ws-task-actions a { display: flex; align-items: center; gap: 12px; padding: 20px 16px; border: 1px solid #dde6f0; border-radius: 14px; background: #fff; color: #2c5a8f; text-decoration: none; transition: border-color .15s, background .15s; }
.ws-task-actions a:first-child { background: #edf4ff; border-color: #b8d0f4; }
.ws-task-actions a:hover { background: #f0f6ff; border-color: #88afe7; }
.ws-task-actions span { display: grid; gap: 6px; flex: 1; min-width: 0; }
.ws-task-actions strong { font-size: 16px; color: #24415f; }
.ws-task-actions small { font-size: 12px; color: #61748b; }
.ws-task-actions svg { flex-shrink: 0; }
.ws-account-settings { margin: 20px 0; border: 1px solid #e0e7ef; border-radius: 12px; background: #fff; }
.ws-account-settings > summary { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 14px 18px; cursor: pointer; list-style: none; color: #425b78; font-size: 14px; }
.ws-account-settings > summary span { margin-left: auto; font-size: 12px; color: #74839a; }
.ws-account-settings > div { padding: 0 18px 18px; }
.ws-account-settings[open] > summary > svg:last-child { transform: rotate(180deg); }
@media (max-width: 1180px) { .ws-task-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .ws-task-actions { gap: 9px; margin: 16px 0 22px; }
  .ws-task-actions a { gap: 9px; padding: 15px 12px; }
  .ws-task-actions a > svg:last-child { display: none; }
  .ws-task-actions strong { font-size: 14px; }
  .ws-task-actions small { font-size: 11px; }
  .ws-account-settings > summary span { display: none; }
}

.pfw-file-buttons { display: grid; justify-items: center; gap: 3px; flex-shrink: 0; }
.pod-header-actions > a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: #355779; font-size: 14px; text-decoration: none; }
.pod-header-actions > a:hover { text-decoration: underline; }
.pod-app > .pl-tabs { display: flex; gap: 6px; border-bottom: 1px solid #dce5f1; margin: 20px 0; }
.pod-app > .pl-tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; min-height: 44px; padding: 10px 18px; color: #65758e; }
.pod-app > .pl-tabs button[aria-selected=true] { color: #3764c8; border-bottom-color: #4877df; font-weight: 650; }
.pfw-source.pfw-source-ready { border-color: #d8e5e1; background: #f3f9f6; color: #41705b; }
.pfw .pfw-text-button { border: 0; background: transparent; color: #346aaa; font-size: 13px; padding: 4px 10px; }
.pfw-options { margin: 18px 0 0 45px; border-top: 1px solid #dfe8f2; font-size: 13px; }
.pfw-options > summary { display: flex; align-items: center; gap: 10px; padding: 12px 0; min-height: 44px; cursor: pointer; list-style: none; color: #3f5e82; }
.pfw-options > summary span { margin-left: auto; font-size: 12px; color: #657c95; }
.pfw-options[open] > summary svg { transform: rotate(180deg); }
.pfw-options-content { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; padding: 5px 0 10px; }
.pfw-options-content p { flex-basis: 100%; font-size: 12px; color: #657c95; margin: 0; line-height: 1.7; }
.pfw-operation > strong { font-size: 15px; line-height: 1.6; }
.pfw .pfw-action-area > .pfw-step { margin-top: 0; }
.pfw .pfw-action-buttons button { min-width: 134px; min-height: 44px; }
.pfw .pfw-footnote { margin-top: 8px; }
.pfw-history { border: 1px solid #dce5ef; border-radius: 12px; background: #fff; margin: 24px 0; scroll-margin-top: 24px; }
.pfw-history > summary { cursor: pointer; padding: 17px 20px; color: #355779; font-size: 15px; }
.pfw-history > summary span { font-size: 12px; color: #6b8098; margin-left: 14px; }
.pfw-history .puh-panel { border: 0; margin: 0; }
.pfw-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 18px; font-size: 12px; color: #607994; border-top: 1px solid #e2e9f1; }
.pfw-pagination span { margin-right: auto; }
@media (max-width: 620px) {
  .pfw-file-buttons { width: calc(100% - 36px); justify-items: stretch; margin-left: 36px; }
  .pfw-file-buttons .pfw-folder-button { margin-left: 0; }
  .pfw .pfw-action-buttons { margin-top: 5px; }
  .pfw-options { margin-left: 36px; }
  .pfw-options > summary { flex-wrap: wrap; gap: 6px; }
  .pfw-options > summary span { margin-left: 0; font-size: 11px; }
  .pfw-history > summary span { display: block; margin: 8px 0 0 18px; }
}

.ai-execution-options { flex-shrink: 0; margin: 0 20px; align-self: flex-start; color: #64748b; font-size: 12px; }
.ai-execution-options > summary { display: flex; align-items: center; gap: 5px; min-height: 32px; cursor: pointer; list-style: none; }
.ai-execution-options .ai-execution-picker { margin: 0; padding: 4px 0 8px; }
.ai-execution-options[open] > summary svg { transform: rotate(180deg); }
.ai-agent-canvas > .ai-execution-options { margin-left: max(24px, calc((100% - 820px) / 2)); }
@media (max-width: 600px) { .ai-agent-canvas > .ai-execution-options { margin-left: 16px; } }

.kefu-tools { position: relative; }
.kefu-tools > summary { list-style: none; cursor: pointer; padding: 9px 14px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #475569; font-size: 14px; }
.kefu-tools > summary::after { content: '⌄'; margin-left: 9px; }
.kefu-tools[open] > summary { background: #f1f5f9; }
.kefu-tools-menu { display: grid; gap: 8px; position: absolute; z-index: 50; right: 0; top: calc(100% + 8px); width: 230px; padding: 12px; background: #fff; border: 1px solid #dbe3ee; border-radius: 12px; box-shadow: 0 12px 32px #1e3a5f24; }
.kefu-tools-menu > button { justify-content: flex-start; width: 100%; }
.kefu-stats > summary { cursor: pointer; color: #64748b; font-size: 12px; padding: 12px 0 0; }
@media (max-width: 640px) {
  body:has(.kefu-main) > header { position: static; }
}
