.wcp-page {
  --blue: #0879b8;
  --blue-dark: #06496f;
  --cyan: #45c9ee;
  --orange: #ff6b35;
  --green: #20a66a;
  --yellow: #d99000;
  --red: #d64040;
  --ink: #172b3a;
  --muted: #5f7280;
  --line: #d8e5ec;
  --bg: #f4f8fb;
  background: var(--bg);
  color: var(--ink);
}
.wcp-page * { box-sizing: border-box; }
.wcp-page button, .wcp-page select { font: inherit; }
.wcp-page button { color: inherit; }
.app-shell { width: min(1080px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 64px; }
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
  margin-bottom: 18px;
  padding: 28px 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue-dark), #0879b8);
  color: #fff;
  box-shadow: 0 12px 30px rgba(8,73,111,.13);
}
.eyebrow, .section-number {
  margin: 0 0 7px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(27px, 4.2vw, 42px); line-height: 1.35; letter-spacing: 0; }
.lede { max-width: 650px; margin: 0; color: rgba(255,255,255,.86); font-size: 13px; line-height: 1.8; }
.meter {
  min-width: 132px;
  padding: 16px 18px;
  border-radius: 7px;
  background: rgba(255,255,255,.13);
  text-align: center;
}
.meter-label { display: block; color: #bcecff; font-size: 11px; font-weight: 700; }
.meter strong { font-size: 42px; line-height: 1.1; }
.meter-unit { margin-left: 3px; font-size: 12px; font-weight: 700; }
.control-panel, .planner, .selection-drawer, .analysis-results {
  margin-top: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(8,73,111,.07);
}
.control-panel { display: grid; gap: 16px; }
.mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.mode-button {
  display: grid;
  gap: 3px;
  min-height: 76px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdff;
  text-align: left;
  cursor: pointer;
}
.mode-button span { font-size: 14px; font-weight: 800; }
.mode-button small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.mode-button.is-active { border-color: var(--blue); background: #eef9fd; box-shadow: inset 0 0 0 2px rgba(69,201,238,.22); }
.model-field { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; }
.model-field label { color: var(--ink); font-size: 12px; font-weight: 700; }
.model-field select {
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}
.toolbar, .section-heading, .drawer-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.status-copy { display: grid; gap: 3px; }
.status-copy strong { color: var(--blue-dark); font-size: 14px; }
.status-copy span { color: var(--muted); font-size: 11px; line-height: 1.55; }
.toolbar-actions { display: flex; align-items: center; gap: 12px; }
.analyze-button {
  min-width: 120px;
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid var(--orange);
  border-radius: 6px;
  background: var(--orange);
  color: #fff !important;
  font-weight: 700;
  cursor: pointer;
}
.analyze-button:hover { background: #e85d2a; }
.analyze-button:disabled { border-color: #c8d4da; background: #c8d4da; cursor: default; }
.reset-button {
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--muted) !important;
  font-size: 11px;
  cursor: pointer;
}
.reset-button:disabled { opacity: .35; cursor: default; }
.section-heading { margin-bottom: 16px; }
.section-number { color: var(--blue); }
.wcp-page h2 { margin: 0; color: var(--ink); font-size: 20px; letter-spacing: 0; }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px 12px; }
.legend span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; }
.dot.safe { border: 1px solid var(--muted); }
.dot.adjacent { background: #8b989f; }
.dot.warning { background: var(--yellow); }
.dot.danger { background: var(--red); }
.dot.selected, .dot.available { background: var(--green); }
.dot.external { background: var(--blue); }
.channel-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.channel {
  position: relative;
  min-height: 82px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdff;
  color: var(--ink) !important;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.channel:hover:not(:disabled) { border-color: var(--blue); transform: translateY(-1px); }
.channel:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid #aebdc5;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 900;
}
.channel-no { display: flex; min-height: 14px; align-items: center; gap: 5px; padding-right: 20px; color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.channel-no b { overflow: hidden; color: var(--blue); font-size: 9px; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.frequency { display: block; margin-top: 14px; font-size: 14px; font-weight: 800; }
.mhz { color: var(--muted); font-size: 9px; font-weight: 500; }
.plan-label { display: block; min-height: 14px; margin-top: 4px; color: var(--blue); font-size: 9px; font-weight: 700; }
.channel.is-selected { border-color: var(--green); background: #effaf5; }
.channel.is-selected .check { border-color: var(--green); background: var(--green); color: #fff; }
.channel.is-danger { border-color: var(--red); background: #fff4f4; }
.channel.is-warning, .channel.is-nearby-guard { border-color: var(--yellow); background: #fff9ed; }
.channel.is-nearby-used { border-color: var(--blue); background: #eef9fd; }
.channel.is-nearby-used .check { border-color: var(--blue); background: var(--blue); color: #fff; }
.channel.is-nearby-used .plan-label { color: var(--blue); }
.channel.is-available { border-color: var(--green); background: #f1fbf6; }
.channel.is-available .plan-label { color: var(--green); }
.channel:disabled { cursor: not-allowed; opacity: .34; }
.channel.is-danger:disabled, .channel.is-warning:disabled { opacity: .66; }
.channel.is-adjacent:disabled { opacity: .45; background: #f0f3f5; }
.analysis-results { border-top: 5px solid var(--green); }
.recommendation-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.recommendation-card { padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: #fbfdff; }
.recommendation-card.is-primary { border-color: var(--green); background: #f1fbf6; }
.recommendation-rank { color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.recommendation-card h3 { margin: 5px 0; color: var(--ink); font-size: 19px; }
.recommendation-card p { min-height: 34px; margin: 0 0 11px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.recommendation-channels { display: flex; flex-wrap: wrap; gap: 5px; }
.recommendation-channels span { padding: 4px 6px; border-radius: 4px; background: #e5f6ed; color: #15774b; font-size: 9px; font-weight: 700; }
.group-badge { padding: 6px 10px; border-radius: 4px; background: var(--blue); color: #fff; font-size: 10px; font-weight: 700; }
.empty-state { padding: 28px 0 16px; color: var(--muted); font-size: 12px; text-align: center; }
.selected-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 18px 0; padding: 0; list-style: none; }
.selected-list:empty { display: none; }
.selected-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 6px; background: #fbfdff; font-size: 11px; }
.selected-list b { color: var(--blue); }
.selected-list button { border: 0; background: transparent; color: var(--muted) !important; cursor: pointer; }
.copy-button {
  display: flex;
  width: 100%;
  justify-content: space-between;
  padding: 12px 15px;
  border: 1px solid var(--blue-dark);
  border-radius: 6px;
  background: var(--blue-dark);
  color: #fff !important;
  font-weight: 700;
  cursor: pointer;
}
.copy-button:disabled { border-color: #c8d4da; background: #c8d4da; cursor: default; }
.note { margin: 14px 2px 0; color: var(--muted); font-size: 9px; line-height: 1.7; }
.group-dialog { width: min(420px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 8px; background: #fff; color: var(--ink); box-shadow: 0 20px 60px rgba(8,73,111,.25); }
.group-dialog::backdrop { background: rgba(6,35,52,.65); }
.group-dialog form { padding: 24px; }
.dialog-frequency { margin: 8px 0 18px; color: var(--muted); font-size: 12px; }
.group-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.group-choice { padding: 13px 7px; border: 1px solid var(--line); border-radius: 6px; background: #fbfdff; font-weight: 800; cursor: pointer; }
.group-choice:hover { border-color: var(--blue); color: var(--blue); }
.dialog-cancel { width: 100%; margin-top: 12px; padding: 9px; border: 0; background: transparent; color: var(--muted) !important; cursor: pointer; }
@media (max-width: 760px) {
  .app-shell { width: min(100% - 24px, 1080px); padding: 24px 0 44px; }
  .hero { grid-template-columns: 1fr auto; padding: 22px; }
  .meter { min-width: 94px; padding: 12px; }
  .mode-switch { grid-template-columns: 1fr; }
  .mode-button { min-height: auto; }
  .channel-grid { grid-template-columns: repeat(3, 1fr); }
  .recommendation-grid { grid-template-columns: 1fr; }
  .selected-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .app-shell { width: min(100% - 16px, 1080px); }
  .hero { grid-template-columns: 1fr; padding: 19px; }
  .hero h1 { font-size: 26px; }
  .meter { display: flex; align-items: baseline; gap: 5px; text-align: left; }
  .meter-label { margin-right: auto; }
  .control-panel, .planner, .selection-drawer, .analysis-results { padding: 15px; }
  .model-field { grid-template-columns: 1fr; gap: 6px; }
  .toolbar, .section-heading { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; justify-content: space-between; }
  .analyze-button { flex: 1; }
  .legend { justify-content: flex-start; }
  .channel-grid { grid-template-columns: repeat(2, 1fr); }
  .selected-list { grid-template-columns: 1fr; }
}
