 .webcam-tool {
      width: 100%;
      max-width: 800px;
      min-height: 600px;
      margin: 0 auto;
      padding: 24px;
      background: #fff;
      border: 1px solid #ebebeb;
      border-radius: 18px;
      box-shadow: 0 12px 40px rgba(0, 0, 0, .09);
    }

    .tool-heading {
      margin-bottom: 22px;
    }

    .tool-heading h1 {
      margin: 0 0 7px;
      font-size: 25px;
      font-weight: 750;
      letter-spacing: -.7px;
    }

    .tool-heading p {
      margin: 0;
      color: #737373;
      font-size: 13px;
    }

    .tool-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
      gap: 20px;
      align-items: start;
    }

    .section-card {
      min-width: 0;
      padding: 15px;
      background: #fff;
      border: 1px solid #e8e8e8;
      border-radius: 13px;
      box-shadow: 0 3px 12px rgba(0, 0, 0, .035);
    }

    .section-title {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 13px;
      font-size: 14px;
      font-weight: 750;
    }

    .section-title i {
      font-size: 16px;
    }

    /* Webcam preview */
    .preview-box {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      aspect-ratio: 4 / 3;
      overflow: hidden;
      border-radius: 10px;
      background: #050505;
      isolation: isolate;
    }

    #webcamVideo {
      display: none;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
      transform-origin: center;
    }

    .preview-placeholder {
      position: absolute;
      inset: 0;
      z-index: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      gap: 10px;
      padding: 18px;
      background: #050505;
      color: #fff;
      text-align: center;
    }

    .camera-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 62px;
      height: 62px;
      border-radius: 18px;
      background: #252525;
      color: #fff;
      font-size: 28px;
    }

    .preview-placeholder strong {
      font-size: 15px;
      font-weight: 650;
    }

    .preview-placeholder span {
      max-width: 220px;
      color: #b8b8b8;
      font-size: 11px;
      line-height: 1.6;
    }

    .preview-top-status {
      position: absolute;
      z-index: 2;
      top: 10px;
      left: 10px;
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 9px;
      border: 1px solid rgba(255, 255, 255, .15);
      border-radius: 7px;
      background: rgba(0, 0, 0, .65);
      color: #fff;
      font-size: 10px;
      font-weight: 650;
    }

    .status-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #a3a3a3;
    }

    .status-dot.active {
      background: #22c55e;
      box-shadow: 0 0 8px rgba(34, 197, 94, .65);
    }

    .fullscreen-btn {
      position: absolute;
      z-index: 3;
      top: 10px;
      right: 10px;
      display: grid;
      place-items: center;
      width: 34px;
      height: 34px;
      border: 1px solid #ffffff40;
      border-radius: 8px;
      background: #000000a8;
      color: #fff;
      font-size: 16px;
      cursor: pointer;
    }

    .fullscreen-btn:hover {
      background: #333;
    }

    /* Fullscreen preview also fills the screen */
    .preview-box:fullscreen {
      width: 100%;
      height: 100%;
      max-width: none;
      aspect-ratio: auto;
      border-radius: 0;
      background: #050505;
    }

    .preview-box:fullscreen #webcamVideo {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
    }

    .preview-box:fullscreen .preview-placeholder {
      position: absolute;
    }

    .preview-box:fullscreen .fullscreen-btn {
      top: 18px;
      right: 18px;
    }

    .preview-box:fullscreen .preview-top-status {
      top: 18px;
      left: 18px;
    }

    .status-message {
      display: flex;
      align-items: center;
      gap: 7px;
      min-height: 34px;
      margin: 10px 0;
      color: #737373;
      font-size: 11px;
      line-height: 1.5;
    }

    .status-message.error {
      color: #dc2626;
    }

    .status-message.success {
      color: #16a34a;
    }

    /* Black gradient buttons */
    .btn-black {
      border: 1px solid #242424;
      background: linear-gradient(135deg, #292929, #050505 75%);
      color: #fff;
      font-weight: 650;
      box-shadow: 0 4px 10px rgba(0, 0, 0, .13);
      transition: transform .18s, box-shadow .18s;
    }

    .btn-black:hover,
    .btn-black:focus-visible {
      border-color: #000;
      background: linear-gradient(135deg, #111, #000);
      color: #fff;
      transform: translateY(-1px);
      box-shadow: 0 6px 14px rgba(0, 0, 0, .2);
    }

    .btn-black:disabled {
      opacity: .45;
      transform: none;
    }

    .btn-light-custom {
      border: 1px solid #e5e5e5;
      background: #fff;
      color: #222;
      font-weight: 600;
    }

    .btn-light-custom:hover {
      background: #f2f2f2;
      border-color: #d2d2d2;
    }

    .action-buttons {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 9px;
    }

    .action-buttons .btn {
      min-height: 40px;
      padding: 9px 8px;
      border-radius: 8px;
      font-size: 12px;
    }

    .camera-select {
      margin-bottom: 10px;
    }

    .camera-select label {
      display: block;
      margin-bottom: 6px;
      color: #444;
      font-size: 11px;
      font-weight: 650;
    }

    .camera-select .form-select {
      min-width: 0;
      padding-top: 9px;
      padding-bottom: 9px;
      border-color: #e5e5e5;
      border-radius: 8px;
      box-shadow: none;
      font-size: 12px;
    }

    .control-group {
      margin-top: 18px;
    }

    .control-group-title {
      margin-bottom: 10px;
      font-size: 12px;
      font-weight: 750;
    }

    .flip-buttons {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .flip-buttons .btn {
      min-height: 39px;
      padding: 7px 5px;
      border-radius: 8px;
      font-size: 11px;
    }

    .flip-buttons .btn.selected {
      border-color: #171717;
      background: #171717;
      color: #fff;
    }

    .stats-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 9px;
    }

    .stat-item {
      min-width: 0;
      padding: 10px;
      border: 1px solid #eee;
      border-radius: 9px;
      background: #fafafa;
    }

    .stat-label {
      display: flex;
      align-items: center;
      gap: 5px;
      margin-bottom: 7px;
      color: #777;
      font-size: 10px;
    }

    .stat-value {
      overflow-wrap: anywhere;
      color: #161616;
      font-size: 13px;
      font-weight: 750;
    }

    .stat-subtitle {
      margin-top: 4px;
      color: #888;
      font-size: 9px;
    }

    .privacy-note {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      margin-top: 18px;
      padding: 11px;
      border: 1px solid #e8eee9;
      border-radius: 9px;
      background: #f8fbf8;
      color: #536456;
      font-size: 10px;
      line-height: 1.6;
    }

    .privacy-note i {
      color: #16803d;
      font-size: 14px;
    }

    .tool-footer {
      margin-top: 18px;
      padding-top: 15px;
      border-top: 1px solid #eee;
      color: #888;
      text-align: center;
      font-size: 10px;
    }

    @media (max-width: 650px) {
      body {
        padding: 12px 8px;
      }

      .webcam-tool {
        min-height: 0;
        padding: 15px;
        border-radius: 14px;
      }

      .tool-heading h1 {
        font-size: 22px;
      }

      .tool-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
      }

      .section-card {
        padding: 13px;
      }
    }

    @media (max-width: 360px) {
      .webcam-tool {
        padding: 10px;
      }

      .action-buttons .btn {
        font-size: 11px;
      }

      .stat-item {
        padding: 8px;
      }
    }