:root{color-scheme: light;--bg-page: #fcfcfc;--bg-surface: #fff;--bg-layout: #e7e7e9;--hl-memo: #fff8d6;--hl-bar: #dbeafe;--text-primary: #252525;--text-secondary: #666;--text-muted: #999;--border-color: #ddd;--sb-thumb: rgba(0,0,0,.35);--sb-thumb-active: #2563eb;}@media (prefers-color-scheme: dark){:root{--bg-page: #030303;--bg-surface: #242527;--bg-layout: #2f2f31;--hl-memo: #3b3520;--hl-bar: #1e3556;--text-primary: #dadada;--text-secondary: #aaa;--text-muted: #888;--border-color: #3a3b3d;--sb-thumb: rgba(255,255,255,.4);--sb-thumb-active: #60a5fa;}}.custom-scroll{scrollbar-width: none;}.custom-scroll::-webkit-scrollbar{display: none;}.sb-thumb{position: fixed;width: 16px;z-index: 60;opacity: 0;pointer-events: none;transition: opacity .2s ease;touch-action: none;}.sb-thumb.visible{opacity: 1;pointer-events: auto;}.sb-thumb::before{content: '';position: absolute;right: 2px;top: 0;bottom: 0;width: 3px;border-radius: 3px;background: var(--sb-thumb);transition: width .12s ease,background .12s ease;}.sb-thumb.dragging::before{width: 5px;background: var(--sb-thumb-active);}html{height: 100%;background: var(--bg-page);overflow: hidden;overscroll-behavior: none;}body{margin: 0 auto;padding: 0;font-family: system-ui,sans-serif;background: var(--bg-page);overflow: hidden;-webkit-tap-highlight-color: transparent;display: flex;flex-direction: column;height: 100vh;height: 100dvh;box-sizing: border-box;overscroll-behavior: none;user-select: none;-webkit-user-select: none;-webkit-touch-callout: none;max-width: 450px;position: relative;transform: translateZ(0);}#topbar-title,[contenteditable="true"],input,textarea{user-select: text;-webkit-user-select: text;-webkit-touch-callout: default;}#top-bar{flex: none;display: flex;align-items: center;gap: 10px;padding: 10px 16px;background: var(--bg-page);border-bottom: 1px solid var(--border-color);}#topbar-cancel{font: inherit;font-size: 16px;border: none;background: none;color: #666;cursor: pointer;width: 28px;height: 28px;border-radius: 50%;flex: none;}#topbar-cancel:hover{background: #f2f2f2;}#topbar-title{flex: 1;outline: none;font-weight: 600;caret-color: #2563eb;color: var(--text-primary);font-size: 19px;}#topbar-sidebar-toggle{font: inherit;font-size: 16px;border: none;background: none;color: var(--text-primary);cursor: pointer;width: 32px;height: 32px;border-radius: 8px;flex: none;}#main-view{position: relative;flex: 1;overflow-y: auto;overflow-x: hidden;padding: 0 2.5%;box-sizing: border-box;background: var(--bg-layout);}#memo-list{background: var(--bg-page);min-height: 100%;box-sizing: border-box;padding: 0 4.35%;}#main-view-dim{position: absolute;inset: 0;background: rgba(0,0,0,.25);pointer-events: none;z-index: 24;}#sidebar[hidden]{display: none;}#sidebar{position: fixed;top: 0;right: 0;bottom: 0;width: min(280px,80%);background: var(--bg-page);color: var(--text-primary);border-left: 1px solid var(--border-color);box-shadow: -4px 0 14px rgba(0,0,0,.12);z-index: 25;padding: 16px;box-sizing: border-box;display: flex;flex-direction: column;}.sidebar-header{display: flex;justify-content: flex-end;margin-bottom: 8px;}#sidebar-settings{font: inherit;font-size: 16px;border: none;background: none;color: var(--text-primary);cursor: pointer;width: 32px;height: 32px;border-radius: 8px;}.sidebar-menu-button{display: block;width: 100%;text-align: left;font: inherit;font-size: 14px;padding: 10px 8px;border: none;background: none;color: var(--text-primary);cursor: pointer;border-radius: 6px;}.sidebar-menu-button:hover{background: rgba(128,128,128,.15);}.sidebar-divider{border: none;border-top: 1px solid var(--border-color);margin: 8px 0;}#file-view{flex: 1;overflow-y: auto;overflow-x: hidden;display: flex;flex-direction: column;}#file-view-title{font-weight: 600;font-size: 13px;color: var(--text-secondary);margin-bottom: 6px;}#file-view-title:empty{display: none;}.queue-clear-button{font: inherit;font-size: 12px;padding: 6px 10px;border: 1px solid var(--border-color);border-radius: 6px;background: var(--bg-surface);color: var(--text-primary);cursor: pointer;margin-bottom: 8px;}.queue-list{display: flex;flex-direction: column;gap: 4px;}.queue-item{display: flex;align-items: center;justify-content: space-between;gap: 8px;padding: 6px 8px;border: 1px solid var(--border-color);border-radius: 6px;font-size: 12px;}.queue-item-name{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}.queue-item-check{color: #2a8a3e;font-weight: 600;flex: none;}.queue-item-abort{color: #b45309;flex: none;}.queue-item-attempt{color: #666;flex: none;display: inline-block;animation: sync-spin 1s linear infinite;}#drive-settings-overlay{position: fixed;inset: 0;display: none;z-index: 30;background: rgba(0,0,0,0.35);align-items: center;justify-content: center;padding: 20px;}#drive-settings-overlay.open{display: flex;}.drive-settings-title{margin: 0 0 10px;font-size: 16px;}#drive-status{font-size: 13px;color: #444;margin-bottom: 14px;}#drive-pick-folder-btn:disabled{opacity: .5;cursor: default;}.drive-duration-label{font-size: 12px;color: #666;margin-bottom: 4px;}.drive-duration-toggle{display: inline-flex;gap: 8px;flex-wrap: wrap;margin-bottom: 14px;}.drive-duration-option{font: inherit;padding: 6px 14px;border: 1px solid #999;border-radius: 999px;background: #fff;color: #666;cursor: pointer;}.drive-duration-option.selected{background: #333;color: #fff;border-color: #333;}#backup-overlay{position: fixed;inset: 0;display: none;z-index: 31;box-sizing: border-box;background: rgba(0,0,0,0.35);align-items: center;justify-content: center;padding: 20px;}#backup-overlay.open{display: flex;}#backup-box{overflow-x: hidden;word-break: break-word;overflow-wrap: anywhere;}#backup-title{margin: 0 0 8px;font-size: 16px;}#backup-message{font-size: 13px;color: #444;white-space: pre-wrap;}#backup-cancel-btn[hidden]{display: none;}#sync-message-overlay{position: fixed;inset: 0;display: none;z-index: 30;box-sizing: border-box;background: rgba(0,0,0,0.35);align-items: center;justify-content: center;padding: 20px;}#sync-message-overlay.open{display: flex;}#sync-message-overlay.with-view{align-items: flex-end;padding: 32px 0 0;background: rgba(0,0,0,0.5);}#sync-message-box{width: 100%;max-width: min(420px,100%);max-height: 100%;box-sizing: border-box;overflow-x: hidden;overflow-y: auto;background: #fff;border-radius: 12px;padding: 16px;display: flex;flex-direction: column;word-break: break-word;overflow-wrap: anywhere;}#sync-message-overlay.with-view #sync-message-box{max-width: 100%;height: 100%;border-radius: 12px 12px 0 0;}#sync-message-title{margin: 0 0 6px;font-size: 16px;}#sync-message-code{font-size: 12px;color: #666;margin-bottom: 8px;}#sync-message-text{font-size: 13px;color: #444;white-space: pre-wrap;}#sync-message-overlay.with-view .sync-message-head{flex: none;margin-bottom: 8px;}.memo-card{position: relative;width: 100%;box-sizing: border-box;background: var(--bg-page);border: none;border-radius: 0;margin: 8px 0;overflow: visible;font-size: 17px;line-height: 1.6;cursor: pointer;transition: background 1.2s ease,opacity .2s ease;}.memo-card.new-highlight,.memo-card.journey-highlight,.memo-card.editing-highlight{background: var(--hl-memo);}.view-field{margin-bottom: 8px;word-break: break-word;overflow-wrap: anywhere;}.view-field:last-child{margin-bottom: 0;}.view-field .field-name{color: var(--text-primary);user-select: none;-webkit-user-select: none;}.view-field .field-value{color: var(--text-primary);white-space: pre-wrap;}.view-field .field-value a{color: #2563eb;}.image-slider{width: 100%;margin: 6px 0 10px;}.image-slider-track{display: flex;overflow-x: auto;scroll-snap-type: x mandatory;scrollbar-width: none;}.image-slider-track::-webkit-scrollbar{display: none;}.image-slider-slide{position: relative;flex: 0 0 100%;scroll-snap-align: start;width: 100%;aspect-ratio: 4 / 3;background: #ddd;}.image-slider-slide img{width: 100%;height: 100%;object-fit: cover;display: block;}.image-slider-dots{display: flex;justify-content: center;gap: 6px;margin-top: 6px;}.image-slider-dot{width: 6px;height: 6px;border-radius: 50%;background: var(--border-color);}.image-slider-dot.active{background: var(--text-secondary);}.format-toggle{display: inline-flex;gap: 8px;flex-wrap: wrap;vertical-align: middle;}.format-option{font: inherit;padding: 6px 14px;border: 1px solid #999;border-radius: 999px;background: #fff;color: #666;cursor: pointer;}.format-option.selected{background: #333;color: #fff;border-color: #333;}.photo-delete{position: absolute;top: 2px;right: 2px;width: 18px;height: 18px;border-radius: 50%;border: none;background: rgba(0,0,0,.55);color: #fff;font-size: 12px;line-height: 1;cursor: pointer;padding: 0;}.q-value-with-photo-add{padding-right: 32px;}.photo-add-btn{position: absolute;right: 0;top: 50%;transform: translateY(-50%);width: 26px;height: 26px;padding: 3px;border-radius: 50%;border: none;background: transparent;cursor: pointer;color: var(--text-muted);}.photo-add-btn svg{width: 100%;height: 100%;display: block;}.photo-add-btn:disabled{opacity: .4;cursor: default;}.photo-add-menu{position: absolute;top: calc(100% + 4px);right: 0;z-index: 5;display: flex;flex-direction: column;align-items: stretch;min-width: 160px;background: var(--bg-surface);border: 1px solid var(--border-color);border-radius: 10px;box-shadow: 0 4px 14px rgba(0,0,0,.18);padding: 4px;box-sizing: border-box;}.photo-add-menu-item{display: block;width: 100%;text-align: left;font: inherit;font-size: 14px;padding: 8px 10px;border: none;background: none;color: var(--text-primary);cursor: pointer;border-radius: 6px;white-space: nowrap;}.photo-add-menu-item:hover{background: rgba(128,128,128,.15);}.journey-row{position: relative;}.journey-row.connected::before{content: '';position: absolute;left: 50%;top: 0;bottom: 0;width: 1px;background: #bbb;transform: translateX(-0.5px);z-index: 0;}.list-bar{position: relative;margin: 0;padding: 0;box-sizing: border-box;overflow: hidden;white-space: nowrap;cursor: pointer;font: inherit;font-size: 17px;line-height: 1.6;color: var(--text-primary);user-select: none;-webkit-user-select: none;}.list-bar-active{background: var(--hl-bar);}.list-bar-move-target{background: var(--hl-bar);}#journey-join-banner,#move-banner{padding: 8px 12px;margin: 10px 12px;background: #333;color: #fff;border-radius: 10px;font-size: 13px;text-align: center;}.journey-selection-collapsed-row{display: flex;justify-content: center;padding: 4px 0;}.journey-selection-collapsed-badge{width: 30px;height: 30px;border-radius: 50%;border: 1px solid #999;background: #eee;color: #555;font-size: 12px;cursor: pointer;display: flex;align-items: center;justify-content: center;}.select-badge{position: absolute;top: 2px;left: 2.5%;width: 22px;height: 22px;border-radius: 50%;background: #fff;border: 2px solid #999;color: transparent;font-size: 13px;display: flex;align-items: center;justify-content: center;z-index: 1;box-shadow: 0 1px 4px rgba(0,0,0,.3);box-sizing: border-box;}.select-badge-checked{background: #333;border-color: #333;color: #fff;}.file-state-badge{position: absolute;top: 6px;right: 6px;font-size: 14px;line-height: 1;z-index: 1;}.file-state-badge-queued{color: #666;}.file-state-badge-cloned{color: #2a8a3e;}.file-state-badge-synced{color: #2563eb;}.file-state-badge-unsynced{color: #b45309;}.file-state-badge-changed{color: #b91c1c;}#context-menu,#context-submenu{position: fixed;bottom: 14px;display: none;z-index: 40;max-width: 90%;width: max-content;background: #fff;border-radius: 16px;box-shadow: 0 4px 18px rgba(0,0,0,.22);padding: 8px 10px;box-sizing: border-box;scrollbar-width: none;}#context-menu::-webkit-scrollbar,#context-submenu::-webkit-scrollbar{display: none;}#context-menu{left: 50%;transform: translateX(-50%);flex-direction: row;align-items: center;gap: 10px;overflow-x: auto;white-space: nowrap;}#context-submenu{flex-direction: column;align-items: stretch;gap: 2px;max-height: 60vh;overflow-y: auto;min-width: 200px;}.menu-group-title{flex: none;padding: 0 4px;font-size: 11px;color: #999;user-select: none;}.menu-action{flex: none;display: flex;flex-direction: column;align-items: center;gap: 2px;padding: 6px 10px;border: none;border-radius: 10px;background: none;font-size: 13px;cursor: pointer;white-space: nowrap;}.menu-action:hover{background: #f2f2f2;}.menu-action-icon{display: flex;}.menu-action-icon svg{width: 20px;height: 20px;display: block;}.menu-action-label{font-size: 10px;line-height: 1;color: #333;}.menu-divider{flex: none;align-self: stretch;width: 1px;margin: 2px 4px;background: #ddd;}.menu-list-action{display: block;width: 100%;text-align: left;font: inherit;font-size: 14px;padding: 10px 12px;border: none;background: none;color: #111;cursor: pointer;border-radius: 8px;white-space: nowrap;}.menu-list-action:hover{background: #f2f2f2;}#form-overlay,#edit-overlay{position: fixed;inset: 0;display: none;z-index: 30;background: rgba(0,0,0,0.35);align-items: center;justify-content: center;padding: 20px;}#form-overlay.open,#edit-overlay.open{display: flex;}.memo-form-box{width: 100%;max-width: 420px;max-height: calc(100vh - 40px);overflow-y: auto;background: var(--bg-surface);border-radius: 12px;padding: 16px;box-sizing: border-box;color: var(--text-primary);}.qform-box{width: 90%;max-width: 90%;max-height: 75vh;scrollbar-width: none;}.qform-box::-webkit-scrollbar{display: none;}.qform-fields{display: flex;flex-direction: column;gap: 44px;}.q-card{display: flex;flex-direction: column;}.q-name{font-weight: 400;color: var(--text-primary);}.q-desc{font-style: italic;font-size: 12px;color: var(--text-muted);margin-top: 2px;}.q-value{margin-top: 6px;padding: 4px 2px 6px;border: none;border-bottom: 1px solid #999;color: var(--text-primary);min-height: 1.4em;line-height: 1.5;word-break: break-word;overflow-wrap: anywhere;outline: none;caret-color: #2563eb;}.q-value.multiline{min-height: 1.4em;white-space: pre-wrap;}.q-value:empty::before{content: attr(data-placeholder);color: var(--text-muted);}.q-value a{color: #2563eb;}.q-format-card .q-name{margin-bottom: 6px;}.q-value-wrap{position: relative;}.q-value-with-gps{padding-right: 32px;}.region-gps-btn{position: absolute;right: 0;top: 50%;transform: translateY(-50%);width: 26px;height: 26px;padding: 3px;border-radius: 50%;border: none;background: transparent;cursor: pointer;color: var(--text-muted);}.region-gps-btn svg{width: 100%;height: 100%;display: block;}.region-gps-btn:disabled{opacity: .4;cursor: default;}.region-gps-denied-notice{position: absolute;right: 0;top: calc(100% + 4px);max-width: 220px;font-size: 11px;line-height: 1.4;color: #b91c1c;text-align: right;}.form-replace-notice{color: #2a8a3e;font-size: 12px;margin-top: 10px;}.form-actions{display: flex;justify-content: flex-end;gap: 8px;margin-top: 14px;}.form-actions button{font: inherit;padding: 7px 16px;border-radius: 8px;border: 1px solid #999;background: #fff;color: #333;cursor: pointer;}.form-actions button.primary{background: #333;color: #fff;border-color: #333;}.confirm-overlay{position: fixed;inset: 0;z-index: 35;background: rgba(0,0,0,0.35);display: flex;align-items: center;justify-content: center;padding: 20px;}.confirm-box{width: 100%;max-width: 320px;background: var(--bg-surface);color: var(--text-primary);border-radius: 12px;padding: 16px;box-sizing: border-box;}.confirm-message{font-size: 14px;line-height: 1.5;}.confirm-actions{display: flex;justify-content: flex-end;gap: 8px;margin-top: 14px;}.confirm-actions button{font: inherit;padding: 7px 16px;border-radius: 8px;border: 1px solid #999;background: #fff;color: #333;cursor: pointer;}.confirm-actions button.primary{background: #333;color: #fff;border-color: #333;}.confirm-actions.choice-actions{flex-direction: column;align-items: stretch;}.confirm-actions.choice-actions button{padding: 10px 12px;text-align: left;}.sync-list{display: flex;flex-direction: column;gap: 4px;}.sync-item{display: flex;align-items: center;justify-content: space-between;gap: 8px;padding: 6px 8px;border: 1px solid var(--border-color);border-radius: 6px;font-size: 12px;cursor: pointer;}.sync-item-name{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}.sync-item-icon{flex: none;font-size: 14px;line-height: 1;}.sync-item-icon-abort{color: #b45309;}.sync-item-icon-caution{color: #b91c1c;}.sync-item-icon-success{color: #2a8a3e;}.sync-item-icon-attempt{color: #666;display: inline-block;animation: sync-spin 1s linear infinite;}@keyframes sync-spin{from{transform: rotate(0deg);}to{transform: rotate(360deg);}}#merge-view{flex: 1;min-height: 0;display: flex;flex-direction: column;width: 100%;}#merge-view[hidden]{display: none;}.merge-title{margin: 0 0 8px;font-size: 15px;text-align: center;flex: none;}.merge-body{flex: 1;min-height: 0;display: flex;align-items: stretch;gap: 4px;}.merge-nav-btn{flex: none;align-self: center;width: 26px;height: 44px;padding: 0;font: inherit;font-size: 13px;border-radius: 6px;border: 1px solid #999;background: #fff;cursor: pointer;}.merge-nav-btn:disabled{opacity: .3;cursor: default;}.merge-panes{flex: 1;min-width: 0;display: flex;flex-direction: column;gap: 8px;}.merge-pane{position: relative;flex: 1 1 0;min-height: 110px;display: flex;flex-direction: column;min-width: 0;border: 1px solid #ddd;border-radius: 8px;overflow: hidden;}.merge-pane-disabled .merge-pane-header span,.merge-pane-disabled .line-editor{opacity: .45;}.merge-pane-header{display: flex;align-items: center;justify-content: space-between;padding: 6px 8px;font-size: 12px;font-weight: 600;background: #f6f6f4;flex: none;}.merge-kind{font-weight: 400;color: #888;}.merge-disable-btn{position: absolute;top: 4px;right: 6px;z-index: 1;font: inherit;font-size: 11px;width: 18px;height: 18px;border-radius: 50%;border: 1px solid #c33;background: #fff;color: #c33;cursor: pointer;line-height: 1;padding: 0;}.line-editor{flex: 1;min-height: 0;overflow-y: auto;overflow-x: hidden;font-family: ui-monospace,monospace;font-size: 12px;}.line-editor-readonly{user-select: text;-webkit-user-select: text;}.editor-line{display: flex;align-items: flex-start;}.line-num{flex: none;width: 2.2em;text-align: right;padding: 2px 6px 2px 0;color: #aaa;user-select: none;-webkit-user-select: none;}.line-content{flex: 1;white-space: pre-wrap;word-break: break-word;padding: 2px 4px;outline: none;min-height: 1.4em;caret-color: #2563eb;}.editor-line.diff-added .line-content{background: #dcfce7;}.editor-line.diff-removed .line-content{background: #fee2e2;}.merge-footer{flex: none;display: grid;grid-template-columns: 1fr auto 1fr;align-items: center;gap: 8px;margin-top: 10px;}#merge-page-indicator{font-size: 13px;text-align: center;white-space: nowrap;}#merge-complete-btn{justify-self: end;white-space: nowrap;font: inherit;padding: 8px 16px;border-radius: 8px;border: 1px solid #333;background: #333;color: #fff;cursor: pointer;}#merge-complete-btn:disabled{opacity: .5;cursor: default;}.merge-error{flex: none;margin-top: 8px;font-size: 13px;color: #b91c1c;}.merge-error[hidden]{display: none;}