* {
    box-sizing: border-box;
}

:root {
    --white: #ffffff;
    --grey: #8a8a8ac7;
    --lgrey: #d0cecec7;
    --red: #ff0000;
    --black: #000000;
    --body: #000000;
    --bg: var(--white);
  
}

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;
}

/* Construction */
.construction-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--bg);
}

body.admin-on .construction-overlay {
    display: none;
}

.construction-card {
    width: min(720px, 92vw);
    border: 1px solid var(--lgrey);
    padding: 28px 32px;
    display: grid;
    gap: 14px;
    text-align: center;
}

.construction-eyebrow {
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.construction-card h1 {
    margin: 0;
    font-size: clamp(26px, 3vw, 34px);
}

.construction-card p {
    margin: 0;
}

.construction-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--red);
    padding: 10px 18px;
    font-weight: 700;
    text-decoration: none;
    color: inherit;
    background: var(--bg);
    margin: 6px auto 0;
}

.construction-admin {
    margin-top: 12px;
    display: grid;
    gap: 8px;
    justify-items: center;
}

.construction-admin label {
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.construction-admin input,
.construction-admin button {
    width: min(320px, 90%);
    padding: 12px 14px;
    border: 1px solid var(--grey);
    background: var(--bg);
    color: inherit;
    text-align: center;
}

.construction-admin button {
    cursor: pointer;
    font-weight: 700;
}

/* 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,
.construction-admin button {
    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,
.construction-link:hover,
.construction-admin button: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;
}

/* 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-right: 1px solid var(--lgrey);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 14px 0 32px rgba(0, 0, 0, 0.12);
    transform: translateX(0);
    transition: transform 0.25s ease;
    overflow: hidden;
}

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

#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;
}

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

.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 {
    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: 24px;
    background: rgba(255, 255, 255, 0.96);
    z-index: 40;
}

.dashboard-view {
    width: 100%;
    height: 100%;
    padding: 14px 18px 18px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 460px;
    grid-template-rows: auto 1fr auto;
    gap: 30px 54px;
    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: space-between;
    gap: 28px;
}

.dashboard-topbar-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.dashboard-topbar .dashboard-tools {
    margin-left: 100px;
}

.dashboard-topbar-status {
    margin-left: 100px;
    padding-top: 8px;
    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;
    border: 1.5px solid rgba(17, 17, 17, 0.45);
    display: flex;
    flex-direction: column;
    min-height: 620px;
    width: 100%;
    max-width: 460px;
    justify-self: end;
    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.77rem, 0.73vw, 0.97rem);
    line-height: 1;
    text-transform: uppercase;
    padding: 14px 12px 12px;
    cursor: pointer;
}

.dashboard-notes-tab:last-child {
    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;
}

.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: 18px;
    height: 18px;
    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: 19px;
    height: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
}

.dashboard-notes-add img {
    width: 19px;
    height: 19px;
    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 .dashboard-note-workspace {
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}

#dashboardNotesPanel.is-detail .dashboard-note-workspace {
    grid-template-rows: minmax(220px, 1.15fr) auto minmax(220px, 0.85fr);
}

#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;
}

.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) 34px;
}

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

.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: stretch;
}

.dashboard-minddump-node-controls {
    display: grid;
    grid-template-columns: repeat(3, 34px);
    gap: 8px;
}

.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.75rem;
    margin: 0 0 6px;
    line-height: 1.2;
    word-break: break-word;
}

.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.63rem;
    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.75rem;
    margin: 0;
    line-height: 1.2;
    word-break: break-word;
    color: inherit;
    text-decoration: none;
}

.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 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px 34px;
    gap: 10px;
    align-items: stretch;
}

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

.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;
}

.dashboard-reminder-link {
    font-size: 0.92rem;
    line-height: 1.45;
    flex: 1;
    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: 5;
    min-width: 180px;
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.96);
    display: grid;
}

.dashboard-note-menu {
    position: absolute;
    top: 40px;
    right: 0;
    z-index: 5;
    min-width: 180px;
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.96);
    display: grid;
}

.dashboard-minddump-node-menu {
    position: absolute;
    top: 40px;
    right: 0;
    z-index: 5;
    min-width: 190px;
    border: 1px solid rgba(17, 17, 17, 0.18);
    background: rgba(255, 255, 255, 0.96);
    display: grid;
}

.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-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: 8px;
}

.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: center;
    padding-left: 92px;
    min-height: 0;
}

.dashboard-feature-list {
    display: grid;
    grid-template-columns: 24px auto;
    gap: 0 34px;
    align-items: stretch;
}

.dashboard-feature-rail-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.dashboard-feature-rail {
    width: 24px;
    height: calc(100% - 32px);
    background: #060606;
}

.dashboard-feature-items {
    display: flex;
    flex-direction: column;
    gap: 46px;
}

.dashboard-feature-item {
    display: flex;
    align-items: center;
    gap: 24px;
}

.dashboard-feature-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex: 0 0 auto;
}

.dashboard-feature-icon-button {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.dashboard-feature-text {
    font-size: clamp(1.2rem, 1.03vw, 1.43rem);
    white-space: nowrap;
}

.dashboard-feature-link {
    font-size: clamp(1.2rem, 1.03vw, 1.43rem);
    white-space: nowrap;
    color: inherit;
    text-decoration: none;
}

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

.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;
    width: 27px;
    height: 27px;
}

.dashboard-tool img {
    width: 100%;
    height: 100%;
    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;
}

#closeSettingsBtn {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 5;
}

.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: 999px;
    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;
}

/* Small screens */
@media (max-width: 900px) {
    #menu,
    .floating-actions,
    .app-banner,
    .reminder-banner,
    .back-btn,
    #wizardframe,
    #toolframe,
    .history,
    .settings,
    .dashboard-overlay {
        display: none !important;
    }

    .welcome {
        display: flex !important;
    }

    .small-screen-note {
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 1180px) {
    .dashboard-view {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        padding-right: 0;
    }

    .dashboard-notes {
        grid-column: 1;
        grid-row: 4;
        min-height: 340px;
    }

    .dashboard-topbar,
    .dashboard-content,
    .dashboard-footer {
        grid-column: 1;
    }

    .dashboard-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-content {
        padding-left: 0;
    }

    .dashboard-footer {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .dashboard-footer-app {
        justify-self: start;
    }
}

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

    .dashboard-view {
        gap: 26px;
    }

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

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

    .dashboard-feature-list {
        grid-template-columns: 16px auto;
        gap: 0 20px;
    }

    .dashboard-feature-rail {
        width: 16px;
        height: calc(100% - 24px);
    }

    .dashboard-feature-item {
        gap: 18px;
    }

    .dashboard-feature-icon {
        width: 54px;
        height: 54px;
    }

    .dashboard-tools {
        gap: 24px;
    }
}
