.popcorn-case {
  --pc-ink: #202a3d;
  --pc-muted: #5d6570;
  --pc-line: #d9d5c8;
  --pc-paper: #f7f2e5;
  --pc-panel: #fffdf8;
  --pc-blue: #1385ae;
  --pc-blue-dark: #0b607f;
  --pc-orange: #e77924;
  --pc-red: #a43d35;
  --pc-yellow: #f3b632;
  color-scheme: light;
  margin: 1.5rem 0 2rem;
  padding: 24px;
  border: 1px solid var(--pc-line);
  border-radius: 10px;
  background: var(--pc-paper);
  color: var(--pc-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.popcorn-case * { box-sizing: border-box; }
.popcorn-case h2, .popcorn-case h3 { margin-top: 0; color: var(--pc-ink); }
.popcorn-case p { color: var(--pc-muted); }
.popcorn-case .pc-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 22px; align-items: start; }
.popcorn-case .pc-panel { padding: 20px; border: 1px solid var(--pc-line); border-radius: 9px; background: var(--pc-panel); }
.popcorn-case .pc-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.popcorn-case .pc-full { grid-column: 1 / -1; }
.popcorn-case label { display: grid; gap: 6px; color: var(--pc-ink); font-weight: 700; }
.popcorn-case input, .popcorn-case select { width: 100%; min-height: 43px; padding: 8px 10px; border: 1px solid #adb5bd; border-radius: 6px; background: #fff; color: var(--pc-ink); font: inherit; }
.popcorn-case input:disabled { background: #eef0f1; color: #555; }
.popcorn-case .pc-help { margin: -4px 0 0; font-size: .86rem; color: var(--pc-muted); }
.popcorn-case .pc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.popcorn-case button { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 14px; border: 1px solid transparent; border-radius: 6px; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
.popcorn-case button[type="submit"], .popcorn-case .pc-primary { background: var(--pc-orange); color: #fff; }
.popcorn-case button[type="submit"]:hover, .popcorn-case .pc-primary:hover { background: #bc5517; color: #fff; }
.popcorn-case button.pc-secondary { border-color: #aeb7be; background: #fff; color: var(--pc-ink); }
.popcorn-case button.pc-secondary:hover { border-color: var(--pc-blue); color: var(--pc-blue-dark); }
.popcorn-case button:disabled { cursor: wait; opacity: .65; }
.popcorn-case .pc-status { min-height: 24px; margin-top: 12px; color: var(--pc-blue-dark); font-weight: 700; }
.popcorn-case .pc-error { color: #a32d22; }
.popcorn-case .pc-summary { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.popcorn-case .pc-summary li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid #ece8de; }
.popcorn-case .pc-summary strong { text-align: right; color: var(--pc-blue-dark); }
.popcorn-case .pc-preview { width: 100%; min-height: 230px; padding: 10px; border: 1px solid var(--pc-line); border-radius: 7px; background: #fff; }
.popcorn-case .pc-preview svg { display: block; width: 100%; height: auto; max-height: 330px; }
.popcorn-case .pc-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: .82rem; color: var(--pc-muted); }
.popcorn-case .pc-swatch { display: inline-block; width: 24px; margin-right: 5px; vertical-align: middle; border-top: 3px solid var(--pc-ink); }
.popcorn-case .pc-swatch.fold { border-top-style: dashed; border-color: var(--pc-blue); }
.popcorn-case .pc-swatch.cut { border-color: var(--pc-orange); }
.popcorn-case .pc-documents { margin-top: 22px; }
.popcorn-case .pc-download-note { margin-bottom: 16px; }
.popcorn-case .pc-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--pc-line); }
.popcorn-case .pc-tab-button { display: inline-flex; align-items: center; min-height: 42px; padding: 9px 14px; border: 1px solid #aeb7be; border-radius: 6px; background: #fff; color: var(--pc-ink); font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
.popcorn-case .pc-tab-button[aria-selected="true"] { border-color: var(--pc-blue-dark); background: var(--pc-blue-dark); color: #fff; }
.popcorn-case .pc-tab-button.pc-complete { border-color: var(--pc-orange); color: #9e4815; }
.popcorn-case .pc-tab-button.pc-complete:hover { background: #fff5e9; color: #7d3510; }
.popcorn-case .pc-tab-panel[hidden] { display: none; }
.popcorn-case .pc-doc-list, .popcorn-case .pc-bundles { display: grid; gap: 10px; }
.popcorn-case .pc-file-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 8px 10px 8px 14px; border: 1px solid #aeb7be; border-radius: 7px; background: #fff; color: var(--pc-ink); font-weight: 750; }
.popcorn-case .pc-file-row:hover { border-color: var(--pc-blue); color: var(--pc-blue-dark); }
.popcorn-case .pc-file-row.pc-primary { border-color: var(--pc-red); background: var(--pc-red); color: #fff; }
.popcorn-case .pc-file-title { min-width: 0; overflow-wrap: anywhere; }
.popcorn-case .pc-file-actions { display: flex; flex: none; gap: 8px; }
.popcorn-case .pc-file-icon { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border: 1px solid currentColor; border-radius: 6px; background: rgba(255,255,255,.85); color: inherit; text-decoration: none; }
.popcorn-case .pc-file-icon svg { width: 18px; height: 18px; stroke: currentColor; }
.popcorn-case .pc-file-icon:hover, .popcorn-case .pc-file-icon:focus { background: #fff; color: var(--pc-blue-dark); }
.popcorn-case .pc-file-row.pc-primary .pc-file-icon { border-color: rgba(255,255,255,.8); background: rgba(255,255,255,.14); color: #fff; }
.popcorn-case .pc-file-row.pc-primary .pc-file-icon:hover, .popcorn-case .pc-file-row.pc-primary .pc-file-icon:focus { background: #fff; color: #7f2d28; }
.popcorn-case .pc-hidden { display: none !important; }
.popcorn-case .pc-noscript { padding: 12px; border-left: 4px solid var(--pc-orange); background: #fff; }

@media (max-width: 820px) {
  .popcorn-case { padding: 15px; }
  .popcorn-case .pc-workspace, .popcorn-case .pc-form-grid { grid-template-columns: 1fr; }
}
