html.mebs-workspace {
  --mebs-nav: #172b4b;
  --mebs-panel: #fff;
  --mebs-canvas: #f5f7fb;
  --mebs-rail: #edf1f7;
  --mebs-text: #14213b;
  --mebs-border: #d9e1ee;
  --mebs-link: #2858a3;
}

html.mebs-workspace:has(#main.dark-mode) {
  --mebs-panel: #202d43;
  --mebs-canvas: #142035;
  --mebs-rail: #18253c;
  --mebs-text: #f0f4ff;
  --mebs-border: #425574;
  --mebs-link: #9dc2ff;
}

html.mebs-workspace header.flexbar {
  background: var(--mebs-nav);
  color: #fff;
}
.mebs-file-actions { flex: 0 0 auto; padding: 7px 11px; margin-inline: 4px 10px; border: 1px solid #9bb7de; border-radius: 8px; background: #294977; color: white; font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.mebs-file-actions:hover { background: #375c94; }
.mebs-file-actions:focus-visible { outline: 2px solid #9dc2ff; outline-offset: 2px; }
.mebs-upload-hint { flex: 0 0 auto; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--mebs-border); border-radius: 8px; background: var(--mebs-panel); color: var(--mebs-text); font-size: 13px; }
.mebs-upload-hint a { color: var(--mebs-link); text-decoration: underline; }

.mebs-file-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  margin-inline: 8px 14px;
  color: #fff !important;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.25;
  font-weight: 700;
}

.mebs-file-brand small { display: block; color: #d5e3fa; font-size: 11px; font-weight: 400; }
.mebs-file-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #9bb7de;
  border-radius: 9px;
  background: #294977;
}

html.mebs-workspace #sidebar,
html.mebs-workspace #sidebar .sidebar-links {
  background: var(--mebs-rail);
  border-color: var(--mebs-border);
  color: var(--mebs-text);
}

html.mebs-workspace #sidebar .sidebar-link-button { color: var(--mebs-text); }
html.mebs-workspace #sidebar .sidebar-link-button:hover { background: var(--mebs-panel); color: var(--mebs-link); }

#mebs-home-link {
  display: block;
  margin: 8px 10px;
  padding: 8px 11px;
  border: 1px solid var(--mebs-border);
  border-radius: 8px;
  background: var(--mebs-panel);
  color: var(--mebs-link);
  font-weight: 700;
  text-decoration: none;
}

html.mebs-workspace #main { background: var(--mebs-canvas); color: var(--mebs-text); }
html.mebs-workspace #main .listing-items :is(.file-items,.folder-items,.pinned-items) > [role="button"]:not([aria-selected="true"]):not(.selected) {
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--mebs-border);
}

@media (max-width: 620px) {
  .mebs-file-brand { margin-inline: 4px 6px; font-size: 13px; }
  .mebs-file-brand small, .mebs-file-mark { display: none; }
}

.mebs-notice-calendar {
  box-sizing: border-box;
  width: min(100%, 670px);
  flex: 0 0 auto;
  margin: 76px 0 16px;
  padding: 14px 16px;
  color: var(--mebs-text);
  background: var(--mebs-panel);
  border: 1px solid var(--mebs-border);
  border-radius: 12px;
}
.mebs-notice-calendar h2 { margin: 0; font-size: 18px; }
.mebs-notice-calendar p { margin: 3px 0 9px; font-size: 13px; color: var(--mebs-link); }
.mebs-notice-calendar table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: center; font-size: 13px; }
.mebs-notice-calendar :is(th,td) { padding: 1px; }
.mebs-notice-calendar td button { position: relative; width: 100%; min-height: 42px; border: 1px solid transparent; border-radius: 8px; color: inherit; background: transparent; font: inherit; cursor: pointer; }
.mebs-notice-calendar td button:hover { border-color: var(--mebs-link); }
.mebs-notice-calendar td button[data-has-schedule]::after { content: ''; position: absolute; bottom: 3px; left: calc(50% - 2px); width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.mebs-notice-calendar [aria-current="date"] { border-radius: 8px; background: #2858a3; color: white; font-weight: 700; }

html.mebs-workspace #main:has(.mebs-notice-calendar) { overflow-y: auto; }
.mebs-schedule-dialog { box-sizing: border-box; width: min(430px, calc(100vw - 24px)); max-height: 85dvh; overflow-y: auto; padding: 20px; border: 1px solid var(--mebs-border); border-radius: 14px; background: var(--mebs-panel); color: var(--mebs-text); }
.mebs-schedule-dialog::backdrop { background: #0c162a99; }
.mebs-schedule-dialog h3 { margin: 0 0 14px; }
.mebs-schedule-dialog label { display: grid; gap: 4px; margin-bottom: 10px; }
.mebs-schedule-dialog input { width: 100%; box-sizing: border-box; padding: 8px; border: 1px solid var(--mebs-border); border-radius: 7px; background: var(--mebs-canvas); color: var(--mebs-text); }
.mebs-schedule-actions { display: flex; justify-content: flex-end; gap: 8px; }
.mebs-schedule-actions button { padding: 8px 12px; border: 1px solid var(--mebs-border); border-radius: 7px; background: var(--mebs-canvas); color: var(--mebs-text); cursor: pointer; }
.mebs-schedule-actions button[type="submit"] { background: #2858a3; color: white; }
