*{box-sizing:border-box;margin:0;padding:0}
body{
  font-family:system-ui, -apple-system, sans-serif;
  background:#0b0f19;
  color:#e2e8f0;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
.header{
  background:linear-gradient(135deg,#111827,#0f172a);
  border-bottom:1px solid #1e293b;
  padding:24px 16px 12px;
  position: relative;
}
.header-container {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  width: 100%;
}
.header-text {
  text-align: center;
}
.header h1{
  font-size:28px;
  font-weight:800;
  letter-spacing:1px;
  color:#fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header h1 span.highlight{
  color:#3b82f6;
  margin-left: 6px;
}
.header h1 span.version {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 10px;
  vertical-align: middle;
}
.header p{
  font-size:10.5px;
  color:#94a3b8;
  margin-top:4px;
}

.video-banner {
  max-width: 640px;
  width: 70%;
  height: 60px;
  margin: 12px auto 0;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(16, 24, 40, 0.3);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.video-banner video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.8;
}

.body{
  flex:1;
  padding:16px 12px 32px;
}
.app{
  max-width:640px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:16px;
  width:100%;
}
.card{
  background:#111827;
  border-radius:12px;
  border:1px solid #1e293b;
  padding:16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 16px;
}
.card:last-child {
  margin-bottom: 0;
}
.card-title{
  font-size:11px;
  font-weight:700;
  color:#3b82f6;
  letter-spacing:1px;
  text-transform:uppercase;
  margin-bottom:12px;
  display:flex;
  align-items:center;
  gap:6px;
}
.upload-area{
  border:2px dashed #334155;
  border-radius:10px;
  padding:24px 16px;
  cursor:pointer;
  transition:.2s;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:#0f172a;
}
.upload-area:hover{
  border-color:#3b82f6;
  background:rgba(59,130,246,.05);
}
.upload-area.has-file{
  border-color:#10b981;
  border-style:solid;
  background:rgba(16,185,129,.05);
}
.upload-area input{display:none}
.upload-text{flex:1; min-width:0;}
.upload-label{font-size:12.5px;color:#cbd5e1;font-weight:600;white-space:normal;line-height:1.4;cursor:pointer}
.upload-sub{font-size:10.5px;color:#64748b;margin-top:2px}
.file-name{font-size:11.5px;font-weight:600;color:#10b981;margin-top:4px;word-break:break-all}
.upload-btn-label{
  padding:8px 16px;
  border:1px solid #3b82f6;
  border-radius:6px;
  background:rgba(59,130,246,.1);
  color:#3b82f6;
  font-size:11px;
  font-weight:600;
  white-space:nowrap;
  cursor:pointer;
  flex-shrink: 0;
}
.upload-btn-label:hover{
  background:#3b82f6;
  color:#fff;
}
.hl-row{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:nowrap;
}
.hl-label{
  font-size:13px;
  font-weight:400;
  color:#f1f5f9;
  flex:1;
  min-width:0;
}
.toggle{position:relative;width:44px;height:24px;flex-shrink:0}
.toggle input{opacity:0;width:0;height:0}
.slider{
  position:absolute;
  inset:0;
  background:#334155;
  border-radius:24px;
  cursor:pointer;
  transition:.25s;
}
.slider:before{
  content:'';
  position:absolute;
  width:18px;
  height:18px;
  left:3px;
  top:3px;
  background:#94a3b8;
  border-radius:50%;
  transition:.25s;
}
.toggle input:checked+.slider{background:#3b82f6}
.toggle input:checked+.slider:before{transform:translateX(20px);background:#fff}

.toggle-small{width:35px;height:19px}
.toggle-small .slider:before{width:14px;height:14px;left:2px;top:2px}
.toggle-small input:checked+.slider:before{transform:translateX(16px)}

.settings-subrow{
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid #1e293b;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:14px;
}
.marker-style-group,.marker-color-group{
  display:flex;
  align-items:center;
  gap:10px;
}
.settings-subrow-label{
  font-size:11px;
  font-weight:700;
  color:#94a3b8;
  letter-spacing:0.5px;
  white-space:nowrap;
}
.marker-mode-switch{
  display:flex;
  align-items:center;
  gap:10px;
}
.marker-mode-label{
  font-size:12px;
  font-weight:600;
  color:#64748b;
  transition:color .2s;
}
.marker-mode-label.active{
  color:#f1f5f9;
}
.color-swatch-row{
  display:flex;
  gap:8px;
}

.dropdown-wrap{position:relative;flex-shrink:0}
.dropdown-btn{
  padding:8px 12px;
  border:1px solid #334155;
  border-radius:8px;
  background:#0f172a;
  font-size:12px;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:6px;
  color:#cbd5e1;
  white-space:nowrap;
  transition:.15s;
}
.dropdown-btn:hover{border-color:#3b82f6;color:#3b82f6}
.badge-count{
  background:#3b82f6;
  color:#fff;
  border-radius:10px;
  font-size:10px;
  padding:1px 6px;
  font-weight:700;
}
.badge-count.all{background:#10b981}
.arrow{font-size:8px;transition:.2s}
.dropdown-btn.open .arrow{transform:rotate(180deg)}
.dropdown-menu{
  position:absolute;
  background:#1e293b;
  border:1px solid #334155;
  border-radius:12px;
  padding:8px 0;
  max-width:240px;
  width:90%;
  z-index:1000;
  box-shadow:0 10px 15px -3px rgba(0,0,0,.5);
  max-height:220px;
  overflow-y:auto;
  text-align:left;
  left:50%;
  transform:translateX(-50%);
  top:calc(100% + 6px);
}
.menu-section{padding:4px 12px;font-size:9px;font-weight:700;color:#64748b;letter-spacing:1px;text-transform:uppercase}
.menu-item{display:flex;align-items:center;gap:8px;padding:6px 12px;cursor:pointer;font-size:12.5px;color:#cbd5e1;transition:.1s}
.menu-item:hover{background:rgba(59,130,246,.1);color:#fff}
.menu-item input[type=checkbox]{width:14px;height:14px;cursor:pointer;accent-color:#3b82f6;flex-shrink:0}

.custom-add-wrap{padding:0}
.custom-add-row{display:flex;gap:6px}
.custom-add-row input{
  flex:1;
  background:#0f172a;
  border:1px solid #334155;
  border-radius:8px;
  padding:8px 10px;
  font-size:12.5px;
  color:#fff;
  outline:none;
  transition:.15s;
}
.custom-add-row input:focus{border-color:#3b82f6}
.custom-add-row input::placeholder{color:#475569}
.custom-add-row button{
  padding:8px 14px;
  border:none;
  border-radius:8px;
  background:#3b82f6;
  color:#fff;
  font-size:12.5px;
  font-weight:600;
  cursor:pointer;
}
.custom-add-row button:hover{background:#2563eb}
.tag-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.tag{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:6px;font-size:11.5px;font-weight:600}
.tag-remove{cursor:pointer;opacity:.6;font-size:11px}
.tag-remove:hover{opacity:1}

.color-chip {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}
.color-chip:hover {
  transform: scale(1.15);
}
.color-chip.active {
  border-color: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.action-btn{
  width:100%;
  padding:12px;
  border:none;
  border-radius:8px;
  font-size:13px;
  font-weight:700;
  letter-spacing:.5px;
  transition:.25s;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  cursor:not-allowed;
}
.run-btn{background:#334155;color:#64748b}
.run-btn.active{
  background:linear-gradient(90deg,#a7f3d0,#86efac);
  color:#064e3b;
  cursor:pointer;
  border:1px solid #6ee7b7;
  font-weight:800;
  box-shadow: 0 4px 10px rgba(134, 239, 172, 0.2);
}
.run-btn.active:hover{filter:brightness(1.05);transform:translateY(-1px); box-shadow: 0 4px 12px rgba(134, 239, 172, 0.4);}

.dl-btn{background:#334155;color:#64748b}
.dl-btn.active{
  background:linear-gradient(90deg,#bfdbfe,#93c5fd);
  color:#1e3a8a;
  cursor:pointer;
  border:1px solid #93c5fd;
  font-weight:800;
  box-shadow: 0 4px 10px rgba(147, 197, 253, 0.2);
}
.dl-btn.active:hover{filter:brightness(1.05);transform:translateY(-1px); box-shadow: 0 4px 12px rgba(147, 197, 253, 0.4);}

.status-bar{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:8px;
  font-size:11.5px;
  font-weight:500;
  margin-top:10px;
  background:#0f172a;
  border:1px solid #1e293b;
  color:#64748b;
  min-height:40px;
}
.status-bar.ready{color:#3b82f6;border-color:#334155}
.status-bar.processing{color:#f59e0b;border-color:#451a03}
.status-bar.done{color:#10b981;border-color:#064e3b}
.status-bar.error{color:#ef4444;border-color:#7f1d1d}
.status-dot{width:8px;height:8px;border-radius:50%;background:currentColor;flex-shrink:0}
.status-bar.processing .status-dot{animation:pulse 1s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.3}}

.offline-instruction {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 10.5px;
  color: #93c5fd;
  line-height: 1.4;
}
.offline-instruction b {
  color: #fff;
}

.offline-row-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.3);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #1e293b;
  width: 100%;
}
.offline-row-links span {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}
.inline-download-btn {
  font-size: 11px;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
  padding: 5px 10px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.05);
  border-radius: 5px;
  transition: all 0.2s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.inline-download-btn:hover {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.survey-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 48px;
  background: #3b82f6;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 8px;
  font-size: 13px;
  transition: all 0.2s ease;
}
.survey-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* AI Briefing Card Styles */
.briefing-content {
  font-size: 13px;
  line-height: 1.6;
  color: #e2e8f0;
}
.loading-briefing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 16px;
  color: #94a3b8;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(59, 130, 246, 0.1);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.briefing-card-item {
  background: #1e293b;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid #3b82f6;
}
.briefing-card-item:last-child {
  margin-bottom: 0;
}
.briefing-card-header {
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.briefing-card-body {
  font-size: 12.5px;
  color: #cbd5e1;
}
.briefing-risk-critical { border-left-color: #ef4444; }
.briefing-risk-high { border-left-color: #f59e0b; }
.briefing-risk-medium { border-left-color: #eab308; }
.briefing-risk-low { border-left-color: #10b981; }
.briefing-risk-info { border-left-color: #8b5cf6; }

.briefing-section-divider {
  height: 1px;
  background: #334155;
  margin: 20px 0;
  position: relative;
}
.briefing-section-divider::after {
  content: '---';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #111827;
  padding: 0 10px;
  color: #475569;
  font-size: 10px;
  letter-spacing: 2px;
}

/* Header interactions */
.header-text h1 {
  cursor: pointer;
  user-select: none;
}
.header-text h1:hover {
  opacity: 0.8;
  transition: opacity 0.2s;
}
