/* =========================================================================
 * ASI Cloud Files — demo styles
 * ========================================================================= */

/* Make the hidden attribute always win, even over display:grid/flex rules.
   Without this, toggling Live mode can't hide .panels / .team. */
[hidden] { display: none !important; }

:root {
  --bg: #eceff5;
  --card: #ffffff;
  --border: #e6e9f0;
  --line: #eef1f6;
  --text: #1f2733;
  --muted: #6b7688;
  --primary: #1c7ed6;
  --accent: #e8590c;     /* CorelDRAW orange */
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 6px 24px rgba(16, 24, 40, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

b { font-weight: 600; }

/* ------------------------------ Brand bar ------------------------------ */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #0f1115;
  color: #fff;
  padding: 13px 26px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { color: var(--accent); font-size: 16px; }
.brand-name { font-weight: 700; letter-spacing: 0.04em; font-size: 14px; }
.brand-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  background: #2b2f36; color: #c7cdd6;
  padding: 3px 7px; border-radius: 5px;
}
.brand-meta { font-size: 12.5px; color: #aeb6c2; }

/* ------------------------------- Layout ------------------------------- */
.wrap {
  max-width: min(1760px, 95vw);
  margin: 0 auto;
  padding: 22px 22px 56px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

/* ------------------------------- Toolbar ------------------------------ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar-left { display: flex; gap: 8px; }
.tbtn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  box-shadow: var(--shadow);
  transition: background .15s, border-color .15s;
}
.tbtn:hover { background: #f3f6fb; border-color: #d6dbe4; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------- Badges ------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-edit    { background: #e6f6ec; color: #1b7a3d; border-color: #bfe6cb; }
.badge-view    { background: #fbf0d3; color: #946200; border-color: #f0dca6; }
.badge-locked  { background: #fde3e1; color: #c0341d; border-color: #f4c4bf; }
.badge-none    { background: #eceef2; color: #8a94a3; border-color: #dfe3ea; }
.badge-editing { background: #e6f6ec; color: #1b7a3d; border-color: #bfe6cb; }
.badge-editing::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #1b7a3d; box-shadow: 0 0 0 0 rgba(27,122,61,.5);
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(27,122,61,.45); }
  70%  { box-shadow: 0 0 0 6px rgba(27,122,61,0); }
  100% { box-shadow: 0 0 0 0 rgba(27,122,61,0); }
}

/* ------------------------------- Banner ------------------------------- */
.banner {
  background: #eaf3fb;
  border: 1px solid #cfe3f5;
  color: #2c4a63;
  border-radius: 12px;
  padding: 12px 16px;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* ---------------------------- Architecture ---------------------------- */
.arch { padding: 16px 18px; margin-bottom: 16px; }
.arch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.arch-cell {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fbfcfe;
}
.arch-k { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.arch-v { font-size: 12.5px; color: #2c3744; line-height: 1.45; }
.ga {
  display: inline-block; margin-top: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; color: #1b7a3d;
  background: #e6f6ec; border: 1px solid #bfe6cb;
  padding: 1px 6px; border-radius: 5px;
}
.arch-foot { margin-top: 12px; font-size: 12px; color: var(--muted); }
@media (max-width: 880px) { .arch-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .arch-grid { grid-template-columns: 1fr; } }

/* ------------------------------- Usage -------------------------------- */
.usage { padding: 16px 18px; margin-bottom: 16px; }.usage-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.usage-head { font-size: 15px; }
.usage-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.usage-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot-corel  { background: var(--accent); }
.dot-img    { background: #2f9e44; }
.dot-office { background: var(--primary); }

.bar {
  display: flex;
  height: 14px;
  background: #e6e9f0;
  border-radius: 8px;
  overflow: hidden;
}
.seg { height: 100%; }
.seg-corel  { background: var(--accent); }
.seg-img    { background: #2f9e44; }
.seg-office { background: var(--primary); }

.usage-foot { margin-top: 10px; font-size: 12.5px; color: var(--muted); }

/* -------------------------------- Team -------------------------------- */
.team {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 18px; margin-bottom: 18px; flex-wrap: wrap;
}
.team-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--muted); text-transform: uppercase; white-space: nowrap;
}
.team-avatars { display: flex; gap: 8px; flex-wrap: wrap; }

.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
  user-select: none;
}
.avatar.sm { width: 22px; height: 22px; font-size: 9px; }

/* ------------------------------- Panels ------------------------------- */
.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.who { display: flex; align-items: center; gap: 10px; }
.who-name { font-weight: 700; font-size: 14px; }
.who-role { font-size: 12px; color: var(--muted); }
.who-upn { font-size: 11px; color: #8a94a3; margin-top: 1px; }
.user-select {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 9px; font-size: 12.5px; background: #fff; color: var(--text);
  cursor: pointer; max-width: 220px;
}

.crumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  padding: 10px 16px; font-size: 13px; border-bottom: 1px solid var(--line);
}
.crumb a { color: var(--primary); text-decoration: none; cursor: pointer; }
.crumb a:hover { text-decoration: underline; }
.crumb .sep { color: var(--muted); }

/* Per-panel tools row (breadcrumb + folder/upload/refresh) */
.panel-tools {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.panel-tools .crumb { border-bottom: none; flex: 1 1 auto; }
.panel-tool-btns { display: flex; gap: 6px; padding: 6px 12px; align-items: center; }
.panel-tool-btns .chip { cursor: pointer; }
.row-sub.err, .err { color: #c0341d; }

/* LIVE indicator pill in the toolbar */
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; color: #1b7a3d;
  background: #f0fbf3; border: 1px solid #bfe6cb;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.live-pill .live-dot { width: 8px; height: 8px; }

/* ----------------------------- File table ----------------------------- */
.ftable { width: 100%; border-collapse: collapse; }
.ftable thead th {
  text-align: left; font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); font-weight: 700;
  padding: 9px 16px; border-bottom: 1px solid var(--line); background: #fafbfd;
}
.ftable tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ftable tbody tr:last-child td { border-bottom: none; }
.ftable tbody tr:hover { background: #f8fafd; }
.ftable .c-size { width: 88px; color: var(--muted); white-space: nowrap; }
.ftable .c-status { width: 104px; }
.ftable .c-act { width: 230px; white-space: normal; text-align: right; }
.ftable .c-act .abtn, .ftable .c-act .chip { margin: 2px 0 2px 5px; }

.row-name { display: flex; align-items: center; gap: 10px; }
.row-name .ic { font-size: 18px; line-height: 1; flex: none; }
.row-name > div { min-width: 0; }
.row-name .nm { font-weight: 600; overflow-wrap: anywhere; }
.row-name.is-folder .nm { color: var(--primary); }
.nm-link { cursor: pointer; }
.nm-link:hover { text-decoration: underline; }
.row-name.is-folder { cursor: pointer; }
.row-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ----------------------------- Versions ------------------------------ */
.ver-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 6px 0 12px; }
.ver-row { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ver-row:last-child { border-bottom: none; }
.ver-row:hover { background: #f8fafd; }
.ver-current { background: #f3f9f4; }
.ver-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ver-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex: none; }
.ver-dot.old { background: #c5ccd6; }
.ver-when { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.ver-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.ver-act { display: flex; gap: 6px; flex: none; }
.tier.local { color: #1b7a3d; }
.tier.cloud { color: #6b7688; }
.lockby { color: #c0341d; }
.lockby.you { color: #1b7a3d; }

.row-none { background: #fbfcfd; }
.row-none .row-name { opacity: 0.55; }
.row-none .nm { color: var(--muted); font-weight: 600; }

/* ----------------------------- Action btns ---------------------------- */
.abtn {
  border: 1px solid #d6dbe4; background: #fff; color: #2a3340;
  padding: 5px 9px; border-radius: 7px; cursor: pointer;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em;
  text-transform: uppercase; transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.abtn:hover { background: #f3f6fb; border-color: #c4ccd8; }
.abtn + .abtn, .chip + .abtn, .abtn + .chip { margin-left: 6px; }
.abtn-edit { background: var(--accent); border-color: var(--accent); color: #fff; }
.abtn-edit:hover { background: #d24f08; border-color: #d24f08; }
.abtn-release { color: #c0341d; border-color: #f0c2bd; background: #fff5f4; }
.abtn-release:hover { background: #fde3e1; border-color: #e9a59d; }
.chip {
  border: 1px solid #e1e5ec; background: #f6f8fb; color: #6b7688;
  padding: 5px 9px; border-radius: 7px; cursor: pointer;
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
}
.chip:hover { background: #eef2f7; }

/* ------------------------------ Activity ------------------------------ */
.activity { padding: 14px 18px 8px; }
.activity-head {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.activity-head span { font-weight: 600; letter-spacing: 0; text-transform: none; }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list .empty { color: var(--muted); padding: 14px 2px; }
.act {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px; border-bottom: 1px solid var(--line);
}
.act:last-child { border-bottom: none; }
.act-text { flex: 1; line-height: 1.35; }
.act-time { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.act .lk { color: #c0341d; font-weight: 600; }

/* -------------------------------- Note -------------------------------- */
.note {
  text-align: center; font-size: 12px; color: var(--muted);
  line-height: 1.5; max-width: 860px; margin: 18px auto 0;
}

/* -------------------------------- Modal ------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 17, 21, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 50;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-md);
  width: 100%; max-width: 640px; max-height: 86vh; overflow: auto;
}
/* Widen the dialog when it's showing a rich document preview. */
.modal:has(.doc-frame),
.modal:has(.doc-rich),
.modal:has(.img-wrap) { max-width: min(1100px, 94vw); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close {
  border: none; background: none; font-size: 16px; color: var(--muted);
  cursor: pointer; line-height: 1; padding: 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 18px 20px; line-height: 1.5; }
.modal-body .muted { color: var(--muted); }
.modal-body p { margin: 0 0 12px; }

.share-url { display: flex; gap: 8px; margin: 12px 0; }
.share-url input {
  flex: 1; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 12.5px; color: var(--text); background: #f8fafd;
}

.ver-list { list-style: none; margin: 8px 0 0; padding: 0; }
.ver-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.ver-list li:last-child { border-bottom: none; }
.ver-list .muted { flex: 1; font-size: 12.5px; }

/* --------------------------- Document editor -------------------------- */
.doc-editor {
  width: 100%; min-height: 240px; resize: vertical;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; background: #fbfcfe; color: var(--text);
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.doc-editor:focus { outline: 2px solid #cfe3f5; border-color: var(--primary); }
.editor-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 12px; flex-wrap: wrap;
}

/* ----------------------- OnlyOffice online editor --------------------- */
/* Give the editor a large, near-fullscreen surface and let the iframe fill it
   via flexbox. A class on the modal (added in JS) makes this robust even where
   :has() isn't honoured, and the height flows: modal (fixed) -> body (flex) ->
   frame (100%) -> iframe (100%). */
.modal.modal-editor,
.modal:has(.oo-frame) {
  width: min(1480px, 97vw);
  max-width: min(1480px, 97vw);
  height: 94vh;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal.modal-editor .modal-body,
.modal:has(.oo-frame) .modal-body {
  flex: 1 1 auto;
  min-height: 0;        /* allow the flex child to shrink so the iframe fills */
  padding: 0;
  overflow: hidden;
}
.oo-frame { width: 100%; height: 100%; }
.oo-frame > iframe,
.oo-frame iframe { display: block; border: 0; width: 100%; height: 100%; }
.oo-loading { padding: 26px 20px; }
.doc-view {
  white-space: pre-wrap; word-break: break-word; margin: 0;
  background: #fbfcfe; border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; max-height: 50vh; overflow: auto;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------------------- Binary document previews ---------------------- */
.doc-frame {
  width: 100%; height: 65vh; border: 1px solid var(--border);
  border-radius: 8px; background: #fff;
}
.img-wrap {
  display: flex; justify-content: center; align-items: center;
  background: #f1f3f7; border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; max-height: 65vh; overflow: auto;
}
.doc-img { max-width: 100%; max-height: 60vh; object-fit: contain; }
.doc-rich {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 18px 22px; max-height: 65vh; overflow: auto;
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}
.doc-rich h1, .doc-rich h2, .doc-rich h3, .doc-rich h4 { margin: 0.6em 0 0.3em; }
.doc-rich p { margin: 0 0 0.6em; }
.doc-rich img { max-width: 100%; height: auto; }
.doc-rich table { border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.doc-rich td, .doc-rich th {
  border: 1px solid var(--line); padding: 4px 8px; text-align: left;
  white-space: nowrap;
}
.sheet-title { margin: 14px 0 4px; font-size: 13px; color: var(--muted); }
.sheet-wrap { overflow: auto; max-width: 100%; }

/* -------------------- Progress bar (download/upload) ------------------ */
.progress-box { margin: 6px 0 4px; }
.progress-track {
  height: 10px; margin-top: 8px; border-radius: 999px;
  background: #eef2f7; border: 1px solid var(--border); overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%; border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #4dabf7);
  transition: width 0.15s ease;
}
.progress-fill.indeterminate {
  width: 40% !important;
  animation: progress-slide 1.1s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { margin-left: -40%; } 100% { margin-left: 100%; }
}

/* ------------------------------- Matrix ------------------------------- */
.matrix-wrap { overflow-x: auto; }
.matrix { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.matrix th, .matrix td {
  padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: center;
}
.matrix th { color: var(--muted); font-weight: 700; }
.matrix td.role, .matrix th:first-child { text-align: left; }
.matrix td.role { font-weight: 600; white-space: nowrap; }
.mini {
  display: inline-block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; padding: 2px 7px; border-radius: 5px;
}
.mini-edit { background: #e6f6ec; color: #1b7a3d; }
.mini-view { background: #fbf0d3; color: #946200; }
.mini-none { background: #eceef2; color: #97a0ad; }

/* ----------------------------- Responsive ----------------------------- */
@media (max-width: 1040px) {
  .panels { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .brand-meta { width: 100%; }
}

/* ------------------------- Auth: header + gate ------------------------ */
.header-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.auth-area { display: flex; align-items: center; gap: 10px; }
.auth-name { font-size: 13px; color: #e9edf3; font-weight: 600; }
.auth-demo { font-size: 12px; color: #aeb6c2; font-style: italic; }
.auth-area .tbtn { padding: 5px 10px; font-size: 12px; }

.signed-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: #1b7a3d;
  background: #e6f6ec; border: 1px solid #bfe6cb;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap;
}

.gate {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2330, #0f1115);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.gate[hidden] { display: none; }
.gate-card {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-md);
  width: 100%; max-width: 440px; padding: 30px 30px 22px; text-align: center;
}
.gate-logo { font-weight: 800; letter-spacing: 0.03em; color: #1f2733; margin-bottom: 12px; }
.gate-logo .brand-mark { color: var(--accent); }
.gate-card h2 { margin: 6px 0 8px; font-size: 20px; }
.gate-msg { color: var(--muted); line-height: 1.5; margin: 0 0 18px; font-size: 13.5px; }
.gate-msg code { background: #f1f3f7; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.gate-actions { display: flex; justify-content: center; }
.gate-foot { margin: 18px 0 0; font-size: 11px; color: #9aa3b1; }

.ms-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #2f2f2f; color: #fff; border: none;
  padding: 11px 18px; border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 600;
}
.ms-btn:hover { background: #1f1f1f; }
.ms-logo { width: 18px; height: 18px; display: block; }

/* ------------------------------ Live mode ----------------------------- */
.tbtn-live { border-color: #bfe6cb; background: #f0fbf3; color: #1b7a3d; font-weight: 700; }
.tbtn-live:hover { background: #e3f6ea; }
.tbtn-live-on { background: #1b7a3d; border-color: #1b7a3d; color: #fff; }
.tbtn-live-on:hover { background: #166a34; }

.live { padding: 0; overflow: hidden; }
.live-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: #f6fbf7; flex-wrap: wrap;
}
.live-title { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.live-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #1b7a3d;
  box-shadow: 0 0 0 0 rgba(27,122,61,.5); animation: pulse 1.4s infinite;
}
.live-warn {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: #c0341d; background: #fde3e1; border: 1px solid #f4c4bf;
  padding: 2px 8px; border-radius: 999px;
}
.live-tools { display: flex; gap: 8px; }
.live .crumb { background: #fff; }
.live-status { margin: 0; padding: 10px 16px; font-size: 13px; border-bottom: 1px solid var(--line); }
.live-status.live-ok { background: #f1faf1; color: #1b7a3d; }
.live-status.live-err { background: #fdecec; color: #c0341d; }
.live-foot { padding: 10px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.lock-badge {
  display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700;
  color: #c0341d; background: #fde3e1; border: 1px solid #f4c4bf;
  padding: 1px 8px; border-radius: 999px; vertical-align: middle;
}
.row-locked { background: #fff8f7; }
.tbtn-unlock { border-color: #f4c4bf; background: #fff5f4; color: #c0341d; font-weight: 700; }
.tbtn-unlock:hover { background: #fde3e1; }

/* =========================================================================
 * My Files — single-account, SharePoint-style document library
 * A clean, production-style view (no demo chrome) over the real share.
 * Palette follows Microsoft Fluent / SharePoint Online.
 * ========================================================================= */
:root {
  --sp-blue: #0f6cbd;
  --sp-blue-hover: #115ea3;
  --sp-ink: #242424;
  --sp-sub: #616161;
  --sp-line: #edebe9;
  --sp-hover: #f3f9fd;
  --sp-sel: #eff6fc;
  --sp-head: #faf9f8;
}

/* ------------------------------- Tabs --------------------------------- */
.tabs {
  display: flex; align-items: center; gap: 2px;
  margin: 14px 0 16px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--sp-sub);
  padding: 9px 16px 11px; border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0; transition: color .12s, background .12s;
}
.tab:hover { color: var(--sp-ink); background: rgba(15, 108, 189, 0.06); }
.tab.is-active { color: var(--sp-blue); border-bottom-color: var(--sp-blue); }
.tabs-note { margin-left: auto; font-size: 12px; color: var(--muted); padding: 4px 0; }

/* ----------------------------- Container ------------------------------ */
.sp {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden;
}

/* --------------------------- Library header --------------------------- */
.sp-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 20px; border-bottom: 1px solid var(--sp-line);
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
  flex-wrap: wrap;
}
.sp-id { display: flex; align-items: center; gap: 13px; }
.sp-app-ic {
  width: 42px; height: 42px; display: grid; place-items: center; font-size: 21px;
  background: #eaf3fb; color: var(--sp-blue); border-radius: 10px;
}
.sp-site { font-size: 17px; font-weight: 700; color: var(--sp-ink); line-height: 1.2; }
.sp-sub { font-size: 12.5px; color: var(--sp-sub); margin-top: 2px; }
.sp-account {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 6px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; font-size: 13px; font-weight: 600; color: var(--sp-ink);
}
.sp-account .sp-ava { width: 28px; height: 28px; font-size: 11px; }
.sp-account .sp-acc-role { font-weight: 500; color: var(--sp-sub); }

/* ----------------------------- Avatars -------------------------------- */
.sp-ava {
  width: 26px; height: 26px; border-radius: 50%; display: inline-grid;
  place-items: center; color: #fff; font-size: 10.5px; font-weight: 700;
  letter-spacing: .02em; flex: none; text-transform: uppercase;
}

/* --------------------------- Command bar ------------------------------ */
.sp-cmd {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 16px; border-bottom: 1px solid var(--sp-line); flex-wrap: wrap;
}
.sp-cmd-left { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sp-btn {
  appearance: none; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--sp-ink); background: transparent; border: 1px solid transparent;
  border-radius: 6px; padding: 7px 12px; display: inline-flex; align-items: center; gap: 7px;
  transition: background .12s, border-color .12s;
}
.sp-btn:hover { background: var(--sp-hover); }
.sp-btn .sp-btn-ic { color: var(--sp-blue); font-weight: 800; font-size: 15px; line-height: 1; }
.sp-btn.sp-ghost { color: var(--sp-sub); }
.sp-search {
  display: inline-flex; align-items: center; gap: 7px; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 11px; min-width: 230px;
}
.sp-search:focus-within { border-color: var(--sp-blue); box-shadow: 0 0 0 1px var(--sp-blue); }
.sp-search-ic { font-size: 13px; opacity: .6; }
.sp-search input { border: 0; outline: 0; font: inherit; width: 100%; background: transparent; color: var(--sp-ink); }

/* ----------------------------- Breadcrumb ----------------------------- */
.sp-crumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
  padding: 11px 18px; font-size: 14px; border-bottom: 1px solid var(--sp-line);
}
.sp-crumb a { color: var(--sp-ink); text-decoration: none; font-weight: 600; padding: 3px 6px; border-radius: 5px; cursor: pointer; }
.sp-crumb a:hover { background: var(--sp-hover); color: var(--sp-blue); }
.sp-crumb a:last-child { color: var(--sp-sub); font-weight: 700; }
.sp-crumb .sep { color: #c8c6c4; padding: 0 1px; }

/* ------------------------------ Status -------------------------------- */
.sp-status { margin: 0; padding: 10px 18px; font-size: 13px; border-bottom: 1px solid var(--sp-line); }
.sp-status.ok { background: #f1faf4; color: #0e7a3d; }
.sp-status.err { background: #fdf3f4; color: #c0341d; }

/* --------------------------- Upload progress -------------------------- */
.sp-upload { padding: 11px 18px; border-bottom: 1px solid var(--sp-line); background: #fbfdff; }
.sp-upload-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--sp-sub); margin-bottom: 6px; }
.sp-upload-name { font-weight: 600; color: var(--sp-ink); }
.sp-upload-track { height: 6px; background: #e9edf2; border-radius: 999px; overflow: hidden; }
.sp-upload-fill { display: block; height: 100%; width: 0; background: var(--sp-blue); border-radius: 999px; transition: width .15s; }

/* ----------------------------- File table ----------------------------- */
.sp-list { overflow-x: auto; }
.sp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sp-table thead th {
  text-align: left; font-weight: 600; color: var(--sp-sub); font-size: 12.5px;
  padding: 10px 14px; border-bottom: 1px solid var(--sp-line);
  background: var(--sp-head); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.sp-table th[data-sort] { cursor: pointer; user-select: none; }
.sp-table th[data-sort]:hover { color: var(--sp-ink); }
.sp-sort-ic { font-size: 10px; color: var(--sp-blue); margin-left: 2px; }
.sp-c-size { text-align: right; width: 110px; }
.sp-c-mod { width: 170px; }
.sp-c-by { width: 210px; }
.sp-c-act { width: 48px; }

.sp-table tbody td { padding: 0 14px; height: 44px; border-bottom: 1px solid var(--sp-line); vertical-align: middle; color: var(--sp-ink); }
.sp-table tbody tr { cursor: pointer; }
.sp-table tbody tr:hover { background: var(--sp-hover); }
.sp-table tbody tr.row-locked { background: #fff8f7; }
.sp-table tbody tr.row-locked:hover { background: #fff1ef; }

.sp-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sp-ic { font-size: 17px; flex: none; width: 22px; text-align: center; }
.sp-fn { font-weight: 600; color: var(--sp-blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-table tbody tr:hover .sp-fn { text-decoration: underline; }
.sp-fn.is-dir { color: var(--sp-ink); }
.sp-mod { color: var(--sp-sub); white-space: nowrap; }
.sp-by { display: flex; align-items: center; gap: 8px; color: var(--sp-ink); }
.sp-by .sp-ava { width: 24px; height: 24px; font-size: 10px; }
.sp-by-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-size { text-align: right; color: var(--sp-sub); white-space: nowrap; font-variant-numeric: tabular-nums; }

.sp-lock {
  display: inline-flex; align-items: center; margin-left: 8px; font-size: 11px; font-weight: 700;
  color: #c0341d; background: #fde3e1; border: 1px solid #f4c4bf; padding: 0 8px; line-height: 18px;
  border-radius: 999px; flex: none;
}
.sp-smb {
  display: inline-flex; align-items: center; margin-left: 8px; font-size: 11px; font-weight: 700;
  color: #8a5300; background: #fff4d6; border: 1px solid #f3df9f; padding: 0 8px; line-height: 18px;
  border-radius: 999px; flex: none;
}
.sp-more {
  appearance: none; border: 0; background: transparent; cursor: pointer; color: var(--sp-sub);
  font-size: 18px; line-height: 1; border-radius: 6px; width: 30px; height: 30px;
}
.sp-more:hover { background: #e9edf2; color: var(--sp-ink); }

.sp-empty { padding: 46px 18px; text-align: center; color: var(--sp-sub); }
.sp-empty-ic { font-size: 34px; display: block; margin-bottom: 8px; opacity: .65; }

/* --------------------------- Actions modal ---------------------------- */
.sp-actions { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 2px; }
.sp-action {
  appearance: none; cursor: pointer; font: inherit; font-size: 14px; text-align: left;
  background: transparent; border: 0; border-radius: 8px; padding: 11px 12px;
  display: flex; align-items: center; gap: 12px; color: var(--sp-ink);
}
.sp-action:hover { background: var(--sp-hover); }
.sp-action .sp-action-ic { width: 20px; text-align: center; font-size: 16px; }
.sp-action.danger { color: #c0341d; }
.sp-action.danger:hover { background: #fdf3f4; }
.sp-meta { font-size: 12.5px; color: var(--sp-sub); border-top: 1px solid var(--sp-line); margin-top: 6px; padding-top: 10px; }
.sp-meta b { color: var(--sp-ink); }

/* ---- My Files: work-account sign-in gate (@locks.com.au) ---- */
.sp-signin { padding: 40px 18px 54px; display: grid; place-items: center; }
.sp-signin-card {
  width: min(420px, 100%); background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-md); padding: 30px 30px 24px;
}
.sp-signin-brand { font-weight: 700; font-size: 15px; color: var(--sp-ink); margin-bottom: 18px; }
.sp-signin-brand .brand-mark { color: var(--accent); margin-right: 6px; }
.sp-signin-title { margin: 0 0 6px; font-size: 21px; color: var(--sp-ink); }
.sp-signin-lead { margin: 0 0 18px; color: var(--sp-sub); font-size: 13.5px; line-height: 1.5; }
.sp-field { display: block; font-size: 12.5px; font-weight: 600; color: var(--sp-sub); margin-bottom: 6px; }
.sp-input {
  width: 100%; font: inherit; font-size: 15px; color: var(--sp-ink);
  padding: 11px 12px; border: 1px solid #c8c6c4; border-radius: 8px; outline: 0;
}
.sp-input:focus { border-color: var(--sp-blue); box-shadow: 0 0 0 1px var(--sp-blue); }
.sp-signin-msg { margin: 10px 0 0; font-size: 13px; color: #c0341d; }
.sp-signin-btn {
  appearance: none; cursor: pointer; font: inherit; font-weight: 600; font-size: 15px;
  margin-top: 16px; width: 100%; padding: 11px 14px; color: #fff;
  background: var(--sp-blue); border: 0; border-radius: 8px;
}
.sp-signin-btn:hover { background: var(--sp-blue-hover); }
.sp-signin-foot { margin: 16px 0 0; font-size: 11.5px; color: var(--muted); }
.sp-signin-msg.info { color: var(--sp-sub); }
.sp-signin-note { margin: 12px 0 0; font-size: 12px; color: var(--sp-sub); line-height: 1.5; }
.sp-signin-note code { background: #f3f2f1; padding: 1px 5px; border-radius: 4px; }
#sp-ms-signin { display: flex; width: 100%; justify-content: center; align-items: center; gap: 10px; margin-top: 8px; }
.sp-acc-vf { color: #107c41; font-weight: 700; }

/* Account chip: name + work email + sign out */
.sp-acc-text { display: inline-flex; flex-direction: column; line-height: 1.2; text-align: left; }
.sp-acc-name { font-weight: 600; color: var(--sp-ink); }
.sp-acc-mail { font-size: 11.5px; color: var(--sp-sub); font-weight: 500; }
.sp-signout {
  appearance: none; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600;
  margin-left: 6px; color: var(--sp-blue); background: transparent;
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px;
}
.sp-signout:hover { background: var(--sp-hover); border-color: var(--sp-blue); }

@media (max-width: 820px) {
  .sp-c-by, .sp-by { display: none; }
  .tabs-note { display: none; }
}
