* { box-sizing: border-box; }
body { font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; margin: 0; background: #f4f6f8; color: #222; font-size: 14px; }
.app { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }

.topbar { display: flex; align-items: center; gap: 24px; padding: 12px 0; border-bottom: 1px solid #e3e7ec; margin-bottom: 16px; }
.brand { font-weight: 600; font-size: 16px; }
.tabs { display: flex; gap: 4px; }
.tab { padding: 6px 12px; border-radius: 6px; text-decoration: none; color: #555; }
.tab.active { background: #2c6ef2; color: #fff; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.card { background: #fff; border: 1px solid #e3e7ec; border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
.card h3 { margin: 0 0 8px; }
.card h4 { margin: 12px 0 6px; font-size: 13px; color: #555; }
.kv td { padding: 3px 8px 3px 0; }
.hint { color: #666; font-size: 12px; margin: 6px 0; }
code { background: #eef1f5; padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.ok { color: #137a3d; font-weight: 600; }
.err { color: #b00020; font-weight: 600; }

.btn { background: #eef1f5; border: 1px solid #d5dae0; padding: 6px 12px; border-radius: 5px; cursor: pointer; font-size: 13px; }
.btn:hover { background: #e2e7ee; }
.btn.primary { background: #2c6ef2; color: #fff; border-color: #2c6ef2; }
.btn.primary:hover { background: #1f5ad6; }
.btn.danger { background: #fff; color: #b00020; border-color: #e6c1c8; }
.btn.danger:hover { background: #fbeaee; }
.btn.small { padding: 4px 8px; font-size: 12px; }
.btn.xs { padding: 2px 6px; font-size: 11px; }
.result { margin-left: 8px; font-size: 12px; }

.rule .rule-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.rule .spacer { flex: 1; }
.rule .block { margin-top: 10px; }
.rule .block-l { display: block; margin-top: 8px; }
.condition { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.condition select, .condition input { padding: 4px 6px; }
.map td { padding: 4px 8px 4px 0; }
.map td:first-child { color: #555; width: 220px; }
.hint-inline { color: #888; font-size: 11px; margin-left: 6px; }

select, input[type=text], textarea { padding: 5px 7px; border: 1px solid #d5dae0; border-radius: 4px; font-size: 13px; font-family: inherit; }
textarea { width: 100%; }

/* Searchable select */
.ss { position: relative; display: inline-block; min-width: 260px; }
.ss-input { width: 100%; padding: 5px 24px 5px 7px; border: 1px solid #d5dae0; border-radius: 4px; font-size: 13px; background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23888' d='M0 0l5 6 5-6z'/></svg>") no-repeat right 8px center; }
.ss-input:focus { outline: none; border-color: #2c6ef2; box-shadow: 0 0 0 2px rgba(44,110,242,.15); }
.ss-dd { display: none; position: absolute; top: calc(100% + 2px); left: 0; right: 0; max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid #d5dae0; border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.08); z-index: 100; }
.ss-dd.open { display: block; }
.ss-group { padding: 5px 8px; font-size: 11px; font-weight: 600; color: #888; background: #f4f6f8; text-transform: uppercase; letter-spacing: .03em; position: sticky; top: 0; }
.ss-opt { padding: 5px 8px; cursor: pointer; font-size: 13px; }
.ss-opt:hover { background: #eef4ff; }
.ss-opt.selected { background: #2c6ef2; color: #fff; }
.ss-empty { padding: 8px; color: #999; font-size: 12px; text-align: center; }

.toolbar { display: flex; gap: 8px; align-items: center; }
table.log { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e3e7ec; border-radius: 8px; overflow: hidden; }
table.log th, table.log td { padding: 6px 8px; border-bottom: 1px solid #eef1f5; text-align: left; vertical-align: top; font-size: 12px; }
table.log th { background: #f7f9fb; font-weight: 600; }
table.log .status-ok { color: #137a3d; }
table.log .status-error { color: #b00020; }
table.log .status-skip { color: #888; }
table.log details summary { cursor: pointer; color: #2c6ef2; }
table.log pre { white-space: pre-wrap; word-break: break-all; max-width: 380px; background: #f7f9fb; padding: 6px; border-radius: 4px; }
