:root {
  color-scheme: light;
  --ink: #111111;
  --soft-ink: #2c2c2c;
  --muted: #77746d;
  --line: #e5e1d8;
  --line-strong: #d4d0c7;
  --surface: rgba(255, 255, 252, 0.92);
  --field: #f7f5ef;
  --accent: #0f1412;
  --green: #2f8a68;
  --green-soft: #e7f2ec;
  --warn: #a13f24;
  --shadow: 0 24px 80px rgba(17, 17, 17, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  background: #f5f3ed;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% -10%, rgba(47, 138, 104, 0.16), transparent 32rem),
    radial-gradient(circle at 88% 4%, rgba(33, 42, 39, 0.08), transparent 26rem),
    #f5f3ed;
}

button,
input,
select {
  font: inherit;
}

button,
.new-link {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fffdfa;
  cursor: pointer;
  font-weight: 760;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

button:hover,
.new-link:hover {
  transform: translateY(-1px);
}

button:active,
.new-link:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.shell {
  width: calc(100vw - 32px);
  max-width: 920px;
  margin: 0 auto;
  padding: 42px 0;
}

.brand,
.shareHead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.brand > div,
.shareHead > div {
  min-width: 0;
}

.kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 840;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  max-width: 700px;
  color: var(--ink);
  letter-spacing: 0;
}

h1 {
  font-size: clamp(40px, 8vw, 72px);
  line-height: 0.96;
}

h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.02;
}

.new-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 16px;
}

.panel {
  width: 100%;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.dropzone {
  position: relative;
  min-height: 176px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 26px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffefa, var(--field));
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(47, 138, 104, 0.16);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropIcon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 34px;
  line-height: 1;
}

.dropzone > div:last-child {
  min-width: 0;
}

.dropzone strong {
  display: block;
  margin-bottom: 3px;
  font-size: 22px;
  line-height: 1.1;
}

.dropzone span,
.status,
.meta {
  color: var(--muted);
}

.dropzone span {
  display: block;
  overflow-wrap: anywhere;
}

.fileGrid,
.sharedGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.fileCard,
.sharedCard {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
}

.fileCard {
  position: relative;
}

.fileCard img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #ebe7df;
}

.fileInfo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
}

.fileName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--soft-ink);
  font-size: 14px;
  font-weight: 760;
}

.meta {
  margin-top: 2px;
  font-size: 12px;
}

.remove {
  width: 32px;
  min-height: 32px;
  height: 32px;
  padding: 0;
  background: #efede7;
  color: var(--soft-ink);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffefa;
  color: var(--soft-ink);
  font-size: 14px;
  font-weight: 760;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent);
  color: #fffdfa;
}

select,
.result input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffefa;
  color: var(--ink);
  padding: 0 14px;
}

select {
  max-width: 150px;
  cursor: pointer;
}

#ttlHours[disabled],
#viewSeconds[disabled] {
  display: none;
}

#shareButton {
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.14);
}

.status {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: 14px;
}

.status.error {
  color: var(--warn);
  font-weight: 760;
}

.result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  margin-top: 12px;
  padding: 8px;
  border: 1px solid rgba(47, 138, 104, 0.18);
  border-radius: 8px;
  background: rgba(231, 242, 236, 0.72);
}

.result[hidden] {
  display: none;
}

.resultField {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 4px 8px;
}

.resultField span {
  color: var(--green);
  font-size: 12px;
  font-weight: 840;
}

.result input {
  width: 100%;
  min-height: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--soft-ink);
  font-size: 14px;
  outline: 0;
}

#copyButton {
  min-width: 116px;
  align-self: stretch;
  padding: 0 16px;
  background: var(--green);
  box-shadow: 0 10px 22px rgba(47, 138, 104, 0.2);
}

.result.copied #copyButton {
  background: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffefa;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 780;
  white-space: nowrap;
}

.siteStats {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.siteStats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 252, 0.58);
}

.siteStats strong {
  color: var(--soft-ink);
  font-weight: 820;
}

.sharedCard {
  min-height: 136px;
}

.imageTile {
  width: 100%;
  min-height: 136px;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 8px;
  align-items: end;
  justify-items: start;
  padding: 14px;
  background: #fffefa;
  color: var(--ink);
  text-align: left;
}

.imageTile:disabled {
  opacity: 1;
}

.tileIcon {
  align-self: start;
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.sharedCard:not(.viewed) .imageTile:hover {
  background: var(--field);
}

.sharedCard.viewed {
  background: #efede7;
}

.modalOpen {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 8, 8, 0.76);
}

.modal[hidden] {
  display: none;
}

.modalPanel {
  width: min(980px, 100%);
  max-height: min(820px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 8px;
  background: #0d0d0d;
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.34);
}

.modalTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 12px;
  color: #fffdfa;
}

.modalTop div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.modalTop strong,
.modalTop span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modalTop span {
  color: #bab8b2;
  font-size: 13px;
}

.iconButton {
  width: 36px;
  min-height: 36px;
  height: 36px;
  padding: 0;
  flex: 0 0 auto;
  background: #2a2a2a;
}

.modal img {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 92px);
  object-fit: contain;
  background: #050505;
}

@media (max-width: 720px) {
  .shell {
    width: calc(100vw - 20px);
    max-width: 920px;
    padding: 22px 0;
  }

  .brand,
  .shareHead {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .new-link {
    min-height: 40px;
  }

  .panel {
    padding: 12px;
    max-width: 100%;
  }

  .dropzone {
    min-height: 150px;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px;
  }

  .dropIcon {
    width: 48px;
    height: 48px;
    font-size: 30px;
  }

  .dropzone strong {
    font-size: 20px;
  }

  .fileGrid,
  .sharedGrid {
    grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .choice,
  select {
    width: 100%;
    max-width: none;
    justify-content: center;
  }

  .result {
    grid-template-columns: 1fr;
  }

  #copyButton {
    min-height: 46px;
  }
}

  h1 {
    max-width: 100%;
    font-size: 34px;
    line-height: 1.02;
  }

  h2 {
    font-size: 28px;
  }
}
