.dict-layout { display:flex; gap:24px; align-items:flex-start; }


  .cho-sidebar { flex:0 0 220px; position:sticky; top:16px; max-height:calc(100vh - 32px); overflow-y:auto; border:1px solid #eee; border-radius:12px; }
  .cho-sidebar-title { font-size:13px; color:var(--text-sub); font-weight:700; padding:12px 14px 8px; }
  .cho-group { border-top:1px solid #f0f0f0; }
  .cho-group summary { list-style:none; cursor:pointer; padding:10px 14px; font-weight:800; font-size:15px; display:flex; justify-content:space-between; align-items:center; }
  .cho-group summary::-webkit-details-marker { display:none; }
  .cho-group summary .cho-count { font-size:12px; font-weight:500; color:var(--text-sub); }
  .cho-group[open] summary { background:#f2f8f5; color:var(--brand,#1e8e5a); }
  .cho-group-list { max-height:220px; overflow-y:auto; padding:0 14px 10px; }
  .cho-word-item { padding:6px 4px; font-size:14px; cursor:pointer; border-radius:6px; }
  .cho-word-item:hover { background:#f2f8f5; }
  .cho-group-empty { padding:6px 4px; font-size:13px; color:var(--text-sub); }


  .dict-main { flex:1; min-width:0; }
  .search-row { display:flex; gap:8px; margin-bottom:16px; }
  .search-row input { flex:1; padding:10px 14px; border:1px solid #ddd; border-radius:8px; }
  .main-results-label { font-size:13px; color:var(--text-sub); margin-bottom:10px; }
  .main-results {
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:14px;
  min-height: 520px;
  align-content: start;
  overflow-y:auto;
  padding-right:4px;
}

@media (max-width: 768px) {
  .dict-layout {
    flex-direction: column;
  }
  .cho-sidebar {
    flex: none;
    width: 100%;
    position: static;
    max-height: 300px;
  }
  .main-results {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .main-results {
    grid-template-columns: repeat(1, 1fr);
  }
}
  .word-card { border:1px solid #eee; border-radius:14px; overflow:hidden; background:#fafafa; cursor:pointer; }
  .word-card video { width:100%; aspect-ratio:4/3; object-fit:cover; background:#000; display:block; }

  

  .word-video-wrap { position:relative; width:100%; aspect-ratio:4/3; background:#000; }
  .word-video-wrap video { width:100%; height:100%; object-fit:cover; display:block; }
  .word-video-wrap.no-thumb { background:#f0f0f0; }
  .video-unavailable {
    position:absolute; top:0; left:0; width:100%; height:100%;
    display:none; align-items:center; justify-content:center;
    background:#f0f0f0; color:var(--text-sub); font-size:13px; font-weight:600;
  }
  .word-video-wrap{position:relative}
  .fav-star{position:absolute;top:8px;z-index:2;width:30px;height:30px;border-radius:50%;background:rgba(255,255,255,.85);border:none;font-size:16px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#c9c9c9}
  .fav-star.active{color:#FFC23E}
  .detail-fav-star{cursor:pointer;font-size:22px;color:#c9c9c9;margin-left:8px;vertical-align:middle}
  .detail-fav-star.active{color:#FFC23E}

  .word-card-name {
  padding:8px 10px;
  font-weight:800;
  font-size:14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
  .main-results-empty { padding:24px; color:var(--text-sub); font-size:14px; }

  .pagination { display:flex; gap:6px; justify-content:center; margin-top:16px; }
  .page-btn { border:1px solid #ddd; background:#fff; border-radius:6px; padding:6px 12px; font-size:13px; cursor:pointer; }
  .page-btn.active { background:var(--brand,#1e8e5a); color:#fff; border-color:var(--brand,#1e8e5a); }

  .sort-btns { display:flex; gap:6px; }
.sort-btn { border:1px solid #ddd; background:#fff; border-radius:6px; padding:5px 12px; font-size:13px; cursor:pointer; color:#333; }
.sort-btn.active { background:var(--brand,#1e8e5a); color:#fff; border-color:var(--brand,#1e8e5a); }


  .cam-modal {
    border:none; border-radius:20px; padding:0; max-width:480px; width:92vw; max-height:85vh;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
  }
  .cam-modal::backdrop { background:rgba(0,0,0,.55); }
  .cam-modal-inner { padding:20px; position:relative; max-height:85vh; overflow-y:auto; }
  .cam-modal-title { font-weight:800; font-size:16px; margin-bottom:12px; }
  .cam-modal-close { position:absolute; top:14px; right:14px; border:none; background:none; font-size:20px; cursor:pointer; line-height:1; }
  .cam-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}
.cam-pause-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: inherit;
}
.cam-pause-overlay.visible {
  display: flex;
}
  .cam-wrap video, .cam-wrap canvas { position:absolute; top:0; left:0; width:100%; height:100%; object-fit:cover; transform:scaleX(-1); }
  .cam-result { font-size:26px; font-weight:800; text-align:center; margin:14px 0; min-height:36px; }
 .cam-modal-btns { display:flex; gap:8px; justify-content:center; }

  .report-modal {
    border:none; border-radius:20px; padding:0; max-width:420px; width:90vw;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
  }
  .report-modal::backdrop { background:rgba(0,0,0,.55); }
  .report-modal-inner { padding:24px; position:relative; }
  .report-modal-close { position:absolute; top:14px; right:14px; border:none; background:none; font-size:20px; cursor:pointer; line-height:1; color:var(--text-sub); }
  .report-modal-title { font-weight:800; font-size:16px; color:#b23b3b; margin-bottom:6px; padding-right:24px; }
  .report-modal-word { font-size:13px; color:var(--text-sub); margin-bottom:14px; }
  .report-modal-word b { color:#333; font-weight:700; }
  .report-reason-input {
    width:100%; min-height:100px; resize:vertical; box-sizing:border-box;
    border:1px solid #e2c4c4; border-radius:10px; padding:12px 14px;
    font-size:14px; font-family:inherit; color:#333;
    background:#fff5f5; outline:none;
  }
  .report-reason-input:focus { border-color:#d99; }
  .report-modal-btns { display:flex; gap:8px; justify-content:flex-end; margin-top:14px; }

  .report-status-modal {
    border:none; border-radius:18px; padding:0; max-width:320px; width:86vw;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
  }
  .report-status-modal::backdrop { background:rgba(0,0,0,.55); }
  .report-status-inner { padding:28px 24px 22px; text-align:center; }
  .report-status-icon {
    width:48px; height:48px; margin:0 auto 14px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    font-size:22px; font-weight:900;
    background:#e6f7ee; color:var(--brand,#1e8e5a);
  }
  .report-status-icon.error { background:#fde8e8; color:#b23b3b; }
  .report-status-msg { font-size:14px; font-weight:600; color:#333; line-height:1.5; margin-bottom:18px; }
  .report-status-inner .btn { width:100%; justify-content:center; }
 

  .detail-modal {
    border:none; border-radius:24px; padding:0; max-width:920px; width:calc(100vw - 32px); height:min(92vh, 940px); max-height:calc(100vh - 24px); overflow:hidden;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
  }
.detail-modal::backdrop { background:rgba(0,0,0,.65); }
.detail-modal-inner { padding:0; position:relative; height:100%; overflow:hidden; display:flex; flex-direction:column; align-items:stretch; }


.detail-scroll-content { flex:1; min-height:0; overflow:hidden; width:100%; display:flex; flex-direction:column; align-items:stretch; margin-top:48px; padding:0 28px 28px; }
.detail-scroll-content > * { flex-shrink:0; }
.detail-video-row { position:relative; width:100%; display:flex; justify-content:center; flex:1; min-height:0; }
.detail-modal-close { border:none; background:none; font-size:22px; cursor:pointer; line-height:1; color:var(--text-sub); }
.detail-video-wrap { width:var(--detail-video-width, 100%); height:100%; max-width:420px; aspect-ratio:auto; border-radius:16px; overflow:hidden; background:#000; box-shadow:0 8px 24px rgba(0,0,0,.15); flex-shrink:0; }
.detail-word-name { font-size:20px; font-weight:900; letter-spacing:-0.5px; margin-top:8px; text-align:center; flex-shrink:0; }
.detail-divider { width:48px; height:3px; background:var(--brand,#1e8e5a); border-radius:2px; margin:10px 0 6px; flex-shrink:0; }
.detail-section-label { font-size:13px; font-weight:800; color:var(--brand,#1e8e5a); letter-spacing:1px; text-transform:uppercase; margin-bottom:8px; text-align:center; }
.detail-video-wrap video { width:100%; height:100%; object-fit:contain; display:block; }
.detail-description { font-size:16px; line-height:1.8; color:#333; text-align:left; max-width:100%; width:100%; flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; white-space:pre-wrap; word-break:keep-all; overflow-wrap:anywhere; background:#f7faf8; border:1px solid #e6efe9; border-radius:14px; padding:16px 20px; box-sizing:border-box; }
 .page-dots { color:var(--text-sub); font-weight:700; }



  .detail-report-btn:hover {
    background: #fde8e8;
  }


.detail-report-btn { position:absolute; top:14px; left:18px; height:24px; display:flex; align-items:center; box-sizing:border-box; z-index:5; border:1px solid #e2c4c4; background:#fff5f5; color:#b23b3b; font-size:12px; font-weight:700; padding:0 5px; border-radius:8px; cursor:pointer; white-space:nowrap; }

.detail-top-actions { position:absolute; top:14px; right:16px; display:flex; align-items:center; gap:8px; z-index:5; }


.detail-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  color: #999;
  font-size: 30px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 6;
  transition: color 0.15s ease, transform 0.15s ease;
}
.detail-nav-btn:hover {
  color: #333;
  transform: translateY(-50%) scale(1.15);
}
.detail-nav-prev { left: 0; }
.detail-nav-next { right: 0; }

.detail-modal-close { width:32px; height:32px; display:flex; align-items:center; justify-content:center; box-sizing:border-box; border:none; background:none; font-size:20px; cursor:pointer; line-height:1; color:var(--text-sub); padding:0; border-radius:8px; transition:background 0.15s ease, color 0.15s ease; }
.detail-modal-close:hover { background:#f2f2f2; color:#333; }

.detail-video-controls { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; max-width:340px; margin:8px auto 0; flex-shrink:0; }

.detail-video-controls-right {
  display: flex;
  gap: 8px;
}

.detail-ctrl-btn {
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: #333;
}
.detail-ctrl-btn:hover {
  background: #f2f8f5;
  border-color: var(--brand, #1e8e5a);
  color: var(--brand, #1e8e5a);
}
.detail-ctrl-btn.active {
  background: var(--brand, #1e8e5a);
  border-color: var(--brand, #1e8e5a);
  color: #fff;
}


.detail-speed-control {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 8px;
  padding: 0 10px;
  height: 32px;
  box-sizing: border-box;
}

.detail-speed-label {
  font-size: 12px;
  font-weight: 700;
  color: #333;
  min-width: 34px;
  text-align: center;
}

.detail-speed-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 140px;
  height: 4px;
  border-radius: 2px;
  background: #ddd;
  outline: none;
  cursor: pointer;
}
.detail-speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--brand, #1e8e5a);
  cursor: pointer;
}
.detail-speed-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--brand, #1e8e5a);
  border: none;
  cursor: pointer;
}


.detail-meta {
  font-size: 13px;
  color: var(--text-sub);
  margin: 0;
  text-align: left;
}

.detail-related-list {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:repeat(4,minmax(0,1fr));
  align-content:stretch;
  flex:1;
  gap:8px 16px;
  margin-top:12px;
  min-height:0;
  overflow-y:auto;
}
.related-item {
  display:flex;
  align-items:center;
  gap:12px;
  min-height:0;
  width:100%;
  border:0;
  background:transparent;
  padding:0;
  text-align:left;
  font:inherit;
  font-size:16px;
  font-weight:600;
  line-height:1.5;
  color:var(--text-main,#333);
  overflow-wrap:anywhere;
  cursor:pointer;
}
.related-thumb { display:flex; align-items:center; justify-content:center; width:88px; max-width:42%; aspect-ratio:4/3; max-height:100%; flex-shrink:0; border-radius:6px; overflow:hidden; }
.related-thumb img { display:block; width:100%; height:100%; object-fit:contain; }
.related-thumb.unavailable::after { content:'▶'; color:#9ca3a0; font-size:18px; }
.related-name { min-width:0; overflow-wrap:anywhere; }
.related-item:hover { color:var(--brand,#1e8e5a); text-decoration:underline; text-underline-offset:4px; }
.related-item:focus-visible { outline:2px solid var(--brand,#1e8e5a); outline-offset:3px; border-radius:4px; }

.cam-status {
  text-align: center;
  font-size: 13px;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  transition: background 0.2s, color 0.2s;
}
.cam-status.detected {
  background: #d1fae5;
  color: #059669;
}
.cam-status.not-detected {
  background: #fee2e2;
  color: #dc2626;
}

.cam-preview {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  min-height: 40px;
  margin: 4px 0;
  transition: opacity 0.15s;
}

.cam-status {
  text-align: center;
  font-size: 13px;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  transition: background 0.2s, color 0.2s;
}
.cam-status.detected {
  background: #d1fae5;
  color: #059669;
}
.cam-status.not-detected {
  background: #fee2e2;
  color: #dc2626;
}


.cam-confidence-row {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}
.cam-confidence-gauge {
  position: relative;
  width: 64px;
  height: 64px;
}
.cam-gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.cam-gauge-bg {
  fill: none;
  stroke: #e5e7eb;
  stroke-width: 3;
}
.cam-gauge-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.15s ease;
}
.cam-gauge-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

#camSearchBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
#camSearchBtn.cam-search-ready {
  animation: searchReadyPulse 0.6s ease;
}
@keyframes searchReadyPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(45, 155, 111, 0.2); }
  100% { transform: scale(1); }
}

@supports (height: 1dvh) {
  .detail-modal { height:min(92dvh, 940px); max-height:calc(100dvh - 24px); }
}
.detail-top-grid { display:grid; grid-template-columns:minmax(0, 1.3fr) minmax(0, 1fr); gap:24px; width:100%; align-items:stretch; flex:0 0 var(--detail-top-height, 60%); min-height:0; }
.detail-demo-panel { display:flex; flex-direction:column; align-items:center; gap:8px; min-width:0; min-height:0; }
.detail-panel-heading { flex-shrink:0; align-self:stretch; font-size:14px; font-weight:800; color:var(--brand,#1e8e5a); margin:0; text-align:left; }
.detail-video-controls { max-width:100%; margin:0; flex-wrap:wrap; }
.detail-word-heading { flex-shrink:0; display:flex; align-items:center; justify-content:center; gap:8px; }
.detail-word-heading .detail-word-name { margin:0; overflow-wrap:anywhere; }
.detail-word-heading .detail-fav-star { position:static; margin:0; flex-shrink:0; }
.detail-related-panel { display:flex; flex-direction:column; min-width:0; min-height:0; overflow:hidden; }
.detail-related-panel > .detail-panel-heading { padding:0; }
.detail-description-section { display:flex; flex-direction:column; flex:1; min-height:0; width:100%; margin-top:20px; padding-top:16px; border-top:1px solid #e6efe9; }
.detail-description-section > .detail-panel-heading { margin-bottom:12px; }
.detail-nav-btn { background:rgba(255,255,255,.88); border-radius:50%; }
@media (max-width: 760px) {
  .detail-modal { width:calc(100vw - 24px); border-radius:20px; }
  .detail-scroll-content { padding:0 16px 20px; }
  .detail-top-grid { grid-template-columns:minmax(0,1.8fr) minmax(0,1fr); gap:16px; }
  .detail-related-list { grid-template-columns:minmax(0,1fr); gap:4px; }
  .related-item { padding:0; gap:6px; font-size:14px; }
  .detail-related-panel > .detail-panel-heading { font-size:13px; }
  .detail-description { padding:16px; }
  .detail-video-controls { gap:8px; }
  .detail-speed-slider { width:52px; }
  .detail-speed-label { min-width:24px; }
  .detail-speed-control { padding:0 6px; gap:4px; }
  .detail-ctrl-btn { padding:6px 8px; font-size:12px; }
}

@media (max-height: 540px) {
  .detail-scroll-content { margin-top:40px; padding-bottom:12px; }
  .detail-report-btn { top:8px; }
  .detail-top-actions { top:4px; }
  .detail-demo-panel { gap:4px; }
  .detail-panel-heading { font-size:12px; }
  .detail-word-heading { position:absolute; top:6px; left:50%; transform:translateX(-50%); }
  .detail-word-heading .detail-word-name { font-size:16px; }
  .detail-speed-control { height:26px; }
  .detail-ctrl-btn { padding:4px 8px; font-size:12px; }
  .detail-related-list { gap:0; margin-top:6px; }
  .related-item { padding:0; gap:8px; font-size:13px; }
  .detail-description-section { margin-top:10px; padding-top:8px; }
  .detail-description-section > .detail-panel-heading { margin-bottom:8px; }
  .detail-description { padding:12px; font-size:14px; line-height:1.6; }
}
