.ferry-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 8990;
}

.ferry-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

.ferry-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 72vh;
    max-height: 78vh;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(105%);
    transition: transform 0.26s ease;
    z-index: 9000;
    overflow: hidden;
}

.ferry-sheet.visible {
    transform: translateY(0);
}

.ferry-handle {
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.15);
    margin: 10px auto 6px;
    flex-shrink: 0;
}

.ferry-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 4px 18px 12px;
    gap: 12px;
    flex-shrink: 0;
}

.ferry-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ferry-title {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    color: #2b3035;
}

.ferry-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d4d8de;
    box-shadow: 0 0 0 4px rgba(212, 216, 222, 0.18);
}

.ferry-status-dot[data-state="loading"] {
    background: #f0be4c;
    box-shadow: 0 0 0 4px rgba(240, 190, 76, 0.16);
}

.ferry-status-dot[data-state="ready"] {
    background: #78c48b;
    box-shadow: 0 0 0 4px rgba(120, 196, 139, 0.16);
}

.ferry-status-dot[data-state="error"] {
    background: #e27b7b;
    box-shadow: 0 0 0 4px rgba(226, 123, 123, 0.16);
}

.ferry-subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: #7b838d;
}

.ferry-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #6a727c;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.ferry-tabs {
    display: flex;
    gap: 8px;
    padding: 0 18px 12px;
    flex-shrink: 0;
}

.ferry-tab {
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    color: #75808b;
    background: #eef1f4;
    cursor: pointer;
}

.ferry-tab.active {
    background: #ffffff;
    color: #33506f;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ferry-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 18px 16px;
}

.ferry-tab-panel {
    display: none;
}

.ferry-tab-panel.active {
    display: block;
}

.ferry-section {
    margin-bottom: 16px;
}

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

.ferry-section-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2f3b47;
}

.ferry-section-hint {
    margin: 0 0 10px;
    font-size: 12px;
    color: #838b94;
}

.ferry-refresh-btn,
.ferry-secondary-btn,
.ferry-write-actions button {
    border: none;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    background: #eef2f6;
    color: #566371;
}

.ferry-memory-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ferry-memory-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.ferry-memory-card.is-warm {
    background: rgba(255, 251, 235, 0.88);
}

.ferry-memory-title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: #2f3b47;
}

.ferry-memory-summary {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    color: #66717d;
}

.ferry-memory-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.ferry-chip {
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    color: #637081;
    background: #f0f3f6;
}

.ferry-memory-time {
    margin-top: 10px;
    font-size: 11px;
    color: #8c96a1;
}

.ferry-empty,
.ferry-list-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 140px;
    padding: 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    color: #7e8793;
    text-align: center;
}

.ferry-empty-icon {
    font-size: 22px;
}

.ferry-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(248, 249, 250, 0.96);
    flex-shrink: 0;
}

.ferry-primary-btn {
    flex: 1;
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #577590, #6d8db0);
    cursor: pointer;
}

.ferry-moment-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    color: #6b7f95;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.ferry-write-panel {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(245, 247, 250, 0.82);
    backdrop-filter: blur(6px);
}

.ferry-write-panel.visible {
    display: flex;
}

.ferry-write-card {
    width: 100%;
    background: #ffffff;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
}

.ferry-write-card h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: #2f3b47;
}

.ferry-input,
.ferry-textarea {
    width: 100%;
    border: 1px solid rgba(99, 112, 129, 0.18);
    border-radius: 12px;
    padding: 12px;
    font-size: 13px;
    color: #2f3b47;
    background: #fbfcfd;
    outline: none;
}

.ferry-input {
    margin-bottom: 10px;
}

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

.ferry-input:focus,
.ferry-textarea:focus {
    border-color: rgba(87, 117, 144, 0.45);
    box-shadow: 0 0 0 3px rgba(87, 117, 144, 0.12);
}

.ferry-write-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.ferry-entry-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}
.ferry-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(13, 18, 24, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 9010;
}

.ferry-modal-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

.ferry-modal {
    position: fixed;
    inset: auto 16px 24px;
    z-index: 9020;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ferry-modal.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ferry-modal-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.ferry-modal-title {
    margin: 0 0 10px;
    font-size: 17px;
    color: #2f3b47;
}

.ferry-modal-summary {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #5f6c7a;
}

.ferry-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.ferry-modal-actions-split {
    justify-content: space-between;
}

.ferry-modal-primary {
    min-width: 96px;
}

.ferry-error-details {
    display: none;
    max-height: 200px;
    overflow: auto;
    margin: 12px 0 0;
    padding: 12px;
    border-radius: 12px;
    background: #f5f7fa;
    color: #475463;
    font-size: 11px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.ferry-error-details.visible {
    display: block;
}

.ferry-link-btn {
    border: none;
    background: transparent;
    padding: 0;
    color: #577590;
    font-size: 12px;
    cursor: pointer;
    text-align: left;
}

.ferry-title-field {
    display: none;
    margin-bottom: 10px;
}

.ferry-title-field.visible {
    display: block;
}

.ferry-field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: #6e7985;
}

.ferry-write-hint {
    margin: 0 0 12px;
    font-size: 12px;
    color: #7a8591;
    line-height: 1.5;
}

.ferry-edit-meta {
    display: none;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #f5f7fa;
}

.ferry-edit-meta.visible {
    display: grid;
}

.ferry-edit-meta div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
    color: #64707c;
}

.ferry-edit-meta strong {
    color: #2f3b47;
    font-weight: 600;
}

.ferry-memory-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    position: relative;
}

.ferry-memory-title-wrap {
    flex: 1;
    min-width: 0;
}

.ferry-memory-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.ferry-memory-info {
    flex: 1;
    min-width: 0;
}

.ferry-card-menu-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #f0f3f6;
    color: #6b7682;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.ferry-card-actions {
    position: absolute;
    top: 30px;
    right: 0;
    display: none;
    flex-direction: column;
    min-width: 110px;
    padding: 6px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    z-index: 2;
}

.ferry-card-actions.visible {
    display: flex;
}

.ferry-card-action {
    border: none;
    background: transparent;
    padding: 9px 10px;
    border-radius: 10px;
    text-align: left;
    font-size: 12px;
    color: #4c5865;
    cursor: pointer;
}

.ferry-card-action:hover {
    background: #f3f6f9;
}

.ferry-card-action-danger,
.ferry-danger-btn {
    color: #b94f58;
}

.ferry-danger-btn {
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    background: rgba(185, 79, 88, 0.1);
    cursor: pointer;
}

.ferry-chip-active {
    background: rgba(255, 244, 214, 0.95);
    color: #9b6b00;
}

.ferry-chip-important {
    background: rgba(255, 247, 224, 0.95);
    color: #8e6500;
}

.ferry-chip-muted {
    background: #eceff3;
    color: #6e7a87;
}

.ferry-moment-btn.is-hidden {
    display: none;
}

.ferry-refresh-btn.is-loading {
    opacity: 0.7;
}

.ferry-error-modal-content {
    padding: 24px 20px;
}

.ferry-chip-breath {
    background: rgba(225, 240, 255, 0.95);
    color: #3d6f9f;
}

.ferry-chip-more {
    border: none;
    cursor: pointer;
    background: #f3f6f9;
    color: #6a7887;
}

.ferry-title-field .ferry-input {
    margin-bottom: 0;
}

.ferry-context-chip {
    background: rgba(225, 240, 255, 0.95);
    color: #3d6f9f;
}

.ferry-system-chip {
    background: #eef2f5;
    color: #65707c;
}

.ferry-chip-system {
    background: #eef2f5;
    color: #65707c;
}

.ferry-chip-context,
.ferry-chip-breath {
    background: rgba(225, 240, 255, 0.95);
    color: #3d6f9f;
}

.ferry-section-note {
    margin-top: -2px;
    margin-bottom: 10px;
    font-size: 11px;
    color: #8b939c;
}

.ferry-error-dialog {
    padding: 20px 18px 16px;
}

.ferry-error-title {
    margin: 4px 0 10px;
    line-height: 1.4;
}

.ferry-error-summary {
    margin: 8px 0 12px;
    line-height: 1.6;
}

.ferry-modal {
    align-items: stretch;
    justify-content: center;
}

.ferry-memory-view {
    display: none;
}

.ferry-memory-view.active {
    display: block;
}

.ferry-memory-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.ferry-recycle-entry-btn {
    border-radius: 999px;
    padding: 8px 14px;
}

.ferry-recycle-view {
    min-height: 100%;
}

.ferry-recycle-head {
    margin-bottom: 12px;
}

.ferry-recycle-back-btn {
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
}

.ferry-recycle-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #2f3b47;
}

.ferry-recycle-hint {
    margin-top: 6px;
}

.ferry-deleted-card {
    background: #fffdfb;
}

.ferry-deleted-time {
    margin-top: 8px;
}

.ferry-deleted-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.ferry-deleted-actions .ferry-secondary-btn,
.ferry-deleted-actions .ferry-danger-btn {
    flex: 1;
    min-height: 40px;
}

.ferry-footer.is-hidden {
    display: none;
}
.ferry-memory-toolbar {
    justify-content: flex-start;
}

.ferry-recycle-entry-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(122, 135, 148, 0.16);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.68);
    color: #748190;
    box-shadow: none;
    font-size: 12px;
    font-weight: 500;
    min-height: 34px;
}

.ferry-recycle-entry-btn::before {
    content: '🗑';
    font-size: 12px;
    opacity: 0.78;
    line-height: 1;
}

.ferry-recycle-entry-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #5f6d7c;
}

.ferry-recycle-entry-btn:active {
    background: rgba(103, 122, 142, 0.08);
    transform: translateY(0);
}

.ferry-companion-list {
    gap: 12px;
}

.ferry-companion-card {
    background: #ffffff;
}

.ferry-companion-card.is-done,
.ferry-companion-card.is-skipped,
.ferry-companion-card.is-cancelled {
    opacity: 0.82;
}

.ferry-companion-card.is-reminder.is-done,
.ferry-companion-card.is-reminder.is-skipped,
.ferry-companion-card.is-reminder.is-cancelled {
    background: #f4f5f6;
    border-left-color: rgba(137, 146, 156, 0.36);
    opacity: 1;
}

.ferry-companion-card.is-reminder.is-done .ferry-memory-title,
.ferry-companion-card.is-reminder.is-skipped .ferry-memory-title,
.ferry-companion-card.is-reminder.is-cancelled .ferry-memory-title {
    color: #66717d;
}

.ferry-companion-card.is-done {
    background: #f7fbf8;
}

.ferry-companion-card.is-skipped {
    background: #faf9f4;
}

.ferry-companion-card.is-cancelled {
    background: #faf7f7;
}

.ferry-companion-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.ferry-companion-actions .ferry-secondary-btn,
.ferry-companion-actions .ferry-danger-btn {
    flex: 1 1 96px;
    min-height: 40px;
}

.ferry-companion-due {
    margin-top: 8px;
}

.ferry-companion-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.ferry-select,
.ferry-datetime-input {
    margin-bottom: 0;
}

.ferry-companion-reminder-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    font-size: 13px;
    color: #55606c;
}

.ferry-companion-reminder-row input {
    width: 16px;
    height: 16px;
}

.ferry-companion-status {
    margin-top: 10px;
}

.ferry-chip-pending {
    background: rgba(225, 240, 255, 0.95);
    color: #3d6f9f;
}

.ferry-chip-done {
    background: rgba(220, 241, 226, 0.95);
    color: #2f7a49;
}

.ferry-chip-skipped {
    background: rgba(245, 239, 216, 0.95);
    color: #8a6c18;
}

.ferry-chip-cancelled {
    background: rgba(238, 233, 233, 0.95);
    color: #75808b;
}

.ferry-companion-panel .ferry-write-card {
    max-height: calc(72vh - 80px);
    overflow-y: auto;
}

.ferry-companion-subtitle {
    margin-bottom: 12px;
}

.ferry-companion-section .ferry-section-head h3 {
    font-size: 16px;
}

.ferry-companion-edit-btn {
    flex: 1 1 100%;
}

.ferry-companion-cancel-btn {
    color: #5e6670;
}

.ferry-companion-archive-btn {
    color: #5e6670;
}

.ferry-companion-actions.is-pending {
    align-items: stretch;
}

.ferry-companion-actions.is-pending .ferry-companion-done-btn {
    order: 1;
    flex: 1 1 100%;
}

.ferry-companion-actions.is-pending .ferry-companion-edit-btn,
.ferry-companion-actions.is-pending .ferry-companion-cancel-btn,
.ferry-companion-actions.is-pending .ferry-secondary-btn:not(.ferry-companion-done-btn) {
    order: 2;
    flex: 1 1 calc(33.333% - 6px);
    min-width: 88px;
}

.ferry-companion-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 14px;
}

.ferry-filter-chip {
    border: 1px solid rgba(116, 132, 149, 0.18);
    background: rgba(255, 255, 255, 0.9);
    color: #5c6672;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
    line-height: 1;
}

.ferry-filter-chip.is-active {
    background: rgba(218, 231, 244, 0.92);
    color: #3f647f;
    border-color: rgba(112, 146, 179, 0.32);
}

.ferry-companion-card.is-reminder {
    background: #f3f9ff;
    border-left: 3px solid rgba(91, 148, 199, 0.42);
}

.ferry-companion-card.is-note {
    background: #fff8eb;
    border-left: 3px solid rgba(190, 151, 84, 0.34);
}

.ferry-companion-card.is-stash {
    background: #eef8f7;
    border-left: 3px solid rgba(74, 145, 140, 0.38);
}

.ferry-memo-type-card {
    display: grid;
    gap: 14px;
}

.ferry-memo-type-grid {
    display: grid;
    gap: 10px;
}

.ferry-memo-type-btn {
    border: 1px solid rgba(116, 132, 149, 0.18);
    background: rgba(255, 255, 255, 0.96);
    color: #43515f;
    border-radius: 16px;
    min-height: 48px;
    padding: 12px 14px;
    text-align: left;
    font-size: 15px;
}

.ferry-companion-form-grid.is-reminder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ferry-companion-form-grid:not(.is-reminder) {
    grid-template-columns: 1fr;
}

.ferry-companion-actions:not(.is-pending) .ferry-companion-edit-btn,
.ferry-companion-actions:not(.is-pending) .ferry-companion-archive-btn {
    flex: 1 1 calc(50% - 4px);
}


.ferry-companion-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.ferry-companion-inline-hint {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    line-height: 1.45;
}

.ferry-companion-toolbar .ferry-refresh-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    min-width: auto;
}

.ferry-memo-type-btn {
    transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.ferry-memo-type-btn:active {
    transform: scale(0.985);
    background: rgba(242, 246, 249, 0.98);
    border-color: rgba(116, 132, 149, 0.28);
}

.ferry-companion-form-grid label {
    display: grid;
    gap: 7px;
}

.ferry-companion-form-grid label[hidden],
.ferry-companion-reminder-row[hidden] {
    display: none !important;
}
