@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');
:root {
  color-scheme:dark;
  --bg:#111212;
  --sidebar:#151616;
  --surface:#1b1c1c;
  --surface-2:#222323;
  --text:#f4f3ef;
  --muted:#a5a7a3;
  --line:#343636;
  --button:#f3f2ee;
  --button-text:#151616;
  font-family:'DM Sans',system-ui,sans-serif
}

* {
  box-sizing:border-box
}

html {
  scroll-behavior:smooth
}

body {
  margin:0;
  background:var(--bg);
  color:var(--text)
}

button,input,a {
  font:inherit
}

button {
  color:inherit
}

a {
  color:inherit;
  text-decoration:none
}

.gallery-shell {
  min-height:100vh;
  display:grid;
  grid-template-columns:250px minmax(0,1fr);
  gap:0
}

.gallery-sidebar {
  position:fixed;
  inset:0 auto 0 0;
  width:250px;
  display:flex;
  flex-direction:column;
  padding:27px 20px 22px;
  border-right:1px solid var(--line);
  background:var(--sidebar)
}

.gallery-brand {
  display:flex;
  align-items:center;
  gap:11px;
  padding:0 10px 38px;
  font-size:12px;
  font-weight:700;
  letter-spacing:.1em;
  text-transform:uppercase
}

.gallery-brand i {
  font-size:24px
}

.gallery-brand img {
  width:27px;
  height:27px;
  border-radius:7px;
  object-fit:contain
}

.category-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 11px 11px;
  color:var(--muted);
  font-size:10px;
  font-weight:700;
  letter-spacing:.14em;
  text-transform:uppercase
}

.mobile-filter {
  display:none
}

.category-list {
  position:relative;
  display:grid;
  gap:3px;
  padding-left:12px
}

.category-list:before {
  content:'';
  position:absolute;
  left:1px;
  top:7px;
  bottom:7px;
  width:1px;
  background:var(--line)
}

.category-list button {
  min-height:38px;
  padding:0 12px;
  border:0;
  border-radius:10px;
  color:var(--muted);
  background:transparent;
  text-align:left;
  cursor:pointer;
  font-size:13px
}

.category-list button:hover {
  color:var(--text);
  background:var(--surface-2)
}

.category-list button.active {
  color:var(--button-text);
  background:var(--button)
}

.sidebar-footer {
  display:grid;
  gap:7px;
  margin-top:auto;
  padding-top:17px;
  border-top:0
}

.sidebar-footer a {
  display:flex;
  align-items:center;
  gap:9px;
  min-height:39px;
  padding:0 10px;
  border-radius:9px;
  color:#151616;
  font-size:12px;
}

.sidebar-footer a:hover {
  color:var(--text);
  background:var(--surface-2)
}

.sidebar-footer .account-link {
  justify-content:center;
  color:var(--button-text);
  background:var(--button)
}

.gallery-main {
  grid-column:2;
  min-width:0;
  padding:22px
}

.gallery-header {
  height:75px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 6px 18px
}

.gallery-header>div:first-child span {
  color:var(--muted);
  font-size:9px;
  font-weight:700;
  letter-spacing:.13em;
  text-transform:uppercase
}

.gallery-header h1 {
  margin:4px 0 0;
  font-size:24px;
  letter-spacing:-.035em
}

.header-actions {
  display:flex;
  align-items:center;
  gap:9px
}

.search {
  height:42px;
  display:flex;
  align-items:center;
  gap:9px;
  width:230px;
  padding:0 13px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface)
}

.search i {
  color:var(--muted)
}

.search input {
  width:100%;
  border:0;
  outline:0;
  color:var(--text);
  background:transparent;
  font-size:12px
}

.header-actions>a {
  height:42px;
  display:flex;
  align-items:center;
  gap:7px;
  padding:0 14px;
  border-radius:12px;
  color:var(--button-text);
  background:var(--button);
  font-size:12px;
  font-weight:600
}

.masonry {
  columns:5 210px;
  column-gap:12px;
  padding:13px;
  border:1px solid var(--line);
  border-radius:22px;
  background:var(--surface)
}

.gallery-card {
  position:relative;
  min-height:270px;
  margin:0 0 12px;
  break-inside:avoid;
  border-radius:14px;
  overflow:hidden;
  background:var(--surface-2);
  cursor:pointer
}

.gallery-card.tall {
  height:520px
}

.gallery-card.portrait {
  height:400px
}

.gallery-card.square {
  height:290px
}

.gallery-card.wide {
  height:230px
}

.gallery-card img {
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  transition:transform .45s ease,filter .35s
}

.gallery-card:nth-child(3n+2) img {
  object-position:25% center
}

.gallery-card:nth-child(3n) img {
  object-position:75% center
}

.gallery-card:nth-child(4n) img {
  filter:hue-rotate(18deg) saturate(.8)
}

.gallery-card:hover img,.gallery-card:focus img {
  transform:scale(1.035)
}

.card-overlay {
  position:absolute;
  inset:auto 0 0;
  display:grid;
  grid-template-columns:1fr auto;
  align-items:end;
  padding:70px 15px 14px;
  background:linear-gradient(transparent,rgba(0,0,0,.86));
  opacity:0;
  transition:opacity .2s
}

.gallery-card:hover .card-overlay,.gallery-card:focus .card-overlay {
  opacity:1
}

.card-overlay span {
  grid-column:1;
  color:#c9cbc7;
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.09em
}

.card-overlay h2 {
  grid-column:1;
  margin:5px 0 0;
  font-size:14px
}

.card-overlay button {
  grid-area:1/2/3;
  width:36px;
  height:36px;
  border:1px solid rgba(255,255,255,.25);
  border-radius:50%;
  background:rgba(20,20,20,.65);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-gallery {
  min-height:400px;
  place-items:center;
  align-content:center;
  text-align:center
}

.empty-gallery i {
  font-size:30px
}

.empty-gallery h2 {
  margin:13px 0 5px;
  font-size:18px
}

.empty-gallery p {
  margin:0;
  color:var(--muted);
  font-size:12px
}

.prompt-dialog {
  width:min(880px,calc(100% - 32px));
  padding:0;
  border:1px solid var(--line);
  border-radius:22px;
  color:var(--text);
  background:var(--surface);
  overflow:hidden
}

.prompt-dialog::backdrop {
  background:rgba(0,0,0,.76);
  backdrop-filter:blur(7px)
}

.prompt-dialog[open] {
  display:grid;
  grid-template-columns:1.05fr .95fr
}

.dialog-close {
  position:absolute;
  top:14px;
  right:14px;
  z-index:2;
  width:38px;
  height:38px;
  border:1px solid var(--line);
  border-radius:50%;
  background:rgba(20,20,20,.8);
  cursor:pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog-image {
  min-height:560px
}

.dialog-image img {
  width:100%;
  height:100%;
  display:block;
  object-fit:cover
}

.dialog-copy {
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  padding:48px 12px 34px 34px;
}

.dialog-category {
  color:var(--muted);
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.1em
}

.dialog-copy h2 {
  margin:5px 0 18px;
  font-size:31px;
  letter-spacing:-.04em
}

.dialog-copy p {
  margin:0 0 28px;
  color:#c4c6c2;
  font-size:14px;
  line-height:1.7
}

.copy-button {
  height:47px;
  border:0;
  border-radius:11px;
  color:var(--button-text);
  background:var(--button);
  cursor:pointer;
  font-weight:600
}

.copy-button.copied {
  color:#fff;
  background:#39724b
}

@media(max-width:900px) {
  .gallery-shell {
    display:block
  }
  .gallery-sidebar {
    position:sticky;
    top:0;
    z-index:5;
    width:100%;
    height:auto;
    display:grid;
    grid-template-columns:1fr auto;
    padding:15px 18px;
    border-right:0;
    border-bottom:1px solid var(--line)
  }
  .gallery-brand {
    padding:0
  }
  .category-heading {
    padding:0
  }
  .category-heading>span {
    display:none
  }
  .mobile-filter {
    display:grid;
    place-items:center;
    width:39px;
    height:39px;
    border:1px solid var(--line);
    border-radius:10px;
    background:var(--surface)
  }
  .category-list {
    grid-column:1/-1;
    display:none;
    grid-template-columns:repeat(2,1fr);
    margin-top:14px;
    padding:12px;
    border:1px solid var(--line);
    border-radius:13px;
    background:var(--surface)
  }
  .category-list.open {
    display:grid
  }
  .category-list:before,.sidebar-footer {
    display:none
  }
  .gallery-main {
    padding:14px
  }
  .gallery-header {
    height:69px
  }
  .masonry {
    columns:3 180px
  }
}

@media(max-width:600px) {
  .gallery-header>div:first-child span {
    display:none
  }
  .gallery-header h1 {
    font-size:21px
  }
  .search {
    width:42px;
    padding:0;
    justify-content:center
  }
  .search input {
    position:absolute;
    left:14px;
    right:14px;
    top:75px;
    z-index:3;
    width:calc(100% - 28px);
    height:43px;
    padding:0 13px;
    border:1px solid var(--line);
    border-radius:11px;
    background:var(--surface);
    display:none
  }
  .search:focus-within input {
    display:block
  }
  .header-actions>a span {
    display:none
  }
  .masonry {
    columns:2 140px;
    padding:8px;
    column-gap:8px;
    border-radius:15px
  }
  .gallery-card {
    margin-bottom:8px;
    border-radius:10px
  }
  .gallery-card.tall {
    height:350px
  }
  .gallery-card.portrait {
    height:290px
  }
  .gallery-card.square {
    height:210px
  }
  .gallery-card.wide {
    height:170px
  }
  .card-overlay {
    opacity:1;
    padding:50px 10px 10px
  }
  .card-overlay button {
    display:none
  }
  .prompt-dialog[open] {
    display:block
  }
  .dialog-image {
    height:330px;
    min-height:0
  }
  .dialog-copy {
    padding:27px 22px
  }
  .dialog-copy h2 {
    font-size:25px
  }
}

/* Let masonry cards follow each uploaded image's natural proportions. */ .gallery-card,.gallery-card.tall,.gallery-card.portrait,.gallery-card.square,.gallery-card.wide {
  height:auto;
  min-height:0
}

.gallery-card img {
  width:100%;
  height:auto;
  object-fit:initial
}

.prompt-dialog[open] {
  height:min(720px,calc(100vh - 32px));
  max-height:calc(100vh - 32px)
}

.dialog-image {
  height:100%;
  min-height:0;
  background:#e8e8e6
}

.dialog-image img {
  object-fit:contain
}

.dialog-copy {
  height:100%;
  min-height:0;
  justify-content:flex-start;
  overflow-y:auto;
  padding-top:70px;
  scrollbar-width:thin;
  scrollbar-color:#686a67 transparent
}

.dialog-copy::-webkit-scrollbar {
  width:8px
}

.dialog-copy::-webkit-scrollbar-thumb {
  border-radius:8px;
  background:#686a67
}

.dialog-copy::-webkit-scrollbar-track {
  background:transparent
}

.prompt-label {
  margin:8px 0 10px;
  color:var(--muted);
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.1em
}

.dialog-copy .dialog-prompt {
  margin-bottom:5px
}

.dialog-prompt.collapsed {
  display:-webkit-box;
  overflow:hidden;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:6
}

.dialog-prompt.expanded {
  display:block;
  overflow:visible
}

.prompt-toggle {
  align-self:flex-start;
  padding:4px 0;
  border:0;
  color:var(--text);
  background:transparent;
  cursor:pointer;
  font-size:12px;
  font-weight:800;
  margin-bottom: 1rem;
}

.copy-button {
  flex:0 0 auto;
  width:100%;
  margin-top:25px
}

@media(max-width:600px) {
  .prompt-dialog[open] {
    height:min(92vh,760px);
    overflow:hidden
  }
  .dialog-image {
    height:38%;
    min-height:220px
  }
  .dialog-copy {
    height:62%;
    padding:22px;
    overflow-y:auto
  }
  .dialog-copy h2 {
    margin-bottom:12px
  }
  .prompt-label {
    margin-top:2px
  }
  .dialog-prompt.collapsed {
    -webkit-line-clamp:4
  }
}

.dialog-copy {
  overflow:hidden
}

.dialog-copy .dialog-prompt {
  flex:0 1 auto;
  min-height:0
}

.dialog-prompt.expanded {
  display:block;
  flex:1 1 auto;
  overflow-y:auto;
  padding-right:25px;
  scrollbar-width:thin;
  scrollbar-color:#686a67 transparent
}

.dialog-prompt.expanded::-webkit-scrollbar {
  width:7px
}

.dialog-prompt.expanded::-webkit-scrollbar-thumb {
  border-radius:8px;
  background:#686a67
}

.prompt-toggle {
  flex:0 0 auto
}

.copy-button {
  margin-top:auto;
  position:relative;
  bottom:0
}

@media(max-width:600px) {
  .dialog-copy {
    overflow:hidden
  }
  .copy-button {
    margin-top:auto
  }
}

.dialog-image {
  display:grid;
  place-items:center;
  padding:36px;
  background:#e7e7e5;
  overflow:hidden
}

.dialog-image img {
  width:auto;
  height:auto;
  max-width:95%;
  max-height:95%;
  border-radius:16px;
  object-fit:contain;
  box-shadow:0 12px 35px rgba(0,0,0,.12)
}

@media(max-width:600px) {
  .dialog-image {
    padding:18px
  }
  .dialog-image img {
    max-width:82%;
    max-height:88%;
    border-radius:12px
  }
}

/* Typography: headings are bold; all other interface copy is regular. */
body,
body button,
body input,
body select,
body textarea,
body a,
body p,
body span,
body small,
body strong,
body b,
body label {
  font-weight: 400 !important;
}

body h1,
body h2,
body h3,
body h4,
body h5,
body h6 {
  font-weight: 700 !important;
}

.header-logout {
  margin: 0;
}

.header-logout button {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
}

.header-logout button:hover {
  background: var(--surface-2);
}

@media(max-width:600px) {
  .header-logout button span {
    display: none;
  }

  .header-logout button {
    width: 42px;
    justify-content: center;
    padding: 0;
  }
}

.sidebar-login {
  width: 100%;
  min-height: 39px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: #151616;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
}

.sidebar-login:hover {
  color: #151616;
  background: transparent;
}

.login-dialog {
  width: min(430px, calc(100% - 28px));
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
}

.login-dialog::backdrop {
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(7px);
}

.login-close {
  position: absolute;
  top: 15px;
  right: 15px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.login-modal-head > span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.login-modal-head h2 {
  margin: 8px 0 5px;
  font-size: 28px;
}

.login-modal-head p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
}

.login-dialog form {
  display: grid;
  gap: 16px;
}

.login-dialog form > label > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-dialog input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  color: var(--text);
  background: var(--surface-2);
}

.login-dialog input:focus {
  border-color: var(--muted);
}

.login-password {
  position: relative;
  display: block;
}

.login-password input {
  padding-right: 48px;
}

.login-password button {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 36px;
  height: 36px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.login-submit {
  height: 46px;
  border: 0;
  border-radius: 11px;
  color: var(--button-text);
  background: var(--button);
  cursor: pointer;
}

.login-submit:disabled {
  opacity: .65;
  cursor: wait;
}

.login-error {
  margin-bottom: 15px;
  padding: 11px 12px;
  border: 1px solid rgba(225, 100, 100, .45);
  border-radius: 10px;
  color: #f0a1a1;
  background: rgba(190, 70, 70, .1);
  font-size: 12px;
}

.forgot-link {
  display: inline-block;
  margin-top: 17px;
  color: var(--muted);
  font-size: 11px;
}

.home-add-button {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  color: var(--button-text);
  background: var(--button);
  cursor: pointer;
  font-size: 12px;
}

.home-add-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  background: var(--surface);
  overflow-y: auto;
}

.home-add-dialog::backdrop {
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(7px);
}

.home-add-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-add-dialog header > span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.home-add-dialog header h2 {
  margin: 7px 0 4px;
  font-size: 27px;
}

.home-add-dialog header p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
}

.home-add-dialog form {
  display: grid;
  gap: 16px;
}

.home-image-file {
  position: relative;
  display: flex;
  place-items: center;
  min-height: 135px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  cursor: pointer;
      flex-direction: column;
    justify-content: center;
    align-items: center;
}

.home-image-file i {
  font-size: 28px;
}

.home-image-file strong {
  margin-top: 7px;
  font-size: 12px;
}

.home-image-file > span {
  color: var(--muted);
  font-size: 10px;
}

.home-image-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.home-add-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.home-add-dialog form > label > span:first-child,
.home-add-fields label > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.home-add-dialog input[type=text],
.home-add-dialog select,
.home-add-dialog textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  color: var(--text);
  background: var(--surface-2);
}

.home-add-dialog select {
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%23a5a7a3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 14px;
}

.home-add-dialog textarea {
  resize: vertical;
}

.home-add-submit {
  height: 46px;
  border: 0;
  border-radius: 11px;
  color: var(--button-text);
  background: var(--button);
  cursor: pointer;
}

.home-add-submit:disabled {
  opacity: .65;
}

.home-add-error {
  margin-bottom: 15px;
  padding: 11px;
  border-radius: 10px;
  color: #f0a1a1;
  background: rgba(190, 70, 70, .12);
  font-size: 12px;
}

@media(max-width:600px) {
  .home-add-button span {
    display: none;
  }

  .home-add-button {
    width: 42px;
    justify-content: center;
    padding: 0;
  }

  .home-add-dialog {
    padding: 22px 18px;
  }

  .home-add-fields {
    grid-template-columns: 1fr;
  }
}

.copy-button span {
    margin-left: 0.4rem;
}

button.copy-button {
    display: flex;
    align-items: center;
    justify-content: center;
}
