* { box-sizing: border-box; }
:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #2c382f;
  background: #faf9f6;
  font-synthesis: none;
  --green: #47664e;
  --muted: #687563;
  --line: #dfe3d8;
  --pale: #edf0e7;
  --card-size: 290px;
}
body { margin: 0; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .5; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid #99b389;
  outline-offset: 4px;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  background: none;
  color: inherit;
  border-radius: 7px;
  min-height: 44px;
  padding: 10px 15px;
}
button svg, svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
[hidden] { display: none !important; }
.icons { position: absolute; width: 0; height: 0; overflow: hidden; }
.site-header {
  height: 96px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 5vw;
}
.brand {
  font: bold 42px Georgia, serif;
  text-decoration: none;
  letter-spacing: -2px;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 2px;
}
.brand-mark { font: 40px Georgia; margin-right: 13px; }
.brand > span:last-child { color: #98a881; }
.header-note { font-size: 14px; color: var(--muted); }
#logout { margin-left: auto; font-size: 14px; }
.primary { background: var(--green); color: white; font-weight: 600; padding: 15px 23px; }
.primary:hover { background: #385740; }
.secondary { border: 1px solid #cbd4c3; background: #fffefa; }
.secondary:hover, .quiet:hover { background: var(--pale); }
.danger { background: #a94730; color: white; font-weight: 600; }
.danger:hover { background: #8c3623; }
.quiet {
  font-size: 14px;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.eyebrow { font-size: 12px; font-weight: bold; letter-spacing: 2.5px; color: var(--muted); }
h1, h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  letter-spacing: -1.5px;
}
h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1.1; margin: 15px 0; }
h2 { font-size: 30px; margin: 16px 0; }
p { line-height: 1.65; color: var(--muted); margin: 10px 0 20px; }
main { max-width: 1550px; padding: 0 5vw; margin: auto; }
.loading { text-align: center; margin-top: 100px; }
.access { max-width: 440px; margin: 60px auto 80px; text-align: center; }
.access-symbol {
  width: 58px;
  height: 58px;
  border: 1px solid #cbd5bf;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 26px;
  color: var(--green);
}
.access form { text-align: left; margin-top: 32px; }
label { display: block; font-size: 14px; margin: 18px 0 9px; font-weight: 600; }
input {
  width: 100%;
  border: 1px solid #cbd4c3;
  border-radius: 6px;
  background: #fffefa;
  padding: 13px;
  color: #2c382f;
  min-height: 46px;
}
.access .primary { width: 100%; margin-top: 22px; justify-content: space-between; }
.field-help { font-size: 14px; }
.message {
  max-width: 900px;
  margin: 20px auto 0;
  background: #eaf0e2;
  padding: 16px 24px;
  border: 1px solid #cbd7bf;
  border-radius: 7px;
  white-space: pre-line;
  line-height: 1.5;
}
.message.error { background: #fff0e9; border-color: #e2b6a6; color: #843b25; }
.album-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 49px 0 30px;
}
.album-heading p { margin-bottom: 0; }
.gallery-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 24px;
}
.tabs { display: flex; gap: 14px; flex-shrink: 0; }
.tabs button {
  border-radius: 0;
  min-height: 57px;
  border-bottom: 2px solid transparent;
  padding: 12px 6px;
  color: var(--muted);
}
.tabs .active { border-bottom-color: var(--green); color: var(--green); font-weight: bold; }
.tabs span { background: var(--pale); border-radius: 5px; padding: 3px 7px; font-size: 12px; }
.gallery-tools { display: flex; align-items: center; justify-content: flex-end; gap: 26px; min-width: 0; }
.zoom-control {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--muted);
  white-space: nowrap;
  font-weight: normal;
}
.zoom-control > span { font-size: 13px; }
.zoom-control svg { width: 17px; height: 17px; }
.zoom-control .zoom-small { width: 14px; height: 14px; }
.zoom-control input {
  width: clamp(90px, 12vw, 170px);
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--green);
  cursor: ew-resize;
}
.save-status { font-size: 13px; color: var(--muted); white-space: nowrap; }
.gallery-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 14px 0 20px;
}
.gallery-hint p { font-size: 14px; margin: 0; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-size)), 1fr));
  gap: 26px 20px;
}
.photo { min-width: 0; }
.photo.dragging { opacity: .42; }
.photo.drop-target .photo-image {
  outline: 3px solid var(--green);
  outline-offset: 4px;
  transform: scale(.985);
}
.photo-image {
  position: relative;
  background: #e6e8df;
  aspect-ratio: 1.12;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 120ms ease, outline-color 120ms ease;
}
.photo-image[draggable="true"] { cursor: grab; }
.photo.dragging .photo-image { cursor: grabbing; }
.photo-open { width: 100%; height: 100%; padding: 0; border-radius: 0; display: block; cursor: inherit; }
.photo-image img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.drag-handle {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #4f5e50;
  background: #fffefae8;
  box-shadow: 0 2px 7px #0001;
  pointer-events: none;
  opacity: .72;
}
.drag-handle svg { width: 19px; height: 19px; }
.photo-image[draggable="false"] .drag-handle { display: none; }
.fallback {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  font-size: 14px;
  text-align: center;
  color: var(--muted);
}
.fallback svg { width: 40px; height: 40px; }
.favorite {
  position: absolute;
  right: 10px;
  top: 10px;
  background: #fffefaed;
  border: 1px solid #ffffff70;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 9px;
  color: #65705e;
  box-shadow: 0 2px 7px #0001;
}
.favorite[aria-pressed="true"] { background: var(--green); color: #fff; }
.favorite[aria-pressed="true"] svg { fill: #fff; stroke-width: 1.3; }
.photo-foot { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.photo-name {
  font-size: 13px;
  color: var(--muted);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.photo .icon-button { padding: 5px; min-height: 34px; width: 29px; border-radius: 4px; }
.photo .icon-button:hover { background: var(--pale); }
.photo .delete { color: #899181; }
.photo .delete:hover { color: #a54f37; background: #fff0e9; }
.empty {
  text-align: center;
  padding: 70px 20px;
  border: 1px dashed #c6d0bc;
  border-radius: 10px;
  margin: 10px 0 35px;
}
.empty > svg { width: 40px; height: 40px; color: #82916f; }
.empty p { max-width: 420px; margin: 12px auto 25px; }
.album-footer {
  margin-top: 45px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.album-footer > div { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.limits { font-size: 12px; color: #75806f; margin-bottom: 40px; }
.upload-status {
  background: var(--pale);
  padding: 18px 22px;
  border-radius: 8px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 25px;
  font-size: 14px;
}
progress { accent-color: var(--green); height: 7px; flex: 1; width: 100%; min-width: 60px; }
.drop-zone {
  position: fixed;
  inset: 15px;
  z-index: 100;
  background: #eef2e7f7;
  border: 3px dashed var(--green);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  pointer-events: none;
}
.drop-zone > svg { width: 60px; height: 60px; }
.icon-button { width: 44px; padding: 10px; }
.close {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 1;
  background: #ffffffeb;
  color: #2c382f;
  border-radius: 50%;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 35px;
  max-width: calc(100vw - 24px);
  color: #2c382f;
  background: #faf9f6;
}
dialog::backdrop { background: #19211bbe; backdrop-filter: blur(5px); }
.delete-dialog {
  width: min(510px, calc(100vw - 32px));
  padding: 42px;
  overflow: hidden;
  box-shadow: 0 28px 80px #17201a3d;
}
.delete-symbol {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 50%;
  color: #9a402a;
  background: #f9e9e2;
}
.delete-symbol svg { width: 24px; height: 24px; }
.delete-dialog h2 { margin: 12px 0 10px; font-size: 34px; line-height: 1.1; }
.delete-dialog > p { margin: 0; font-size: 15px; }
.delete-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  margin: 25px 0 28px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f3f3ed;
}
.delete-preview img {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 6px;
  object-fit: cover;
  background: #e0e4d9;
}
.delete-preview > div { min-width: 0; }
.delete-preview span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: bold; letter-spacing: 1.4px; }
.delete-preview strong { display: block; overflow: hidden; color: #2c382f; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.dialog-actions button { min-width: 145px; }
.delete-dialog[open] { animation: dialog-in 160ms ease-out; }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
}
.connection { width: 570px; padding: 46px 35px 30px; }
.connection h2 { font-size: 34px; margin-top: 20px; }
.connection p { font-size: 15px; }
.copy-row { display: flex; gap: 8px; margin-bottom: 23px; }
.copy-row input { min-width: 0; font-size: 14px; }
.viewer { width: min(1100px, 95vw); padding: 0; background: #17201a; color: white; overflow: hidden; }
.viewer > img { width: 100%; height: 75vh; object-fit: contain; display: block; }
.viewer-footer { display: flex; justify-content: space-between; align-items: center; padding: 12px; gap: 14px; }
.viewer-footer span { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#viewer-fallback { padding: 100px 40px; color: #dbe4d7; text-align: center; }
body.modal-open { overflow: hidden; }

@media (max-width: 900px) {
  .gallery-bar { align-items: flex-start; flex-wrap: wrap; }
  .gallery-tools { width: 100%; justify-content: space-between; padding-bottom: 12px; }
  .zoom-control input { width: clamp(90px, 28vw, 170px); }
}
@media (max-width: 720px) {
  .site-header { height: 76px; padding: 0 20px; gap: 10px; }
  .brand { font-size: 35px; }
  .brand-mark { font-size: 31px; margin-right: 9px; }
  .header-note { display: none; }
  main { padding: 0 20px; }
  .album-heading { padding: 32px 0 25px; display: block; }
  .album-heading > .primary { margin-top: 23px; width: 100%; }
  .album-heading p { font-size: 15px; }
  .grid { gap: 22px 12px; }
  .photo-image { aspect-ratio: .85; }
  .drag-handle { display: none; }
  .photo-foot { flex-wrap: wrap; justify-content: flex-end; gap: 2px; }
  .photo-name { flex-basis: 100%; padding: 0 5px 3px; }
  .photo .icon-button { min-height: 42px; width: 42px; }
  .gallery-bar { gap: 8px; }
  .tabs { gap: 15px; width: 100%; }
  .gallery-tools { display: block; }
  .zoom-control { width: 100%; justify-content: space-between; }
  .zoom-control input { flex: 1; width: auto; }
  .save-status { display: block; padding-top: 8px; }
  .gallery-hint { align-items: flex-start; }
  .gallery-hint p { font-size: 13px; }
  .gallery-hint .quiet { padding-top: 0; min-height: 28px; }
  .album-footer { display: block; }
  .album-footer > .secondary { width: 100%; margin-top: 20px; }
  .message { margin: 12px 20px 0; font-size: 14px; }
  .access { margin-top: 35px; }
  .upload-status { display: block; }
  .upload-status progress { margin-top: 10px; }
  .connection { padding: 45px 23px 20px; }
  .delete-dialog { padding: 34px 22px 22px; }
  .delete-dialog h2 { font-size: 30px; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions button { width: 100%; }
  .viewer > img { height: 65vh; }
  .copy-row { flex-wrap: wrap; }
  .copy-row button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .delete-dialog[open] { animation: none; }
}
