.calendar-sync-form {
    margin: 0;
}

@media (max-width: 640px) {
    .attachment-preview-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
    }

    .attachment-preview-dialog-body {
        min-height: 50vh;
        padding: 8px;
    }

    .attachment-preview-dialog-body img {
        max-height: calc(100dvh - 180px);
    }

    .attachment-preview-dialog-actions {
        gap: 8px;
        padding: 10px;
    }

    .attachment-preview-dialog-actions > [data-attachment-preview-download] {
        width: 100%;
        text-align: center;
    }
}

.diary-document {
    min-height: 420px;
}

.task-summary-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.task-summary-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: inherit;
    text-decoration: none;
}

.task-summary-links a:hover,
.task-summary-links a:focus-visible {
    border-color: var(--ink);
    transform: translateY(-1px);
}

.task-summary-links strong { font-size: 1rem; }

.media-review-cover.is-placeholder {
    height: 96px;
    min-height: 88px;
}

.media-review-cover.is-placeholder span {
    font-size: 14px;
    letter-spacing: .14em;
}

.diary-reading-navigation {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 24px;
}

.diary-reading-navigation a {
    display: block;
    width: auto;
    height: auto;
    min-width: min(240px, 100%);
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid var(--line);
    line-height: 1.45;
    text-align: left;
    text-decoration: none;
}

@media (max-width: 600px) {
    .diary-reading-navigation {
        align-items: stretch;
        flex-direction: column;
    }

    .diary-reading-navigation a {
        width: 100%;
        min-width: 0;
    }
}

.diary-body {
    overflow-wrap: anywhere;
    font-size: 16px;
    line-height: 1.9;
}

.upload-drop {
    display: flex;
    min-height: 112px;
    padding: 20px;
    border: 1px dashed var(--muted);
    background: #fafafa;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.upload-drop:hover {
    border-color: var(--ink);
    background: #f2f2ef;
}

.upload-drop input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.upload-drop span,
.upload-drop strong,
.upload-drop small {
    display: block;
}

.upload-drop small {
    margin-top: 4px;
    color: var(--muted);
}

.selected-files {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.selected-files span {
    padding: 8px 10px;
    border: 1px solid var(--soft-line);
    background: #fafafa;
    border-radius: 5px;
    color: var(--muted);
    font-size: 12px;
}

.existing-attachments {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--soft-line);
}

.attachment-section {
    margin-top: 24px;
}

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

.attachment-item {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
    min-height: 96px;
    padding: 10px;
    border: 1px solid var(--line);
    background: #fafafa;
    border-radius: 7px;
    align-items: center;
}

.attachment-item > form {
    grid-column: 2;
    margin: 0;
}

.attachment-preview,
.attachment-file-mark {
    display: grid;
    width: 76px;
    height: 76px;
    overflow: hidden;
    place-items: center;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 6px;
    text-decoration: none;
}

.attachment-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-file-mark {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.attachment-info {
    min-width: 0;
}

.attachment-info a,
.attachment-info span,
.attachment-info small {
    display: block;
}

.attachment-info a {
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-info span,
.attachment-info small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.attachment-library {
    display: grid;
    border-top: 1px solid var(--line);
}

.attachment-library-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 18px;
    padding: 18px 8px;
    border-bottom: 1px solid var(--line);
    align-items: center;
}

.attachment-library-row > form {
    margin: 0;
}

.attachment-library-type {
    display: grid;
    width: 62px;
    height: 62px;
    place-items: center;
    border: 1px solid var(--ink);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
}

.attachment-library-row h2 {
    margin: 0 0 3px;
    font-size: 18px;
}

.attachment-library-row h2 a {
    text-decoration: none;
}

.attachment-library-row p,
.attachment-library-row span {
    margin: 2px 0;
    color: var(--muted);
    font-size: 11px;
}

.status-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border: 1px solid var(--ink);
    border-radius: 50%;
}

.status-dot.status-in_progress,
.status-dot.status-achieved {
    background: var(--ink);
}

.review-preview {
    display: block;
    padding: 20px;
    border-left: 3px solid var(--ink);
    background: #f8f8f6;
    text-decoration: none;
}

.review-preview > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.review-preview p {
    margin: 10px 0 0;
}

.wish-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.wish-dashboard-card {
    min-height: 120px;
    padding: 16px;
    border: 1px solid var(--line);
    background: #fafafa;
    border-radius: 8px;
    text-decoration: none;
}

.wish-dashboard-card:hover {
    border-color: var(--ink);
}

.wish-dashboard-card span,
.wish-dashboard-card strong,
.wish-dashboard-card small {
    display: block;
}

.wish-dashboard-card span {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.12em;
}

.wish-dashboard-card strong {
    margin: 13px 0;
}

.wish-dashboard-card small {
    color: var(--muted);
}

.phase-label {
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
}

.subnav {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.heading-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 180px 220px auto;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-bar-goals {
    grid-template-columns: minmax(220px, 1fr) 170px 160px 120px auto;
}

.filter-bar-wishes {
    grid-template-columns: minmax(220px, 1fr) 170px 200px auto;
}

.filter-bar-notes {
    grid-template-columns: minmax(220px, 1fr) 150px 190px 130px auto;
}

.filter-bar-bookmarks {
    grid-template-columns: minmax(220px, 1fr) 170px 120px 120px auto;
}

.inline-check {
    display: flex;
    gap: 7px;
    align-items: center;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.inline-check input {
    width: 17px;
    height: 17px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.task-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.task-table th,
.task-table td {
    padding: 14px 13px;
    border-bottom: 1px solid var(--soft-line);
    text-align: left;
    vertical-align: middle;
}

.task-table th {
    color: var(--muted);
    background: #fafafa;
    font-size: 11px;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

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

.task-table tr.is-completed {
    color: var(--muted);
    background: #f8f8f7;
}

.task-table tr.is-completed .task-title {
    text-decoration: line-through;
}

.tag-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.tag-row a,
.tag-row span {
    color: var(--muted);
    font-size: 11px;
    text-decoration: none;
}

.priority-badge,
.completed-mark {
    display: inline-grid;
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.row-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    white-space: nowrap;
}

.row-actions form {
    margin: 0;
}

.row-actions a,
.link-button {
    border: 0;
    padding: 0;
    color: var(--muted);
    background: transparent;
    font-size: 12px;
    text-decoration: underline;
}

.link-button:hover,
.row-actions a:hover {
    color: var(--ink);
}

.danger-text {
    color: var(--danger);
}

.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 24px;
}

.pagination a {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    text-decoration: none;
}

.pagination a.active {
    color: #fff;
    background: var(--ink);
}

.editor-form {
    display: grid;
    gap: 20px;
}

.form-section {
    padding: 28px;
}

.form-advanced-section {
    display: grid;
    gap: 20px;
}

.form-advanced-section > summary {
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    font-weight: 800;
    cursor: pointer;
}

.form-section-main {
    display: grid;
    gap: 18px;
}

.task-essential-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(180px, .7fr) minmax(180px, .7fr);
    gap: 18px;
    align-items: end;
}

.section-title {
    margin-bottom: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.field {
    display: grid;
    gap: 7px;
    align-content: start;
}

.field > span,
.field legend {
    font-size: 13px;
    font-weight: 700;
}

.field b {
    color: var(--danger);
    font-size: 10px;
}

.field small,
.form-note {
    color: var(--muted);
    font-size: 12px;
}

.field-wide {
    grid-column: 1 / -1;
}

.pagination-ellipsis {
    display: inline-grid;
    min-width: 24px;
    place-items: center;
    color: var(--muted);
}

.wish-quick-update {
    margin-top: 10px;
}

.wish-quick-update summary,
.attachment-storage-details summary {
    cursor: pointer;
    font-weight: 700;
}

.wish-quick-update .filter-bar {
    margin-top: 10px;
}

.attachment-storage-details .attachment-summary-grid {
    margin-top: 16px;
}

.review-context-details > summary {
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
}

.review-reading-details { margin-top: 10px; }
.review-reading-details > summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.review-reading-details[open] > summary { margin-bottom: 8px; }
.review-reading-details > p { white-space: normal; overflow-wrap: anywhere; }

.card-primary-summary { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; margin: -8px 0 10px; }
.card-primary-summary > span,
.card-primary-summary > a { display: inline-flex; align-items: baseline; gap: 7px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: inherit; text-decoration: none; }
.card-primary-summary > a:hover,
.card-primary-summary > a:focus-visible { border-color: var(--ink); }
.card-summary-details { margin: 0 0 14px; }
.card-summary-details > summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.card-summary-details p { margin: 7px 0 0; }
.card-security-note { margin: 10px 0 16px; }

.calendar-view-switcher {
    display: flex;
    align-items: center;
    gap: 10px 18px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.calendar-view-switcher .subnav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
}

.calendar-view-switcher .subnav + .subnav {
    padding-left: 18px;
    border-left: 1px solid var(--line);
}

.calendar-view-switcher a {
    flex: 0 0 auto;
}

.panel.auxiliary-empty {
    padding: 12px 16px;
    box-shadow: none;
}

.panel.auxiliary-empty .panel-header {
    margin-bottom: 4px;
}

.panel.auxiliary-empty .panel-header .eyebrow {
    display: none;
}

.panel.auxiliary-empty .panel-header h2,
.panel.auxiliary-empty > h2 {
    font-size: 16px;
}

.panel.auxiliary-empty > .muted:last-child {
    margin-bottom: 0;
}

.auxiliary-details {
    padding: 12px 16px;
    box-shadow: none;
}

.auxiliary-details > summary {
    cursor: pointer;
    font-weight: 700;
}

.media-rich-editor-field {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
}

.media-rich-editor-field .editor-toolbar,
.media-rich-editor-field .rich-editor {
    min-width: 0;
    max-width: 100%;
}

.rich-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
    pointer-events: none;
}

@media (max-width: 720px) {
    .media-rich-editor-field .rich-editor {
        min-height: 220px;
        padding: 16px;
    }

    .media-rich-editor-field .editor-toolbar {
        flex-wrap: wrap;
        overflow-x: hidden;
    }

    .media-rich-editor-field .editor-toolbar-group {
        flex: 1 1 100%;
        min-width: 0;
    }
}

.option-card {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 72px;
    padding: 14px;
    border: 1px solid var(--line);
    background: #fafafa;
    border-radius: 7px;
}

.option-card input {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.option-card span,
.option-card strong,
.option-card small {
    display: block;
}

.option-card small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.note-mode-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.note-editor-section {
    min-height: 560px;
    min-width: 0;
}

.note-editor-section > *,
.markdown-editor-grid > *,
[data-rich-editor-wrap],
[data-markdown-wrap] {
    min-width: 0;
    max-width: 100%;
}

.editor-toolbar {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    padding: 8px;
    border: 1px solid var(--line);
    border-bottom: 0;
    background: #f5f5f3;
    border-radius: 7px 7px 0 0;
}

.editor-toolbar button {
    min-width: 36px;
    min-height: 34px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 5px;
    font-size: 12px;
}

.editor-toolbar button:hover {
    border-color: var(--ink);
}

.rich-editor {
    min-height: 430px;
    padding: 22px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 0 0 7px 7px;
    outline: none;
}

@media (max-width: 720px) {
    .rich-editor,
    .markdown-editor-grid textarea {
        min-height: 260px;
    }
}

.rich-editor:focus {
    border-color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--ink);
}

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

.markdown-editor-grid textarea {
    min-height: 480px;
    font-family: "Cascadia Code", Consolas, monospace;
    line-height: 1.65;
}

.preview-label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
}

.markdown-preview {
    min-height: 480px;
    padding: 20px;
    overflow-wrap: anywhere;
    border: 1px solid var(--line);
    background: #fafafa;
    border-radius: 6px;
}

.note-view-heading {
    align-items: start;
}

.note-view-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 330px);
    gap: 24px;
    align-items: start;
}

.note-document {
    min-height: 540px;
}

.note-body {
    overflow-wrap: anywhere;
}

.note-body > :first-child {
    margin-top: 0;
}

.note-body h2,
.note-body h3,
.note-body h4 {
    margin: 1.5em 0 0.6em;
    font-family: Georgia, "Yu Mincho", serif;
    font-weight: 500;
}

.note-body pre {
    overflow-x: auto;
    padding: 16px;
    color: #fff;
    background: var(--ink);
    border-radius: 7px;
}

.note-body code {
    padding: 1px 4px;
    background: #eeeeeb;
    border-radius: 3px;
    font-family: "Cascadia Code", Consolas, monospace;
}

.note-body pre code {
    padding: 0;
    background: transparent;
}

.note-body blockquote {
    margin-left: 0;
    padding-left: 16px;
    border-left: 3px solid var(--line);
    color: var(--muted);
}

.note-tags {
    margin-top: 36px;
    padding-top: 18px;
    border-top: 1px solid var(--soft-line);
}

.note-sidebar {
    display: grid;
    gap: 16px;
}

.side-link-list,
.revision-list {
    display: grid;
    gap: 8px;
}

.side-link-list a,
.side-link-list span,
.revision-list span {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--soft-line);
    font-size: 12px;
}

.broken-link,
.wiki-link.is-broken {
    color: var(--muted);
    text-decoration: underline dotted;
}

.wiki-link {
    font-weight: 700;
}

.folder-trash-panel {
    margin-top: 24px;
}

.bookmark-list {
    display: grid;
    gap: 14px;
}

.bookmark-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
    gap: 22px;
    padding: 22px;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.bookmark-meta {
    display: flex;
    gap: 6px;
    align-content: start;
    flex-wrap: wrap;
}

.bookmark-meta span {
    padding: 4px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.bookmark-main h2 {
    margin: 8px 0 2px;
    font-family: Georgia, "Yu Mincho", serif;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.bookmark-main h2 a {
    text-decoration: none;
}

.bookmark-url {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.save-reason {
    padding: 12px;
    border-left: 3px solid var(--ink);
    background: #f7f7f5;
}

.bookmark-management {
    min-width: 0;
    align-self: start;
    border-top: 1px solid var(--soft-line);
}

.bookmark-management summary {
    padding: 8px 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
}

.bookmark-management-body {
    display: grid;
    gap: 7px;
    padding: 8px 0;
    overflow-wrap: anywhere;
}

.bookmark-management-body > span,
.bookmark-management-body > small {
    color: var(--muted);
    font-size: 11px;
}

.bookmark-management .content-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 8px;
}

.global-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 24px;
}

.global-search-form input {
    min-height: 52px;
    padding: 11px 16px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 7px;
    font-size: 17px;
}

.search-empty {
    min-height: 310px;
}

.search-count {
    color: var(--muted);
    font-size: 13px;
}

.search-results {
    display: grid;
    border-top: 1px solid var(--line);
}

.search-result {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) 100px;
    gap: 22px;
    padding: 22px 10px;
    border-bottom: 1px solid var(--line);
}

.search-result h2 {
    margin: 0 0 5px;
    font-size: 19px;
}

.search-result h2 a {
    text-decoration: none;
}

.search-result p {
    margin: 5px 0 0;
}

.search-result time,
.search-type,
.search-context {
    color: var(--muted);
    font-size: 11px;
}

.search-type {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 6px;
    align-self: start;
    padding: 5px 9px;
    border: 1px solid var(--soft-line);
    border-radius: 999px;
    background: #fff;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.search-match-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 6px 0 8px;
}

.search-match-row span {
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--muted);
    background: var(--accent-soft);
    font-size: 11px;
    font-weight: 700;
}

.search-suggestion-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: min(680px, 100%);
    margin: 20px auto 0;
}

.search-suggestion-grid a {
    padding: 12px;
    border: 1px solid var(--soft-line);
    border-radius: 14px;
    background: #fff;
    text-decoration: none;
    font-weight: 800;
}

.search-result time {
    text-align: right;
}

.weekday-field {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0;
    border: 0;
}

.weekday-grid {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.weekday-grid input {
    position: absolute;
    opacity: 0;
}

.weekday-grid span {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
}

.weekday-grid input:checked + span {
    color: #fff;
    background: var(--ink);
}

.sticky-actions {
    position: sticky;
    bottom: 12px;
    display: flex;
    gap: 10px;
    width: max-content;
    margin-left: auto;
    padding: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

