/* Support pages: /cases/, /cases/new/, /upload/. Prefix sc-. */

/* ── Case list ─────────────────────────────────────────── */
.sc-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.sc-head-text { flex: 1 1 260px; min-width: 0; }
.sc-head .ac-page-sub { margin-bottom: 0; }
.sc-note { font-size: 12px; color: var(--muted); margin: 0 0 20px; }
.sc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sc-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 16px; color: var(--ink); text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sc-row:hover { border-color: rgba(45,106,53,0.3); box-shadow: 0 3px 12px rgba(45,106,53,0.08); text-decoration: none; }
.sc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sky); flex-shrink: 0; visibility: hidden; }
.sc-dot--on { visibility: visible; }
.sc-row-main { flex: 1; min-width: 0; }
.sc-row-subject { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-row--unread .sc-row-subject { color: var(--sky); }
.sc-row-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 4px; }
.sc-empty { font-size: 13px; color: var(--muted); padding: 8px 0; margin: 0; }

/* ── Status badges ─────────────────────────────────────── */
.sc-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
}
.sc-badge--waiting { background: var(--orange-dim); color: var(--orange); }
.sc-badge--open    { background: var(--sky-dim); color: var(--sky); }
.sc-badge--closed  { background: var(--border); color: var(--muted); }

/* ── Case page ─────────────────────────────────────────── */
.sc-back { display: inline-block; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.sc-back:hover { color: var(--ink); }
.sc-case-title { font-family: var(--font-serif); font-size: 24px; font-weight: 400; color: var(--ink); margin: 0 0 6px; overflow-wrap: anywhere; }
.sc-case-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-bottom: 22px; }
.sc-banner {
  border-radius: 10px; padding: 11px 14px; font-size: 12.5px; margin-bottom: 16px;
  background: var(--orange-dim); color: var(--ink); border: 1px solid rgba(212,107,42,0.18);
}
.sc-banner--muted { background: var(--border); border-color: transparent; color: var(--muted); }

.sc-thread { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.sc-msg { max-width: 88%; border-radius: 12px; padding: 12px 15px; font-size: 13.5px; line-height: 1.6; overflow-wrap: anywhere; }
.sc-msg--you { align-self: flex-end; background: var(--green-dim); border: 1px solid rgba(45,106,53,0.16); border-bottom-right-radius: 4px; }
.sc-msg--us  { align-self: flex-start; background: var(--panel); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.sc-msg-head { display: flex; gap: 8px; align-items: baseline; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.sc-msg-who { font-weight: 600; color: var(--ink); }
.sc-msg-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sc-msg-file { display: block; width: 96px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-mid); background: var(--bg); }
.sc-msg-file img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-msg-file--name { width: auto; height: auto; padding: 6px 10px; font-size: 11.5px; }

/* Rendered Markdown */
.sc-md > :first-child { margin-top: 0; }
.sc-md > :last-child { margin-bottom: 0; }
.sc-md p, .sc-md ul, .sc-md ol, .sc-md blockquote, .sc-md pre { margin: 0 0 10px; }
.sc-md ul, .sc-md ol { padding-left: 22px; }
.sc-md h3, .sc-md h4 { font-size: 14px; margin: 12px 0 6px; }
.sc-md blockquote { border-left: 3px solid var(--border-mid); padding-left: 10px; color: var(--muted); }
.sc-md code { font-size: 12px; background: var(--border); padding: 1px 5px; border-radius: 4px; }
.sc-md pre { background: var(--border); padding: 10px 12px; border-radius: 8px; overflow-x: auto; }
.sc-md pre code { background: none; padding: 0; }
.sc-md img { max-width: 100%; border-radius: 6px; }
.sc-md hr { border: 0; border-top: 1px solid var(--border-mid); margin: 12px 0; }

/* Upload requests on a case */
.sc-req { border: 1px solid var(--border-mid); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.sc-req:last-child { margin-bottom: 0; }
.sc-req-ask { font-size: 13px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 6px; }
.sc-req-limits { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }

/* ── Composer ──────────────────────────────────────────── */
.sc-composer { position: relative; border-radius: 10px; }
.sc-composer--drop { outline: 2px dashed var(--green); outline-offset: 4px; }
.sc-tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.sc-tab {
  font-family: var(--font-ui); font-size: 12px; font-weight: 600; color: var(--muted);
  background: none; border: 1px solid transparent; border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
.sc-tab--on { color: var(--ink); background: var(--bg); border-color: var(--border-mid); }
.sc-textarea, .sc-input, .sc-select {
  width: 100%; box-sizing: border-box; padding: 10px 12px; font-family: var(--font-ui); font-size: 13.5px;
  color: var(--ink); background: var(--bg); border: 1px solid var(--border-mid); border-radius: 8px; outline: none;
}
.sc-textarea { min-height: 140px; line-height: 1.55; resize: vertical; }
.sc-textarea:focus, .sc-input:focus, .sc-select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,106,53,0.10); }
/* Rich-text reply editor (js/case-composer.js). */
.sc-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.sc-tool {
  font-family: var(--font-ui); font-size: 12px; font-weight: 600; color: var(--ink);
  background: var(--bg); border: 1px solid var(--border-mid); border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
.sc-tool:hover { border-color: var(--green); }
.sc-tool:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.sc-tool--b { font-weight: 800; }
.sc-tool--i { font-style: italic; font-family: var(--font-serif, Georgia, serif); }
.sc-editor {
  min-height: 140px; max-height: 60vh; overflow-y: auto; box-sizing: border-box; padding: 10px 12px;
  font-family: var(--font-ui); font-size: 13.5px; line-height: 1.55; color: var(--ink); background: var(--bg);
  border: 1px solid var(--border-mid); border-radius: 8px; outline: none; overflow-wrap: anywhere; cursor: text;
}
.sc-editor:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,106,53,0.10); }
.sc-editor:empty::before { content: attr(data-placeholder); color: var(--muted-light); pointer-events: none; }
.sc-editor[contenteditable="false"] { opacity: 0.7; }
.sc-editor ul, .sc-editor ol { margin: 4px 0; padding-left: 22px; }
.sc-editor a { color: var(--green); }
.sc-preview { min-height: 140px; box-sizing: border-box; padding: 10px 12px; font-size: 13.5px; line-height: 1.6; border: 1px solid var(--border-mid); border-radius: 8px; background: var(--panel); }
.sc-muted { color: var(--muted); }
.sc-hint { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted-light); margin: 6px 0 10px; }
.sc-shots { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.sc-shots:empty { display: none; }
.sc-shot { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-mid); border-radius: 8px; padding: 6px 8px; background: var(--panel); }
.sc-shot--err { border-color: rgba(192,48,58,0.35); }
.sc-shot-thumb { width: 44px; height: 34px; flex-shrink: 0; border-radius: 5px; overflow: hidden; background: var(--bg); font-size: 9px; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.sc-shot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sc-shot-meta { flex: 1; min-width: 0; }
.sc-shot-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-shot-size { font-size: 11px; color: var(--muted); }
.sc-shot-err { font-size: 11px; color: var(--like-red); }
.sc-shot-rm { background: none; border: 0; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; }
.sc-shot-rm:hover { color: var(--like-red); }
.sc-bar { height: 5px; border-radius: 3px; background: var(--border-mid); overflow: hidden; margin-top: 5px; }
.sc-bar-fill { height: 100%; width: 0; background: var(--green); transition: width 0.15s; }
.sc-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sc-status { font-size: 12px; color: var(--muted); }
.sc-status--err { color: var(--like-red); }

/* New-case form */
.sc-field { margin-bottom: 14px; }
.sc-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 5px; }
.sc-row2 { display: flex; gap: 12px; flex-wrap: wrap; }
.sc-row2 > .sc-field { flex: 1 1 200px; min-width: 0; }

/* ── Upload page (no sidebar) ──────────────────────────── */
.sc-upload-page { max-width: 600px; margin: 0 auto; padding: 32px 16px 60px; }
.sc-upload-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; color: var(--ink); text-decoration: none; }
.sc-upload-brand img { width: 30px; height: 30px; }
.sc-upload-brand span { font-family: var(--font-serif); font-size: 17px; }
.sc-limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0; }
.sc-limit { background: var(--bg); border-radius: 8px; padding: 9px 12px; }
.sc-limit-k { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-light); }
.sc-limit-v { font-size: 13px; color: var(--ink); margin-top: 2px; overflow-wrap: anywhere; }
.sc-drop {
  display: block; border: 2px dashed var(--border-mid); border-radius: 12px; padding: 26px 16px; text-align: center;
  cursor: pointer; color: var(--muted); font-size: 13px; transition: border-color 0.15s, background 0.15s;
}
.sc-drop:hover, .sc-drop--over { border-color: var(--green); background: var(--green-dim); color: var(--ink); }
.sc-drop strong { color: var(--green); }
.sc-files { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sc-file { border: 1px solid var(--border-mid); border-radius: 8px; padding: 8px 10px; background: var(--panel); }
.sc-file-top { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; }
.sc-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-file-state { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.sc-file--done .sc-file-state { color: var(--green); }
.sc-file--err { border-color: rgba(192,48,58,0.35); }
.sc-file--err .sc-file-state { color: var(--like-red); white-space: normal; text-align: right; }
.sc-gone { text-align: center; padding: 10px 0; }
.sc-gone h1 { font-family: var(--font-serif); font-weight: 400; font-size: 22px; margin: 0 0 8px; }
.sc-gone p { font-size: 13px; color: var(--muted); margin: 0 0 6px; }

@media (max-width: 640px) {
  .sc-msg { max-width: 100%; }
  .sc-case-title { font-size: 21px; }
}
