/* Gerege Drive accent: oklch hue 175 (teal), apart from vending.mn's 268 and the eID blue.
   Neutrals and the error red are the only colours added beside it. */
:root {
  --accent: oklch(0.55 0.11 175);
  --accent-subtle: oklch(0.97 0.02 175);
  --accent-fg: oklch(0.42 0.09 175);
  --bg: #f7f8f8;
  --card: #fff;
  --text: #1b1f1e;
  --muted: #5f6866;
  --line: #e3e7e6;
  --err: #b42318;
  --r: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--accent-fg); }
h1 { font-size: clamp(1.4rem, 5vw, 1.8rem); margin: .5rem 0 .25rem; }
h2 { font-size: 1.2rem; margin: 0 0 .5rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .25rem; }
.muted { color: var(--muted); font-size: .9rem; }
.err { color: var(--err); min-height: 1.2em; margin: 0; font-size: .9rem; }

button {
  font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--card);
  color: var(--text); padding: .55rem .9rem; border-radius: var(--r); white-space: nowrap;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.ghost { border-color: transparent; background: none; }
button.link { border: 0; background: none; color: var(--accent-fg); padding: .25rem; }
button.danger { color: var(--err); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input {
  font: inherit; width: 100%; padding: .6rem .7rem; border: 1px solid var(--line);
  border-radius: var(--r); background: #fff; color: var(--text);
}
label { display: grid; gap: .3rem; font-size: .9rem; color: var(--muted); }

#auth, #connect { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.card {
  width: min(100%, 380px); background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 1.5rem; display: grid; gap: .8rem;
}

header {
  display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem;
  background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2;
}
.brand { white-space: nowrap; display: flex; align-items: center; gap: .5rem; font-weight: 650; color: var(--text); text-decoration: none; margin-right: auto; }
main { max-width: 960px; margin: 0 auto; padding: 1rem; }
.bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }
.actions { display: flex; gap: .5rem; }
#crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; font-size: 1.05rem; min-width: 0; }
#crumbs button { border: 0; background: none; padding: .3rem .4rem; font-weight: 600; }
#crumbs span { color: var(--muted); }

#list { list-style: none; margin: .75rem 0 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
#list:empty { display: none; }
#list li { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-top: 1px solid var(--line); }
#list li:first-child { border-top: 0; }
#list li:hover { background: var(--accent-subtle); }
.ico { flex: none; width: 28px; height: 28px; color: var(--muted); }
.ico.dir { color: var(--accent); }
.name { flex: 1; min-width: 0; }
.name button { border: 0; background: none; padding: 0; text-align: left; font-weight: 550; overflow-wrap: anywhere; white-space: normal; }
.name small { display: block; color: var(--muted); font-size: .8rem; }
.tag { color: var(--accent-fg); }
.menu { position: relative; }
.menu > button { border-color: transparent; background: none; padding: .35rem .6rem; font-size: 1.2rem; line-height: 1; }
.menu ul {
  position: absolute; right: 0; top: 100%; z-index: 3; list-style: none; margin: 0; padding: .3rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px #0002; min-width: 170px;
}
.menu ul button { width: 100%; text-align: left; border: 0; }
.empty { text-align: center; padding: 3rem 1rem; border: 2px dashed var(--line); border-radius: 12px; color: var(--muted); }

#drop {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; font-size: 1.3rem; font-weight: 600;
  background: color-mix(in oklch, var(--accent) 15%, transparent); border: 3px dashed var(--accent); color: var(--accent-fg);
}

dialog { border: 1px solid var(--line); border-radius: 16px; padding: 1.25rem; width: min(92vw, 420px); }
dialog:has(.wide) { width: min(94vw, 640px); }
dialog::backdrop { background: #0006; }
dialog form { display: grid; gap: .6rem; }
.row { display: flex; gap: .5rem; justify-content: flex-end; align-items: center; }
.row input { flex: 1; }
.mini { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.mini li { display: flex; gap: .5rem; align-items: center; justify-content: space-between; font-size: .9rem; overflow-wrap: anywhere; }
pre { background: #10201e; color: #e6f2f0; padding: .75rem; border-radius: var(--r); font-size: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; margin: .5rem 0 0; }

@media (max-width: 560px) {
  #usage { display: none; }
  .actions { width: 100%; }
  .actions button { flex: 1; }
}
button.primary.danger { background: var(--err); border-color: var(--err); color: #fff; }
@media (max-width: 560px) {
  header { flex-wrap: wrap; }
  #usage { display: block; order: 5; width: 100%; font-size: .8rem; }
}
#eid { display: grid; gap: .8rem; }
#eid eid-login-button { display: block; }
.or { display: flex; align-items: center; gap: .6rem; margin: 0; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.perms { margin: 0; padding-left: 1.2rem; display: grid; gap: .3rem; }
.card p { margin: 0; overflow-wrap: anywhere; }
