/* Files, Docs and Forms (files.html, doc.html, form.html, fill.html) - on top of sb.css. */
.storage { margin: 0 4px; padding: 12px 14px; font-size: 12.5px; }
.storage b { font-size: 13px; }
.storage .meter { margin-top: 8px; }
.storage .meter i.full { background: var(--bad); }
.drive-search .input { width: 240px; height: 36px; }
@media (max-width: 720px) { .drive-search .input { width: 150px; } }

.dpath { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; margin: -4px 0 14px; }
.dpath a { color: var(--text-2); padding: 3px 6px; border-radius: 6px; }
.dpath a:hover { background: rgba(160,186,224,.08); color: var(--text); }
.dpath b { padding: 3px 6px; }
.dpath .sep { color: var(--faint); }

.dlist td.n { width: 100%; }
.dlist .nm { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
.dlist .nm b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.dlist .nm small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.dlist tr:hover td { background: rgba(160,186,224,.035); }
.kic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.kic svg.i { width: 18px; height: 18px; }
.kic.folder { background: rgba(242,194,0,.13); color: var(--gold-2); }
.kic.doc { background: rgba(96,165,250,.14); color: var(--blue); }
.kic.form { background: rgba(167,139,250,.15); color: #c4b5fd; }
.kic.img { background: rgba(74,222,128,.12); color: var(--ok); }
.dlist td.m { white-space: nowrap; color: var(--muted); font-size: 13px; }
.dlist .acts { white-space: nowrap; text-align: right; }
@media (max-width: 760px) { .dlist .hide-sm { display: none; } .dlist .nm b { max-width: 22ch; } }

.dmenu { position: relative; display: inline-block; }
.dmenu > div { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 190px; padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2, var(--line)); box-shadow: var(--shadow); display: none; }
.dmenu.open > div { display: grid; gap: 2px; }
.dmenu > div button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: 500 14px var(--font); cursor: pointer; }
.dmenu > div button:hover { background: rgba(160,186,224,.08); }
.dmenu > div button.bad { color: var(--bad); }
.dmenu > div button[disabled] { opacity: .45; cursor: default; }
.dmenu > div button small { margin-left: auto; color: var(--muted); font-size: 11px; }

.empty-drive { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty-drive .kic { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; }
.empty-drive .kic svg.i { width: 26px; height: 26px; }
.upsell { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--gold-line); background: var(--gold-soft); margin-bottom: 16px; font-size: 14px; }
.upsell b { color: var(--text); }

.drop-hint { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; background: rgba(6,13,25,.72); backdrop-filter: blur(3px); pointer-events: none; }
.drop-hint > div { display: grid; gap: 6px; text-align: center; padding: 34px 46px; border-radius: 20px; border: 2px dashed var(--gold); background: var(--surface); font-size: 18px; }
.drop-hint span { font-size: 13px; color: var(--muted); }
body.dragging .drop-hint { display: grid; }
.uploads { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: grid; gap: 8px; width: min(340px, calc(100vw - 36px)); }
.up { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; }
.up .row { flex-wrap: nowrap; } .up .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.up .meter { margin-top: 7px; } .up.bad { border-color: rgba(248,113,113,.4); } .up.bad .muted { color: var(--bad); }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tpl { text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; }
.tpl:hover, .tpl.on { border-color: var(--gold); }
.tpl b { display: block; font-size: 14px; margin-bottom: 3px; } .tpl span { font-size: 12px; color: var(--muted); }

/* ---- Docs editor */
.ed-top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.ed-bar1 { display: flex; align-items: center; gap: 10px; padding: 10px 18px; flex-wrap: wrap; }
.ed-title { flex: 1; min-width: 180px; height: 38px; border: 1px solid transparent; background: transparent; color: var(--text); font: 700 17px var(--font-display, var(--font)); padding: 0 8px; border-radius: 8px; }
.ed-title:hover, .ed-title:focus { border-color: var(--line); background: var(--surface); outline: none; }
.ed-state { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ed-state.bad { color: var(--bad); }
.ed-tools { display: flex; align-items: center; gap: 2px; padding: 6px 14px; border-top: 1px solid var(--line); overflow-x: auto; flex-wrap: wrap; }
.ed-tools button, .ed-tools select { height: 32px; min-width: 32px; padding: 0 8px; border: 0; border-radius: 7px; background: none; color: var(--text-2); font: 600 13.5px var(--font); cursor: pointer; }
.ed-tools select { background: var(--surface); border: 1px solid var(--line); color: var(--text); padding: 0 6px; }
.ed-tools button:hover { background: rgba(160,186,224,.09); color: var(--text); }
.ed-tools button.on { background: var(--gold-soft); color: var(--gold-2); }
.ed-tools .sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.ed-wrap { padding: 28px 16px 80px; background: #0b1424; min-height: calc(100vh - 120px); }
.paper { max-width: 816px; min-height: 1056px; margin: 0 auto; padding: 72px 80px; background: #fff; color: #1b1f24; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.45);
  font: 15px/1.6 Calibri, Carlito, "Segoe UI", Arial, sans-serif; outline: none; }
.paper h1 { font-size: 26px; margin: 0 0 12px; } .paper h2 { font-size: 20px; margin: 18px 0 8px; } .paper h3 { font-size: 16.5px; margin: 16px 0 6px; }
.paper p { margin: 0 0 10px; } .paper a { color: #1a56db; } .paper blockquote { border-left: 3px solid #cbd5e1; margin: 0 0 10px; padding: 2px 0 2px 14px; color: #475569; }
.paper table { border-collapse: collapse; width: 100%; margin: 0 0 12px; } .paper td, .paper th { border: 1px solid #cbd5e1; padding: 6px 8px; vertical-align: top; }
.paper hr { border: 0; border-top: 1px solid #cbd5e1; margin: 16px 0; }
.paper[contenteditable="false"] { cursor: default; }
@media (max-width: 760px) { .paper { padding: 36px 24px; min-height: 70vh; } }
.ed-banner { margin: 0 auto 14px; max-width: 816px; }
@media print {
  body { background: #fff !important; }
  .ed-top, .ed-banner, .uploads, .toast { display: none !important; }
  .ed-wrap { padding: 0; background: #fff; min-height: 0; }
  .paper { box-shadow: none; padding: 0; max-width: none; min-height: 0; border-radius: 0; }
  @page { margin: 22mm 20mm; }
}

/* ---- Form editor + filling in */
.fe { max-width: 820px; margin: 0 auto; padding: 24px 16px 80px; }
.fe-q { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 12px; }
.fe-q.on { border-color: var(--gold-line); }
.fe-q .row { gap: 8px; }
.fe-q textarea { min-height: 70px; }
.fe-tabs { display: flex; gap: 4px; padding: 0 18px; border-top: 1px solid var(--line); }
.fe-tabs a { padding: 11px 12px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; }
.fe-tabs a.on { color: var(--text); border-bottom-color: var(--gold); }
.share-box { display: flex; gap: 8px; align-items: center; } .share-box .input { flex: 1; font-family: var(--mono, monospace); font-size: 13px; }
.fill-wrap { min-height: 100vh; padding: 40px 16px 60px; background: radial-gradient(1200px 500px at 50% -10%, rgba(242,194,0,.09), transparent), var(--bg); }
.fill { max-width: 680px; margin: 0 auto; }
.fill .card-body > h1 { margin: 0 0 6px; font-size: 26px; }
.fill .q { padding: 16px 0; border-top: 1px solid var(--line); }
.fill .q > b { display: block; margin-bottom: 4px; } .fill .q > b i { color: var(--bad); font-style: normal; }
.fill .q .help { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.fill .opt { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 14.5px; cursor: pointer; }
.fill .opt input { width: 17px; height: 17px; accent-color: var(--gold); }
.ans-tbl td { vertical-align: top; font-size: 13.5px; max-width: 280px; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 720px) { .topbar .crumbs { display: none; } .drive-search { flex: 1; } .drive-search .input { width: 100%; } }

/* A row's ••• menu, floating above the page (files.js openPop). */
.dpop { position: fixed; z-index: 90; min-width: 200px; padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2, var(--line)); box-shadow: 0 18px 44px rgba(0,0,0,.5); display: grid; gap: 2px; animation: dpop-in .12s ease-out; }
@keyframes dpop-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.dpop button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: 500 14px var(--font); cursor: pointer; }
.dpop button:hover { background: rgba(160,186,224,.08); }
.dpop button.bad { color: var(--bad); }
.dpop button[disabled] { opacity: .45; cursor: default; background: none; }
.dpop svg.i { width: 16px; height: 16px; color: var(--muted); }
.dpop button.bad svg.i { color: var(--bad); }

/* Scrollbars in the dark theme (no white bars). */
* { scrollbar-width: thin; scrollbar-color: rgba(160,186,224,.22) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(160,186,224,.18); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(160,186,224,.32); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---- The explorer (files.js): the same idea as the Smile Hosting file manager, in Smile Business colours. */
.fx { --fx-bg: #070e19; --fx-side: #09121f; --fx-line: rgba(147,176,214,.12); --fx-hover: rgba(147,176,214,.07); --fx-sel: rgba(242,194,0,.1);
  position: relative; display: flex; flex-direction: column; height: calc(100vh - 200px); min-height: 480px; border: 1px solid rgba(147,176,214,.16); border-radius: 16px; overflow: hidden; background: var(--fx-bg); box-shadow: 0 18px 40px -22px rgba(0,0,0,.8); }
.fx svg.i { width: 17px; height: 17px; flex: none; }
.fx-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--fx-line); background: #0b1524; min-width: 0; }
.fx-btn { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border: 0; border-radius: 9px; background: transparent; color: #8fa1b8; cursor: pointer; padding: 0; }
.fx-btn:hover { background: var(--fx-hover); color: #e2e8f0; }
.fx-btn.on { background: rgba(242,194,0,.13); color: var(--gold); }
.fx-group { display: flex; align-items: center; gap: 2px; padding-left: 8px; border-left: 1px solid var(--fx-line); }
.fx-newbtn { margin-left: 6px; }
.fx-spacer { flex: 1; min-width: 0; }
.fx.readonly .fx-edit-only { display: none; }
.fx-selectbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 12px; border-bottom: 1px solid var(--fx-line); background: rgba(242,194,0,.06); font-size: 13px; }
.fx-selectbar[hidden] { display: none; }
.fx-selcount { margin-right: auto; color: var(--gold); font-weight: 700; }
.fx-body { flex: 1; display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); min-height: 0; }
.fx-side { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--fx-side); border-right: 1px solid var(--fx-line); }
.fx-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 8px; font: 700 10.5px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: #7d8ea5; }
.fx-count { font-size: 11px; letter-spacing: 0; background: rgba(147,176,214,.12); color: #9fb0c6; border-radius: 999px; padding: 2px 8px; }
.fx-tree { flex: 1; overflow: auto; padding: 0 6px 12px; }
.fx-row { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 4px 0 calc(6px + var(--d, 0) * 15px); border-radius: 7px; cursor: pointer; font-size: 13.5px; color: #cbd5e1; user-select: none; }
.fx-row:hover { background: var(--fx-hover); }
.fx-row.sel { background: var(--fx-sel); color: #fff; }
.fx-row.open .fx-name { color: var(--gold-2); }
.fx-row.fx-dim { color: #62728a; font-style: italic; cursor: default; font-size: 12.5px; }
.fx-row.fx-dim:hover { background: none; }
.fx-chev { width: 16px; height: 16px; display: grid; place-items: center; color: #6b7c93; flex: none; transition: transform .12s; }
.fx-chev svg.i { width: 13px; height: 13px; }
.fx-chev.down { transform: rotate(90deg); }
.fx-ico { width: 20px; height: 18px; display: inline-grid; place-items: center; flex: none; }
.fx-folder { color: #e8b84a; }
.fx-ico-file { color: #8b98a9; }
.fx-k-doc { color: var(--blue); } .fx-k-form { color: #c4b5fd; }
.fx-badge { font: 800 9px/1 ui-monospace, Consolas, monospace; color: var(--c); letter-spacing: -.02em; background: color-mix(in srgb, var(--c) 15%, transparent); border-radius: 4px; width: 22px; height: 16px; overflow: hidden; }
.fx-badge.big { width: 36px; height: 36px; border-radius: 10px; font-size: 11px; }
.fx-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-more { width: 26px; height: 24px; display: grid; place-items: center; border: 0; background: transparent; color: #8193aa; border-radius: 6px; opacity: 0; cursor: pointer; padding: 0; flex: none; font-size: 11px; letter-spacing: 1px; }
.fx-row:hover .fx-more, .fx-row.sel .fx-more, .fx-li:hover .fx-more { opacity: 1; }
.fx-more:hover { background: rgba(147,176,214,.15); color: #fff; }
.fx-empty-small { padding: 14px; color: #6b7c93; font-size: 13px; }
.fx-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--fx-bg); }
.fx-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--fx-line); font-size: 13px; color: #62728a; }
.fx-crumb { border: 0; background: transparent; color: #9fb0c6; padding: 3px 6px; border-radius: 6px; cursor: pointer; font: inherit; }
.fx-crumb:last-of-type { color: #fff; font-weight: 600; }
.fx-crumb:hover { background: var(--fx-hover); }
.fx-sep { color: #3f4f66; }
.fx-pill { margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--gold-2); background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 999px; padding: 2px 8px; }
.fx-empty { margin: auto; display: grid; justify-items: center; gap: 6px; color: #6b7c93; text-align: center; padding: 32px; }
.fx-empty svg.i { width: 46px; height: 46px; stroke-width: 1.4; color: #3d4b60; margin-bottom: 8px; }
.fx-empty strong { color: #cbd5e1; font-size: 16px; font-weight: 600; }
.fx-empty span { font-size: 13.5px; }
.fx-list { flex: 1; overflow: auto; }
.fx-lhead, .fx-li { display: grid; grid-template-columns: minmax(0, 1fr) 150px 130px 80px 34px; align-items: center; gap: 12px; padding: 0 14px; }
.fx-lhead { height: 34px; font: 700 10.5px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: #62728a; border-bottom: 1px solid var(--fx-line); position: sticky; top: 0; background: var(--fx-bg); z-index: 1; }
.fx-li { height: 42px; border-bottom: 1px solid rgba(147,176,214,.06); cursor: pointer; font-size: 13.5px; color: #dbe4f0; }
.fx-li:hover { background: var(--fx-hover); }
.fx-li.checked { background: var(--fx-sel); }
.fx-li-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fx-dimtxt { color: #7d8ea5; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-check { width: 15px; height: 15px; margin: 0; flex: none; accent-color: var(--gold); }
.fx-grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; padding: 14px; align-content: start; }
.fx-tile { position: relative; display: grid; justify-items: center; gap: 5px; padding: 16px 8px 12px; border-radius: 12px; border: 1px solid transparent; background: rgba(147,176,214,.04); color: #cbd5e1; cursor: pointer; min-width: 0; font: inherit; }
.fx-tile:hover { background: var(--fx-hover); border-color: var(--fx-line); }
.fx-tile.checked { background: var(--fx-sel); border-color: rgba(242,194,0,.35); }
.fx-tile-check { position: absolute; top: 8px; left: 8px; }
.fx-tile-ico .fx-ico:not(.big) { transform: scale(1.8); margin: 8px 0 10px; }
.fx-tile-ico .fx-badge.big { margin: 2px 0 4px; }
.fx-tile-name { font-size: 13px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-tile-meta { font-size: 11.5px; color: #62728a; }
.fx-tabbar { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 0; border-bottom: 1px solid var(--fx-line); background: #09121f; min-height: 44px; min-width: 0; }
.fx-backlist { display: none; } .fx-backlist svg.i { transform: rotate(180deg); }
.fx-tab { display: flex; align-items: center; gap: 8px; align-self: stretch; padding: 0 8px 0 14px; background: var(--fx-bg); border-right: 1px solid var(--fx-line); box-shadow: inset 0 2px 0 var(--gold); font-size: 13.5px; color: #e2e8f0; min-width: 0; }
.fx-tab-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.fx-tab-close { width: 24px; height: 24px; display: grid; place-items: center; border: 0; background: transparent; color: #8193aa; border-radius: 6px; cursor: pointer; padding: 0; flex: none; font-size: 12px; }
.fx-tab-close:hover { background: rgba(147,176,214,.15); color: #fff; }
.fx-path { font: 12px ui-monospace, Consolas, monospace; color: #62728a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fx-ro { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #9fb0c6; background: rgba(147,176,214,.1); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.fx-save[disabled] { opacity: .45; cursor: default; }
.fx-editor { flex: 1; display: flex; min-height: 0; font: 13px/1.6 "JetBrains Mono", ui-monospace, Consolas, monospace; }
.fx-gutter { margin: 0; padding: 12px 10px 32px 10px; min-width: 52px; text-align: right; color: #3f4f66; background: var(--fx-bg); overflow: hidden; user-select: none; font: inherit; border-right: 1px solid rgba(147,176,214,.06); }
.fx-code { flex: 1; min-width: 0; margin: 0; border: 0; border-radius: 0; resize: none; outline: none; background: var(--fx-bg); color: #dbe4f0; font: inherit; padding: 12px 16px 32px; white-space: pre; overflow: auto; tab-size: 2; }
.fx-code::selection { background: rgba(242,194,0,.25); }
.fx-statusbar { display: flex; gap: 18px; align-items: center; padding: 5px 14px; font-size: 11.5px; color: #7d8ea5; border-top: 1px solid var(--fx-line); background: #09121f; white-space: nowrap; overflow: hidden; }
.fx-hint { margin-left: auto; }
.fx-info { margin: auto; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 32px; color: #7d8ea5; font-size: 13.5px; max-width: 520px; }
.fx-info-ico .fx-ico:not(.big) { transform: scale(2.2); margin-bottom: 14px; }
.fx-info strong { color: #e2e8f0; word-break: break-all; font-size: 15px; }
.dpop-title { padding: 6px 10px 8px; font-size: 12px; color: #7d8ea5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dpop button small { margin-left: auto; color: var(--muted); font-size: 11px; }
@media (max-width: 980px) { .fx-lhead, .fx-li { grid-template-columns: minmax(0, 1fr) 34px; } .fx-lhead .hide-sm, .fx-li .hide-sm { display: none; } }
@media (max-width: 720px) {
  .fx { height: calc(100vh - 170px); border-radius: 12px; }
  .fx-bar { flex-wrap: wrap; }
  .fx-body { grid-template-columns: minmax(0, 1fr); }
  .fx-main { display: none; }
  .fx.file-open .fx-side, .fx.grid-view .fx-side { display: none; }
  .fx.file-open .fx-main, .fx.grid-view .fx-main { display: flex; }
  .fx-backlist { display: grid; }
  .fx-tab { box-shadow: none; border-right: 0; padding-left: 0; }
  .fx-path, .fx-hint { display: none; }
  .fx-row { height: 40px; font-size: 14.5px; }
  .fx-more { opacity: 1; width: 34px; height: 34px; }
  .fx-code { font-size: 16px; line-height: 1.5; }
  .fx-gutter { display: none; }
  .fx-statusbar span:nth-child(n+3) { display: none; }
}
