:root {
  color-scheme: light;
  --bg: #f6f7f5;
  --panel: #ffffff;
  --panel-soft: #f0f8f7;
  --text: #252a2c;
  --muted: #667074;
  --line: #dde3e1;
  --teal: #168477;
  --teal-dark: #0d6258;
  --blue: #2f6fbd;
  --amber: #bc7a19;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(33, 43, 48, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea {
  font: inherit;
}

.shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 720;
  letter-spacing: 0;
}

.composer,
.recent {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.composer {
  padding: 18px;
}

.composer-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.share-room-button {
  gap: 8px;
  font-weight: 720;
}

.share-room-label {
  white-space: nowrap;
}

.share-room-button.is-copied {
  border-color: rgba(22, 132, 119, 0.38);
  color: var(--teal);
  background: var(--panel-soft);
}

.share-room-button.is-copy-failed {
  border-color: rgba(180, 35, 24, 0.32);
  color: var(--danger);
  background: #fff6f4;
}

.label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.textarea-wrap {
  position: relative;
}

textarea {
  display: block;
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--text);
  background: #fbfcfb;
  line-height: 1.45;
  outline: none;
}

.char-count {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}

textarea:focus {
  border-color: rgba(22, 132, 119, 0.65);
  box-shadow: 0 0 0 4px rgba(22, 132, 119, 0.12);
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 7px;
  margin-top: 14px;
  min-height: 130px;
  border: 1px dashed #aab8b5;
  border-radius: 8px;
  background: #fbfcfb;
  padding: 14px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--teal);
  background: var(--panel-soft);
}

.dropzone.is-dragging {
  transform: translateY(-1px);
}

.dropzone input {
  display: none;
}

.cloud-symbol {
  display: block;
  margin-bottom: 3px;
  color: var(--teal);
}

.cloud-symbol svg {
  display: block;
  width: 54px;
  height: 42px;
}

.cloud-symbol path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.drop-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 740;
  text-align: center;
}

.drop-meta {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.selected-files {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.selected-file {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 13px;
}

.selected-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file-details {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.selected-file-status {
  color: var(--blue);
  font-weight: 720;
}

.selected-file.is-done .selected-file-status {
  color: var(--teal);
}

.selected-file.is-failed .selected-file-status {
  color: var(--danger);
}

.progress {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edeb;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width 120ms ease;
}

.form-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.primary-button,
.ghost-button,
.icon-button,
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
  will-change: transform;
}

.primary-button:active,
.ghost-button:active,
.icon-button:active,
.action-button:active {
  transform: translateY(1px) scale(0.96);
}

.primary-button.is-clicked,
.ghost-button.is-clicked,
.icon-button.is-clicked,
.action-button.is-clicked {
  animation: button-press 260ms ease;
}

.button-symbol {
  display: inline-block;
  line-height: 1;
}

.primary-button {
  min-height: 42px;
  min-width: 190px;
  padding: 0 22px;
  background: var(--teal);
  color: #fff;
  font-weight: 720;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.primary-button.is-error {
  background: var(--danger);
}

.primary-button.is-busy {
  background: var(--blue);
}

.ghost-button {
  min-height: 42px;
  padding: 0 14px;
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.ghost-button:hover,
.icon-button:hover,
.action-button:hover {
  border-color: #b8c5c2;
  color: var(--text);
  background: #f8faf9;
}

.recent {
  margin-top: 18px;
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

h2 {
  font-size: 17px;
  line-height: 1.2;
  font-weight: 740;
  letter-spacing: 0;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 18px;
}

.items {
  display: grid;
}

.loading-state {
  display: grid;
  min-height: 118px;
  place-items: center;
  padding: 24px 18px;
}

.list-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #dce7e4;
  border-top-color: var(--teal);
  border-radius: 999px;
  animation: list-spin 720ms linear infinite;
}

.item {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.item.is-previewable:hover {
  background: #fbfcfb;
}

.item.is-previewable:focus-visible {
  outline: 3px solid rgba(22, 132, 119, 0.2);
  outline-offset: -3px;
}

.item:last-child {
  border-bottom: 0;
}

.thumb,
.file-mark,
.text-mark {
  width: 74px;
  height: 64px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.thumb {
  display: block;
  object-fit: cover;
  background: #edf2f1;
}

.file-mark,
.text-mark {
  display: grid;
  place-items: center;
  background: #f5f8f7;
  color: var(--muted);
  font-weight: 760;
  text-transform: uppercase;
  font-size: 12px;
}

.text-mark {
  background: #fff7ea;
  color: var(--amber);
  text-transform: none;
  font-size: 20px;
}

.item-body {
  min-width: 0;
}

.item-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 15px;
  font-weight: 720;
}

.item-excerpt {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: #3f484b;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: pre-wrap;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.date-meta,
.expires-meta {
  white-space: nowrap;
}

.expires-meta {
  color: var(--teal);
  font-weight: 740;
}

.expires-meta.is-soon {
  color: var(--amber);
}

.expires-meta.is-expired {
  color: var(--danger);
}

.actions {
  display: flex;
  gap: 8px;
  cursor: default;
}

.action-button {
  width: 36px;
  height: 36px;
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 16px;
}

.empty-state {
  padding: 34px 18px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 25, 28, 0.72);
}

.preview-frame {
  position: relative;
  display: grid;
  gap: 10px;
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
}

.preview-frame img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.preview-frame.is-text {
  width: min(760px, 100%);
}

.preview-text {
  display: block;
  width: 100%;
  max-height: calc(100vh - 48px);
  margin: 0;
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: 14px/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@keyframes button-press {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(0.93);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes list-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .primary-button,
  .ghost-button,
  .icon-button,
  .action-button,
  .progress-bar {
    transition: none;
  }

  .primary-button.is-clicked,
  .ghost-button.is-clicked,
  .icon-button.is-clicked,
  .action-button.is-clicked {
    animation: none;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 760px);
    padding-top: 18px;
  }

  .form-actions {
    display: flex;
  }

  .primary-button {
    width: 100%;
  }

  .composer-head {
    justify-content: stretch;
  }

  .share-room-button {
    width: 100%;
  }

  .item {
    grid-template-columns: 58px 1fr;
    align-items: start;
  }

  .thumb,
  .file-mark,
  .text-mark {
    width: 58px;
    height: 54px;
  }

  .actions {
    grid-column: 2;
  }

}
