/* ===== Orutsch Tasks: dark, app-like skin for Vikunja ===== */
:root, :root.dark, :root.light {
  --or-bg: #000;
  --or-surface: #1c1c1e;
  --or-surface-2: #2c2c2e;
  --or-surface-3: #3a3a3c;
  --or-line: rgba(255,255,255,.08);
  --or-text: #f2f2f7;
  --or-muted: #98989f;
  --or-blue: #4c8dff;
  --or-list: #101214;
  --or-card: #22272b;
  --or-tab-h: 68px;
  --or-safe-b: env(safe-area-inset-bottom, 0px);
  --or-safe-t: env(safe-area-inset-top, 0px);

  --grey-50-hsl: 240, 3%, 11%;      --grey-50: #1c1c1e;
  --grey-100-hsl: 240, 2%, 18%;     --grey-100: #2c2c2e;
  --grey-200: #3a3a3c; --grey-300: #636366; --grey-400: #8e8e93;
  --grey-500-hsl: 240, 3%, 61%;     --grey-500: #98989f;
  --grey-600: #c7c7cc; --grey-700: #e5e5ea; --grey-800: #f2f2f7;
  --grey-900-hsl: 0, 0%, 100%;      --grey-900: #fff;
  --white: #1c1c1e;
  --text: #f2f2f7; --text-strong: #fff; --text-light: #8e8e93; --text-muted: #98989f;
  --scheme-main: #000; --body-background-color: #000;
  --primary-h: 217deg; --primary-s: 100%; --primary-l: 65%;
  --card-border-color: transparent;
  --family-primary: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --body-family: var(--family-primary);
  color-scheme: dark;
}
html { background: #000 !important; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { font-family: var(--family-primary) !important; -webkit-font-smoothing: antialiased; }
body { background: #000 !important; color: var(--or-text); font-size: 17px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
input, textarea, select, .input, .textarea, [contenteditable] { font-size: 17px !important; }
::selection { background: rgba(76,141,255,.35); }

/* hide Vikunja branding & desktop-only bits */
.menu-bottom-link, .keyboard-shortcuts-button { display: none !important; }

/* ================= phone / tablet: app shell ================= */
@media (max-width: 1023px) {
  html.or-app body { padding-bottom: calc(var(--or-tab-h) + var(--or-safe-b) + 16px) !important; }
  html.or-app .app-container { background: #000 !important; min-height: 100vh; }
  html.or-app .app-container-background { display: none !important; }
  html.or-app aside.menu-container, html.or-app .menu-show-button, html.or-app .menu-hide-button,
  html.or-app .mobile-overlay, html.or-app .logo-link, html.or-app header.navbar .notifications,
  html.or-app header.navbar .username-dropdown-trigger, html.or-app header.navbar .dropdown:has(.username-dropdown-trigger) { display: none !important; }
  html.or-app .app-content { padding: 8px 16px 24px !important; margin: 0 !important; inline-size: 100% !important; max-inline-size: 100% !important; transform: none !important; }

  /* top bar */
  html.or-app header.navbar {
    background: rgba(0,0,0,.82) !important; -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border: 0 !important; box-shadow: none !important; padding-top: var(--or-safe-t) !important;
    min-height: calc(56px + var(--or-safe-t)); display: flex; align-items: center; gap: 8px; padding-inline: 12px !important;
  }
  html.or-app header.navbar .project-title-wrapper, html.or-app header.navbar .project-title { font-size: 19px !important; font-weight: 700 !important; color: #fff !important; }
  html.or-app header.navbar .navbar-end { margin-inline-start: auto; gap: 6px; }
  html.or-app header.navbar .navbar-end .trigger-button { inline-size: 40px; block-size: 40px; border-radius: 50%; background: var(--or-surface); color: #fff; }
  html.or-app.or-is-home header.navbar { display: none !important; }
  .or-back { display: none; }
  html.or-app:not(.or-is-root) .or-back {
    display: inline-flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; border-radius: 50%;
    background: var(--or-surface); border: 0; color: #fff; flex: 0 0 auto; cursor: pointer;
  }
  .or-back svg { inline-size: 22px; block-size: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

  /* home: hide Vikunja's own content, show ours */
  html.or-is-home .app-content.home > .content { display: none !important; }

  /* bigger type everywhere */
  html.or-app h1, html.or-app .title.is-1 { font-size: 30px !important; font-weight: 800 !important; letter-spacing: -.02em; color: #fff !important; }
  html.or-app h2, html.or-app .title { color: #fff !important; }
  html.or-app .button { font-size: 17px !important; min-height: 46px; border-radius: 12px !important; }
  html.or-app .button.is-outlined { background: var(--or-surface) !important; border: 0 !important; color: var(--or-text) !important; }
  html.or-app .button.is-primary:not(.is-outlined) { background: var(--or-blue) !important; border: 0 !important; color: #fff !important; }
  html.or-app .input, html.or-app .textarea, html.or-app select { background: var(--or-surface) !important; border: 0 !important; color: #fff !important; border-radius: 12px !important; min-height: 46px; }
  html.or-app .card { background: var(--or-surface) !important; border: 0 !important; border-radius: 14px !important; box-shadow: none !important; overflow: hidden; }
  html.or-app .dropdown-content, html.or-app .dropdown-menu .dropdown-content { background: var(--or-surface-2) !important; border-radius: 14px !important; box-shadow: 0 12px 40px rgba(0,0,0,.6) !important; }
  html.or-app .dropdown-item { font-size: 17px !important; padding: 12px 16px !important; color: var(--or-text) !important; }
  html.or-app .modal-content, html.or-app .modal-card { border-radius: 18px !important; }

  /* list view rows */
  html.or-app .tasks .single-task, html.or-app .single-task { font-size: 17px !important; padding: 14px 12px !important; border-bottom: 1px solid var(--or-line) !important; }
  html.or-app .single-task .tasktext, html.or-app .single-task .task-link { color: var(--or-text) !important; }

  /* project view switcher -> iOS segmented control */
  html.or-app .switch-view-container { margin-block: 4px 12px !important; justify-content: space-between; gap: 8px; }
  html.or-app .switch-view { background: var(--or-surface) !important; border-radius: 12px !important; padding: 3px !important; box-shadow: none !important; }
  html.or-app .switch-view-button { font-size: 15px !important; padding: 7px 12px !important; border-radius: 9px !important; color: var(--or-muted) !important; }
  html.or-app .switch-view-button.is-active { background: var(--or-surface-3) !important; color: #fff !important; }
  html.or-app .filter-container .button { min-height: 38px; }

  /* ---------- kanban like the phone boards ---------- */
  html.or-app .project-kanban { margin-inline: -16px; }
  html.or-app .project-kanban .switch-view-container { padding-inline: 16px; }
  html.or-app .kanban-bucket-container { scroll-snap-type: x mandatory; gap: 12px; padding-inline: 16px !important; -webkit-overflow-scrolling: touch; }
  html.or-app .kanban .bucket {
    inline-size: 84vw !important; min-inline-size: 84vw !important; max-inline-size: 360px; scroll-snap-align: center;
    background: var(--or-list) !important; border-radius: 16px !important; padding: 10px 8px 8px !important; margin: 0 !important;
  }
  html.or-app .kanban .bucket-header { padding: 4px 6px 10px !important; }
  html.or-app .kanban .bucket-header .title { font-size: 18px !important; font-weight: 700 !important; }
  html.or-app .kanban .tasks { padding: 0 !important; }
  html.or-app .kanban .task-item { background: transparent !important; }
  html.or-app .kanban-card, html.or-app .kanban .task {
    background: var(--or-card) !important; border: 0 !important; border-radius: 12px !important; box-shadow: 0 1px 0 rgba(0,0,0,.5) !important;
    color: var(--or-text) !important; font-size: 17px !important; margin-block-end: 8px !important;
  }
  html.or-app .kanban-card .p-2 { padding: 12px 14px !important; }
  html.or-app .kanban-card .task-id { display: none !important; }
  html.or-app .kanban .bucket-footer .button { background: transparent !important; color: var(--or-muted) !important; justify-content: flex-start !important; font-weight: 600; }
  html.or-app .kanban .new-bucket { inline-size: 84vw !important; min-inline-size: 84vw !important; }
  html.or-app .kanban .new-bucket .button { background: rgba(255,255,255,.08) !important; color: #fff !important; }

  /* ---------- task detail: quick actions first, as tiles ---------- */
  html.or-app .task-view { padding: 0 !important; background: transparent !important; box-shadow: none !important; }
  html.or-app .task-view .back-button { display: none !important; }
  html.or-app .task-view .heading .title.input { font-size: 30px !important; font-weight: 800 !important; line-height: 1.2; padding: 0 !important; }
  html.or-app .task-view .task-id { font-size: 15px !important; color: var(--or-muted) !important; }
  html.or-app .task-view .subtitle { font-size: 16px !important; color: var(--or-muted) !important; }
  html.or-app .task-view .columns.mbs-2 { display: flex !important; flex-direction: column !important; }
  html.or-app .task-view .action-buttons {
    order: -1; display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; margin: 8px 0 18px !important;
    background: var(--or-surface); border-radius: 16px; inline-size: 100% !important; max-inline-size: none !important; position: static !important;
  }
  html.or-app .task-view .action-buttons .action-heading { grid-column: 1 / -1; font-size: 15px !important; font-weight: 700; color: var(--or-muted); margin: 6px 2px 0 !important; text-transform: none; }
  html.or-app .task-view .action-buttons .button {
    margin: 0 !important; inline-size: 100% !important; justify-content: flex-start !important; text-align: start; white-space: normal;
    background: var(--or-surface-2) !important; min-height: 54px; font-size: 15px !important; line-height: 1.2; padding: 8px 12px !important;
  }
  html.or-app .task-view .action-buttons .button.button--mark-done { grid-column: 1 / -1; background: var(--or-blue) !important; color: #fff !important; font-weight: 700; }
  html.or-app .task-view .action-buttons .is-danger { color: #ff6961 !important; }
  html.or-app .task-view .action-buttons .created { grid-column: 1 / -1; font-size: 13px; color: var(--or-muted); }
  html.or-app .task-view .detail-content { inline-size: 100% !important; padding: 0 !important; }
  html.or-app .task-view .details, html.or-app .task-view .content.attachments, html.or-app .task-view .comments-container {
    background: var(--or-surface); border-radius: 16px; padding: 14px 16px !important; margin-block-end: 14px !important;
  }
  html.or-app .task-section-title { font-size: 19px !important; color: #fff !important; }
  html.or-app .tiptap__editor, html.or-app .tiptap { font-size: 17px !important; }
  html.or-app .editor-toolbar { background: var(--or-surface-2) !important; border-radius: 12px !important; border: 0 !important; }

  /* Vikunja's "add to home screen" hint: above our tab bar */
  html.or-app .bottom-banners { bottom: calc(var(--or-tab-h) + var(--or-safe-b) + 16px) !important; z-index: 61; }
  html.or-app .add-to-home-screen { background: var(--or-surface-2) !important; color: #fff !important; border-radius: 16px !important; }
  html.or-app .button, html.or-app .filter-container .button { text-transform: none !important; letter-spacing: 0 !important; }
  html.or-app .heading .title.input, html.or-app .bucket-header .title.input, html.or-app h1.title.input {
    background: transparent !important; box-shadow: none !important; min-height: 0 !important; border-radius: 8px !important; }
  html.or-app .heading .title.input:focus, html.or-app .bucket-header .title.input:focus { background: var(--or-surface) !important; }
  html.or-app .scroll-to-comments-button { display: none !important; }
}

/* ---------- tab bar ---------- */
.or-tabbar { display: none; }
@media (max-width: 1023px) {
  html.or-app .or-tabbar {
    position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(8px + var(--or-safe-b));
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; block-size: var(--or-tab-h);
    padding: 6px; border-radius: 34px; background: rgba(28,28,30,.86);
    -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
    box-shadow: 0 10px 30px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.07);
  }
  .or-tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; block-size: 100%;
    border: 0; background: transparent; color: #e5e5ea; font: 600 12px/1.1 var(--family-primary); border-radius: 28px; cursor: pointer; padding: 0;
  }
  .or-tabbar button.active { background: rgba(255,255,255,.12); color: var(--or-blue); }
  .or-tabbar svg { inline-size: 26px; block-size: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .or-tabbar .or-avatar {
    inline-size: 28px; block-size: 28px; border-radius: 50%; background: #5b3fd6; color: #fff; font: 700 12px/28px var(--family-primary);
    font-style: normal; text-align: center; display: block;
  }
}

/* ---------- boards home ---------- */
#or-home { display: none; }
html.or-is-home #or-home { display: block; padding-top: var(--or-safe-t); color: var(--or-text); }
#or-home svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.or-large { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 16px; }
.or-large h1 { margin: 0; font-size: 40px !important; font-weight: 800 !important; letter-spacing: -.02em; color: #fff; }
.or-large-actions { display: flex; gap: 12px; }
.or-circle { inline-size: 52px; block-size: 52px; border-radius: 50%; border: 0; background: var(--or-surface); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.or-circle svg { inline-size: 24px; block-size: 24px; }
.or-circle.or-primary { background: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.35); }
.or-circle.or-primary svg { inline-size: 28px; block-size: 28px; stroke-width: 2.4; }
.or-searchbox { display: flex; align-items: center; gap: 10px; background: var(--or-surface); border-radius: 26px; padding: 0 18px; block-size: 54px; margin-bottom: 22px; }
.or-searchbox svg { inline-size: 22px; block-size: 22px; color: var(--or-muted); flex: 0 0 auto; }
.or-searchbox input { flex: 1; min-inline-size: 0; background: transparent; border: 0; outline: 0; color: #fff; font-size: 19px !important; -webkit-appearance: none; appearance: none; }
.or-searchbox input::placeholder { color: var(--or-muted); }
.or-inbox { background: #45474d; border-radius: 22px; padding: 14px; margin-bottom: 26px; box-shadow: 0 0 0 4px rgba(200,215,255,.85); }
.or-inbox-h { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 12px; }
.or-inbox-t { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 800; color: #fff; }
.or-inbox-t svg { inline-size: 24px; block-size: 24px; color: #e5e5ea; }
.or-count { color: #9fb8ff; font-size: 18px; font-weight: 700; }
.or-icon { border: 0; background: transparent; color: #e5e5ea; padding: 4px; cursor: pointer; }
.or-icon svg { inline-size: 26px; block-size: 26px; }
.or-inbox-add { inline-size: 100%; box-sizing: border-box; background: #2a2b2f; border: 1px solid rgba(0,0,0,.35); border-radius: 12px; padding: 16px; color: #fff; font-size: 19px !important; outline: 0; }
.or-inbox-add::placeholder { color: #a1a1a8; }
.or-sec { display: flex; align-items: center; gap: 12px; font-size: 21px !important; font-weight: 500 !important; color: #e5e5ea !important; margin: 0 0 10px 4px; }
.or-sec svg { inline-size: 26px; block-size: 26px; }
.or-caps { font-size: 18px !important; font-weight: 800 !important; letter-spacing: .02em; text-transform: uppercase; color: #d1d1d6 !important; margin: 28px 0 10px 4px; }
.or-list { background: var(--or-surface); border-radius: 16px; overflow: hidden; margin: 0 -16px; border-radius: 0; }
.or-row { display: flex; align-items: center; gap: 16px; inline-size: 100%; border: 0; background: transparent; color: #fff; padding: 10px 16px; cursor: pointer; text-align: left; }
.or-row + .or-row { box-shadow: inset 0 1px 0 var(--or-line); }
.or-row:active { background: var(--or-surface-2); }
.or-thumb { inline-size: 64px; block-size: 50px; border-radius: 8px; flex: 0 0 auto; }
.or-row-t { font-size: 21px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.or-empty { color: var(--or-muted); font-size: 17px; padding: 8px 4px; }
.or-toast { position: fixed; left: 50%; bottom: calc(var(--or-tab-h) + var(--or-safe-b) + 24px); transform: translate(-50%, 20px); opacity: 0; z-index: 70;
  background: #f2f2f7; color: #000; font: 600 15px/1.2 var(--family-primary); padding: 12px 18px; border-radius: 22px; transition: .25s; white-space: nowrap; }
.or-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 1024px) { #or-home { display: none !important; } }

@media (display-mode: standalone) { .add-to-home-screen { display: none !important; } }

/* ---------- headings: same font everywhere ---------- */
h1, h2, h3, .title, .subtitle { font-family: var(--family-primary) !important; }
@media (max-width: 1023px) { html.or-app .app-content h1 { font-size: 28px !important; line-height: 1.2; } }

/* ---------- login ---------- */
.no-auth-wrapper { background: #000 !important; min-height: 100vh; padding: calc(env(safe-area-inset-top, 0px) + 40px) 20px 40px !important; }
.no-auth-wrapper > .logo, .noauth-container > section.image, .no-auth-wrapper .api-config, .no-auth-wrapper .legal-links { display: none !important; }
.noauth-container { background: transparent !important; box-shadow: none !important; max-inline-size: 440px !important; margin: 0 auto !important; display: block !important; }
.noauth-container::before {
  content: ""; display: block; inline-size: 76px; block-size: 76px; margin: 10px auto 18px; border-radius: 18px;
  background: url(/orutsch/icon-192.png) center / cover; box-shadow: 0 8px 30px rgba(207,22,27,.35);
}
.noauth-container > main.content { background: transparent !important; padding: 0 !important; }
.no-auth-wrapper h2.title { text-align: center; font-size: 30px !important; font-weight: 800 !important; color: #fff !important; margin-bottom: 26px !important; }
.no-auth-wrapper h2.title::after { content: "Orutsch Tasks"; display: block; font-size: 16px; font-weight: 500; color: var(--or-muted); margin-top: 4px; }
.no-auth-wrapper .label { color: #d1d1d6 !important; font-size: 15px !important; font-weight: 600 !important; }
.no-auth-wrapper .input { background: var(--or-surface) !important; border: 0 !important; color: #fff !important; border-radius: 14px !important; min-height: 54px; padding-inline: 16px !important; }
.no-auth-wrapper .button.is-primary { inline-size: 100%; min-height: 54px; border-radius: 14px !important; background: var(--or-blue) !important; border: 0 !important; font-size: 18px !important; font-weight: 700 !important; text-transform: none !important; margin-top: 10px; }
.no-auth-wrapper .checkbox { color: #d1d1d6; font-size: 16px; margin-block: 6px; }
.no-auth-wrapper a { color: var(--or-blue) !important; }
@media (max-width: 1023px) {
  html.or-app .kanban .bucket-header, html.or-app .kanban .bucket .tasks, html.or-app .kanban .bucket .bucket-footer, html.or-app .kanban .bucket .tasks > li { background: transparent !important; }
  html.or-app .kanban-card .p-2, html.or-app .kanban-card .p-2 > * { font-size: 17px !important; line-height: 1.35; }
  html.or-app .kanban-card .footer, html.or-app .kanban-card .tw\:text-sm { font-size: 14px !important; }
}
@media (max-width: 1023px) {
  /* card opened from a board (modal) -> full screen sheet with a round close button */
  html.or-app dialog.task-detail-view-modal { background: #000 !important; padding: 0 !important; }
  html.or-app dialog.task-detail-view-modal .modal-container { padding: calc(env(safe-area-inset-top, 0px) + 68px) 16px calc(env(safe-area-inset-bottom, 0px) + 40px) !important; margin: 0 !important; max-inline-size: none !important; }
  html.or-app dialog.task-detail-view-modal .modal-content { margin: 0 !important; inline-size: 100% !important; max-inline-size: none !important; }
  html.or-app dialog.task-detail-view-modal .task-view { background: transparent !important; box-shadow: none !important; }
  html.or-app dialog.task-detail-view-modal .close {
    position: fixed !important; top: calc(env(safe-area-inset-top, 0px) + 10px) !important; left: 12px !important; right: auto !important; z-index: 80;
    inline-size: 44px !important; block-size: 44px !important; border-radius: 50%; background: var(--or-surface) !important; color: #fff !important;
    display: inline-flex !important; align-items: center; justify-content: center; font-size: 20px; }
  html.or-app:has(dialog.task-detail-view-modal[open]) .or-tabbar,
  html.or-app:has(dialog.task-detail-view-modal[open]) .bottom-banners { display: none !important; }
}

/* ---------- desktop: same dark palette ---------- */
@media (min-width: 1024px) {
  header.navbar, .menu-container, .app-container .menu-container { background: #111113 !important; box-shadow: none !important; border-color: var(--or-line) !important; }
  .kanban .bucket { background: var(--or-list) !important; border-radius: 14px !important; }
  .kanban .bucket-header, .kanban .bucket .tasks, .kanban .bucket .bucket-footer, .kanban .task-item { background: transparent !important; }
  .kanban-card { background: var(--or-card) !important; border-radius: 10px !important; border: 0 !important; }
  .card, .task-view, .switch-view { background: var(--or-surface) !important; border: 0 !important; }
  .button { text-transform: none !important; letter-spacing: 0 !important; }
}
/* brand instead of the llama logo */
header.navbar .logo-link > div, .menu-container .logo > div { display: none !important; }
header.navbar .logo-link::before, .menu-container .logo::before {
  content: "Orutsch Tasks"; display: flex; align-items: center; gap: 10px; font: 800 20px/1 var(--family-primary); color: #fff;
  padding-inline-start: 46px; min-height: 36px; background: url(/orutsch/icon-192.png) left center / 36px 36px no-repeat;
}
