* {
    box-sizing: border-box;
}

:root {
    --white: #ffffff;
    --grey: #8a8a8ac7;
    --lgrey: #d0cecec7;
    --red: #ff0000;
    --black: #000000;
    --body: #000000;
    --bg: var(--white);
    --quest-green: #5cb85c;
    --quest-yellow: #f0ad4e;
    --quest-red: #d9534f;
    --quest-blue: #337ab7;
    --quest-grey: #888888;
    --quest-border: #2a2a2a;
    --quest-muted: #6b6b6b;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    height: 100vh;
    display: flex;
    overflow: hidden;
    background: var(--bg);
    color: var(--black);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--black);
}

.hidden {
    display: none;
}

[hidden] {
    display: none !important;
}


/* Global buttons */
.btn,
.fab,
.back-btn,
.app-banner,
.reminder-banner,
button,
input,
select,
textarea {
    font-family: inherit;
}

.btn,
.fab,
.back-btn,
.app-banner,
.reminder-banner {
    border: 1px solid var(--lgrey);
    background: var(--bg);
    color: inherit;
    border-radius: 0;
    box-shadow: none;
}

.btn,
.fab,
.back-btn {
    cursor: pointer;
    font-weight: 700;
}

.btn:hover,
.fab:hover,
.back-btn:hover,
.app-banner.show:hover,
.reminder-banner.show:hover {
    background: var(--lgrey);
    color: var(--black);
}

/* Banner + reminder */
.app-banner {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 65;
    padding: 8px 14px;
    font-size: 13px;
    letter-spacing: 0.2px;
    display: none;
    align-items: center;
    gap: 8px;
}

.app-banner.show {
    display: inline-flex;
}

.app-label,
.reminder-label {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 10px;
    opacity: 1;
}

.reminder-banner {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    letter-spacing: 0.2px;
    max-width: 280px;
    overflow: hidden;
    white-space: nowrap;
}

.reminder-banner.show {
    display: inline-flex;
}

.reminder-text {
    display: inline-block;
    white-space: nowrap;
}

.reminder-text.scrolling {
    padding-left: 100%;
    animation: reminder-scroll var(--scroll-duration, 10s) linear infinite;
}

@keyframes reminder-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Back button */
.back-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 60;
    padding: 8px 12px;
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
}

.back-btn.hidden {
    display: none;
}

/* Left Edge Hover Trigger for Side Menu */
.menu-edge-trigger {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    bottom: 0;
    z-index: 99;
    background: transparent;
    border-left: 5px solid #000;
    pointer-events: auto;
}

/* Sidebar */
#menu {
    width: 220px;
    background: var(--white);
    color: inherit;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    border-left: 5px solid #000;
    border-right: 1px solid var(--lgrey);
    box-shadow: none;
    transform: translateX(0);
    transition: transform 0.25s ease;
    overflow: hidden;
}

#menu.hidden {
    transform: translateX(-100%);
    pointer-events: none;
}

#menu.is-hover-open {
    transform: translateX(0) !important;
    pointer-events: auto !important;
}

#menu.is-locked {
    transform: translateX(0) !important;
    pointer-events: auto !important;
}

#menu button {
    font-size: 18px;
    padding: 14px;
    background:  var(--white);
    color: inherit;
    border: none;
    cursor: pointer;
}

#menu button:hover {
    background: var(--lgrey);
    color: var(--white);
}

#menuCloseBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--lgrey);
    background: var(--white);
    color: inherit;
    line-height: 1;
    z-index: 1;
}

#menuCloseBtn img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

#menu ul {
    list-style: none;
    padding: 46px 0 77px;
    margin: 0;
    overflow-y: auto;
}

#menu .menu-list.hidden {
    display: none;
}

#menu li a {
    display: block;
    padding: 12px 14px;
    color: inherit;
    text-decoration: none;

    white-space: nowrap;
}

#menu li a.menu-icon-link {
    display: flex;
    align-items: center;
    gap: 10px;
}

#menu li a:hover {
    background: var(--lgrey);
    color: var(--black);
}

.stack-section-title {
    padding: 12px 14px 6px;
    border-top: 1px solid var(--lgrey);
}

.stack-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.stack-section-head a {
    padding: 0;
    color: inherit;
    text-decoration: none;
}

.stack-section-head a:hover,
.stack-section-head a:focus-visible {
    text-decoration: underline;
    background: transparent;
}

.stack-links-menu {
    padding: 0 0 16px;
}

#menu li a.stack-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.stack-menu-favicon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border-radius: 4px;
    object-fit: contain;
}

.stack-menu-icon {
    width: 18px;
    height: 18px;
    padding: 3px;
    object-fit: contain;
    flex: 0 0 auto;
    position: relative;
    top: 1px;
}

.stack-menu-link:hover,
.stack-menu-link:focus-visible {
    background: var(--lgrey);
    color: var(--black);
    outline: none;
}

.custom-links.hidden {
    display: none;
}

#customLinks {
    list-style: none;
    padding: 0;
    margin: 0;
}

#customLinksHeader {
    padding: 10px 14px;
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
   
}

/* Main content */
#content {
    min-width: 0;
    flex: 1;
    height: 100%;
    position: relative;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
}

#wizardframe {
    background: var(--bg);
    display: none;
}

/* Menu + notes strips */
/* Floating actions */
.floating-actions {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 70;
}

.fab {
    padding: 10px 14px;
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.fab.icon-only {
    padding: 10px;
}

.fab svg {
    display: block;
}

/* Panels */
.welcome,
.history,
.settings,
.dashboard-overlay {
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--bg);
}

.welcome.show,
.history.show,
.settings.show,
.dashboard-overlay.show {
    display: flex;
}

.dashboard-overlay {
    position: absolute;
    inset: 0;
    padding: clamp(16px, 2.5vw, 36px);
    background: rgba(255, 255, 255, 0.96);
    z-index: 40;
}

.dashboard-view {
    width: 100%;
    height: 100%;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    column-gap: clamp(16px, 2.5vw, 36px);
    row-gap: 12px;
    color: var(--black);
    min-width: 0;
}

.dashboard-view img {
    display: block;
    max-width: 100%;
}

.dashboard-topbar {
    grid-column: 1 / 2;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-left: 0;
}

.dashboard-topbar-left {
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.dashboard-topbar .dashboard-tools {
    margin-left: 0;
    justify-content: center;
}

.dashboard-topbar-status {
    margin-left: 0;
    padding-top: 8px;
    justify-content: center;
    text-align: center;
    flex-wrap: wrap;
}

.dashboard-brand-group,
.dashboard-status-group {
    display: flex;
    align-items: center;
    gap: 26px;
    min-width: 0;
}

.dashboard-brand {
    width: 54px;
    height: 54px;
    object-fit: contain;
    flex: 0 0 auto;
}

.dashboard-status,
.dashboard-menu,
.dashboard-feature-text,
.dashboard-notes-title,
.dashboard-footer-app {
    font-size: clamp(0.97rem, 0.87vw, 1.2rem);
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1;
}

.dashboard-status,
.dashboard-menu {
    white-space: nowrap;
}

.dashboard-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-menu a {
    color: inherit;
    text-decoration: none;
}

.dashboard-menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.dashboard-menu-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dashboard-menu a:hover,
.dashboard-menu a:focus-visible {
    opacity: 0.7;
    outline: none;
}

.dashboard-notes {
    grid-column: 2 / 3;
    grid-row: 1 / 4;
    position: relative;
    border: 3px solid #000;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: none;
    min-width: 0;
    background: rgba(255, 255, 255, 0.54);
}

.dashboard-notes-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1.5px solid rgba(17, 17, 17, 0.45);
}

.dashboard-notes-tab {
    border: 0;
    border-right: 1.5px solid rgba(17, 17, 17, 0.45);
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: clamp(0.7rem, 0.68vw, 0.9rem);
    line-height: 1;
    text-transform: uppercase;
    padding: 13px 8px 11px;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-notes-tab:last-child,
.dashboard-notes-tab:last-of-type {
    border-right: 0;
}

.dashboard-notes-tab.is-active {
    background: #060606;
    color: #ffffff;
}

.dashboard-notes-body {
    flex: 1;
    min-height: 0;
    padding: 20px 24px 24px;
}

.dashboard-notes-panel {
    height: 100%;
    display: none;
    flex-direction: column;
    min-height: 0;
}

.dashboard-notes-panel.is-active {
    display: flex;
}

.dashboard-notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-notes-title {
    margin: 0;
    text-transform: uppercase;
    font-size: clamp(1.2rem, 1.15vw, 1.45rem);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.dashboard-notes-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.dashboard-minddump-header-group-controls {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.dashboard-minddump-header-group-controls .dashboard-minddump-group-controls {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.dashboard-minddump-header-group-controls .dashboard-frog-btn,
.dashboard-minddump-header-group-controls .dashboard-minddump-move {
    width: 36px;
    height: 36px;
    min-width: 36px;
    flex: 0 0 36px;
    border: 1.5px solid rgba(17, 17, 17, 0.45);
    background: transparent;
    border-radius: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dashboard-minddump-header-group-controls .dashboard-minddump-move img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.dashboard-minddump-header-group-controls .dashboard-frog-icon {
    width: 18px;
    height: 18px;
}

.dashboard-minddump-header-group-controls .dashboard-frog-btn:hover,
.dashboard-minddump-header-group-controls .dashboard-minddump-move:hover {
    background: rgba(17, 17, 17, 0.06);
}

.dashboard-minddump-header-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--quest-muted);
    background: rgba(17, 17, 17, 0.06);
    border: 1px solid rgba(17, 17, 17, 0.15);
    padding: 2px 8px;
    border-radius: 0;
    line-height: 1.2;
}

.dashboard-notes-title-button {
    cursor: pointer;
}

.dashboard-notes-title-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.dashboard-notes-title-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.dashboard-notes-icon-btn {
    border: 0;
    background: transparent;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.dashboard-notes-title-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex: 0 0 auto;
}

.dashboard-notes-title-link:hover,
.dashboard-notes-title-link:focus-visible,
.dashboard-notes-title-button:hover,
.dashboard-notes-title-button:focus-visible,
.dashboard-notes-icon-btn:hover,
.dashboard-notes-icon-btn:focus-visible {
    text-decoration: underline;
    outline: none;
}

.dashboard-notes-add {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
}

.dashboard-notes-add[hidden],
.dashboard-notes-action-icon[hidden] {
    display: none !important;
}

.dashboard-notes-add img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.dashboard-notes-action {
    border: 1.5px solid rgba(17, 17, 17, 0.45);
    background: transparent;
    color: inherit;
    height: 36px;
    padding: 0 10px;
    font: inherit;
    font-size: 0.7rem;
    text-transform: uppercase;
    cursor: pointer;
}

.dashboard-notes-action-icon {
    width: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dashboard-notes-action-icon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.dashboard-notes-add:hover,
.dashboard-notes-add:focus-visible,
.dashboard-notes-action:hover,
.dashboard-notes-action:focus-visible,
.dashboard-note-tile:hover,
.dashboard-note-tile:focus-visible {
    background: rgba(17, 17, 17, 0.06);
    outline: none;
}

.dashboard-notes-pad {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
    padding-right: 4px;
}

.dashboard-note-workspace {
    display: grid;
    grid-template-rows: minmax(180px, 1fr) auto minmax(0, 220px);
    gap: 12px;
    flex: 1;
    min-height: 0;
}

#dashboardNotesPanel:not(.is-detail) .dashboard-note-workspace {
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}

#dashboardNotesPanel:not(.is-detail).is-scratchpad-collapsed .dashboard-note-workspace,
#dashboardNotesPanel:not(.is-detail) .dashboard-note-workspace:has(.dashboard-scratchpad.is-collapsed) {
    grid-template-rows: minmax(0, 1fr) auto;
}

#dashboardNotesPanel.is-detail .dashboard-note-workspace {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important;
    height: 100% !important;
    grid-template-rows: none !important;
}

#dashboardNotesPanel.is-detail .dashboard-note-editor {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    display: block !important;
    resize: none !important;
}

#dashboardNotesPanel.is-detail .dashboard-notes-pad,
#dashboardNotesPanel.is-detail #dashboardNotesPad,
#dashboardNotesPanel.is-detail .dashboard-scratchpad,
#dashboardNotesPanel.is-detail #dashboardScratchPadSection {
    display: none !important;
}

#dashboardMindDumpPanel .dashboard-note-workspace {
    grid-template-rows: auto auto minmax(0, 1fr);
}

.dashboard-note-editor {
    width: 100%;
    min-height: 0;
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.42);
    color: inherit;
    resize: none;
    padding: 14px;
    font: inherit;
    line-height: 1.45;
    outline: none;
}

.dashboard-note-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.dashboard-note-status {
    font-size: 0.63rem;
    color: var(--grey);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dashboard-note-list {
    min-height: 0;
}

.dashboard-scratchpad {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
}

.dashboard-scratchpad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-scratchpad-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-scratchpad-title {
    outline: none;
    min-width: 0;
}

.dashboard-scratchpad-editor {
    min-height: 0;
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.42);
    color: inherit;
    padding: 14px;
    font: inherit;
    line-height: 1.45;
    outline: none;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.dashboard-mind-dump {
    flex: 1;
    min-height: 0;
    width: 100%;
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.42);
    color: inherit;
    resize: none;
    padding: 14px;
    font: inherit;
    line-height: 1.45;
    outline: none;
}

.dashboard-minddump-entry {
    display: grid;
    gap: 10px;
}

.dashboard-minddump-node-entry {
    display: grid;
    gap: 10px;
}

.dashboard-minddump-node-entry {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.dashboard-minddump-input {
    width: 100%;
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.42);
    color: inherit;
    height: 36px;
    padding: 6px 12px;
    font: inherit;
    line-height: 1.1;
    outline: none;
}

.dashboard-note-tile,
.dashboard-link-tile,
.dashboard-reminder-tile {
    border: 1px solid rgba(17, 17, 17, 0.18);
    padding: 14px 14px 12px;
    background: rgba(255, 255, 255, 0.42);
}

.dashboard-note-tile,
.dashboard-link-tile {
    text-decoration: none;
    color: inherit;
    display: block;
}

.dashboard-note-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px 34px;
    gap: 10px;
    align-items: stretch;
}

.dashboard-note-menu-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.quest-task-input.is-note-quest,
.quest-task-input.is-stack-quest {
    cursor: pointer;
}

.quest-task-input.is-note-quest:hover,
.quest-task-input.is-stack-quest:hover,
.quest-task-input.is-stack-quest:focus-visible {
    text-decoration: underline;
}

#questApp .dashboard-frog-control,
.today-todos .dashboard-frog-control {
    display: none !important;
}

.dashboard-minddump-list-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.dashboard-reminder-row {
    display: block;
}

.dashboard-reminder-group {
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.42);
    padding: 14px;
    display: grid;
    gap: 12px;
}

.dashboard-reminder-group.drag-over {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(17, 17, 17, 0.35);
}

.dashboard-reminder-group-title {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    text-align: right;
    font-size: 0.98rem;
    line-height: 1.1;
    text-transform: uppercase;
    cursor: grab;
    user-select: none;
}

.dashboard-reminder-group-link-title {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-minddump-node-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.dashboard-minddump-node-controls {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
}

.dashboard-note-tile:hover,
.dashboard-note-tile:focus-visible,
.dashboard-link-tile:hover,
.dashboard-link-tile:focus-visible {
    border-color: rgba(17, 17, 17, 0.35);
    background: rgba(255, 255, 255, 0.78);
}

.dashboard-note-tile-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.25;
    word-break: break-word;
}

.dashboard-minddump-tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 2px;
}

.dashboard-minddump-tile-header .dashboard-note-tile-title {
    margin: 0;
    flex: 1;
    font-size: 1.05rem;
    font-weight: 600;
}

.dashboard-minddump-count-badge {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--quest-muted);
    background: rgba(17, 17, 17, 0.06);
    border: 1px solid rgba(17, 17, 17, 0.12);
    padding: 2px 7px;
    border-radius: 0;
    line-height: 1.2;
}

.dashboard-note-tile-meta,
.dashboard-link-tile-meta,
.dashboard-note-tile-preview,
.dashboard-link-tile-preview,
.dashboard-reminder-tile,
.dashboard-notes-empty {
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--grey);
    word-break: break-word;
}

.dashboard-note-tile-meta {
    margin-bottom: 8px;
}

.dashboard-note-tile.is-active {
    border-color: #000000;
    background: rgba(255, 255, 255, 0.9);
}

.dashboard-note-tile.is-pinned {
    border-color: #b42318;
}

.dashboard-notes-empty {
    border: 1px dashed rgba(17, 17, 17, 0.22);
    padding: 14px;
}

.dashboard-link-tile-title {
    font-size: 0.88rem;
    margin: 0;
    line-height: 1.3;
    color: inherit;
    text-decoration: none;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-link-tile-meta {
    margin-bottom: 8px;
}

.dashboard-reminder-tile {
    color: inherit;
    display: grid;
    gap: 10px;
    font-size: 0.92rem;
    line-height: 1.45;
    padding: 0;
    border: 0;
    background: transparent;
}

.dashboard-reminder-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-link-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.dashboard-link-tile {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 8px 12px;
    min-height: 36px;
}

.dashboard-link-controls {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
}

.dashboard-note-row,
.dashboard-link-row {
    cursor: grab;
}

.dashboard-reminder-row,
.dashboard-minddump-node-row {
    cursor: default;
}

.dashboard-reminder-tile,
.dashboard-reminder-text,
.dashboard-reminder-link,
.dashboard-reminder-next-step {
    cursor: text;
    user-select: text;
    -webkit-user-select: text;
}

.dashboard-note-row.is-dragging,
.dashboard-link-row.is-dragging,
.dashboard-reminder-row.is-dragging,
.dashboard-minddump-node-row.is-dragging {
    opacity: 0.45;
}

.dashboard-note-row.drag-over .dashboard-note-tile,
.dashboard-link-row.drag-over .dashboard-link-tile,
.dashboard-reminder-row.drag-over .dashboard-reminder-tile,
.dashboard-minddump-node-row.drag-over .dashboard-reminder-tile {
    border-color: #000000;
    background: rgba(255, 255, 255, 0.9);
}

.dashboard-note-delete,
.dashboard-link-delete {
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.42);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.dashboard-note-delete.is-active {
    background: rgba(255, 255, 255, 0.9);
    border-color: #000000;
}

.dashboard-reminder-text {
    font-size: 0.92rem;
    line-height: 1.45;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.dashboard-reminder-link {
    font-size: 0.92rem;
    line-height: 1.45;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    color: inherit;
    text-decoration: none;
}

.dashboard-reminder-link:hover,
.dashboard-reminder-link:focus-visible {
    text-decoration: underline;
    outline: none;
}

.dashboard-reminder-next-step {
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--grey);
    border-top: 1px solid rgba(17, 17, 17, 0.12);
    padding-top: 8px;
}

.dashboard-reminder-controls {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
    align-items: center;
}

.dashboard-reminder-action {
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.42);
    color: inherit;
    height: 30px;
    min-width: 30px;
    padding: 0 10px;
    font: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.dashboard-reminder-action-text {
    min-width: 88px;
}

.dashboard-reminder-action-icon {
    min-width: 30px;
    padding: 0;
}

.dashboard-reminder-action-icon img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.dashboard-reminder-action img,
.dashboard-minddump-move img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.dashboard-minddump-delete {
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.42);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.dashboard-minddump-move {
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.42);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font: inherit;
    font-size: 16px;
    line-height: 1;
}

.dashboard-minddump-move:disabled {
    opacity: 0.35;
    cursor: default;
}

.dashboard-minddump-menu-btn {
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.42);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.dashboard-note-menu-btn {
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.42);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.dashboard-minddump-menu-btn img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.dashboard-note-menu-btn img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.dashboard-minddump-menu {
    position: absolute;
    top: 40px;
    right: 0;
    z-index: 9999;
    min-width: 180px;
    border: 1px solid rgba(17, 17, 17, 0.2);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    display: grid;
}

.dashboard-note-menu {
    position: absolute;
    top: 40px;
    right: 0;
    z-index: 9999;
    min-width: 180px;
    border: 1px solid rgba(17, 17, 17, 0.2);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    display: grid;
}

.dashboard-minddump-node-menu {
    position: absolute;
    top: 40px;
    right: 0;
    z-index: 9999;
    min-width: 190px;
    border: 1px solid rgba(17, 17, 17, 0.2);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    display: grid;
}

.dashboard-note-row:has(.dashboard-frog-dropdown, .dashboard-minddump-menu, .dashboard-note-menu),
.dashboard-minddump-node-row:has(.dashboard-frog-dropdown, .dashboard-minddump-node-menu),
.dashboard-link-row:has(.dashboard-frog-dropdown),
.dashboard-minddump-group-controls:has(.dashboard-frog-dropdown) {
    position: relative;
    z-index: 200 !important;
}

.dashboard-minddump-menu button {
    border: 0;
    border-bottom: 1px solid rgba(17, 17, 17, 0.1);
    background: transparent;
    color: inherit;
    text-align: left;
    padding: 10px 12px;
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
}

.dashboard-frog-btn {
    position: relative;
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.42);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    font: inherit;
    color: var(--quest-green);
}

.dashboard-frog-btn:hover {
    background: rgba(17, 17, 17, 0.06);
}

.dashboard-frog-icon {
    width: 17px;
    height: 17px;
    fill: currentColor;
    display: block;
}

.dashboard-frog-dropdown {
    position: absolute;
    top: 34px;
    right: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid rgba(17, 17, 17, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    padding: 6px 8px;
    display: flex;
    gap: 6px;
    align-items: center;
    border-radius: 0;
    white-space: nowrap;
}

.dashboard-frog-dropdown-item {
    width: 22px;
    height: 22px;
    border-radius: 0;
    border: 1.5px solid rgba(0, 0, 0, 0.2);
    padding: 0;
    cursor: pointer;
    transition: transform 0.12s ease;
    display: inline-block;
}

.dashboard-frog-dropdown-item:hover {
    transform: scale(1.15);
    border-color: #000;
}

.dashboard-frog-dropdown-item[data-slot="main"] { background: var(--quest-green); }
.dashboard-frog-dropdown-item[data-slot="side-0"] { background: var(--quest-yellow); }
.dashboard-frog-dropdown-item[data-slot="side-1"] { background: var(--quest-red); }
.dashboard-frog-dropdown-item[data-slot="side-2"] { background: var(--quest-blue); }
.dashboard-frog-dropdown-item[data-slot="side-3"] { background: var(--quest-grey); }

.dashboard-note-menu button {
    border: 0;
    border-bottom: 1px solid rgba(17, 17, 17, 0.1);
    background: transparent;
    color: inherit;
    text-align: left;
    padding: 10px 12px;
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
}

.dashboard-minddump-node-menu button {
    border: 0;
    border-bottom: 1px solid rgba(17, 17, 17, 0.1);
    background: transparent;
    color: inherit;
    text-align: left;
    padding: 10px 12px;
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
}

.dashboard-minddump-menu button:last-child {
    border-bottom: 0;
}

.dashboard-note-menu button:last-child {
    border-bottom: 0;
}

.dashboard-minddump-node-menu button:last-child {
    border-bottom: 0;
}

.dashboard-minddump-menu button:hover,
.dashboard-minddump-menu button:focus-visible,
.dashboard-note-menu button:hover,
.dashboard-note-menu button:focus-visible,
.dashboard-minddump-node-menu button:hover,
.dashboard-minddump-node-menu button:focus-visible,
.dashboard-minddump-move:hover,
.dashboard-minddump-move:focus-visible,
.dashboard-note-menu-btn:hover,
.dashboard-note-menu-btn:focus-visible,
.dashboard-minddump-menu-btn:hover,
.dashboard-minddump-menu-btn:focus-visible {
    background: rgba(17, 17, 17, 0.06);
    outline: none;
}

.dashboard-link-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    min-width: 0;
    width: 100%;
}

.dashboard-link-favicon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex: 0 0 auto;
}

.dashboard-note-delete img,
.dashboard-minddump-delete img,
.dashboard-link-delete img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.dashboard-note-delete:hover,
.dashboard-note-delete:focus-visible,
.dashboard-minddump-delete:hover,
.dashboard-minddump-delete:focus-visible,
.dashboard-link-delete:hover,
.dashboard-link-delete:focus-visible,
.dashboard-link-tile-title:hover,
.dashboard-link-tile-title:focus-visible {
    opacity: 0.7;
    outline: none;
}

.dashboard-content {
    grid-column: 1 / 2;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-left: 0;
    min-height: 0;
    overflow-y: auto;
}

/* Quest Method */
.quest-app {
    min-height: 100%;
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 0 0 16px;
}

.quest-frog-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: left;
}

.quest-frog {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    color: var(--quest-green);
}

.quest-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.quest-section {
    width: 100%;
}

.quest-side-title {
    margin: 0 0 0.45rem;
    font-size: 0.84rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: -0.01em;
}

.quest-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--quest-border);
    background: #fff;
    padding: 0.5rem 0.85rem;
    min-height: 3.4rem;
    box-sizing: border-box;
}

.quest-card--main {
    min-height: 4rem;
    padding: 0.6rem 0.85rem;
}

.quest-dot-btn {
    flex-shrink: 0;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 0;
    border: none;
    padding: 0;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.quest-dot-btn:hover {
    transform: scale(1.08);
}

.quest-dot-btn:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.quest-dot-btn[data-color="green"] { background: var(--quest-green); }
.quest-dot-btn[data-color="yellow"] { background: var(--quest-yellow); }
.quest-dot-btn[data-color="red"] { background: var(--quest-red); }
.quest-dot-btn[data-color="blue"] { background: var(--quest-blue); }
.quest-dot-btn[data-color="grey"] { background: var(--quest-grey); }

.quest-dot-btn.done {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.quest-dot-btn.done::after {
    content: "";
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}

.quest-task-input {
    flex: 1;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.95rem;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 1.25em;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0;
    margin: 0;
    color: inherit;
    display: block;
    align-self: center;
    box-sizing: border-box;
}

.quest-task-input:focus {
    outline: none;
}

.quest-task-input::placeholder {
    color: #aaa;
}

.quest-card.done .quest-task-input {
    text-decoration: line-through;
    color: var(--quest-muted);
}

.quest-clear-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.42);
    color: var(--quest-muted);
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0;
    opacity: 1;
    transition: background 0.15s ease;
    padding: 0;
}

.quest-clear-btn:hover {
    background: rgba(17, 17, 17, 0.08);
}

.quest-card:hover .quest-clear-btn {
    opacity: 1;
}

.quest-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0;
}

.quest-flow-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quest-flow-dot {
    width: 9px;
    height: 9px;
    border-radius: 0;
}

.quest-flow-dot.g { background: var(--quest-green); }
.quest-flow-dot.y { background: var(--quest-yellow); }
.quest-flow-dot.r { background: var(--quest-red); }
.quest-flow-dot.b { background: var(--quest-blue); }
.quest-flow-dot.gr { background: var(--quest-grey); }

.quest-flow-arrow {
    width: 1px;
    height: 12px;
    background: #bbb;
    margin: 0 auto;
}

.quest-flow-row.mid .quest-flow-arrow-h {
    width: 26px;
    height: 1px;
    background: #bbb;
}

.quest-side-stack {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.quest-week-planner {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.15rem;
}

.quest-week-planner-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.quest-week-nav-btn {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--quest-border);
    background: #fff;
    border-radius: 0;
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
    color: #111;
    line-height: 1;
}

.quest-week-nav-btn:hover {
    background: #f3f3f3;
}

.quest-week-nav-btn:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.quest-week-range-label {
    margin: 0;
    flex: 1;
    text-align: center;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--quest-muted);
    letter-spacing: 0.02em;
}

.quest-week-day-buttons {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.35rem;
}

.quest-week-day-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.12rem;
    padding: 0.4rem 0.15rem 0.35rem;
    border: 1px solid var(--quest-border);
    background: #fff;
    border-radius: 0;
    font: inherit;
    cursor: pointer;
    color: #111;
    min-width: 0;
}

.quest-week-day-btn:hover {
    background: #f6f6f6;
}

.quest-week-day-btn:disabled,.quest-week-day-btn:disabled:hover { background:#eee;color:#858585;opacity:.6;cursor:default; }

.quest-week-day-btn:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.quest-week-day-btn .wd-name {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--quest-muted);
}

.quest-week-day-btn .wd-num {
    font-size: 0.84rem;
    font-weight: 600;
}

.quest-week-day-btn.is-selected {
    border-color: #111;
    background: #111;
    color: #fff;
}

.quest-week-day-btn.is-selected .wd-name {
    color: #111;
}

.quest-week-day-btn.is-today:not(.is-selected) {
    box-shadow: inset 0 0 0 2px var(--quest-green);
}

.quest-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0.25rem;
    margin-top: 0.15rem;
}

.quest-footer-weekday {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #222;
    letter-spacing: -0.01em;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.quest-footer-weekday .footer-date {
    display: inline;
    margin: 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--quest-muted);
}

.dashboard-footer {
    grid-column: 1 / 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.dashboard-tools {
    display: flex;
    align-items: center;
    gap: 19px;
    min-width: 0;
    flex-wrap: wrap;
}

.dashboard-tool {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 27px;
    width: auto;
    height: 27px;
    color: inherit;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-tool img {
    width: 27px;
    height: 27px;
    object-fit: contain;
}

.dashboard-footer-app {
    justify-self: start;
    font-size: clamp(1.1rem, 1vw, 1.33rem);
    white-space: nowrap;
}

.dashboard-footer-app a {
    color: inherit;
    text-decoration: none;
}

.dashboard-footer-app a:hover,
.dashboard-footer-app a:focus-visible {
    text-decoration: underline;
    outline: none;
}

.welcome-card,
.history-card,
.settings-card {
    width: min(900px, 92vw);
    border: 1px solid var(--lgrey);
    padding: 28px 30px;
    display: grid;
    gap: 14px;
}

.welcome-card img {
    width: 216px;
    height: 216px;
    object-fit: contain;
}

.welcome-card h1 {
    margin: 0;
    font-size: 32px;
}

.welcome-card p {
    margin: 0;
    line-height: 1.6;
}

.small {
    font-size: 13px;
}

.welcome-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.welcome-actions button {
    padding: 10px 16px;
}

.small-screen-note {
    display: none;
    padding: 10px 14px;
    border: 1px solid var(--lgrey);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 12px;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.history-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.history-controls .btn {
    padding: 8px 14px;
}

.history-controls input {
    padding: 8px 10px;
    border: 1px solid var(--lgrey);
    background: var(--bg);
    color: inherit;
    font-size: 13px;
}

.history-list {
    display: grid;
    gap: 10px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.history-item {
    padding: 10px 12px;
    border: 1px solid var(--lgrey);
    display: grid;
    gap: 6px;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
}

.history-links {
    display: grid;
    gap: 4px;
}

.history-links a {
    color: inherit;
    text-decoration: none;
    word-break: break-all;
}

.history-links a:hover {
    text-decoration: underline;
}

.history-empty {
    font-size: 14px;
}

.settings-card {
    gap: 18px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.settings-card h2,
.settings-card h1 {
    margin: 50px 0 12px 0;
    font-size: 18px;
}

.settings-grid {
    display: grid;
    gap: 18px;
}

.settings-grid > div {
    border-top: 1px solid var(--lgrey);
    padding-top: 12px;
}

.settings-grid > div:first-child {
    border-top: 0;
    padding-top: 0;
}

.settings-info-box {
    margin: 10px 0 14px;
    padding: 12px 14px;
    border: 1px solid var(--grey);
    background: var(--card);
    font-size: 13px;
    line-height: 1.5;
}

.settings-subsection {
    margin-top: 18px;
}

.settings-subsection h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.greeting-stack-list {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.greeting-stack-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.greeting-stack-row label {
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.settings-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 8px;
}

.settings-card input[type="text"],
.settings-card input[type="password"],
.settings-card select,
.settings-card textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--grey);
    background: var(--bg);
    color: inherit;
}

.settings-card textarea {
    min-height: 140px;
    resize: vertical;
}

.settings-card textarea.autosize {
    resize: none;
    overflow: hidden;
}

.settings-card .toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-size: 13px;
}

.settings-card .btn {
    padding: 10px 16px;
    margin-top: 15px;
}

/* Noter */
#noterPanel {
    display: none;
    position: absolute;
    inset: 0;
    height: 100%;
    background: var(--bg);
}

#noterPanel.show {
    display: block;
}

#noterPanel .noter-app {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    background: var(--bg);
    color: inherit;
}

#noterPanel .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    padding-left: 100px;
 
}

#noterPanel .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
}

#noterPanel .dot {
    width: 10px;
    height: 10px;
    border-radius: 0;
    background: var(--red);
    flex: 0 0 auto;
}

#noterPanel .titlewrap {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

#noterPanel .apptitle {
    font-weight: 700;
    letter-spacing: 0.2px;
    font-size: 14px;
}

#noterPanel .status {
    font-size: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 4px;
    flex-wrap: wrap;
}

#noterPanel .status .pill {
    padding: 3px 8px;
    border: 1px solid var(--lgrey);
}

#noterPanel .controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

#noterPanel .btn {
    border: 1px solid var(--lgrey);
    background: var(--bg);
    color: inherit;
    padding: 8px 10px;
    border-radius: 0;
    font-size: 13px;
    cursor: pointer;
}

#noterPanel .split {
    height: 34px;
    width: 1px;
    background: var(--red);
    margin: 0 4px;
}

#noterPanel .select,
#noterPanel .wraptoggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid var(--lgrey);
    background: var(--white);
}

#noterPanel .select label {
    font-size: 12px;
}

#noterPanel select,
#noterPanel input[type="text"] {
    background: transparent;
    border: none;
    outline: none;
    color: inherit;
    font-size: 13px;
    min-width: 78px;
}

#noterPanel .main {
    flex: 1;
    min-height: 0;
    display: flex;
    background: transparent;
    border: none;
    overflow: hidden;
}

#noterPanel .note-layout {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 12px;
    width: 100%;
}

#noterPanel .note-editor {
    border: 1px solid var(--white);
    background: transparent;
    overflow: hidden;
}

#noterPanel textarea {
    width: 100%;
    height: 100%;
    padding: 18px 18px 22px;
    padding-left: 100px;
    border: none;
    outline: none;
    background: transparent;
    color: inherit;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 16px;
    line-height: 1.55;
    resize: none;
    white-space: pre-wrap;
    word-break: break-word;
}

#noterPanel .note-list {
    border: 1px solid var(--white);
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#noterPanel .note-item {
    border: 1px solid var(--lgrey);
    padding: 8px 10px;
    cursor: pointer;
    background: transparent;
    color: inherit;
    font-size: 13px;
    line-height: 1.3;
}

#noterPanel .note-item.active {
    background: var(--lgrey);
    color: var(--black);
}

#noterPanel .note-item small {
    display: block;
    font-size: 11px;
    margin-top: 4px;
}

#noterPanel .footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--white);
    background: var(--white);
}

#noterPanel .hint {
    font-size: 12px;
}

#noterPanel .toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    padding: 10px 12px;
    border: 1px solid var(--lgrey);
    background: var(--white);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
    max-width: 340px;
    font-size: 13px;
}

#noterPanel .toast.show {
    opacity: 1;
    transform: translateY(0);
}

#noterPanel .modalback {
    position: fixed;
    inset: 0;
    background: var(--white);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#noterPanel .modalback.show {
    display: flex;
}

#noterPanel .modal {
    width: min(560px, 100%);
    border: 1px solid var(--lgrey);
    background: var(--bg);
    overflow: hidden;
}

#noterPanel .modalheader {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--lgrey);
    background: var(--bg);
}

#noterPanel .modalbody {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#noterPanel .row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

#noterPanel .row input[type="text"] {
    flex: 1 1 220px;
    padding: 10px 12px;
    border: 1px solid var(--lgrey);
    background: var(--bg);
    min-width: 220px;
}

/* Admin visibility */
.admin {
    display: none;
}

body.admin-on .admin {
    display: list-item;
}

body.admin-on hr.admin {
    display: block;
}

body.admin-on .lual {
    display: none;
}

/* Mobile & Small screens responsive layout */
@media (max-width: 900px) {
    body {
        height: auto !important;
        min-height: 100vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    .small-screen-note {
        display: none !important;
    }

    .dashboard-overlay {
        position: relative !important;
        inset: auto !important;
        min-height: 100vh;
        height: auto !important;
        overflow-y: visible !important;
        padding: 12px !important;
    }

    .dashboard-view {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        gap: 20px !important;
    }

    .dashboard-topbar,
    .dashboard-content,
    .dashboard-footer {
        width: 100% !important;
        padding-left: 0 !important;
    }

    .dashboard-topbar-left {
        max-width: 100% !important;
        align-items: center !important;
    }

    .dashboard-tools {
        justify-content: center !important;
        gap: 14px !important;
    }

    .dashboard-content {
        justify-content: center !important;
        overflow-y: visible !important;
    }

    .quest-app {
        max-width: 100% !important;
    }

    .dashboard-notes-nav {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }

    .dashboard-footer {
        flex-direction: column !important;
        gap: 16px !important;
        padding-bottom: 24px !important;
    }
}

@media (max-width: 720px) {
    .dashboard-overlay {
        padding: 10px !important;
    }

    .dashboard-view {
        gap: 16px;
    }

    .dashboard-brand-group,
    .dashboard-status-group {
        gap: 12px;
        flex-wrap: wrap;
    }

    .dashboard-status,
    .dashboard-menu,
    .dashboard-feature-text,
    .dashboard-footer-app,
    .dashboard-notes-title {
        white-space: normal;
    }
    .dashboard-tools {
        gap: 14px;
    }
}

/* Pledge Overlay on Right Card */
.dashboard-pledge-overlay {
    position: absolute;
    inset: 0;
    z-index: 25;
    background: #ffffff;
    color: #000000;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.dashboard-pledge-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1.5px solid rgba(17, 17, 17, 0.15);
    background: #ffffff;
}

.dashboard-pledge-top-title {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-pledge-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-pledge-icon-btn {
    border: 1px solid rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.65);
    color: #000;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 0;
    cursor: pointer;
    line-height: 1.2;
}

.dashboard-pledge-icon-btn:hover {
    background: #fff;
}

.dashboard-pledge-close-btn {
    font-size: 1.15rem;
    padding: 2px 9px;
}

.dashboard-pledge-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px 24px;
    text-align: center;
    min-height: 0;
    overflow-y: auto;
}

.dashboard-pledge-stage-above {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.dashboard-pledge-line {
    min-height: 4.5rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
}

.dashboard-pledge-line p {
    margin: 0;
    font-family: Georgia, serif;
    font-size: clamp(1.05rem, 1.2vw, 1.3rem);
    font-weight: 700;
    line-height: 1.45;
    color: #000;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dashboard-pledge-line.visible p {
    opacity: 1;
    transform: translateY(0);
}

.dashboard-pledge-line.idle p {
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    color: #222;
}

.dashboard-pledge-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    min-height: 8px;
    opacity: 0;
    transition: opacity 0.25s;
}

.dashboard-pledge-dots.visible {
    opacity: 1;
}

.dashboard-pledge-dots span {
    width: 8px;
    height: 8px;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.28);
    transition: background 0.2s, transform 0.2s;
}

.dashboard-pledge-dots span.active {
    background: #000;
    transform: scale(1.25);
}

.dashboard-pledge-dots span.done {
    background: #000;
}

.dashboard-pledge-shield-wrap {
    position: relative;
    width: min(52vw, 210px);
    aspect-ratio: 1;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease;
}

.dashboard-pledge-shield-wrap:hover {
    transform: scale(1.03);
}

.dashboard-pledge-shield-wrap:active {
    transform: scale(0.97);
}

.dashboard-pledge-shield-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dashboard-pledge-shield-wrap.playing .dashboard-pledge-shield-img {
    filter: drop-shadow(0 0 16px rgba(0, 0, 0, 0.35));
}

.dashboard-pledge-stage-below {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
}

.dashboard-pledge-tagline {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: 0.01em;
}

/* PledgeBob in Settings */
.settings-pledges-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(17, 17, 17, 0.15);
}

.settings-pledges-hint {
    font-size: 0.85rem;
    color: #444;
    margin: 0 0 12px;
    line-height: 1.4;
}

.settings-pledge-add-form {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.settings-pledge-add-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(17, 17, 17, 0.3);
    background: #fff;
    padding: 8px 12px;
    font: inherit;
    font-size: 0.9rem;
    border-radius: 0;
}

.settings-pledge-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-pledge-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(17, 17, 17, 0.18);
    border-radius: 0;
    font-size: 0.9rem;
}

.settings-pledge-item.editing {
    border-color: #000;
    background: #fff;
}

.settings-pledge-item-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.settings-pledge-item textarea {
    flex: 1;
    border: 1px solid #000;
    font: inherit;
    font-size: 0.9rem;
    padding: 6px;
    resize: vertical;
    min-height: 50px;
}

.settings-pledge-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.settings-pledge-action-btn {
    border: 1px solid rgba(17, 17, 17, 0.25);
    background: #fff;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 0;
    cursor: pointer;
}

.settings-pledge-action-btn:hover {
    background: #eee;
}

.settings-pledge-action-btn.danger {
    color: #c00;
    border-color: rgba(200, 0, 0, 0.4);
}

.settings-pledge-action-btn.danger:hover {
    background: #fee;
}

.settings-pledge-audio-row {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed rgba(17, 17, 17, 0.18);
}

.settings-pledge-audio-field {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.settings-pledge-audio-field select {
    max-width: 200px;
    padding: 4px 8px;
    font: inherit;
    font-size: 0.85rem;
}

.settings-pledge-backup-row {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed rgba(17, 17, 17, 0.18);
}

.settings-pledge-backup-row h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 10px;
}

.settings-pledge-backup-row .settings-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

#settingsPledgesStatus {
    margin-top: 8px;
    min-height: 18px;
    color: var(--quest-muted);
}

/* Tool Stack Settings Item & Sort Styles */
.toolstack-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--lgrey);
    background: var(--card, #fff);
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
    user-select: none;
}

.toolstack-item.is-dragging {
    opacity: 0.45;
}

.toolstack-item.drag-over {
    border-color: #000;
    background: rgba(0, 0, 0, 0.05);
}

.toolstack-drag-handle {
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    color: var(--grey);
    font-size: 18px;
    line-height: 1;
    touch-action: none;
    flex-shrink: 0;
}

.toolstack-drag-handle:active {
    cursor: grabbing;
}

.toolstack-order-btns {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.toolstack-move-btn {
    width: 26px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--lgrey);
    background: var(--white);
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    border-radius: 0;
    transition: background 0.1s, border-color 0.1s;
}

.toolstack-move-btn:hover:not(:disabled) {
    background: var(--lgrey);
    border-color: var(--grey);
}

.toolstack-move-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.toolstack-fields {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(180px, 2fr) minmax(150px, 1.2fr);
    gap: 10px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

@media (max-width: 700px) {
    .toolstack-fields {
        grid-template-columns: 1fr;
    }
}

/* Concertina / Collapsible Scratchpad */
#dashboardNotesPanel:not(.is-detail) .dashboard-note-workspace:has(.dashboard-scratchpad.is-collapsed) {
    grid-template-rows: minmax(0, 1fr) auto;
}

.dashboard-scratchpad.is-collapsed {
    grid-template-rows: auto;
    gap: 0;
    min-height: 0;
    align-self: end;
}

.dashboard-scratchpad.is-collapsed .dashboard-scratchpad-editor {
    display: none;
}

.dashboard-scratchpad-toggle-btn {
    font-size: 11px;
    padding: 0 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.dashboard-scratchpad.is-collapsed .dashboard-scratchpad-toggle-btn {
    transform: none;
}
.dashboard-scratchpad.is-collapsed .dashboard-scratchpad-toggle-btn span { display:inline-block; transform:rotate(-90deg); }
.dashboard-scratchpad-actions > button { box-sizing:border-box; height:36px; min-height:36px; }
.dashboard-scratchpad-toggle-btn { min-width:36px; display:inline-flex; align-items:center; justify-content:center; }
/* Leave room for the 2px focus outline and its 3px offset inside the clipped column. */
.dashboard-minddump-node-entry { min-width:0; padding:6px; }
.dashboard-minddump-input { box-sizing:border-box; min-width:0; }
#settingsGeneralPage[hidden], #settingsHabitsPage[hidden] { display:none; }
.settings-page-tabs { display:flex; gap:6px; margin-bottom:20px; border-bottom:1px solid #ccc; }
.settings-page-tabs button { font:inherit; padding:9px 16px; border:1px solid #ccc; background:#fff; cursor:pointer; }
.settings-page-tabs [aria-current="page"] { background:#111; color:white; border-color:#111; }

/* Auth Gate Overlay */
.auth-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(246, 246, 246, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
}

.auth-gate-card {
    background: #ffffff;
    border: 1.5px solid rgba(17, 17, 17, 0.4);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
    padding: 36px 32px;
    width: 100%;
    max-width: 520px;
    text-align: left;
    border-radius: 0;
}

.auth-gate-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-gate-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    margin: 0 auto 12px;
    display: block;
}

.auth-gate-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: #f0f0f0;
    color: #444;
    border: 1px solid rgba(17, 17, 17, 0.2);
    padding: 3px 8px;
    margin-bottom: 8px;
    border-radius: 0;
}

.auth-gate-card h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    color: #111;
}

.auth-gate-subtitle {
    font-size: 0.95rem;
    line-height: 1.45;
    color: #555;
    margin: 0;
}

.auth-gate-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0 28px;
    padding: 16px;
    background: #fafafa;
    border: 1.5px solid rgba(17, 17, 17, 0.15);
}

.auth-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.auth-feature-icon {
    font-size: 1.25rem;
    line-height: 1.2;
    flex-shrink: 0;
    padding-top: 2px;
}

.auth-feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-feature-text strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111;
}

.auth-feature-text span {
    font-size: 0.8rem;
    line-height: 1.35;
    color: #666;
}

.auth-gate-action {
    text-align: center;
}

#gateGoogleSignInBtn {
    width: 100%;
    padding: 14px 20px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    cursor: pointer;
    background: #111;
    color: #fff;
    border: 1.5px solid #111;
    transition: background 0.15s ease, color 0.15s ease;
}

#gateGoogleSignInBtn:hover {
    background: #333;
    color: #fff;
}

/* Global / Floating Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: #111827;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 99999;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Navigation keeps an explicit scrollbar visible when mobile browsers hide theirs. */
.dashboard-tab-navigation { width:100%; min-width:0; }
.dashboard-tab-scroll {
    display:block;
    width:100%;
    height:8px;
    margin:4px 0 0;
    padding:0;
    border:0;
    appearance:none;
    -webkit-appearance:none;
    background:transparent;
    cursor:pointer;
    touch-action:pan-y;
}
.dashboard-tab-scroll::-webkit-slider-runnable-track { height:8px; background:transparent; border:0; border-radius:0; }
.dashboard-tab-scroll::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:var(--tab-scroll-thumb-width,40px); height:8px; box-sizing:border-box; margin:0; border:2px solid transparent; border-radius:0; background:rgba(17,17,17,.28); background-clip:padding-box; }
.dashboard-tab-scroll::-moz-range-track { height:8px; background:transparent; border:0; border-radius:0; }
.dashboard-tab-scroll::-moz-range-thumb { width:var(--tab-scroll-thumb-width,40px); height:8px; box-sizing:border-box; border:2px solid transparent; border-radius:0; background:rgba(17,17,17,.28); background-clip:padding-box; }
.dashboard-tab-scroll:hover::-webkit-slider-thumb { background-color:rgba(17,17,17,.45); }
.dashboard-tab-scroll:hover::-moz-range-thumb { background-color:rgba(17,17,17,.45); }
.dashboard-tab-scroll:focus-visible { outline:2px solid #111; outline-offset:2px; }
.dashboard-left-nav::-webkit-scrollbar { display:none; }

/* Left Panel Navigation */
.dashboard-left-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    margin-top: 4px;
    margin-bottom: 0;
}

.dashboard-left-nav > .dashboard-left-nav-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.dashboard-left-nav > :first-child { margin-left: auto; }
.dashboard-left-nav > :last-child { margin-right: auto; }

.dashboard-left-nav-btn {
    background: transparent;
    border: 1px solid rgba(17, 17, 17, 0.25);
    color: var(--black);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 12px;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.dashboard-left-nav-btn:hover {
    background: rgba(17, 17, 17, 0.06);
}

#btnNavQuests:not(.is-active) {
    background: #d8edc3;
    color: #111;
}

.dashboard-left-nav-btn.is-active {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

/* Don't Break the Chain App Container */
.chain-app {
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 0 0 16px;
}

.chain-empty-card {
    background: #ffffff;
    border: 1px dashed rgba(17, 17, 17, 0.25);
    border-radius: 0;
    padding: 1.5rem 1.25rem;
    text-align: center;
    box-sizing: border-box;
}

.chain-empty-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.chain-empty-desc {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--quest-muted);
}

.chain-summary-card {
    background: #ffffff;
    border: 1px solid var(--quest-border);
    padding: 0.75rem 1rem;
    text-align: center;
    box-sizing: border-box;
}

.chain-summary-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--quest-muted);
    margin-bottom: 0.2rem;
}

.chain-summary-value {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
}

.chain-add-bar {
    display: flex;
    gap: 0.5rem;
}

.chain-add-input {
    flex: 1;
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.7);
    color: inherit;
    height: 36px;
    padding: 6px 12px;
    font: inherit;
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
}

.chain-btn-add {
    flex-shrink: 0;
}

.chain-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chain-card {
    border: 1px solid var(--quest-border);
    background: #ffffff;
    padding: 0.85rem 1rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.chain-card.is-best {
    border-color: #111827;
}

.chain-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 0.65rem;
}

.chain-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    flex: 1;
    word-break: break-word;
}

.chain-best-badge {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(17, 17, 17, 0.08);
    color: #111827;
    padding: 2px 6px;
    border-radius: 0;
}

.chain-delete {
    border: 0;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--quest-muted);
    cursor: pointer;
    padding: 2px 6px;
}

.chain-delete:hover {
    color: #d9534f;
}

.chain-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.chain-stat {
    background: rgba(17, 17, 17, 0.03);
    border: 1px solid rgba(17, 17, 17, 0.08);
    padding: 0.45rem 0.6rem;
    border-radius: 0;
}

.chain-stat-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--quest-muted);
    margin-bottom: 0.15rem;
}

.chain-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #2563eb;
    line-height: 1.1;
}

.chain-stat-value.zero {
    color: var(--quest-muted);
}

.chain-heatmap-wrap {
    margin-bottom: 0.75rem;
    direction: rtl;
}

.chain-heatmap-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    direction: rtl;
    padding-bottom: 3px;
}

.chain-heatmap-scroll::-webkit-scrollbar {
    height: 4px;
}

.chain-heatmap-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 0;
}

.chain-heatmap {
    display: flex;
    gap: 4px;
    min-width: min-content;
    direction: ltr;
    padding: 2px 0;
}

.chain-day-cell {
    width: 14px;
    height: 14px;
    border-radius: 0;
    flex-shrink: 0;
    background: rgba(17, 17, 17, 0.06);
    border: 1px solid rgba(17, 17, 17, 0.15);
    cursor: pointer;
    touch-action: manipulation;
    padding: 0;
}

.chain-day-cell.done {
    background: #16a34a;
    border-color: #16a34a;
}

.chain-day-cell.today {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.chain-day-cell.today:not(.done) {
    background: #ffffff;
}

.chain-heatmap-labels {
    display: flex;
    justify-content: space-between;
    direction: ltr;
    font-size: 0.65rem;
    color: var(--quest-muted);
    margin-top: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.chain-today-btn {
    width: 100%;
    padding: 0.65rem 0.9rem;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 0;
    border: 1px solid #111827;
    color: #ffffff;
    background: #111827;
    cursor: pointer;
    transition: background 0.15s ease;
}

.chain-today-btn:hover {
    background: #000000;
}

.chain-today-btn.done-today {
    background: #dcfce7;
    color: #15803d;
    border: 1.5px solid #16a34a;
}

/* Footer Actions: Copy All */
.dashboard-notes-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid rgba(17, 17, 17, 0.12);
}

.dashboard-notes-action-copy-all {
    font-weight: 600;
}

/* Clickable text styling for copy */
.dashboard-reminder-text,
.dashboard-reminder-link,
#dashboardMindDumpPad .dashboard-reminder-tile,
.dashboard-todone-text {
    cursor: pointer;
}

/* Todone History Panel */
.dashboard-todone-pad {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dashboard-todone-date-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dashboard-todone-date-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--quest-muted);
    padding: 4px 6px 4px 2px;
    border-bottom: 1px solid rgba(17, 17, 17, 0.15);
    margin-bottom: 4px;
}

.dashboard-todone-date-count {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--quest-muted);
    background: rgba(17, 17, 17, 0.06);
    padding: 1px 6px;
    border-radius: 0;
}

.dashboard-todone-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(17, 17, 17, 0.12);
    border-radius: 0;
    transition: background 0.12s ease;
}

.dashboard-todone-item:hover {
    background: rgba(255, 255, 255, 0.9);
}

.dashboard-todone-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: 0;
    flex-shrink: 0;
    background: rgba(17, 17, 17, 0.08);
    color: #374151;
}

.dashboard-todone-badge.badge-todo {
    background: #dbeafe;
    color: #1e40af;
}

.dashboard-todone-badge.badge-quest {
    background: #dcfce7;
    color: #166534;
}

.dashboard-todone-badge.badge-chain {
    background: #fef3c7;
    color: #92400e;
}

.dashboard-todone-text {
    flex: 1;
    font-size: 0.88rem;
    line-height: 1.35;
    color: var(--black);
    word-break: break-word;
}

.dashboard-todone-time {
    font-size: 0.7rem;
    color: var(--quest-muted);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.dashboard-todone-delete {
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.42);
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.dashboard-todone-delete img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.dashboard-todone-delete:hover {
    background: rgba(220, 38, 38, 0.08);
    border-color: #dc2626;
}

/* Scrollbar Padding & Spacing */
* {
    scrollbar-color: rgba(17, 17, 17, 0.28) transparent;
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(17, 17, 17, 0.25);
    border-radius: 0;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(17, 17, 17, 0.45);
    background-clip: padding-box;
}

.dashboard-notes-pad,
.dashboard-content,
.dashboard-todone-pad,
.history-list,
.settings,
.settings-card,
#menu ul {
    padding-right: 8px;
    scrollbar-gutter: stable;
}

/* Todo Sorting Wrap & Menu */
.dashboard-todo-sort-wrap {
    position: relative;
    display: inline-block;
}

.dashboard-todo-sort-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #ffffff;
    border: 1px solid var(--black);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 0;
    z-index: 100;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    padding: 4px 0;
}

.dashboard-todo-sort-menu[hidden] {
    display: none !important;
}

.dashboard-todo-sort-opt {
    display: block;
    width: 100%;
    padding: 6px 12px;
    text-align: left;
    border: none;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    color: #111;
}

.dashboard-todo-sort-opt:hover {
    background: rgba(17, 17, 17, 0.08);
}

/* Mind Dump Recycle Bin */
.dashboard-minddump-bin-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
}

.dashboard-minddump-bin-view[hidden] {
    display: none !important;
}

.dashboard-minddump-bin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 0;
}

.dashboard-minddump-bin-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #991b1b;
}

.dashboard-minddump-bin-actions {
    display: flex;
    gap: 6px;
}

.dashboard-minddump-bin-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: #ffffff;
    border: 1px solid rgba(17, 17, 17, 0.15);
    border-radius: 0;
    font-size: 0.85rem;
}

.dashboard-minddump-bin-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dashboard-minddump-bin-item-title {
    font-weight: 600;
    color: #111;
    word-break: break-word;
}

.dashboard-minddump-bin-item-meta {
    font-size: 0.72rem;
    color: var(--quest-muted);
}

.dashboard-minddump-restore-btn {
    border: 1px solid #111;
    background: #111;
    color: #fff;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.dashboard-minddump-restore-btn:hover {
    background: #333;
}

/* Quest Week Planner Completed Indicator */
.quest-week-day-btn.has-completed::after {
    content: "•";
    color: var(--quest-green);
    font-size: 1rem;
    line-height: 0.5;
    margin-top: 2px;
}

.quest-week-day-btn.is-selected.has-completed::after {
    color: #4ade80;
}

/* Settings Chain Management */
.settings-chain-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.settings-chain-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid rgba(17, 17, 17, 0.15);
    border-radius: 0;
}

.settings-chain-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-chain-item-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: #111;
}

.settings-chain-item-streak {
    font-size: 0.75rem;
    color: var(--quest-muted);
}

.settings-chain-del-btn {
    background: #d32f2f !important;
    color: #fff !important;
    border-color: #d32f2f !important;
    padding: 4px 10px !important;
    font-size: 0.8rem !important;
}

/* Shared inline actions for nodes, todo items, and whole Minddump groups. */
.dashboard-minddump-group-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.dashboard-frog-control {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

:is(.dashboard-minddump-node-controls, .dashboard-reminder-controls,
    .dashboard-minddump-group-controls, .dashboard-link-controls) > button,
.dashboard-frog-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    flex: 0 0 30px;
    padding: 0;
    border: 1px solid rgba(17, 17, 17, 0.18);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.42);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

:is(.dashboard-minddump-node-controls, .dashboard-reminder-controls,
    .dashboard-minddump-group-controls, .dashboard-link-controls) button > img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

:is(.dashboard-minddump-node-controls, .dashboard-reminder-controls,
    .dashboard-minddump-group-controls, .dashboard-link-controls) > button:hover,
.dashboard-frog-btn:hover {
    background: rgba(17, 17, 17, 0.08);
}

/* Let short laptop screens use their full height without clipping either card. */
@media (min-width: 901px) {
    .dashboard-overlay { padding-block: 16px; }
    .dashboard-content { padding-bottom: 0; }
    .quest-app { padding-bottom: 0; gap: 0.65rem; }
    .quest-section { display: flex; flex-direction: column; flex: 1; }
    .quest-section[aria-label="Side quests"] { flex: 4; }
    .quest-side-stack { flex: 1; }
    .quest-card { flex: 1; }
}

@media (max-width: 600px) {
    .dashboard-notes-body { padding: 14px 12px; }
    .dashboard-minddump-node-row,
    .dashboard-link-row { gap: 6px; }
    .dashboard-minddump-node-controls,
    .dashboard-link-controls,
    .dashboard-reminder-controls,
    .dashboard-reminder-top { gap: 4px; }
}

@media (min-width: 901px) and (max-height: 720px) {
    .quest-app { gap: 0.35rem; }
    .quest-side-stack { gap: 0.35rem; }
    .quest-card { min-height: 2.9rem; }
    .quest-card--main { min-height: 3.5rem; }
    .dashboard-view { row-gap: 8px; }
}

.dashboard-reminder-row.is-complete .dashboard-reminder-text {
    text-decoration: line-through;
    opacity: 0.6;
}
.dashboard-reminder-action[aria-pressed="true"] {
    background: #dcfce7;
    border-color: #5cb85c;
}

.quest-task-content {
    flex: 1;
    min-width: 0;
}
.quest-next-step {
    margin-top: 2px;
    font-size: 0.78rem;
    line-height: 1.2;
    color: var(--quest-muted);
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.quest-next-step[hidden] { display: none; }

/* Install App Button */
.dashboard-install-btn {
    border: 1px solid var(--grey);
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.dashboard-install-btn:hover {
    background: #eef2f6;
    border-color: #111;
    transform: translateY(-1px);
}

.dashboard-install-btn img {
    width: 20px;
    height: 20px;
}


/* Planning, nesting and quick capture */
.dashboard-quick-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 10px;
    width: 100%;
    align-self: stretch;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid var(--quest-border, #ddd);
}
.dashboard-quick-add > input { min-width: 0; width: 100%; }
.dashboard-quick-add-options {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 8px;
}
.dashboard-quick-add-options label {
    display: grid;
    gap: 4px;
    min-width: 0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}
.dashboard-quick-add-options .quick-add-todo {
    display: flex;
    align-items: center;
    align-self: center;
    gap: 5px;
    white-space: nowrap;
}
.dashboard-quick-add input, .dashboard-quick-add select {
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid rgba(17, 17, 17, 0.25);
    border-radius: 0;
    background: #fff;
    font: inherit;
    font-size: 0.8rem;
    box-sizing: border-box;
}
.dashboard-quick-add select { width: 100%; text-overflow: ellipsis; }
.dashboard-quick-add button[type="submit"] {
    border-radius: 0;
    height: 31px;
    padding: 0 14px;
    font-size: 0.72rem;
    font-weight: 600;
}
.quest-card[hidden] { display:none !important; }
.quest-task-input[readonly]:not(.is-note-quest):not(.is-stack-quest) { cursor:default; }
.quest-flow { display:none; }
.quest-week-day-btn.is-today { outline:3px solid #222; outline-offset:-3px; font-weight:800; }
.quest-week-day-btn.is-selected { background:#d8edc3; color:#111; }
.dashboard-frog-dropdown-item.is-occupied { border:4px solid #000 !important; }
.dashboard-note-tile.drag-over { outline:3px solid #222; background:#d8edc3; }
.dashboard-minddump-menu select { max-width:100%; padding:8px; }
.chain-heatmap { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; width:100%; }
.chain-day-cell { width:auto; height:auto; min-height:42px; padding:5px 2px; font-size:11px; color:#222; }
.chain-day-cell.today { outline:3px solid #222; outline-offset:-3px; font-weight:800; }
.chain-day-cell.is-selected { box-shadow:inset 0 -4px #222; }
.chain-heatmap-scroll { width:100%; }
.dashboard-topbar .quest-week-planner { margin:0 0 8px; width:100%; }
.dashboard-topbar-left, .dashboard-topbar-right { min-width:0; }

/* Right column layout (default: wide screens) */
.dashboard-right-column {
    grid-column: 2;
    grid-row: 1 / 4;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    gap: 8px;
}
.dashboard-right-column > .dashboard-notes {
    flex: 1;
}

/* Stack Tool Button (hidden on desktop/wide screens, shown on small screens) */
.dashboard-stack-tool {
    display: none !important;
    border-radius: 0;
    cursor: pointer;
    padding: 0 4px;
}

.dashboard-stack-tool img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Close button on right card (hidden on desktop/wide screens, shown on small screens) */
.dashboard-mobile-stack-close {
    display: none !important;
}

@media (max-width: 900px) {
    .dashboard-stack-tool {
        display: flex !important;
    }

    .dashboard-stack-tool.is-active {
        outline: 2px solid #111;
        background: rgba(17, 17, 17, 0.08);
    }

    /* Small screens: hide right panel by default, display OVER TOP only when opened with opaque white backdrop */
    .dashboard-right-column {
        display: none !important;
        position: fixed !important;
        inset: 0 !important;
        z-index: 120 !important;
        background: #ffffff !important;
        padding: 16px !important;
        overflow-y: auto !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .dashboard-right-column.is-mobile-open {
        display: flex !important;
    }

    .dashboard-right-column > .dashboard-notes {
        width: 100% !important;
        max-width: 680px !important;
        max-height: 90vh !important;
        height: 85vh !important;
        min-height: 480px !important;
        background: #ffffff !important;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15) !important;
        position: relative !important;
        margin: auto !important;
    }

    /* Tab bar with evenly spaced tabs and full square close button at end */
    .dashboard-notes-tabs {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) auto !important;
        padding-right: 0 !important;
        align-items: stretch !important;
    }

    .dashboard-notes-tab {
        border-right: 1.5px solid rgba(17, 17, 17, 0.45) !important;
    }

    .dashboard-mobile-stack-close {
        display: flex !important;
        position: static !important;
        aspect-ratio: 1 / 1 !important;
        height: 100% !important;
        width: auto !important;
        min-width: 38px !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
        color: #111111 !important;
        border: none !important;
        font-size: 22px !important;
        font-weight: 400 !important;
        line-height: 1 !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        border-radius: 0 !important;
        transition: background 0.15s ease, color 0.15s ease !important;
    }

    .dashboard-mobile-stack-close:hover,
    .dashboard-mobile-stack-close:focus-visible {
        background: #000000 !important;
        color: #ffffff !important;
        outline: none !important;
    }
}

.todo-drag-handle { cursor:grab; color:#555; padding:0 5px 0 0; align-self:center; font-size:18px; }
.dashboard-reminder-group-title[draggable="true"] { cursor:grab; }

/* Embedded Dashboard Iframe Stage */
.dashboard-iframe-stage {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 480px;
    border: 1px solid var(--quest-border, #ddd);
    background: #ffffff;
    box-sizing: border-box;
    overflow: hidden;
}
.dashboard-iframe-stage[hidden] {
    display: none !important;
}
.dashboard-iframe-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}
.dashboard-iframe-title {
    font-weight: 700;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dashboard-iframe-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.dashboard-iframe-link-btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 36px;
}
.dashboard-iframe-stack {
    flex: 1;
    width: 100%;
    height: 100%;
    position: relative;
    min-height: 400px;
}
.dashboard-embedded-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
.dashboard-embedded-iframe[hidden] {
    display: none !important;
}


/* Dashboard tools fill the workspace while the left navigation stays available. */
body.dashboard-tool-open .dashboard-iframe-stage { position:fixed; inset:0; width:100vw; height:100dvh; min-height:0; border:0; z-index:80; }
body.dashboard-tool-open .dashboard-iframe-bar { display:none; }
body.dashboard-tool-open .dashboard-iframe-stack { min-height:0; }
body.dashboard-tool-open .dashboard-overlay { z-index:90; }
body.dashboard-tool-open .dashboard-view > :not(.dashboard-content) { visibility:hidden; }
body.dashboard-tool-open .menu-edge-trigger { width:14px; }

.iframe-universal-close {
    position: fixed !important;
    top: 13px !important;
    right: 10px !important;
    z-index: 10050 !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    aspect-ratio: 1 / 1 !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    color: #000000 !important;
    border: 1.5px solid #000000 !important;
    border-radius: 50% !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: transform 0.15s ease, background 0.15s ease !important;
}

/* Keep standalone app controls clear of the corners without changing their height. */
body:not(.ozlauncher-hosted) :is(#dashboardStageCloseBtn, #universalIframeCloseBtn),
#closeSettingsBtn {
    left: calc(50% - 11px) !important;
    right: auto !important;
}

.iframe-universal-close svg {
    width: 10px !important;
    height: 10px !important;
    display: block !important;
    flex-shrink: 0 !important;
}

.iframe-universal-close[hidden] {
    display: none !important;
}

.iframe-universal-close:hover,
.iframe-universal-close:focus-visible {
    background: #f2f2f2 !important;
    color: #000000 !important;
    border-radius: 50% !important;
    transform: scale(1.05);
    outline: none;
}

/* Uniform title styling and spacing across all left panel sections */
.quest-side-title,
.quest-app .quest-side-title,
.quest-habits-title,
.today-todos .dashboard-reminder-group-title {
    margin: 10px 0 6px !important;
    padding: 0 !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    text-align: center !important;
    justify-content: center !important;
    letter-spacing: 0.04em;
    text-transform: uppercase !important;
}

.quest-app-section-drag[draggable="true"] .quest-side-title,
.quest-app-section-drag[draggable="true"] .quest-habits-title {
    cursor: grab;
}

.quest-app-section-drag.drag-over,
.dashboard-reminder-group.drag-over {
    outline: 2px dashed #111;
    outline-offset: 2px;
}
.dashboard-reminder-group[data-kind="quests"] { background:#edf3e9; }
.dashboard-reminder-group[data-kind="habits"] { background:#ffe8d6; }
.dashboard-reminder-group[data-kind="other"] { background:#eee8f7; }
.dashboard-reminder-group[data-kind="links"] { background:#e0eff5; }
.dashboard-reminder-row[data-quest-slot="main"] .dashboard-reminder-tile { background:#d5ebca; }
.dashboard-reminder-row[data-quest-slot="side-0"] .dashboard-reminder-tile { background:#fff1b8; }
.dashboard-reminder-row[data-quest-slot="side-1"] .dashboard-reminder-tile { background:#f9cccc; }
.dashboard-reminder-row[data-quest-slot="side-2"] .dashboard-reminder-tile { background:#d1e8fa; }
.dashboard-reminder-row[data-quest-slot="side-3"] .dashboard-reminder-tile { background:#e2e2e2; }
.dashboard-reminder-group[data-kind="habits"] .dashboard-reminder-tile,
.dashboard-reminder-group[data-kind="other"] .dashboard-reminder-tile,
.dashboard-reminder-group[data-kind="links"] .dashboard-reminder-tile { background:transparent; }
.dashboard-frog-dropdown { width:210px; display:flex; flex-direction:column; }
.dashboard-frog-dropdown-item { width:100%; height:auto; min-height:32px; border-radius:0; padding:7px 10px; font-size:12px; text-align:left; }

.quest-step-btn, .quest-clear-btn { border:1px solid rgba(17,17,17,.18); background:rgba(255,255,255,.42); cursor:pointer; padding:0; width:30px; height:30px; flex:0 0 30px; display:inline-flex; align-items:center; justify-content:center; }

.quest-step-btn[hidden], .quest-clear-btn[hidden] { display:none !important; }

.quest-step-btn img, .quest-clear-btn img { width:14px; height:14px; flex:0 0 14px; object-fit:contain; }
.chain-card-simple { display:flex; flex-direction:column; align-items:stretch; gap:10px; padding:14px; }
.chain-preset-habits {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin-top: 12px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--quest-border, #ddd);
}
.chain-preset-habit-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #111;
    cursor: pointer;
    user-select: none;
}
.chain-preset-habit-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #111;
    cursor: pointer;
}
.chain-card-simple-header { display:flex; align-items:center; gap:10px; width:100%; }
.chain-card-simple strong { flex:1; min-width:0; }
.chain-card-simple small { flex-basis:100%; }
.chain-name-editable { cursor:pointer; }
.chain-name-editable:hover { text-decoration:underline; }
.chain-streak { font-size:13px; color:#555; }
.chain-month-dots {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding-top: 4px;
}
.chain-month-dot {
    width: 12px;
    height: 12px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(17, 17, 17, 0.2);
    border-radius: 0;
    background: #d1d5db; /* Grey if not done */
    cursor: pointer;
    flex-shrink: 0;
    display: inline-block;
    transition: transform 0.1s ease, background 0.12s ease;
}
.chain-month-dot:hover {
    transform: scale(1.2);
    border-color: #111;
}
.chain-month-dot.is-done {
    background: var(--quest-green); /* Green if done */
    border-color: #43a047;
}
.chain-month-dot.is-today {
    outline: 2px solid #111;
    outline-offset: 1px;
}
.dashboard-minddump-node-menu select { width:100%; padding:8px; }

#menu #menuInstallBtn { width:100%; padding:12px 14px; display:flex; align-items:center; gap:10px; text-align:left; font:inherit; color:inherit; background:none; border:0; cursor:pointer; }
#menu #menuInstallBtn:hover { background:var(--lgrey); color:var(--black); }

.quest-habits { flex:0 0 auto; padding:12px; background:#ffe8d6; border:1px solid var(--quest-border); margin-bottom:12px; }
.quest-habits[hidden] { display:none; }
.quest-habits-title { margin:0 0 8px; font-size:14px; }
.quest-habit-row { display:flex; align-items:center; gap:8px; padding:6px 0; }
.quest-habit-text { flex:1; min-width:0; overflow-wrap:anywhere; }
.quest-habit-text small { display:block; margin-top:3px; color:#555; }
.quest-habit-row.is-complete .quest-habit-text > span { text-decoration:line-through; opacity:.65; }
.quest-habit-row button[aria-pressed="true"] { background:#dcfce7; border-color:#5cb85c; }

/* One daily plan with compact, consistently titled sections. */
.quest-app { min-height:0; }
.quest-app > .quest-section, .quest-app .quest-side-stack, .quest-app .quest-card { flex:0 0 auto; }
.quest-app > .quest-section { display:flex; flex-direction:column; gap:6px; }
.quest-app .quest-card { min-height:56px; }

/* Uniform title styling and spacing across all left panel sections */
.quest-side-title,
.quest-app .quest-side-title,
.quest-habits-title,
.today-todos .dashboard-reminder-group-title {
    margin: 10px 0 6px !important;
    padding: 0 !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    text-align: center !important;
    justify-content: center !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
}

.quest-habits { background:transparent; border:0; padding:0; margin:0; }
.quest-habit-row { background:#fff; border:1px solid var(--quest-border); padding:12px; margin-bottom:6px; }
.quest-dot-btn[data-color="black"] { background:#111; }
.quest-habit-row .quest-dot-btn[aria-pressed="true"] { background:#111; border-color:#111; }
.today-todos { display:block; min-height:0; border-top:1px solid #ddd; padding-top:6px; }
.today-todos[hidden] { display:none !important; }
.today-todos .dashboard-notes-pad { overflow:visible; flex:0 0 auto; padding:0; }
.today-todos .dashboard-reminder-group { margin-bottom:10px; }
.today-todos .dashboard-notes-footer-actions { padding:10px 0; }
.dashboard-reminder-row.is-complete .dashboard-reminder-link { text-decoration:line-through; opacity:.6; }
.today-todos .todo-complete-btn.is-recurring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.today-todos .todo-complete-btn.is-recurring.done {
    background: #dcfce7;
    border-color: #5cb85c;
}

/* Todo and Links use the same white cards and leading completion control as quests. */
.today-todos .dashboard-reminder-group {
    --todo-tick-color:#eee8f7;
    background:#fff;
    border:0;
    padding:0;
    gap:6px;
}
.today-todos .dashboard-reminder-group[data-kind="links"] { --todo-tick-color:#e0eff5; }
.today-todos .dashboard-reminder-group .dashboard-reminder-tile {
    background:#fff;
    border:1px solid var(--quest-border);
    padding:12px;
    min-height:56px;
}
.today-todos .dashboard-reminder-top { gap:8px; }
.today-todos .todo-drag-handle { display:none; }
.today-todos .dashboard-reminder-row.is-stack .todo-drag-handle { display:inline; }
.today-todos .todo-complete-btn {
    background:var(--todo-tick-color);
    color:#111;
    flex:0 0 1.3rem;
}
.today-todos .todo-complete-btn.done::after { border-color:#111; }

.today-todos .todo-complete-btn.is-recurring[aria-pressed="true"] { outline:2px solid #111; outline-offset:2px; }
@media (max-width:600px) {
    .today-todos .dashboard-reminder-top { flex-wrap:wrap; }
    .today-todos .dashboard-reminder-text,
    .today-todos .dashboard-reminder-link { flex-basis:calc(100% - 30px); }
    .today-todos .dashboard-reminder-controls { margin-left:auto; }
}
/* Dated events and appointments */
.events-app { padding: 12px 0; }
.events-app h2 { margin: 0 0 6px; font-size: 1.1rem; }
.events-intro, .events-empty { font-size: .8rem; line-height: 1.5; color: #555; }
.event-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; padding: 12px 0 20px; border-bottom: 1px solid #ddd; }
.event-form label { display: grid; min-width: 0; gap: 5px; font-size: .75rem; }
.event-title-field, .event-form-actions { grid-column: 1 / -1; }
.event-form input { min-width: 0; width: 100%; box-sizing: border-box; min-height: 38px; padding: 7px 8px; border: 1px solid #aaa; border-radius: 0; background: #fff; color: #111; font: inherit; font-size: 16px; }
.event-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.events-date-group { margin-top: 22px; }
.events-date-group h3, .scheduled-events-today h3 { margin: 0 0 10px; font-size: .85rem; }
.scheduled-events-today { margin-bottom: 18px; }
.scheduled-event-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid #e5e5e5; }
.scheduled-event-check { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.scheduled-event-check input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: #111; }
.scheduled-event-copy { display: grid; min-width: 0; gap: 4px; overflow-wrap: anywhere; }
.scheduled-event-copy strong { font-size: .85rem; font-weight: 600; }
.scheduled-event-when { font-size: .7rem; color: #555; }
.scheduled-event-row.is-complete strong { text-decoration: line-through; color: #777; }
.scheduled-event-actions { display: flex; flex: 0 0 auto; gap: 4px; }
.scheduled-event-actions button { min-height: 30px; padding: 4px 6px; border: 1px solid #bbb; border-radius: 0; background: #fff; color: #111; font: inherit; font-size: .7rem; cursor: pointer; }

.minddump-paste-dialog{width:min(560px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:24px;border:1px solid #bbb;background:#fff;color:#222}
.minddump-paste-dialog::backdrop{background:#0008}
.minddump-paste-dialog h2{margin:0 0 16px}
.minddump-paste-dialog label{display:block;margin-bottom:10px}
.minddump-paste-dialog textarea{display:block;width:100%;min-height:180px;resize:vertical;padding:12px;font:inherit;color:inherit;background:#fff;border:1px solid #bbb}
.minddump-paste-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:16px}
.minddump-paste-actions button{padding:10px 16px;cursor:pointer}

/* Dedicated Mind Dump handles keep item text selectable and support touch. */
.dashboard-minddump-list-row,
.dashboard-minddump-node-row { grid-template-columns: 24px minmax(0, 1fr) auto; }
.minddump-drag-handle { display:flex; align-items:center; justify-content:center; align-self:stretch; padding:0; border:0; background:transparent; color:#666; font-size:22px; line-height:1; cursor:grab; touch-action:none; user-select:none; -webkit-user-select:none; }
.minddump-drag-handle:active { cursor:grabbing; }
.minddump-drag-handle:focus-visible { outline:2px solid #222; outline-offset:2px; }
.minddump-drop-before { box-shadow:0 -3px 0 #176b45; }
.minddump-drop-after { box-shadow:0 3px 0 #176b45; }

/* Today section labels stay hidden until the H toggle is enabled. */
#questApp:not(.show-section-headings) h3,
#questApp:not(.show-section-headings) .dashboard-reminder-group-title { display:none !important; }
#todayHeadingsToggle { font-family:inherit; font-size:16px; font-weight:400; }
#todayHeadingsToggle[aria-pressed="true"] { font-weight:800; }

/* Without section headings, keep the same 6px gap within and between every item group. */
#questApp:not(.show-section-headings) { --today-item-gap:6px; gap:var(--today-item-gap); }
#questApp:not(.show-section-headings) :is(.quest-habits, .scheduled-events-today) {
    display:flex;
    flex-direction:column;
    flex:0 0 auto;
    gap:var(--today-item-gap);
    margin:0;
}
#questApp:not(.show-section-headings) :is(.quest-section, .quest-side-stack, .dashboard-notes-pad, .dashboard-reminder-group) { gap:var(--today-item-gap); }
#questApp:not(.show-section-headings) :is(.quest-habit-row, .dashboard-reminder-group) { margin-block:0; }
#questApp:not(.show-section-headings) .today-todos { border-top:0; padding-top:0; }

.quest-task-input.is-stack-quest:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

/* Without headings every Today item shares one sortable day plan. */
.today-flat-order > #questHabits,
.today-flat-order > #todayEvents,
.today-flat-order > #questSectionMain,
.today-flat-order > #questSectionSide,
.today-flat-order > #questSectionFallback,
.today-flat-order > #dashboardRemindersPanel { display:none !important; }
#todayPlanItems { display:flex;flex-direction:column;gap:6px;border:0;padding:0; }
#todayPlanItems[hidden] { display:none; }
#todayPlanItems > .today-plan-item { flex:0 0 auto;min-width:0;margin:0;width:100%; }
#todayPlanItems .quest-card,
#todayPlanItems .quest-habit-row,
#todayPlanItems .scheduled-event-row { margin:0; }
#todayPlanItems .today-item-handle { display:inline-flex;flex:0 0 18px;width:18px;min-width:18px;padding:0;font-size:20px; }
#todayPlanItems .quest-habit-row { grid-template-columns:18px 28px minmax(0,1fr) auto auto; }
#todayPlanItems .quest-habit-row .chain-month-dots { grid-column:3/-1; }
#todayPlanItems .scheduled-event-row { display:flex;align-items:center;gap:8px; }
#todayPlanItems .scheduled-event-check { flex:1;min-width:0; }
#todayPlanItems .today-plan-item.drag-over { outline:2px solid #222; }
