/* Shared controls and dialog chrome. Loaded after each page's existing styles. */
:root{--control-height:44px;--control-radius:10px;--page-width:1800px}
.upcoming a{display:block;margin-top:10px;overflow-wrap:anywhere}.upcoming p{font-size:13px;margin-top:10px}
.recent-badge{display:inline-block;background:#fce5b3;color:#70400a;border-radius:5px;font-size:11px;font-weight:700;line-height:1.4;padding:2px 5px;margin-left:6px;white-space:nowrap}
.original-preview{display:block;max-width:100%;max-height:65dvh;object-fit:contain;margin:auto}
body dialog input[type=checkbox]{width:20px;height:20px;min-height:20px;vertical-align:middle}
.album-view-tools label{display:flex;align-items:center;gap:8px;margin:0}.album-view-tools select{width:auto;margin:0}
body .album-card .photo-modified,body .album-card .photo-size,body .album-card .photo-resolution,body .album-card .photo-type{display:none}
body .album-grid[data-view=small]{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}
body .album-grid[data-view=small] .image-button,body .album-grid[data-view=small] img{height:120px}
body .album-grid[data-view=list],body .album-grid[data-view=details]{display:block}
body .album-grid[data-view=list] .album-card{display:grid;grid-template-columns:64px minmax(100px,1fr) minmax(130px,1fr);align-items:center;margin-bottom:6px}
body .album-grid[data-view=details] .album-card{display:grid;grid-template-columns:64px minmax(120px,2fr) repeat(2,minmax(140px,1.4fr)) minmax(80px,.7fr) minmax(90px,.8fr) minmax(100px,1fr);align-items:center;margin-bottom:6px}
body .album-grid[data-view=list] .image-button,body .album-grid[data-view=list] img,body .album-grid[data-view=details] .image-button,body .album-grid[data-view=details] img{height:64px}
body .album-grid[data-view=details] .album-card p{display:block;padding:6px;margin:0}
body .album-grid[data-view=details] .photo-taken::before{content:'촬영일 · ';display:block}
body .album-grid[data-view=details] .photo-modified::before{content:'수정일 · ';display:block}
body .album-grid[data-view=details] .photo-size::before{content:'크기 · '}
body .album-grid[data-view=details] .photo-resolution::before{content:'해상도 · ';display:block}
body .album-grid[data-view=details] .photo-type::before{content:'형식 · ';display:block}
body .folder-grid[data-view=list],body .folder-grid[data-view=details]{grid-template-columns:repeat(auto-fit,minmax(250px,1fr))}
body .folder-grid[data-view=list] img,body .folder-grid[data-view=details] img{display:none}
@media(max-width:1100px){body .album-grid[data-view=details] .album-card{grid-template-columns:64px minmax(100px,1fr) minmax(100px,1fr)}body .album-grid[data-view=details] .album-card label{grid-column:2/-1}body .album-grid[data-view=details] .photo-taken{grid-column:1/-1}}
body button:where(:not(.image-button):not(.calendar-day):not(.event-row):not(.document-link)){min-height:var(--control-height);padding:9px 14px;border-radius:var(--control-radius);font-size:14px;line-height:1.5;vertical-align:middle}
body button.primary{background:var(--green,#23695c);color:#fff;border:1px solid transparent}
body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),body select{min-height:var(--control-height);font:inherit;line-height:1.5;border-radius:var(--control-radius);max-width:100%}
body input[type=file]{max-width:100%;min-width:0}
body .tools,body .actions,body .invite-actions,body .member-actions,body .profile-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
body .tools>button,body .actions>button,body .invite-actions>button,body .member-actions>button,body .profile-actions>button{margin-top:0;margin-bottom:0}
body .folder-card .tools button,body .comment button,body .side-menu button,body .member button{min-height:44px;padding:9px 14px;font-size:14px;line-height:1.5}
body .document-link{min-height:44px}
body .page-heading,body .section-heading{gap:12px;flex-wrap:wrap;align-items:center}
body header{height:auto;min-height:76px;gap:12px;flex-wrap:wrap;padding-top:12px;padding-bottom:12px;max-width:var(--page-width)}
body main.album-main,body main.family-layout,body main.workspace,body .family-shortcuts{max-width:var(--page-width);width:100%}
body .family-shortcuts{margin-bottom:16px}
body .family-layout{grid-template-columns:200px minmax(0,1fr);gap:24px}
body .album-intro{margin-bottom:12px}body .album-intro h1{margin-bottom:8px}
body .album-main .section-heading{margin:24px 0 12px}
body .album-grid{grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px;align-items:start}
body .folder-grid{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
body .album-card img,body .album-card .image-button{height:clamp(160px,16vw,250px);object-fit:contain}
body .folder-card img{object-fit:contain}
body .photo-grid{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}
body .photo-grid img{object-fit:contain;background:#edf1eb}
body .share-grid{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
body .panel,body .post{padding:20px}
body .selection-tools{position:static;padding:8px}
body dialog.family-dialog{padding:0;overflow:hidden;max-height:calc(100dvh - 24px);width:calc(100% - 24px);box-sizing:border-box}
body dialog.family-dialog[open]{display:flex;flex-direction:column}
body .dialog-bar{flex:0 0 auto;display:flex;justify-content:flex-end;background:#fafbf7;border-bottom:1px solid #e0e7dc;padding:4px 8px;z-index:1}
body button.dialog-x{width:44px;height:44px;min-height:44px;padding:0;font-size:28px;line-height:1;margin:0;display:grid;place-items:center;flex-shrink:0;border:1px solid #c5d5c8;color:#245c51;background:#fff}
body .dialog-body{flex:1 1 auto;min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;padding:16px;scrollbar-gutter:stable;overflow-wrap:anywhere}
body .family-dialog #message-text,body .family-dialog #confirm-text{max-height:none;overflow:visible}
body:has(dialog[open]){overflow:hidden}
body #viewer,body #editor,body #compare-dialog{max-width:1600px}
body #view-image{max-height:70dvh;width:100%;object-fit:contain}
body #edit-canvas{max-height:62dvh}
body #large-photo{max-height:72dvh;object-fit:contain}
body #view-name{margin-top:8px}
body #viewer .dialog-body>.tools:first-child{margin-top:0}
body .dialog-body fieldset{min-width:0}
body .dialog-body button{max-width:100%;overflow-wrap:anywhere}
@media(min-width:1100px){
 body #viewer .dialog-body{display:grid;grid-template-columns:minmax(0,1fr) 300px;column-gap:20px;align-items:start}
 body #viewer .dialog-body>.tools:first-child{grid-column:1/-1}
 body #view-image,body #view-fallback{grid-column:1;grid-row:2}
 body #viewer .photo-info{grid-column:2;grid-row:2;min-width:0}
}
@media(max-width:750px){
 body .family-layout{grid-template-columns:minmax(0,1fr);gap:16px}
 body .family-layout aside{padding-top:0}
 body main.album-main,body main.family-layout,body main.workspace{padding-left:10px;padding-right:10px}
 body .family-shortcuts{padding-left:10px!important;padding-right:10px!important}
 body .album-grid,body .folder-grid,body .photo-grid,body .share-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 body .folder-card{padding:8px}body .folder-card .tools{gap:4px}
 body .album-card img,body .album-card .image-button{height:clamp(130px,32vw,220px)}
 body .panel,body .post{padding:14px}
 body .dialog-body{padding:12px}
 body dialog.family-dialog{width:calc(100% - 12px);max-height:calc(100dvh - 12px)}
 body .dialog-body .tools{gap:6px}
 body .edit-controls fieldset{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-height:500px){body .dialog-bar{padding:2px 6px}body #view-image,body #edit-canvas{max-height:calc(100dvh - 156px)}}

/* Album thumbnails follow the original proportions; spare columns stay empty. */
body .album-view-tools{gap:10px 16px;margin:10px 0 14px}
body .album-view-tools label{font-family:inherit;font-size:14px;line-height:1.5;gap:6px}
body .album-view-tools select{font-family:inherit;font-size:14px;font-weight:400;letter-spacing:normal;line-height:1.5;color:var(--ink);background-color:#fff;border:1px solid #becfc3;padding:8px 10px;min-height:44px}
body .album-view-tools option{font-family:inherit;font-size:14px;font-weight:400}
body .album-grid:not([data-view=list]):not([data-view=details]) .image-button{height:auto;min-height:0;line-height:0;background:transparent}
body .album-grid:not([data-view=list]):not([data-view=details]) .image-button img{display:block;width:100%;height:auto;object-fit:contain}
body .album-grid:not([data-view=list]):not([data-view=details]) .album-card{border-radius:10px}
body .album-grid:not([data-view=list]):not([data-view=details]) .album-card label{display:flex;align-items:center;gap:6px;padding:5px 8px 0;min-height:32px;font-size:12px;line-height:1.4}
body .album-card .photo-filename{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body .album-card label input{flex-shrink:0;margin:0}
body .album-grid:not([data-view=list]):not([data-view=details]) .photo-taken{margin:0;padding:0 8px 7px 34px;font-size:11px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#748078}
body .album-grid:not([data-view=list]):not([data-view=details]) .recent-badge{margin-left:auto;flex-shrink:0;font-size:10px}

body #event-form .check-label{display:inline-flex;width:fit-content;gap:8px;align-items:center;cursor:pointer}
body #event-dialog{border-top:5px solid var(--event-color,#23695c)}
body .event-row{border-left:4px solid var(--event-color,#23695c)}
body .calendar-table{table-layout:fixed;border-collapse:collapse}
body .calendar-table .calendar-day{min-height:48px;height:auto;padding:5px}
body .calendar-table td{vertical-align:top}
body .calendar-table .event-band td{padding:1px 0 4px;border-top:0}
body button.calendar-event-bar{display:block;width:100%;min-height:32px;padding:5px 7px;border:0;border-radius:5px;background:var(--event-color,#23695c);color:white;font-size:12px;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}
body button.calendar-event-bar.continues-before{border-top-left-radius:0;border-bottom-left-radius:0}
body button.calendar-event-bar.continues-after{border-top-right-radius:0;border-bottom-right-radius:0}
body .time-picker-button{margin-top:5px}
body .field-invalid{border:2px solid #b84b57!important;background:#fff3f3!important}
body .field-error{display:block;font-size:12px;color:#a73540;margin:4px 0 8px;line-height:1.5}
body .folder-card>button{font-size:18px;font-weight:650;background:transparent;border:0;padding:5px 0}
body .folder-card .tools{border-top:1px solid #dce4da;padding-top:6px;margin:6px 0 0;gap:6px}
body .folder-card .tools button{font-size:12px;padding:7px 10px;background:transparent;border-color:transparent;color:#60766a}
body .folder-card .tools button:last-child{color:#60766a}
body .folder-card .recent-badge{font-size:10px;font-weight:500}
body .album-grid{padding-top:12px;border-top:1px solid #e0e6dd}
@media(max-width:600px){body button.calendar-event-bar{font-size:11px;min-height:36px;padding:7px 3px}body .calendar-day .day-number{font-size:13px}}

body .calendar-table td{height:auto}body .calendar-table .event-band td{height:auto}body #meeting-room .photo-card img{height:auto;max-height:320px;object-fit:contain}body #meeting-list{margin-top:20px}body #meeting-list p{font-size:12px}body #meeting-dialog input,body #meeting-dialog select{max-width:100%;min-width:0;width:100%;margin:8px 0}

/* Keep the hour/minute picker compact on desktop and mobile. */
body dialog.time-picker-dialog{max-width:320px}
body .time-picker-dialog h2{font-size:20px;margin:0 0 14px}
body .time-picker-row{display:flex;align-items:center;gap:10px}
body .time-picker-row select{flex:0 1 100px;width:100px;min-width:0;margin:0;font-family:inherit;font-size:15px;padding:8px 10px}
body .time-picker-actions{display:flex;justify-content:flex-end;margin-top:14px}
body .time-picker-actions button{width:auto;min-width:64px;margin:0}

/* A week is one date grid: event lanes do not add horizontal day dividers. */
body .calendar-table .calendar-week-dates:has(+ .event-band) td{border-bottom:0}
body .calendar-table .event-band td{border-top:0;border-bottom:0}
body .calendar-table .event-band:last-child td{border-bottom:1px solid #e1e8df}

/* Pastel event colors keep the chosen hue without overpowering date numbers. */
body button.calendar-event-bar{background:color-mix(in srgb,var(--event-color,#23695c) 16%,white);color:#293e37}
body .calendar-day[aria-pressed=true]{background:#f1f6f0;outline-color:#a0b9ac}
body .calendar-frame{position:relative}
body .calendar-frame .calendar-day[aria-pressed=true]{background:transparent;outline:none}
body .calendar-selection{position:absolute;pointer-events:none;z-index:1;border:2px solid #39786a;border-radius:6px;background:rgba(57,120,106,.05)}
body .calendar-frame .calendar-day:focus-visible{outline:3px solid #af7951;outline-offset:-3px}
body .calendar-day.is-today .day-number{background:#edf3ef;color:#245c51;box-shadow:inset 0 0 0 1px #a0b9ac;font-weight:700}
body .calendar-day.is-saturday .day-number{color:#2866ad}
body .calendar-day.is-sunday .day-number,body .calendar-day.is-holiday .day-number{color:#bd3c3c}
/* Compact folder cards: status and actions share one row; names keep two lines. */
body .folder-card{padding:8px 12px 12px;align-self:stretch}
body .folder-card .folder-header{display:flex;align-items:center;gap:6px;min-height:44px}
body .folder-card .folder-icon{font-size:21px;line-height:1;flex:none}
body .folder-card .folder-header .recent-badge{margin:0;font-size:10px;line-height:1.4;flex:none}
body .folder-card .folder-menu{margin-left:auto;flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:0;border:0;background:transparent;color:#526b61;font-size:26px;line-height:1}
body .folder-card>button.folder-open{display:block;width:100%;min-height:44px;margin:0;padding:0;border:0;background:transparent;text-align:left;color:#245c51}
body .folder-card .folder-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;word-break:normal;font-size:16px;line-height:22px;height:44px;font-weight:650}
body .folder-actions-dialog h2{overflow-wrap:anywhere;font-size:20px}
body .folder-actions{display:grid;gap:8px;margin:16px 0}
body .folder-actions button{min-height:44px;text-align:left}
body .folder-actions .danger{color:#a64c52}
@media(max-width:600px){body .folder-card{padding:6px 10px 10px}}

.upload-meter{margin:12px 0;min-width:0}.upload-meter progress{display:block;width:100%;height:14px}.upload-meter p{font-size:13px;overflow-wrap:anywhere;margin:8px 0}
