﻿:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111318;
  color: #f7f4ed;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(145deg, rgba(42, 179, 154, 0.16), transparent 26rem),
    linear-gradient(180deg, #17191f 0%, #0d0f13 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.auth-view {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}

.pin-panel {
  width: min(24rem, 100%);
  padding: 1.25rem;
  border: 1px solid rgba(247, 244, 237, 0.12);
  border-radius: 1.5rem;
  background: rgba(21, 23, 29, 0.94);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.32);
}

.overline {
  margin: 0 0 0.35rem;
  color: #2fc4a7;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

.pin-panel h1,
.title-block h1 {
  margin: 0;
  font-size: clamp(1.65rem, 7vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.pin-form {
  margin-top: 1.25rem;
}

.pin-boxes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.pin-digit {
  width: 100%;
  aspect-ratio: 1;
  min-height: 4rem;
  border: 1px solid rgba(247, 244, 237, 0.16);
  border-radius: 1rem;
  background: #0c0e13;
  color: #f7f4ed;
  font-size: clamp(1.55rem, 8vw, 2.15rem);
  font-weight: 950;
  text-align: center;
  outline: 0;
  -webkit-appearance: none;
}

.pin-digit:focus {
  border-color: #2fc4a7;
  box-shadow: 0 0 0 0.22rem rgba(47, 196, 167, 0.18);
}

.form-error {
  margin: 0.9rem 0 0;
  color: #ff9d82;
  font-weight: 850;
}

.app-view {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 4.75rem;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: max(0.75rem, env(safe-area-inset-top)) 1rem 0.75rem;
  border-bottom: 1px solid rgba(247, 244, 237, 0.1);
  background: rgba(17, 19, 24, 0.92);
  backdrop-filter: blur(18px);
}

.mobile-header #backButton {
  grid-column: 1;
}

.mobile-header .title-block {
  grid-column: 2;
}

.mobile-header .header-actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

.title-block {
  min-width: 0;
}

.title-block h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-button,
.round-small,
.download-chip,
.save-chip,
.rename-chip,
.delete-chip {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #f7f4ed;
  background: rgba(247, 244, 237, 0.09);
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
}

.round-button {
  width: 3rem;
  height: 3rem;
}

.round-small,
.download-chip,
.save-chip,
.rename-chip,
.delete-chip {
  width: 2.45rem;
  height: 2.45rem;
}

.round-button:hover,
.round-small:hover,
.download-chip:hover,
.save-chip:hover,
.rename-chip:hover,
.delete-chip:hover {
  background: rgba(247, 244, 237, 0.15);
}

.content-shell {
  width: min(72rem, 100%);
  margin: 0 auto;
  padding: 0.95rem 0.9rem max(1.1rem, env(safe-area-inset-bottom));
}

.status-line {
  min-height: 1.45rem;
  color: #b7afa3;
  font-size: 0.9rem;
  font-weight: 800;
}

.upload-progress {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.65rem;
  padding: 0.75rem;
  border: 1px solid rgba(247, 244, 237, 0.1);
  border-radius: 0.9rem;
  background: rgba(247, 244, 237, 0.06);
}

.upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #f7f4ed;
  font-size: 0.86rem;
  font-weight: 900;
}

.upload-progress-head strong {
  color: #2fc4a7;
}

.upload-progress-track {
  height: 0.72rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(247, 244, 237, 0.11);
}

.upload-progress-track span {
  width: 0%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #2fc4a7;
  transition: width 160ms ease;
}

.selection-bar {
  min-height: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.65rem;
  padding: 0.45rem 0.55rem 0.45rem 0.8rem;
  border: 1px solid rgba(247, 244, 237, 0.1);
  border-radius: 999px;
  background: rgba(17, 19, 24, 0.82);
}

.selection-bar strong {
  min-width: 0;
  overflow: hidden;
  color: #f7f4ed;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.selection-text-button,
.selection-save-button {
  min-height: 2.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  border-radius: 999px;
  padding: 0 0.8rem;
  color: #f7f4ed;
  background: rgba(247, 244, 237, 0.09);
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
}

.selection-save-button {
  background: #2fc4a7;
  color: #06110f;
}

.selection-bar button:disabled {
  opacity: 0.42;
  cursor: default;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.75rem;
}

.tile {
  position: relative;
  min-width: 0;
  min-height: 9.7rem;
  display: grid;
  align-content: end;
  gap: 0.32rem;
  overflow: hidden;
  padding: 0.85rem;
  border: 1px solid rgba(247, 244, 237, 0.1);
  border-radius: 1rem;
  background: rgba(247, 244, 237, 0.065);
  color: #f7f4ed;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.tile:active {
  transform: scale(0.99);
}

.action-tile {
  background: rgba(255, 191, 105, 0.1);
}

.primary-tile {
  background: rgba(47, 196, 167, 0.14);
}

.folder-tile {
  background: rgba(93, 140, 255, 0.1);
}

.rename-tile {
  background: rgba(255, 191, 105, 0.12);
}

.rename-tile .tile-icon {
  color: #ffcf89;
}

.danger-tile {
  background: rgba(238, 108, 77, 0.13);
}

.danger-tile .tile-icon {
  color: #ff9d82;
}

.tile-open {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  gap: 0.32rem;
  width: 100%;
  height: 100%;
  padding: 0.85rem;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.tile-icon,
.tile-cover {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  width: 3.1rem;
  height: 3.1rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(247, 244, 237, 0.1);
  color: #ffbf69;
}

.primary-tile .tile-icon {
  color: #2fc4a7;
}

.folder-tile .tile-icon {
  color: #8da6ff;
}

.tile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile-title {
  min-width: 0;
  overflow: hidden;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-meta {
  min-width: 0;
  overflow: hidden;
  color: #b7afa3;
  font-size: 0.82rem;
  font-weight: 780;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-tile {
  min-height: 12rem;
  padding: 0;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.photo-thumb {
  position: relative;
  width: 100%;
  height: 8.6rem;
  display: block;
  padding: 0;
  background: #252832;
  color: inherit;
  cursor: pointer;
}

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

.photo-select-indicator {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: 2px solid rgba(247, 244, 237, 0.9);
  border-radius: 50%;
  background: rgba(17, 19, 24, 0.38);
  color: transparent;
  opacity: 0;
  transform: scale(0.94);
  transition:
    opacity 130ms ease,
    transform 130ms ease,
    background 130ms ease,
    color 130ms ease;
}

.selection-active .photo-select-indicator,
.photo-tile.is-selected .photo-select-indicator {
  opacity: 1;
  transform: scale(1);
}

.photo-tile.is-selected .photo-select-indicator {
  border-color: #2fc4a7;
  background: #2fc4a7;
  color: #06110f;
}

.photo-tile.is-selected .photo-thumb img {
  filter: brightness(0.72);
}

.photo-caption {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem 3.65rem 0.75rem 0.75rem;
}

.download-chip,
.save-chip {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  background: #2fc4a7;
  color: #06110f;
  z-index: 2;
}

.floating-share-button {
  display: none;
}

.rename-chip {
  position: absolute;
  right: 3.45rem;
  top: 0.65rem;
  background: rgba(255, 191, 105, 0.18);
  color: #ffcf89;
  z-index: 2;
}

.delete-chip {
  position: absolute;
  right: 0.65rem;
  top: 0.65rem;
  background: rgba(238, 108, 77, 0.2);
  color: #ffb2a1;
  z-index: 2;
}

.name-dialog,
.share-dialog {
  width: min(23rem, calc(100vw - 2rem));
  border: 1px solid rgba(247, 244, 237, 0.14);
  border-radius: 1.15rem;
  background: #181b22;
  color: #f7f4ed;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.42);
}

.name-dialog::backdrop,
.share-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.name-dialog form,
.share-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dialog-head h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.field {
  display: grid;
  gap: 0.45rem;
  color: #c8c0b2;
  font-weight: 850;
}

.field input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0 1rem;
  border: 1px solid rgba(247, 244, 237, 0.14);
  border-radius: 999px;
  background: #0c0e13;
  color: #f7f4ed;
  outline: 0;
  -webkit-appearance: none;
}

.field input:focus {
  border-color: #2fc4a7;
  box-shadow: 0 0 0 0.2rem rgba(47, 196, 167, 0.18);
}

.qr-frame {
  display: grid;
  place-items: center;
  padding: 0.85rem;
  border-radius: 1rem;
  background: #f7f4ed;
}

.qr-frame img {
  width: min(14rem, 100%);
  height: auto;
  display: block;
}

.share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.dialog-submit,
.dialog-secondary {
  min-height: 3.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 999px;
  background: #2fc4a7;
  color: #06110f;
  font-weight: 950;
  cursor: pointer;
}

.dialog-secondary {
  border: 1px solid rgba(247, 244, 237, 0.13);
  background: rgba(247, 244, 237, 0.09);
  color: #f7f4ed;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 3;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  border-radius: 999px;
  background: #f7f4ed;
  color: #111318;
  font-weight: 900;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.35);
}

.is-busy .tile,
.is-busy .round-button,
.is-busy .floating-share-button,
.is-busy .dialog-submit,
.is-busy .dialog-secondary,
.is-busy .save-chip,
.is-busy .rename-chip,
.is-busy .delete-chip {
  pointer-events: none;
  opacity: 0.72;
}

svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
  stroke-width: 2.25;
}

@media (min-width: 42rem) {
  .content-shell {
    padding-inline: 1.2rem;
  }

  .tile-grid {
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 1rem;
  }

  .tile {
    min-height: 10.5rem;
  }
}

@media (max-width: 42rem) {
  .floating-share-button {
    position: fixed;
    right: 1rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 3;
    width: 3.25rem;
    height: 3.25rem;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: #2fc4a7;
    color: #06110f;
    box-shadow: 0 0.9rem 2rem rgba(0, 0, 0, 0.32);
    cursor: pointer;
    touch-action: manipulation;
  }
}

@media (max-width: 22.5rem) {
  .tile-grid {
    grid-template-columns: 1fr;
  }

  .pin-boxes {
    gap: 0.5rem;
  }
}






