:root {
    --bg-top: #d9edf9;
    --bg-bottom: #f4f7fb;
    --ink: #1b2b48;
    --muted: #5e6c84;
    --panel: rgba(255, 255, 255, 0.86);
    --panel-strong: #ffffff;
    --line: #d7deea;
    --accent: #0f6cbd;
    --accent-dark: #084b83;
    --accent-soft: #dbeafe;
    --success: #1f845a;
    --warning: #ae2e24;
    --shadow: 0 18px 42px rgba(14, 30, 62, 0.12);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(15, 108, 189, 0.14), transparent 32%),
        radial-gradient(circle at bottom right, rgba(31, 132, 90, 0.12), transparent 24%),
        linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(18px);
    opacity: 0.75;
}

body::before {
    width: 240px;
    height: 240px;
    top: 70px;
    right: -70px;
    background: rgba(15, 108, 189, 0.15);
}

body::after {
    width: 220px;
    height: 220px;
    bottom: 30px;
    left: -60px;
    background: rgba(31, 132, 90, 0.1);
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px 16px;
}

.auth-card {
    width: min(460px, 100%);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.auth-card h1 {
    margin: 10px 0 0;
    font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
    letter-spacing: 0.02em;
}

.auth-form {
    margin-top: 24px;
}

.auth-mark {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    border-radius: 18px;
    background: linear-gradient(145deg, #74c0fc, #0f6cbd);
    color: #ffffff;
    font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
}

.app-shell {
    width: min(1500px, calc(100% - 32px));
    margin: 24px auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 22px 26px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 28px;
    background: rgba(18, 40, 68, 0.9);
    color: #f8fbff;
    box-shadow: var(--shadow);
}

.topbar-leading {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-card h1,
.panel h2,
.section-heading h2,
.task-card h3,
.diary-card h3,
.board-card h3 {
    margin: 0;
    font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
    letter-spacing: 0.02em;
}

.brand-copy,
.section-copy,
.eyebrow,
.panel-note p,
.task-card p,
.task-meta dt,
.diary-meta span,
.board-card p {
    margin: 0;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.72rem;
    opacity: 0.76;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.task-search {
    position: relative;
    width: min(420px, 36vw);
    min-width: 260px;
}

.task-search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(248, 251, 255, 0.82);
}

.task-search-field iconify-icon {
    flex: 0 0 auto;
    font-size: 1.05rem;
}

.task-search-field input {
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #ffffff;
}

.task-search-field input::placeholder {
    color: rgba(248, 251, 255, 0.62);
}

.task-search-field input:focus {
    outline: none;
}

.task-search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 45;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background: rgba(18, 40, 68, 0.98);
    box-shadow: 0 20px 34px rgba(10, 22, 44, 0.36);
}

.task-search-results {
    display: grid;
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
}

.task-search-result,
.task-search-empty {
    border-radius: 14px;
}

.task-search-result {
    display: grid;
    gap: 6px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.08);
    color: #f8fbff;
    text-align: left;
}

.task-search-result:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.12);
}

.task-search-result-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.task-search-result-top strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-search-result-time,
.task-search-result-meta,
.task-search-result-snippet,
.task-search-empty {
    color: rgba(248, 251, 255, 0.72);
}

.task-search-result-time {
    flex: 0 0 auto;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.task-search-result-meta {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.task-search-result-snippet {
    font-size: 0.82rem;
    line-height: 1.35;
}

.task-search-empty {
    padding: 14px;
    background: rgba(255, 255, 255, 0.08);
    text-align: center;
}

.session-badge {
    display: grid;
    gap: 2px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.session-badge strong {
    font-size: 0.96rem;
}

.session-role {
    color: rgba(248, 251, 255, 0.76);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 700;
    white-space: nowrap;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.menu-toggle:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.18);
}

.menu-toggle-bars {
    display: inline-grid;
    gap: 4px;
}

.menu-toggle-bars span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.menu-toggle-label {
    line-height: 1;
}

.menu-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.view-switch {
    display: inline-flex;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.view-tab {
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(248, 251, 255, 0.82);
    font-weight: 700;
}

.view-tab.is-active {
    background: #ffffff;
    color: var(--accent-dark);
}

.message-bar {
    width: min(760px, calc(100% - 32px));
    margin: 16px auto 0;
    padding: 14px 18px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    font-weight: 700;
    position: relative;
    z-index: 40;
}

.message-bar.is-success {
    background: rgba(31, 132, 90, 0.14);
    color: #145c40;
}

.message-bar.is-error {
    background: rgba(174, 46, 36, 0.12);
    color: #8b241d;
}

.message-bar.is-info {
    background: rgba(15, 108, 189, 0.12);
    color: #0a507f;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    gap: 22px;
    margin-top: 22px;
    align-items: start;
    transition: grid-template-columns 0.24s ease, gap 0.24s ease;
}

.workspace.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.sidebar,
.main-content {
    min-width: 0;
}

.sidebar {
    padding-right: 2px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: opacity 0.24s ease, transform 0.24s ease, visibility 0.24s ease;
}

.workspace.is-sidebar-collapsed .sidebar {
    display: none;
    opacity: 0;
    transform: translateX(-22px);
    pointer-events: none;
    visibility: hidden;
}

.panel,
.stats-pill {
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-lg);
    background: var(--panel);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.panel {
    padding: 18px;
}

.panel + .panel {
    margin-top: 18px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.panel-copy {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.5;
}

.stack-form,
.modal-body {
    display: grid;
    gap: 14px;
}

.stack-form label,
.modal-body label {
    display: grid;
    gap: 6px;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--ink);
}

textarea {
    resize: vertical;
    min-height: 110px;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
    border: 0;
    border-radius: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-button {
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--accent), #3093ec);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(15, 108, 189, 0.22);
}

.secondary-button {
    padding: 11px 14px;
    background: #edf3fa;
    color: var(--accent-dark);
    font-weight: 700;
}

.ghost-button {
    padding: 10px 12px;
    background: rgba(15, 108, 189, 0.08);
    color: var(--accent-dark);
    font-weight: 700;
}

.icon-button {
    padding: 9px 12px;
    background: rgba(15, 108, 189, 0.08);
    color: var(--accent-dark);
    font-size: 0.88rem;
    font-weight: 700;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.view-tab:hover,
.board-card:hover {
    transform: translateY(-1px);
}

.boards-list {
    display: grid;
    gap: 12px;
}

.board-card {
    width: 100%;
    padding: 15px 16px;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background:
        linear-gradient(155deg, rgba(15, 108, 189, 0.1), transparent 55%),
        #ffffff;
    box-shadow: 0 10px 18px rgba(14, 30, 62, 0.08);
}

.board-card.is-active {
    border-color: rgba(15, 108, 189, 0.35);
    background:
        linear-gradient(155deg, rgba(15, 108, 189, 0.18), transparent 62%),
        #ffffff;
}

.board-card p {
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.45;
}

.view-section {
    display: none;
}

.view-section.is-active {
    display: block;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.section-copy {
    margin-top: 6px;
    color: var(--muted);
    max-width: 760px;
    line-height: 1.5;
}

.board-heading-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.board-heading-actions {
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
}

.board-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.board-filter-picker {
    min-width: min(320px, 100%);
    width: min(360px, 100%);
}

.diary-heading-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.toggle-row,
.checkbox-row {
    display: inline-flex;
    gap: 10px;
    align-items: center;
}

.toggle-row {
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
    white-space: nowrap;
}

.toggle-row input,
.checkbox-row input {
    width: auto;
    margin: 0;
}

.lists-container {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(300px, 320px);
    gap: 18px;
    overflow-x: auto;
    align-items: stretch;
    isolation: isolate;
    padding-bottom: 12px;
}

.lists-container:empty::after {
    content: "Nessuna lista disponibile in questa bacheca.";
    display: block;
    padding: 24px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.5);
    color: var(--muted);
}

.list-card {
    display: flex;
    flex-direction: column;
    min-height: clamp(360px, 62vh, 680px);
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 252, 0.96));
    box-shadow: var(--shadow);
}

.list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.list-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.list-delete-button {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(174, 46, 36, 0.08);
    color: #8b241d;
    font-size: 0.75rem;
    font-weight: 700;
}

.list-count,
.badge,
.board-tag,
.stats-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.list-count {
    padding: 7px 10px;
    background: rgba(15, 108, 189, 0.1);
    color: var(--accent-dark);
}

.task-stack {
    display: grid;
    flex: 1 1 auto;
    align-content: start;
    gap: 12px;
    min-height: 180px;
    padding: 4px;
    border-radius: var(--radius-md);
    transition: background 0.18s ease, box-shadow 0.18s ease;
}

.lists-container.is-task-dragging .task-stack,
.lists-container.is-task-dragging .list-card {
    transition: none;
}

.task-stack.is-drop-target {
    background: rgba(15, 108, 189, 0.08);
    box-shadow: inset 0 0 0 2px rgba(15, 108, 189, 0.26);
}

.list-card.is-drop-target {
    border-color: rgba(15, 108, 189, 0.3);
    box-shadow: 0 18px 34px rgba(14, 30, 62, 0.14);
}

.task-card,
.diary-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-strong);
    box-shadow: 0 12px 22px rgba(14, 30, 62, 0.08);
}

.task-card {
    border-left: 4px solid var(--accent);
}

.task-card[draggable="true"] {
    cursor: grab;
}

.task-card.is-dragging {
    opacity: 0.48;
    transform: rotate(-1deg) scale(0.99);
}

.task-card.is-drop-before {
    position: relative;
}

.task-card.is-drop-before::before {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    top: -8px;
    height: 3px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 2px rgba(15, 108, 189, 0.12);
}

.task-stack.is-drop-at-end::after {
    content: "";
    display: block;
    height: 3px;
    margin: 2px 10px 4px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 2px rgba(15, 108, 189, 0.12);
}

.task-card.is-completed,
.diary-card.is-completed {
    border-left-color: var(--success);
    background: linear-gradient(180deg, rgba(31, 132, 90, 0.04), #ffffff);
}

.diary-card-head,
.task-actions,
.diary-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-actions,
.diary-actions,
.diary-card-head {
    justify-content: space-between;
}

.task-card h3,
.diary-card h3 {
    font-size: 1rem;
}

.task-card h3 {
    margin-top: 0;
}

.diary-card h3 {
    margin-top: 10px;
}

.task-card p,
.diary-card p {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.45;
}

.task-meta,
.diary-meta {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.diary-meta span {
    padding: 8px 10px;
    border-radius: 12px;
    background: #f4f7fb;
}

.task-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    padding: 3px 6px;
    border: 1px solid rgba(214, 223, 235, 0.95);
    border-radius: 999px;
    background: #f7fafd;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    font-weight: 700;
    font-size: 0.68rem;
    line-height: 1.1;
}

.task-meta-pill iconify-icon {
    flex: 0 0 auto;
    font-size: 0.7rem;
}

.task-meta-pill span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-meta-pill.is-owner {
    background: rgba(15, 108, 189, 0.08);
    border-color: rgba(15, 108, 189, 0.14);
    color: var(--accent-dark);
}

.task-meta-pill.is-status.is-open {
    background: var(--accent-soft);
    border-color: rgba(15, 108, 189, 0.14);
    color: var(--accent-dark);
}

.task-meta-pill.is-status.is-complete {
    background: rgba(31, 132, 90, 0.14);
    border-color: rgba(31, 132, 90, 0.18);
    color: #145c40;
}

.task-meta-pill.is-duration {
    background: rgba(31, 132, 90, 0.08);
    border-color: rgba(31, 132, 90, 0.16);
    color: #145c40;
}

.task-meta-pill.is-completed-at {
    background: rgba(15, 108, 189, 0.08);
    border-color: rgba(15, 108, 189, 0.14);
    color: var(--accent-dark);
}

.task-meta-pill.is-start {
    background: rgba(31, 132, 90, 0.09);
    border-color: rgba(31, 132, 90, 0.14);
    color: #145c40;
}

.task-meta-pill.is-end {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.14);
    color: #9a3412;
}

.task-actions,
.diary-actions {
    margin-top: 12px;
}

.empty-column,
.empty-state {
    padding: 18px 16px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
    background: rgba(244, 247, 251, 0.7);
}

.access-search-field,
.access-selected-block {
    display: grid;
    gap: 8px;
}

.access-search-wrap {
    position: relative;
}

.access-search-wrap input:disabled {
    background: #f3f6fa;
    color: var(--muted);
}

.access-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 4;
    display: grid;
    gap: 6px;
    max-height: 240px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 34px rgba(14, 30, 62, 0.14);
    overflow-y: auto;
}

.access-suggestion,
.access-suggestion-empty,
.access-selected-item {
    border-radius: 14px;
}

.access-suggestion {
    display: grid;
    gap: 2px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid transparent;
    background: #f8fbff;
    text-align: left;
    color: var(--ink);
}

.access-suggestion:hover {
    border-color: rgba(15, 108, 189, 0.18);
    background: #eef6ff;
}

.access-suggestion small,
.access-selected-copy small,
.access-selected-label {
    color: var(--muted);
}

.access-suggestion-empty {
    padding: 14px;
    background: #f8fbff;
    text-align: center;
    color: var(--muted);
}

.access-selected {
    display: grid;
    gap: 10px;
}

.access-selected-label {
    font-size: 0.92rem;
    font-weight: 700;
}

.access-selected-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    background: #f8fbff;
}

.access-selected-copy {
    display: grid;
    gap: 2px;
}

.access-remove-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(174, 46, 36, 0.12);
    color: #8b241d;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.access-remove-button:hover {
    background: rgba(174, 46, 36, 0.18);
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.diary-calendar-shell {
    display: grid;
    gap: 16px;
    overflow-x: auto;
}

.diary-calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-lg);
    background: var(--panel);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.diary-calendar-nav {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.diary-calendar-heading {
    display: grid;
    gap: 4px;
}

.diary-calendar-heading strong {
    font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.diary-calendar-range {
    color: var(--muted);
    font-size: 0.84rem;
}

.diary-month-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.diary-month-tab {
    padding: 9px 12px;
    border: 1px solid rgba(15, 108, 189, 0.12);
    border-radius: 999px;
    background: #ffffff;
    color: var(--muted);
    font-weight: 700;
}

.diary-month-tab.is-active {
    background: linear-gradient(135deg, var(--accent), #3093ec);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 108, 189, 0.22);
}

.diary-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    min-width: 980px;
}

.diary-weekdays span {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(18, 40, 68, 0.88);
    color: rgba(248, 251, 255, 0.82);
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.diary-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    min-width: 980px;
}

.diary-day {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 220px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 26px rgba(14, 30, 62, 0.08);
}

.diary-day.is-outside-month {
    background: rgba(244, 247, 251, 0.72);
    opacity: 0.78;
}

.diary-day.is-today {
    border-color: rgba(15, 108, 189, 0.26);
    box-shadow: 0 16px 28px rgba(15, 108, 189, 0.12);
}

.diary-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.diary-day-number {
    font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

.diary-day-badge {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(15, 108, 189, 0.12);
    color: var(--accent-dark);
    font-size: 0.72rem;
    font-weight: 700;
}

.diary-day-events {
    display: grid;
    align-content: start;
    gap: 8px;
    overflow-y: auto;
    min-height: 0;
}

.diary-day-empty {
    padding: 10px;
    border-radius: 12px;
    background: #f6f9fd;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
}

.diary-event {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 10px 11px;
    border: 1px solid rgba(15, 108, 189, 0.14);
    border-left: 4px solid var(--accent);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(15, 108, 189, 0.08), rgba(255, 255, 255, 0.96));
    text-align: left;
    color: var(--ink);
    box-shadow: 0 8px 18px rgba(14, 30, 62, 0.06);
}

.diary-event.is-continuing {
    border-left-color: #f97316;
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.08), rgba(255, 255, 255, 0.96));
}

.diary-event.is-completed {
    border-left-color: var(--success);
    background: linear-gradient(180deg, rgba(31, 132, 90, 0.08), rgba(255, 255, 255, 0.96));
    color: #35515c;
}

.diary-event-time {
    color: var(--accent-dark);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.diary-event.is-continuing .diary-event-time {
    color: #9a3412;
}

.diary-event.is-completed .diary-event-time {
    color: #145c40;
}

.diary-event-title {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
}

.diary-event-assignee {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(15, 108, 189, 0.08);
    color: var(--accent-dark);
    font-size: 0.73rem;
    font-weight: 700;
    line-height: 1.2;
}

.diary-event-board {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.25;
}

.board-tag {
    padding: 7px 11px;
    background: rgba(15, 108, 189, 0.08);
    color: var(--accent-dark);
}

.diary-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-pill {
    padding: 12px 16px;
    color: var(--accent-dark);
    font-weight: 700;
}

.board-modal,
.list-modal,
.access-modal,
.task-modal {
    width: min(620px, calc(100% - 24px));
    padding: 0;
    border: 0;
    border-radius: 26px;
    background: transparent;
}

.task-modal {
    width: calc(100vw - 24px);
    max-width: none;
}

.complete-task-modal {
    width: min(680px, calc(100vw - 24px));
}

.board-modal::backdrop,
.list-modal::backdrop,
.access-modal::backdrop,
.task-modal::backdrop {
    background: rgba(14, 30, 62, 0.48);
    backdrop-filter: blur(6px);
}

.modal-shell {
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.task-modal .modal-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: min(88vh, 900px);
}

.modal-header,
.modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 18px 22px;
}

.modal-header {
    border-bottom: 1px solid #e8edf5;
}

.modal-body {
    padding: 22px;
}

.task-modal .modal-body {
    overflow-y: auto;
    padding-bottom: 18px;
}

.task-modal-divider {
    margin: 2px 0;
    border: 0;
    border-top: 1px solid #e8edf5;
}

.delete-list-summary {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    padding: 16px 18px;
    border: 1px solid rgba(15, 108, 189, 0.12);
    border-radius: 16px;
    background: rgba(15, 108, 189, 0.06);
    color: var(--ink);
    line-height: 1.5;
}

.delete-list-strategy-block {
    display: grid;
    gap: 12px;
}

.delete-list-option {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px 16px;
    border: 1px solid #e8edf5;
    border-radius: 16px;
    background: #fbfdff;
}

.delete-list-option input {
    width: auto;
    margin: 2px 0 0;
    accent-color: var(--accent);
}

.delete-list-option span {
    display: grid;
    gap: 4px;
}

.delete-list-option small {
    color: var(--muted);
    line-height: 1.45;
}

.delete-list-transfer-fields {
    padding: 0 4px 2px 34px;
}

.delete-list-transfer-grid {
    display: grid;
    gap: 12px;
}

.date-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

#taskEndDate[readonly] {
    background: #f4f7fb;
    color: var(--ink-soft);
    cursor: default;
}

#completeTaskEndDate[readonly] {
    background: #f4f7fb;
    color: var(--ink-soft);
    cursor: default;
}

.task-completion-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(31, 132, 90, 0.16);
    border-radius: 14px;
    background: rgba(31, 132, 90, 0.08);
    color: #145c40;
    font-size: 0.9rem;
    font-weight: 600;
}

.task-completion-summary span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.task-complete-context {
    display: grid;
    gap: 6px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(15, 108, 189, 0.12);
    border-radius: 14px;
    background: rgba(15, 108, 189, 0.06);
}

.task-complete-context strong {
    font-size: 1rem;
}

.task-complete-context small {
    color: var(--muted);
}

.modal-footer {
    border-top: 1px solid #e8edf5;
    justify-content: flex-start;
}

.danger-button {
    background: linear-gradient(135deg, #b42318, #d14343);
    box-shadow: 0 10px 24px rgba(177, 49, 49, 0.22);
}

.task-modal .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

.modal-footer-leading {
    display: inline-flex;
    gap: 12px;
    flex-wrap: wrap;
}

.modal-footer-actions {
    display: inline-flex;
    gap: 12px;
    margin-left: auto;
}

#taskToggleCompleteButton.is-active {
    background: rgba(174, 46, 36, 0.12);
    color: #8b241d;
}

#taskTitleInput {
    padding: 9px 12px;
}

.field-note {
    color: var(--muted);
    font-size: 0.82rem;
}

.task-assignee-field {
    display: grid;
    gap: 8px;
}

.task-assignee-picker {
    position: relative;
}

.task-assignee-toggle {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    color: var(--ink);
    text-align: left;
}

.task-assignee-toggle-copy {
    display: grid;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

.task-assignee-summary {
    font-weight: 700;
}

.task-assignee-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.task-assignee-chip,
.task-assignee-placeholder {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
}

.task-assignee-chip {
    background: rgba(15, 108, 189, 0.08);
    color: var(--accent-dark);
    font-weight: 700;
}

.task-assignee-chip.is-overflow {
    background: rgba(14, 30, 62, 0.08);
    color: var(--ink);
}

.task-assignee-placeholder {
    background: #f4f7fb;
    color: var(--muted);
}

.task-assignee-caret {
    flex: 0 0 auto;
    padding-top: 2px;
    color: var(--muted);
    transition: transform 0.18s ease;
}

.task-assignee-picker.is-open .task-assignee-caret {
    transform: rotate(180deg);
}

.task-assignee-picker.is-disabled .task-assignee-toggle {
    background: #f3f6fa;
    color: var(--muted);
    cursor: default;
}

.task-assignee-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 5;
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 36px rgba(14, 30, 62, 0.14);
}

.task-assignee-search input {
    padding: 10px 12px;
}

.board-filter-reset {
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: #f4f7fb;
    color: var(--accent-dark);
    font-weight: 700;
    text-align: left;
}

.board-filter-reset:disabled {
    color: var(--muted);
    cursor: default;
}

.task-assignee-options {
    display: grid;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.task-assignee-option {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: stretch;
    gap: 14px;
    padding: 8px 10px;
    border: 1px solid #e8edf5;
    border-radius: 12px;
    background: #f8fbff;
}

.task-assignee-option input {
    width: 30px;
    min-height: 46px;
    margin: 0;
    accent-color: var(--accent);
    align-self: stretch;
}

.task-assignee-option-copy {
    display: grid;
    gap: 2px;
    align-content: center;
}

.task-assignee-option-copy small,
.task-assignee-empty {
    color: var(--muted);
}

.task-assignee-empty {
    padding: 14px 12px;
    border-radius: 12px;
    background: #f8fbff;
    text-align: center;
}

.task-attachments-field {
    display: grid;
    gap: 10px;
}

.task-custom-fields-field {
    display: grid;
    gap: 12px;
}

.task-custom-fields-head {
    display: block;
}

.task-custom-fields-title {
    display: inline-block;
    font-weight: 700;
}

.task-custom-fields-table-wrap {
    overflow-x: auto;
    border: 1px solid #e8edf5;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.task-custom-fields-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    table-layout: fixed;
}

.task-custom-fields-table th,
.task-custom-fields-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: top;
}

.task-custom-fields-table th {
    background: #f8fbff;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
}

.task-custom-fields-table tbody tr:last-child td {
    border-bottom: 0;
}

.task-custom-fields-action-head,
.task-custom-field-actions {
    width: 132px;
    text-align: right;
}

.task-custom-field-key,
.task-custom-field-value {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--ink);
}

.task-custom-field-value {
    min-height: 50px;
    resize: vertical;
}

.task-custom-field-remove {
    white-space: nowrap;
}

.task-attachments-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.task-attachments-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.task-attachments-trigger input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}

.task-attachment-list {
    display: grid;
    gap: 8px;
}

.task-attachment-group-title {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.task-attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border: 1px solid #e8edf5;
    border-radius: 14px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
}

.task-attachment-item.is-pending {
    background: #f8fbff;
}

.task-attachment-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.task-attachment-copy strong {
    overflow-wrap: anywhere;
}

.task-attachment-copy small,
.task-attachment-empty {
    color: var(--muted);
}

.task-attachment-link {
    color: var(--accent-dark);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.task-attachment-remove {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: rgba(174, 46, 36, 0.12);
    color: #8b241d;
    font-weight: 700;
    line-height: 1;
}

.task-attachment-empty {
    padding: 14px 12px;
    border-radius: 12px;
    background: #f8fbff;
    text-align: center;
}

.wysiwyg-field {
    display: grid;
    gap: 8px;
}

.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wysiwyg-toolbar .icon-button {
    padding: 7px 10px;
}

.wysiwyg-editor {
    min-height: 190px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    line-height: 1.55;
    color: var(--ink);
}

.wysiwyg-editor:focus {
    outline: 2px solid rgba(15, 108, 189, 0.18);
    outline-offset: 0;
}

.wysiwyg-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
}

.wysiwyg-editor p,
.wysiwyg-editor ul,
.wysiwyg-editor ol {
    margin: 0 0 10px;
}

.wysiwyg-editor p:last-child,
.wysiwyg-editor ul:last-child,
.wysiwyg-editor ol:last-child {
    margin-bottom: 0;
}

code {
    padding: 2px 5px;
    border-radius: 6px;
    background: rgba(15, 108, 189, 0.08);
}

@media (max-width: 1080px) {
    .workspace {
        grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
    }

    .sidebar {
        padding-right: 0;
    }
}

@media (max-width: 840px) {
    .app-shell {
        width: min(100% - 16px, 100%);
        margin: 12px auto;
    }

    .topbar,
    .section-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .task-search {
        width: 100%;
        min-width: 0;
    }

    .menu-toggle {
        width: auto;
        align-self: flex-start;
        justify-content: center;
    }

    .view-switch {
        width: 100%;
        justify-content: stretch;
    }

    .view-tab {
        flex: 1;
    }

    .inline-form,
    .date-grid,
    .diary-meta {
        grid-template-columns: 1fr;
    }

    .diary-calendar-toolbar,
    .diary-calendar-nav,
    .diary-month-tabs {
        align-items: stretch;
    }

    .diary-calendar-nav {
        width: 100%;
        justify-content: space-between;
    }

    .diary-month-tabs {
        width: 100%;
        justify-content: flex-start;
    }

    .diary-day {
        min-height: 180px;
    }

    .task-modal .modal-footer {
        flex-wrap: wrap;
    }

    .task-modal .modal-footer-actions {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }

    .lists-container {
        grid-auto-columns: minmax(280px, 88vw);
    }

    .workspace,
    .workspace.is-sidebar-collapsed {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .workspace.is-sidebar-collapsed .sidebar {
        display: none;
    }
}
