/* components.css — Buttons, status pills and the upload progress panel */
/* Buttons + status */
.primary { position: relative; min-height: 46px; padding: .7rem 1.4rem; border: 0;
            border-radius: var(--r-xs); background: var(--grad-button); color: white;
            font-family: Sora, sans-serif; font-size: .9rem; font-weight: 700;
            box-shadow: var(--shadow-teal); transition: all .2s; }
.primary:hover:not(:disabled) { background: linear-gradient(135deg, #05645f, #087f79);
                                  transform: translateY(-1px); box-shadow: 0 12px 28px rgba(8,127,121,.35); }
.primary:active:not(:disabled) { transform: translateY(0); }
.primary:disabled { background: #c7d2cf; color: #6f7c78; box-shadow: none; cursor: not-allowed; }
.primary.small { min-height: 38px; padding: .5rem .9rem; font-size: .82rem; }
.primary[data-loading="true"] { padding-left: 2.5rem; color: transparent; }
.primary[data-loading="true"]::before { content: ""; position: absolute; top: 50%; left: 1rem;
                                          width: 14px; height: 14px; margin-top: -7px;
                                          border: 2px solid rgba(255,255,255,.5);
                                          border-top-color: white; border-radius: 50%;
                                          animation: spin .75s linear infinite; }
#submit-btn-ab[data-loading="true"] { color: white; min-width: 245px; }
@keyframes spin { to { transform: rotate(360deg); } }
.status { min-height: 1.2rem; margin: .55rem 0 0; color: var(--muted); font-size: .82rem; }
.status[data-state="error"] { color: var(--red); font-weight: 600; }
.status[data-state="success"] { color: var(--green); font-weight: 600; }
.status[data-state="loading"] { color: var(--blue); }

/* Secondary / destructive-lite button — used by every upload cancel control. */
.ghost { padding: .45rem .85rem; border: 1px solid var(--line); border-radius: var(--r-xs);
         background: var(--paper); color: var(--ink-soft); font-size: .8rem;
         font-weight: 600; cursor: pointer; transition: all .15s; }
.ghost:hover:not(:disabled) { border-color: var(--red); color: var(--red);
                              background: var(--red-soft); }
.ghost:disabled { opacity: .5; cursor: default; }
.ghost[hidden] { display: none; }

/* Upload progress panel (shared by all three tabs) */
.upload-progress-panel { margin-top: 1rem; padding: 1rem 1.1rem;
                          border: 1px solid var(--line); border-radius: var(--r);
                          background: linear-gradient(180deg, #fbfffe 0%, #f8f7ff 100%);
                          box-shadow: var(--shadow-sm); }
.upload-progress-panel[hidden] { display: none; }
.upload-progress-panel[data-state="error"] { border-color: #e9b4aa; background: var(--red-soft); }
.upload-progress-head { display: flex; align-items: center; justify-content: space-between;
                         gap: 1rem; margin-bottom: .55rem; }
.upload-progress-head > div { display: flex; min-width: 0; flex-direction: column; gap: .1rem; }
.upload-progress-head strong { color: var(--ink); font-size: .88rem; font-weight: 700; }
.upload-progress-head small { color: var(--muted); font-size: .72rem; }
.upload-progress-head { flex-wrap: wrap; }
.upload-progress-percent { font-family: Sora, sans-serif; font-size: 1.05rem; font-weight: 800;
                            color: var(--teal-dark); font-variant-numeric: tabular-nums;
                            min-width: 3.5rem; text-align: right; }
.progress-bar { position: relative; width: 100%; height: 8px; overflow: hidden;
                 border-radius: 999px; background: var(--line); }
.progress-bar .progress-fill { display: block; height: 100%; min-width: 0;
                                background: linear-gradient(90deg, #087f79, #0a9d96);
                                border-radius: 999px; transition: width .15s ease-out; }
/* Initial state lives here rather than in a style="" attribute so the page
   needs no 'unsafe-inline' in style-src-attr. */
.progress-fill.progress-empty { width: 0; }
.upload-progress-current { margin: .55rem 0 .65rem; color: var(--ink-soft); font-size: .76rem; }
.upload-file-list { display: flex; min-width: 0; flex-direction: column; gap: .45rem;
                     margin: 0; padding: 0; list-style: none; }
.upload-file-list .upload-file-row { display: flex; min-width: 0; flex-direction: column;
                                       gap: .25rem; padding: .55rem .65rem;
                                       border: 1px solid var(--line); border-radius: var(--r-sm);
                                       background: var(--paper); }
.upload-file-list .upload-file-head { display: flex; align-items: center;
                                       gap: .55rem; font-size: .76rem; }
.upload-file-list .upload-file-lane { display: inline-grid; place-items: center;
                                       width: 22px; height: 22px; flex: 0 0 22px;
                                       border-radius: 50%; color: white;
                                       font-family: Sora, sans-serif; font-weight: 800;
                                       font-size: .72rem; }
.upload-file-list .upload-file-lane[data-lane="a"] { background: linear-gradient(135deg, #087f79, #0a9d96); }
.upload-file-list .upload-file-lane[data-lane="b"] { background: linear-gradient(135deg, #c86f1c, #e08528); }
.upload-file-list .upload-file-lane[data-lane="audio"] { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.upload-file-list .upload-file-lane[data-lane="video"] { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.upload-file-list .upload-file-name { flex: 1; min-width: 0; overflow: hidden;
                                       text-overflow: ellipsis; white-space: nowrap;
                                       color: var(--ink); font-weight: 600; }
.upload-file-list .upload-file-size { color: var(--muted); font-size: .7rem;
                                       font-variant-numeric: tabular-nums; }
.upload-file-list .upload-file-percent { color: var(--teal-dark); font-family: Sora, sans-serif;
                                          font-size: .72rem; font-weight: 700;
                                          min-width: 3rem; text-align: right;
                                          font-variant-numeric: tabular-nums; }
.upload-file-list .progress-bar { height: 5px; }
.upload-file-list .upload-file-row[data-status="done"] .upload-file-percent { color: var(--green); }
.upload-file-list .upload-file-row[data-status="error"] .upload-file-percent { color: var(--red); }

/* Quota confirmation dialog. Uses the native <dialog> top layer, so only the
   box itself needs styling — the backdrop, focus trap and Escape handling come
   from the platform. */
.quota-confirm {
  width: min(30rem, calc(100vw - 2rem));
  padding: 0; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--paper); color: var(--ink);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.quota-confirm::backdrop { background: rgba(8, 14, 18, .62); }
.quota-confirm.is-last { border-color: var(--amber); }
.quota-confirm-inner { display: flex; flex-direction: column; gap: .9rem; padding: 1.4rem; }
.quota-confirm-title { margin: 0; font-family: Sora, sans-serif; font-size: 1.1rem; font-weight: 700; }
.quota-confirm-lede { margin: 0; color: var(--red); font-size: .86rem; font-weight: 600; }
.quota-confirm-rows { display: flex; flex-direction: column; gap: .4rem; margin: 0; }
.quota-confirm-rows > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: .5rem .7rem; border-radius: var(--r-sm); background: var(--surface-2);
}
.quota-confirm-rows dt { color: var(--muted); font-size: .82rem; }
.quota-confirm-rows dd { margin: 0; font-size: .86rem; font-weight: 600; text-align: right; }
.quota-confirm-remain {
  margin: 0; padding: .6rem .75rem; border-radius: var(--r-sm);
  background: var(--teal-soft); color: var(--teal-dark);
  font-size: .84rem; font-weight: 600;
}
.quota-confirm.is-last .quota-confirm-remain { background: var(--amber-soft); color: #79480e; }
.quota-confirm-remain[hidden] { display: none; }
.quota-confirm-actions { display: flex; justify-content: flex-end; gap: .6rem; }
.quota-confirm-actions .primary, .quota-confirm-actions .ghost { min-width: 8rem; }
