:root{font-family:Segoe UI,Arial,sans-serif;color:#283b35;background:#edf0e8}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:linear-gradient(130deg,#f4f2eb,#e5ebe2);background-attachment:fixed}button,input,textarea{font:inherit}button{cursor:pointer;border:0;border-radius:6px;padding:12px 18px;min-height:44px;font-size:15px;color:inherit}button:disabled{opacity:.45;cursor:default}button:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid #927640;outline-offset:3px}.primary{background:#355d46;color:white}.primary:hover{background:#244732}.secondary{background:#fafbf7;border:1px solid #bbc7b6}.quiet{background:transparent}.quiet:hover{background:#dce4d8}header{height:76px;display:flex;align-items:center;padding:0 32px;border-bottom:1px solid #d5ddcf;background:#f8faf3a6}main{padding:28px 32px;max-width:1600px;margin:auto}.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:20px}.photo-card{background:#fffefa;border:1px solid #d4dccd;padding:9px;text-align:left;box-shadow:0 3px 9px #273a3009}.photo-card:hover{box-shadow:0 5px 15px #273a3018}.photo-card img{display:block;width:100%;height:210px;object-fit:contain;background:#e8eae2}.card-name{display:block;font-size:13px;padding:12px 3px 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status{display:inline-block;font-size:11px;padding:4px 8px;background:#edf0e8;color:#607056;border-radius:12px}.status.has-notes{background:#dce8d4;color:#34573a}#empty{color:#6a7463;text-align:center;margin-top:60px}.upload-panel{max-width:620px;margin:45px auto;padding:30px;background:#fbfcf7;border:1px solid #d5ddcd;border-radius:10px}h1{font-size:25px;font-weight:500;margin:0 0 26px}.upload-options{display:flex;gap:12px;flex-wrap:wrap}.upload-options button{flex:1;min-width:190px}#dropzone{margin-top:25px;padding:32px;text-align:center;border:1px dashed #9daa91;border-radius:6px;color:#62725c}#dropzone.dragging{background:#e0ead8;border:2px solid #355d46}.muted{font-size:13px;color:#66735e;line-height:1.6}details{border-top:1px solid #d7ddcf;padding-top:18px;margin-top:25px;font-size:13px}summary{cursor:pointer;padding:10px 0}details button{font-size:13px;margin-top:10px}#storage-status{font-size:14px}#message{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);max-width:90vw;padding:14px 22px;background:#283b35;color:white;border-radius:7px;z-index:10;font-size:14px;line-height:1.5}dialog{width:96vw;max-width:1550px;height:92vh;max-height:92vh;padding:0;border:0;border-radius:9px;background:#f2f4ed;color:#283b35}dialog::backdrop{background:#172b24b8}.viewer-head{height:76px;padding:14px 20px;border-bottom:1px solid #d7dece;display:flex;align-items:center;justify-content:space-between;gap:15px}.viewer-head h2{font-size:16px;font-weight:500;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.viewer-nav{display:flex;align-items:center;gap:8px;flex-shrink:0}#photo-index{font-size:12px;min-width:40px;text-align:center}.viewer-nav .secondary{padding:8px 14px}.viewer-body{display:grid;grid-template-columns:minmax(0,1fr) 340px;height:calc(100% - 76px)}.photo-pane{padding:16px;display:flex;flex-direction:column;min-height:0}.photo-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;color:#607056;margin-bottom:10px}.photo-tools button{font-size:13px}.photo-scroll{flex:1;min-height:180px;display:flex;align-items:center;justify-content:center;overflow:auto;background:#e0e5d9;border-radius:5px;padding:18px}.photo-stage{position:relative;max-width:100%;line-height:0;flex-shrink:0}.photo-stage>img{display:block;max-width:100%;max-height:calc(92vh - 185px);height:auto;cursor:crosshair}.photo-scroll.zoomed{display:block}.photo-scroll.zoomed .photo-stage{max-width:none;width:max-content;margin:auto}.photo-scroll.zoomed img{max-width:none;max-height:none}#connections{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}#connections line{stroke:#fffaf0;stroke-width:2;vector-effect:non-scaling-stroke;filter:drop-shadow(0 1px 1px #243c32)}#connections circle{fill:#fffaf0;stroke:#355d46;stroke-width:1;vector-effect:non-scaling-stroke}.marker{position:absolute;transform:translate(-50%,-50%);width:34px;height:34px;min-height:0;border-radius:50%;background:#fffdf4;color:#355d46;border:2px solid #355d46;box-shadow:0 2px 5px #0004;padding:0;font-size:13px;font-weight:600;line-height:30px;touch-action:none;cursor:grab;user-select:none}.marker:active{cursor:grabbing}.marker.selected{background:#355d46;color:white;border-color:white;outline:2px solid #355d46}.marker.draft{background:#ead7a5}.notes-pane{background:#fffefa;border-left:1px solid #d7dece;padding:24px;overflow:auto}form{margin-bottom:26px}form label{display:flex;align-items:center;justify-content:space-between;font-size:17px;margin-bottom:12px}textarea{width:100%;font-size:16px;line-height:1.6;color:#283b35;border:1px solid #b8c5ae;background:white;border-radius:5px;padding:12px;resize:vertical;min-height:180px}.form-actions{display:flex;gap:8px;margin-top:14px}.form-actions .primary{flex:1;font-weight:600;letter-spacing:1px}.letter{display:inline-grid;place-items:center;min-width:28px;height:28px;border-radius:50%;background:#e3ebdb;color:#355d46;font-size:13px}.note{border:1px solid #d7dece;padding:14px;border-radius:5px;margin-bottom:12px}.note.active{background:#f0f5e9;border-color:#355d46}.note-select{background:transparent;padding:0;min-height:32px}.note-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px;line-height:1.65;margin:12px 0}.note-actions{display:flex;gap:6px}.note-actions button{font-size:12px;padding:7px 10px;min-height:36px}[hidden]{display:none!important}@media(max-width:800px){header{padding:0 18px}main{padding:20px 18px}.gallery{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px}.photo-card img{height:170px}.viewer-body{display:block;height:auto}.photo-scroll{max-height:55vh}.photo-stage>img{max-height:45vh}.notes-pane{border-left:0;border-top:1px solid #d7dece}.viewer-head{height:auto;min-height:76px;flex-wrap:wrap}.viewer-head h2{width:100%}.viewer-nav{width:100%}.viewer-nav #close-viewer{margin-left:auto}.upload-panel{padding:22px;margin-top:25px}.photo-tools{font-size:12px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* Photo detail is a normal page, with compact memo previews. */
#viewer{max-width:1600px;padding:20px 32px;margin:auto;width:auto;height:auto;background:transparent}
#viewer .viewer-head{padding:0 0 16px;height:60px}
#viewer .viewer-body{height:calc(100vh - 176px);min-height:450px;border:1px solid #d7dece;border-radius:7px;overflow:hidden}
.note.compact{max-width:235px;padding:10px;display:flex;gap:10px;align-items:center;cursor:pointer}
.note.compact .note-text{margin:0;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:13px;line-height:1.5;min-width:0}
.note.expanded{width:100%}
.note:focus-visible{outline:3px solid #927640;outline-offset:3px}
.add-tag{display:flex;align-items:center;gap:12px;width:100%;padding:14px 10px;background:transparent;text-align:left;border:1px dashed #aab99e}
.add-tag:hover{background:#edf3e6}
.add-plus{font-size:38px;line-height:1;font-weight:300}
.add-tag .letter{margin-left:auto}
@media(max-width:800px){#viewer{padding:16px 18px}#viewer .viewer-head{height:auto}#viewer .viewer-body{height:auto;overflow:visible;min-height:0}.note.compact{max-width:260px}}

/* Prominent photo controls. */
#viewer .viewer-head{height:auto;min-height:70px;display:flex;gap:18px;align-items:center;flex-wrap:wrap}
#viewer .viewer-head h2{flex:1;width:auto}
#viewer .gallery-back{font-size:20px;font-weight:750;min-height:56px;padding:15px 24px;flex-shrink:0}
#viewer .tag-toggle{font-size:19px;font-weight:700;min-height:56px;padding:15px 24px;color:#355d46;border:2px solid #355d46;background:#f7faf1}
#viewer .tag-toggle[aria-pressed=true]{background:#355d46;color:white}
#viewer .viewer-nav{width:100%;display:flex;justify-content:space-between;align-items:center;gap:15px;padding:18px 0}
#viewer .photo-navigation{font-size:21px;font-weight:700;min-height:60px;padding:14px 26px;display:flex;align-items:center;gap:20px}
#viewer .photo-navigation span{font-size:34px;line-height:1}
#viewer #photo-index{font-size:16px}
#viewer .viewer-body{height:calc(100vh - 280px)}
.add-tag{background:#355d46;color:white;font-weight:750;border:2px solid #355d46;font-size:18px}
.add-tag:hover{background:#244732;border-color:#244732}
.add-plus{color:#ffe4a3;font-size:46px;font-weight:800}
.add-tag .letter{background:#eff5e7;color:#355d46;font-weight:750}
@media(max-width:800px){#viewer .viewer-body{height:auto}#viewer .viewer-head h2{order:3;flex-basis:100%}#viewer .tag-toggle{margin-left:auto}#viewer .gallery-back,#viewer .tag-toggle{font-size:17px;padding:12px 16px}#viewer .photo-navigation{font-size:18px;padding:12px 18px;gap:10px}}
@media(max-width:420px){#viewer .viewer-head{gap:10px}#viewer .gallery-back,#viewer .tag-toggle{font-size:15px;padding:12px}#viewer .photo-navigation{font-size:16px;padding:10px 14px}}

/* Navigation above filename and tag visibility. */
#viewer .viewer-control-row{display:flex;align-items:center;gap:16px;padding-bottom:18px;border-bottom:1px solid #d7dece}
#viewer .viewer-control-row .gallery-back{margin-right:auto}
#viewer .viewer-head{padding:14px 0;min-height:78px;border-bottom:0;flex-wrap:nowrap}
#viewer .viewer-head h2{order:0;flex:1;width:auto}
#viewer .photo-tools{justify-content:flex-end}
@media(max-width:800px){#viewer .viewer-control-row{gap:8px}#viewer .viewer-control-row .gallery-back{margin-right:auto}#viewer .viewer-head h2{flex-basis:auto}#viewer .viewer-control-row .photo-navigation,#viewer .viewer-control-row .gallery-back{font-size:15px;padding:10px 12px;min-height:50px}#viewer .viewer-control-row .photo-navigation{gap:6px}#viewer .viewer-control-row .photo-navigation span{font-size:24px}}
@media(max-width:540px){#viewer .viewer-control-row{gap:5px}#viewer .viewer-control-row .gallery-back,#viewer .viewer-control-row .photo-navigation{font-size:12px;padding:8px;min-height:48px}#viewer .viewer-control-row .photo-navigation{gap:3px}#viewer .viewer-control-row .photo-navigation span{font-size:20px}#viewer .viewer-control-row #photo-index{font-size:11px;min-width:28px}#viewer .viewer-head h2{font-size:13px}}

/* Center photo navigation independently of the gallery button. */
#viewer .viewer-control-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto minmax(0,1fr);gap:16px}
#viewer .viewer-control-row .gallery-back{grid-column:1;justify-self:start;margin-right:0;background:#865735;color:#fff;white-space:nowrap}
#viewer .viewer-control-row .gallery-back:hover{background:#6b4227}
#viewer .viewer-control-row #previous-photo{grid-column:2}
#viewer .viewer-control-row #photo-index{grid-column:3}
#viewer .viewer-control-row #next-photo{grid-column:4}
@media(max-width:800px){#viewer .viewer-control-row{gap:8px}}
@media(max-width:650px){#viewer .viewer-control-row{grid-template-columns:minmax(0,1fr) auto auto auto minmax(0,1fr)}#viewer .viewer-control-row .gallery-back{grid-column:1 / -1;grid-row:1}#viewer .viewer-control-row #previous-photo,#viewer .viewer-control-row #photo-index,#viewer .viewer-control-row #next-photo{grid-row:2}}

header #logout{margin-left:auto}.login-input{display:block;width:100%;padding:12px;border:1px solid #b8c5ae;border-radius:5px;margin-bottom:22px;font:inherit}.login-submit{width:100%;margin-top:15px}

/* Fit the actual image box to the available photo area; tags share that box. */
#viewer .photo-pane{min-width:0;min-height:0}
#viewer .photo-scroll:not(.zoomed){overflow:hidden;align-items:center;justify-content:center}
#viewer .photo-stage{max-width:none;width:max-content;max-height:none}
#viewer .photo-stage>img{max-width:none;max-height:none;object-fit:contain}
@media(max-width:800px){#viewer .photo-scroll{flex:none;height:55vh;height:55dvh;max-height:none;min-height:180px}}

/* Memo status, zoom tools, and equal-size note actions. */
.photo-card.has-memos{border:3px solid #355d46;box-shadow:0 0 0 3px #d5e5c9,0 4px 10px #273a3018}
.photo-card.has-memos .status{background:#355d46;color:white;font-size:13px;font-weight:750;padding:6px 10px}
#viewer #zoom-photo{display:flex;align-items:center;gap:12px;font-size:22px;font-weight:750;min-height:60px;padding:12px 18px;background:#fffef8;border:2px solid #355d46;color:#355d46}
.loupe{width:36px;height:36px;flex-shrink:0}
#viewer .note.compact,#viewer .add-tag{width:235px;max-width:100%;min-height:80px;box-sizing:border-box;border-width:2px}
#viewer .add-tag{padding:10px;gap:8px;margin-bottom:12px}
#viewer .add-tag .add-plus{font-size:46px;flex-shrink:0}
#viewer .add-tag .letter{min-width:30px;flex-shrink:0}
#viewer .general-button{background:#865735;border-color:#865735}
#viewer .general-button:hover{background:#6b4227;border-color:#6b4227}
#viewer .note .letter{width:auto;padding:0 8px}

/* Compact single toolbar and viewport-sized photo workspace. */
body.photo-open{height:100dvh;overflow:hidden;display:flex;flex-direction:column}
body.photo-open>header{height:auto;min-height:60px;flex:0 0 auto;padding:8px 18px;gap:12px;flex-wrap:nowrap}
#photo-toolbar{display:flex;align-items:center;gap:12px;flex:1;min-width:0}
.toolbar-navigation{display:flex;align-items:center;justify-content:center;gap:12px;flex:1}
#photo-toolbar button{min-height:36px;padding:8px 14px;font-size:13px;font-weight:700;white-space:nowrap;display:flex;align-items:center;gap:10px}
#photo-toolbar .gallery-back{background:#865735;color:white}
#photo-toolbar .gallery-back:hover{background:#6b4227}
#photo-toolbar .photo-navigation span{font-size:21px;line-height:1}
#photo-toolbar #photo-index{font-size:13px;min-width:38px}
#photo-toolbar .tag-toggle{background:#f7faf1;border:1px solid #355d46;color:#355d46}
#photo-toolbar .tag-toggle[aria-pressed=true]{background:#355d46;color:white}
#photo-toolbar #zoom-photo{background:#fffef8;border:1px solid #355d46;color:#355d46}
#photo-toolbar .loupe{width:22px;height:22px}
body.photo-open #logout{font-size:13px;min-height:36px;padding:8px 12px;margin-left:0;white-space:nowrap}
body.photo-open #viewer{width:100%;max-width:none;flex:1;min-height:0;padding:8px 18px 14px;margin:0;display:flex;flex-direction:column}
.photo-filename{font-size:13px;font-weight:500;margin:0 0 8px;line-height:20px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:0 0 auto}
body.photo-open #viewer .viewer-body{height:auto;min-height:0;flex:1;overflow:hidden;display:grid;grid-template-columns:minmax(0,1fr) 290px}
body.photo-open .photo-pane{min-height:0;padding:12px}
body.photo-open #photo-scroll{height:auto;max-height:none;min-height:0;flex:1}
body.photo-open .notes-pane{min-height:0;overflow:auto;padding:18px}
@media(max-width:800px){body.photo-open>header{padding:6px 10px;gap:6px}#photo-toolbar{gap:6px}.toolbar-navigation{gap:6px}#photo-toolbar button{padding:7px 9px;font-size:12px;gap:5px}body.photo-open #viewer{padding:8px 10px 10px}body.photo-open #viewer .viewer-body{grid-template-columns:minmax(0,1fr) 250px}}
@media(max-width:600px){#photo-toolbar{gap:4px}.toolbar-navigation{gap:3px}#photo-toolbar button{font-size:10px;padding:6px 5px;gap:3px}#photo-toolbar .photo-navigation span{font-size:16px}#photo-toolbar .loupe{width:16px;height:16px}#photo-toolbar #photo-index{font-size:10px;min-width:26px}body.photo-open #logout{font-size:10px;padding:6px 5px}body.photo-open #viewer .viewer-body{grid-template-columns:minmax(0,1fr) 200px}body.photo-open .notes-pane{padding:10px}}
