/* Trợ lý nhập liệu (plg_system_softwayinput) */
.sw-ia-ui, .sw-ia-ui * { box-sizing: border-box; }
.sw-ia-ui { font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: #1d2733; text-align: left; letter-spacing: normal; text-transform: none; }

.sw-ia-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 5px 0 2px; }
.sw-ia-bar:empty { display: none; }

.sw-ia-btn { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 3px 10px; min-height: 26px; border: 1px solid #d6dce5; border-radius: 999px; background: #fff; color: #1d2733; font: inherit; font-size: 12.5px; line-height: 1.3; cursor: pointer; box-shadow: none; text-shadow: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.sw-ia-btn:hover { background: #f3f6fa; border-color: #b9c3d1; }
.sw-ia-btn:focus { outline: none; }
.sw-ia-btn:focus-visible { outline: 2px solid #5b8def; outline-offset: 1px; }
.sw-ia-btn[disabled] { opacity: .45; cursor: not-allowed; }
.sw-ia-btn--icon { padding: 3px 8px; }
.sw-ia-btn--primary { background: #f14833; border-color: #f14833; color: #fff; }
.sw-ia-btn--primary:hover { background: #d93a26; border-color: #d93a26; }
.sw-ia-btn--soft { background: #fff6f4; border-color: #fbd0c8; color: #b8321f; }
.sw-ia-btn--soft:hover { background: #ffece8; }
.sw-ia-btn--link { border: 0; background: none; padding: 0 4px; min-height: 0; color: #1f5fbf; text-decoration: underline; font-weight: 600; }
.sw-ia-btn--link:hover { background: none; color: #164a96; }
.sw-ia-btn--live { background: #e8f7ee; border-color: #3aa76d; color: #1e7a4a; animation: sw-ia-pulse 1.2s infinite; }
.sw-ia-ai { border-color: #f6c4bb; color: #c13a26; }

.sw-ia-count { margin-left: auto; font-size: 12px; color: #7b8696; }
.sw-ia-count--near { color: #c13a26; font-weight: 600; }

.sw-ia-hint { margin: 4px 0 2px; padding: 4px 9px; border-radius: 6px; font-size: 12.5px; line-height: 1.45; }
.sw-ia-hint[hidden] { display: none !important; }
.sw-ia-hint--ok { background: #ecf8f1; color: #1e6b43; }
.sw-ia-hint--warn { background: #fff5e5; color: #8a5300; }
.sw-ia-hint--info { background: #eef3fb; color: #2b4a75; }

.sw-ia-flash { animation: sw-ia-flash 1.6s ease-out; }
@keyframes sw-ia-flash { 0% { box-shadow: 0 0 0 3px rgba(241, 72, 51, .45); } 100% { box-shadow: 0 0 0 3px rgba(241, 72, 51, 0); } }
@keyframes sw-ia-pulse { 50% { box-shadow: 0 0 0 4px rgba(58, 167, 109, .25); } }

.sw-ia-formbar { display: flex; justify-content: flex-end; margin: 0 0 8px; }

.sw-ia-pop { position: absolute; z-index: 100050; padding: 10px; background: #fff; border: 1px solid #d6dce5; border-radius: 10px; box-shadow: 0 10px 30px rgba(20, 30, 50, .18); }
.sw-ia-menu { display: flex; flex-direction: column; gap: 8px; }
.sw-ia-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.sw-ia-brief, .sw-ia-source { width: 100%; max-width: none; margin: 0; padding: 7px 9px; border: 1px solid #d6dce5; border-radius: 7px; font: inherit; font-size: 13px; color: #1d2733; background: #fff; box-shadow: none; height: auto; }
.sw-ia-brief:focus, .sw-ia-source:focus { outline: none; border-color: #5b8def; box-shadow: 0 0 0 2px rgba(91, 141, 239, .2); }
.sw-ia-preview { max-height: 260px; overflow: auto; padding: 8px 10px; background: #f7f9fc; border-radius: 7px; white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.sw-ia-note { margin-top: 6px; padding: 5px 8px; background: #fff5e5; color: #8a5300; border-radius: 6px; font-size: 12.5px; }
.sw-ia-error { color: #a82a17; font-size: 13px; }
.sw-ia-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.sw-ia-small { margin: 0 0 8px; font-size: 12px; color: #6b7788; }
.sw-ia-wait, .sw-ia-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #4a5668; }
.sw-ia-spin { display: inline-block; width: 14px; height: 14px; border: 2px solid #f6c4bb; border-top-color: #f14833; border-radius: 50%; animation: sw-ia-spin .8s linear infinite; }
@keyframes sw-ia-spin { to { transform: rotate(360deg); } }

.sw-ia-overlay { position: fixed; inset: 0; z-index: 100060; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px 12px; background: rgba(15, 23, 36, .45); overflow: auto; }
.sw-ia-dialog { width: 100%; max-width: 560px; padding: 14px 16px 16px; background: #fff; border-radius: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.sw-ia-dialog__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 15px; }
.sw-ia-thumb { position: relative; display: inline-block; margin-top: 8px; }
.sw-ia-thumb[hidden] { display: none; }
.sw-ia-thumb img { display: block; max-width: 160px; max-height: 110px; border-radius: 6px; border: 1px solid #d6dce5; }
.sw-ia-thumb .sw-ia-btn { position: absolute; top: -8px; right: -8px; padding: 0 7px; min-height: 22px; }
.sw-ia-proposal { margin-top: 12px; border-top: 1px solid #e3e7ee; padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.sw-ia-row { display: grid; grid-template-columns: 20px minmax(90px, 32%) 1fr; gap: 8px; align-items: start; margin: 0; padding: 5px 4px; border-radius: 6px; font-size: 13px; font-weight: normal; cursor: pointer; }
.sw-ia-row:hover { background: #f7f9fc; }
.sw-ia-row input { margin: 2px 0 0; }
.sw-ia-row__label { color: #6b7788; }
.sw-ia-row__val { word-break: break-word; }
.sw-ia-row__val s { color: #a3acb9; }

@media (max-width: 600px) {
	.sw-ia-row { grid-template-columns: 20px 1fr; }
	.sw-ia-row__val { grid-column: 2; }
	.sw-ia-overlay { padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.sw-ia-flash, .sw-ia-btn--live, .sw-ia-spin { animation: none; }
}
