/* Hexeria Drive.
 *
 * Same palette as chat, so the two read as one product. No build step: this
 * file is served as written.
 */

:root {
  --bg: #0b1016;
  --panel: #121821;
  --raised: #1a222d;
  --line: #262f3b;
  --ink: #e8e3d8;
  --dim: #94a0ab;
  --accent: #d8b872;
  --danger: #c96f6f;
}

* { box-sizing: border-box; }

/* The `hidden` attribute works through the browser's own [hidden]{display:none},
   which ANY id or class rule setting display outranks. #drop sets display:flex,
   so without this the drop overlay was never hidden -- it sat over the whole
   app from page load, dimming everything behind it and looking exactly like a
   drag that would not end. Chat carries the same line for the same reason. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica,
        Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.muted { color: var(--dim); }
.spacer { flex: 1; }

button, .btn, .alt {
  font: inherit;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover, .alt:hover { border-color: var(--accent); }
.alt { background: none; color: var(--dim); }
.btn { border-color: var(--accent); color: var(--accent); }
button.danger { color: var(--danger); }

/* --- the signed-out state ------------------------------------------------ */

#gate, #outage {
  max-width: 420px;
  margin: 18vh auto 0;
  padding: 0 20px;
  text-align: center;
}
#gate h1 {
  margin: 0 0 6px;
  font: 600 30px/1.1 ui-serif, Georgia, "Times New Roman", serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-indent: .18em;
}
#gate .btn { display: inline-block; margin-top: 22px; }

/* --- the app ------------------------------------------------------------- */

#envbar {
  padding: 4px 12px;
  background: repeating-linear-gradient(135deg,
    #4a3a12 0 12px, #3d3010 12px 24px);
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  text-align: center;
}

header, #bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.brand {
  font: 600 15px/1 ui-serif, Georgia, serif;
  letter-spacing: .16em;
  text-transform: uppercase;
}

#crumbs { display: flex; align-items: center; gap: 4px; font-size: 13px; }
#crumbs button {
  background: none;
  border: 0;
  padding: 2px 4px;
  color: var(--dim);
  border-radius: 5px;
}
#crumbs button:last-child { color: var(--ink); }
#crumbs .sep { color: var(--line); }

#quota-bar {
  display: inline-block;
  width: 120px;
  height: 6px;
  border-radius: 999px;
  background: var(--raised);
  overflow: hidden;
}
#quota-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .2s ease;
}
/* Past nine tenths the bar stops being reassuring and starts being a
   warning, which is the only point at which the colour matters. */
#quota-bar.full #quota-fill { background: var(--danger); }

#pill {
  margin: 0;
  padding: 8px 16px;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
#pill.err { color: var(--danger); }

/* --- the listing --------------------------------------------------------- */

#listing { padding: 6px 8px 40px; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
}
.row:hover { background: var(--panel); }

.glyph { width: 20px; text-align: center; color: var(--dim); font-size: 16px; }
.row.folder .glyph { color: var(--accent); }

.row-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
}
.row-size {
  font-size: 12.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

/* Actions stay in the layout rather than appearing on hover: a control that
   is not there until the pointer arrives cannot be found on a touchscreen. */
.row-acts { display: flex; gap: 4px; }
.row-acts button {
  padding: 3px 8px;
  font-size: 12px;
  background: none;
  color: var(--dim);
}

#empty { padding: 24px 18px; }

/* --- dropping ------------------------------------------------------------ */

#drop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 16, 22, .82);
  border: 2px dashed var(--accent);
  color: var(--accent);
  font-size: 18px;
  letter-spacing: .1em;
  text-transform: uppercase;
  pointer-events: none;
}

@media (max-width: 600px) {
  header, #bar { padding: 8px 10px; }
  #quota-bar { display: none; }
  .row-size { display: none; }
}

/* --- overlays ------------------------------------------------------------ */

.ov {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .5);
  padding: 20px;
}
.ov-box {
  width: min(520px, 100%);
  max-height: 80vh;
  overflow-y: auto;
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.ov-title {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.ov-row { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.ov-row input[type="text"], .ov-row select {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
}
.ov-row select { flex: 0 0 auto; }
.hint-line { margin: 4px 0 8px; font-size: 12.5px; color: var(--dim); }

.grant, .link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.grant .who, .link-row .who {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-row .who { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
                 font-size: 12px; color: var(--dim); }
.grant button, .link-row button {
  padding: 3px 8px;
  font-size: 12px;
  background: none;
  color: var(--dim);
}

/* The drive switcher. Drawn here rather than by the operating system: a
   native <select> opens as OS chrome that ignores the page's palette
   entirely, which on a dark app is a bright blue rectangle. */
#drive-switch {
  font: inherit;
  font-size: 13px;
  color: var(--dim);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
}
#drive-switch::after {
  content: "\25BE";
  color: var(--accent);
  font-size: 10px;
}
#drive-switch:hover { border-color: var(--accent); color: var(--ink); }
#drive-switch-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

#drive-menu {
  position: fixed;
  z-index: 45;
  min-width: 250px;
  max-width: min(320px, 86vw);
  padding: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
}
.dm-row {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%; padding: 8px 10px;
  background: none; border: 0; border-radius: 8px;
  color: var(--ink); text-align: left; cursor: pointer;
}
.dm-row:hover, .dm-row.sel { background: var(--raised); }
.dm-row.sel .dm-name { color: var(--accent); }
.dm-hex { color: var(--accent); font-size: 15px; line-height: 1.35; }
.dm-name { display: block; font-size: 14px; }
.dm-hint { display: block; font-size: 12px; color: var(--dim); }

/* Inline style attributes are blocked by style-src 'self' just as inline
   <style> is, so spacing that would otherwise be a style="" lives here. */
.spaced { margin-top: 16px; }

/* How long something has left in the trash. Muted, because it is a fact
   about the item rather than a warning -- until it is nearly out. */
.row-left {
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
}
.row-left.soon { color: var(--danger); }

@media (max-width: 600px) {
  .row-left { display: none; }
}

.note { margin: 0; padding: 10px 16px 0; font-size: 12.5px; }

/* A two-state choice, both states visible. Preferred to a dropdown of two
   entries, which hides half the answer behind a click. */
.seg {
  display: inline-flex;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.seg button {
  border: 0;
  border-radius: 0;
  padding: 7px 11px;
  font-size: 13px;
  color: var(--dim);
  background: var(--raised);
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: #12140f; }
.seg button:hover:not(.on) { color: var(--ink); }
