body { font-family: Arial, sans-serif; margin: 0; background: #f4f6f8; color: #222; overflow-x: hidden; }
.topbar { display:flex; justify-content:space-between; align-items:center; padding:14px 20px; background:#111827; color:#fff; gap:12px; flex-wrap:wrap; }
.brand { font-size:22px; font-weight:700; }
.topbar a { color:#fff; margin-left:14px; text-decoration:none; }
.container { max-width: 1240px; margin: 24px auto; padding: 0 16px 24px; box-sizing:border-box; }
.auth-page .container { max-width: 760px; margin-top: 40px; }
.card { background:#fff; border-radius:14px; padding:18px; box-shadow:0 2px 8px rgba(0,0,0,.06); margin-bottom:16px; overflow:hidden; }
.dashboard-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.hero-card { min-height: 220px; display:flex; flex-direction:column; }
.run-control-card { min-height: 260px; }
.info-panel { min-height: 320px; }
label { display:grid; gap:6px; font-size:14px; min-width:0; }
.field-row { display:grid; grid-template-columns:220px 220px; gap:12px; align-items:end; margin-bottom:12px; }
.field-stack { display:grid; grid-template-columns:220px; gap:14px; align-items:start; margin-bottom:12px; }
.field-block { min-width:0; }
.field-label { font-size:14px; color:#334155; margin-bottom:8px; font-weight:600; }
.option-group { display:grid; grid-template-columns:1fr 1fr; gap:10px; max-width:320px; }
.option-card { display:flex; align-items:center; gap:8px; padding:10px 12px; border:1px solid #cbd5e1; border-radius:10px; background:#f8fafc; cursor:pointer; }
.option-card input[type="radio"] { width:auto; margin:0; }
input, textarea, select, button { font: inherit; padding:10px; border:1px solid #cbd5e1; border-radius:10px; width:100%; box-sizing:border-box; max-width:100%; }
button { background:#2563eb; color:#fff; border:none; cursor:pointer; }
button.danger { background:#dc2626; }
.run-control-form { display:flex; flex:1; flex-direction:column; min-height:0; }
.run-control-body { flex:1; }
.run-control-footer { margin-top:auto; display:flex; justify-content:flex-end; align-items:flex-end; gap:12px; padding-top:20px; }
.run-control-footer-left { justify-content:flex-start; align-items:flex-end; }
.action-btn { width:140px; min-width:140px; height:40px; padding:9px 16px; white-space:nowrap; }
pre { white-space:pre-wrap; word-break:break-word; background:#0f172a; color:#e2e8f0; padding:12px; border-radius:10px; overflow:auto; }
.logbox { max-height: 320px; min-height: 180px; }
.file-list { list-style:none; padding:0; margin:0; display:grid; gap:10px; }
.file-list-scroll { height:236px; overflow-y:auto; padding-right:4px; }
.file-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px; border:1px solid #e2e8f0; border-radius:10px; background:#f8fafc; }
.file-main { min-width:0; display:flex; flex-direction:column; gap:4px; }
.file-actions { display:flex; align-items:center; gap:6px; flex-shrink:0; }
.file-list span { color:#64748b; font-size:13px; }
.download-btn { display:inline-flex; align-items:center; justify-content:center; min-width:72px; padding:8px 12px; border-radius:10px; background:#2563eb; color:#fff; text-decoration:none; white-space:nowrap; }
.icon-delete-btn { width:22px; height:22px; min-width:22px; padding:0; border-radius:999px; background:transparent; color:#a1a1aa; border:1px solid #e5e7eb; font-size:12px; line-height:1; }
.icon-delete-btn:hover { background:#f8fafc; color:#b91c1c; border-color:#fecdd3; }
.card-title-row { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:8px; }
.card-title-row h2 { margin:0; }
.ghost-danger { width:auto; min-width:0; padding:6px 10px; background:#fff; color:#be123c; border:1px solid #fecdd3; box-shadow:none; }
.tiny-btn { font-size:12px; line-height:1; }
.summary-grid { display:grid; gap:10px; }
.status-grid { grid-template-columns:1fr 1fr; }
.summary-tile { padding:12px; border:1px solid #e2e8f0; border-radius:10px; background:#f8fafc; min-height:76px; }
.summary-key { color:#64748b; font-size:13px; margin-bottom:6px; }
.summary-value { color:#0f172a; font-weight:600; word-break:break-word; }
.summary-sub { color:#64748b; font-size:13px; margin-top:6px; }
.muted { color:#64748b; font-size:14px; margin:0; }
.flash-wrap { display:grid; gap:12px; margin-bottom:16px; }
.flash { padding:12px 14px; border-radius:12px; font-weight:600; box-shadow:0 2px 8px rgba(0,0,0,.06); }
.flash-success { background:#dcfce7; color:#166534; border:1px solid #86efac; }
.flash-danger { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }
.flash-info { background:#dbeafe; color:#1d4ed8; border:1px solid #93c5fd; }
.auth-card { max-width: 400px; margin: 0 auto; padding: 20px 24px; }
.auth-card h1 { margin: 0 0 18px; text-align: center; }
.auth-form { display:grid; gap:18px; justify-items:center; }
.auth-form label { width: 100%; max-width: 304px; }
.auth-form input, .auth-form button { max-width: 304px; }
.password-form .form-actions { width: 100%; max-width: 304px; margin-top: 10px; justify-content:center; }
.login-form { display:grid; gap:20px; justify-items:center; }
.login-form label { width: 100%; max-width: 304px; }
.login-form .form-actions { width: 100%; max-width: 304px; justify-content:center; }
.config-form { display:block; }
.config-stack { display:block; }
.config-item { margin-bottom:20px; }
.config-label { font-size:14px; color:#334155; margin-bottom:8px; font-weight:600; }
.config-item-inline { display:flex; align-items:center; gap:12px; }
.config-item-inline .config-label { margin-bottom:0; }
.config-item-inline input[type="checkbox"] { width:auto; }
.config-actions { margin-top:16px; }
.save-btn { width:auto; min-width:160px; }
.form-actions { margin-top:8px; display:flex; gap:12px; }
.table-wrap { overflow:auto; }
.preview-table { width:max-content; min-width:100%; border-collapse:collapse; }
.preview-table th, .preview-table td { border:1px solid #e2e8f0; padding:8px 10px; text-align:left; vertical-align:top; background:#fff; }
.preview-table th { background:#f8fafc; position:sticky; top:0; }

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns:1fr; }
  .field-row { grid-template-columns:1fr 1fr; }
  .run-control-footer { justify-content:flex-start; }
  .action-btn { width:100%; min-width:0; }
  .status-grid { grid-template-columns:1fr 1fr; }
  .card { padding:14px; }
  .hero-card, .info-panel { min-height:auto; }
  .topbar a { margin-left:0; margin-right:12px; }
  .card-title-row { align-items:flex-start; }
}

@media (max-width: 520px) {
  .field-row { grid-template-columns:1fr; }
  .run-control-footer { display:grid; grid-template-columns:1fr 1fr; }
  .status-grid { grid-template-columns:1fr 1fr; }
}

.daily-searched-note { display:flex; align-items:center; gap:8px; flex-wrap:wrap; color:#64748b; font-size:13px; }
.subtle-danger-btn { width:auto; min-width:0; padding:4px 8px; border-radius:999px; background:transparent; color:#94a3b8; border:1px solid #e5e7eb; font-size:12px; box-shadow:none; }
.subtle-danger-btn:hover { color:#b91c1c; border-color:#fecdd3; background:#f8fafc; }

.flash-wrap { position:fixed; top:72px; right:18px; z-index:1000; width:min(360px, calc(100vw - 36px)); display:grid; gap:10px; margin:0; pointer-events:none; }
.flash { position:relative; display:flex; align-items:center; justify-content:space-between; gap:10px; animation:toast-in .24s ease-out; pointer-events:auto; }
.flash-hide { animation:toast-out .24s ease-in forwards; }
.flash-close { width:22px; min-width:22px; height:22px; padding:0; border-radius:999px; background:transparent; color:currentColor; opacity:.55; border:none; line-height:1; }
.flash-close:hover { opacity:1; background:rgba(255,255,255,.45); }
@keyframes toast-in { from { opacity:0; transform:translateY(-8px) scale(.98); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes toast-out { from { opacity:1; transform:translateY(0) scale(1); } to { opacity:0; transform:translateY(-8px) scale(.98); } }
