/* common: what every app of cloud.aljl.eu shares, its look (shell.js: the menu, the account, the theme).

   The themes: every colour an app uses is one of these variables, never written in the app; a theme is a set of
   their values, on <html data-theme="…"> (shell.js puts it there before the page shows: the choice kept by the
   browser, the same for every app of the site). clair is the house's palette: À table's, warm, its terracotta accent
   (Jonathan, 20/10/2026; before, the greys and blue of fichiers and agenda). */
:root, :root[data-theme="clair"] {
  --bg: #FBF7F3;          /* behind: the page, a table's head, a recessed box */
  --surface: #FFFFFF;     /* the panes, the cards, the fields, the buttons, the menus */
  --fg: #2E2522;          /* the text */
  --weak: #7B6C66;        /* the text that matters less: dates, counts, labels */
  --a: #B8654B;           /* the accent: links, the main button, the selection's mark */
  --a-hover: #9C523B;
  --on-a: #FFFFFF;        /* the text on the accent (the main button) */
  --line: #EEE3DA;        /* the lines between things */
  --border: #E3D5C9;      /* a button's edge */
  --hl: #F8EFE9;          /* under the pointer */
  --sel: #F6E3DA;         /* chosen: the folder, the message, the row */
  --danger: #A04B3C;      /* what deletes; an error */
  --danger-line: #E2B9AE;
  --danger-hl: #F7E4DE;
  --warn: #b9770e;        /* a warning: something out of reach, the cache answering alone */
  --shadow: 0 6px 24px rgba(0, 0, 0, .12);
  --brand: #1f5f8b;       /* the pastille: the house's blue, whatever the theme */
  --brand-hover: #174b70;
  /* the shapes, the same in every theme */
  --font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --title-font: Georgia, "Times New Roman", serif;   /* the titles: the app's name, a page's or a section's heading */
  --radius: 10px;         /* a button, a field, a row or an entry of a list */
  --radius-lg: 14px;      /* a card, a panel, a tile, a dialog */
  color-scheme: light;
}
:root[data-theme="sombre"] {
  --bg: #15181c; --surface: #1d2126; --fg: #e3e5e8; --weak: #9aa3ad; --a: #6aa9d6; --a-hover: #8fc0e3; --on-a: #10202c;
  --line: #2c3238; --border: #3b434b; --hl: #252f39; --sel: #2a3a4a;
  --danger: #ef6b63; --danger-line: #6e3531; --danger-hl: #3b2422; --warn: #e0a24a; --shadow: 0 6px 24px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
:root[data-theme="sepia"] {
  --bg: #ece4d6; --surface: #f7f1e6; --fg: #2a2521; --weak: #7b7064; --a: #9a4a26; --a-hover: #7c3b1e; --on-a: #ffffff;
  --line: #ddd2c1; --border: #cdbfa9; --hl: #ece2d0; --sel: #e5d6bd;
  --danger: #a8321e; --danger-line: #dcb4a8; --danger-hl: #f4e2da; --warn: #a2630a; --shadow: 0 6px 24px rgba(60, 40, 20, .16);
  color-scheme: light;
}

/* ---------------------------------------------------------------- the menu (shell.js) */
/* the pastille: fixed at the top right of the window, unless the app gives it a place (an element [data-shell]) */
.shell { position: relative; font: var(--font); z-index: 60; }
.shell, .shell * { box-sizing: border-box; }
.shell.fixed { position: fixed; top: 10px; right: 14px; }
.shell-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
             border: 0; border-radius: 50%; background: var(--brand); color: #fff; font: 600 15px/1 system-ui, sans-serif;
             text-transform: uppercase; cursor: pointer; }
.shell-btn:hover, .shell-btn[aria-expanded="true"] { background: var(--brand-hover); }
.shell-btn:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }
.shell-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 17em; max-height: calc(100vh - 60px);
              overflow-x: hidden; overflow-y: auto; padding: .3em 0; background: var(--surface); color: var(--fg); border: 1px solid var(--line);
              border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.shell-menu[hidden] { display: none; }
.shell-menu a, .shell-menu button.item { display: flex; align-items: center; gap: .6em; width: 100%; padding: .5em 1em;
                                        border: 0; background: none; color: var(--fg); font: inherit; text-align: left;
                                        text-decoration: none; white-space: nowrap; cursor: pointer; }
.shell-menu a:hover, .shell-menu button.item:hover, .shell-menu a:focus-visible, .shell-menu button.item:focus-visible {
  background: var(--hl); outline: none; }
.shell-menu a.current { font-weight: 600; }
.shell-menu .ico { width: 18px; height: 18px; flex: none; object-fit: contain; }
.shell-menu .sep { border-top: 1px solid var(--line); margin: .3em 0; }
.shell-menu .who { padding: .5em 1em .3em; color: var(--weak); font-size: .9em; }
.shell-menu button.item.due { color: var(--a); font-weight: 600; }
.shell-menu button.item:disabled { color: var(--weak); cursor: progress; }
.shell-menu .version { padding: 0 1em .5em; color: var(--weak); font-size: .8em; }
.shell-menu .themes { display: flex; gap: .3em; padding: .4em 1em .5em; }
.shell-menu .themes button { flex: 1; padding: .2em .4em; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
                             color: var(--fg); font: inherit; font-size: .9em; cursor: pointer; }
.shell-menu .themes button:hover { background: var(--hl); }
.shell-menu .themes button[aria-pressed="true"] { border-color: var(--a); color: var(--a); font-weight: 600; }
