.z-element {
  display: flex;
  flex-flow: column nowrap;
}

.z-app {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  position: relative;
  cursor: default;
  touch-action: manipulation;
  user-select: none;
  font-family: 'IBM Plex Sans', 'IBM Plex Sans JP', sans-serif;
}

.z-button {
  user-select: none;
  padding: 8px 16px;
  display: inline-flex;
  flex-flow: row nowrap;
  align-items: center;
}

.z-text-field {
  height: 40px;
}

.z-text-field>input {
  display: flex;
  background-color: var(--gray-10);
  border: none;
  border-bottom: 1px solid var(--border-strong);
  padding: 0 16px;
  margin: 0;
  flex: 1;
  height: 40px;
  box-sizing: border-box;
  border-radius: 0;
  -webkit-appearance: none;
  outline-offset: -2px;
}

.z-file-list-panel .panel-header {
  border-bottom: var(--single-pixel) solid var(--gray-20);
}

.z-file-list-panel .panel-header .z-toolbar {
  border-bottom: none;
}

.search-toolbar.hidden {
  display: none;
}

.z-search-field {
  flex-flow: row nowrap;
  align-items: center;
  height: 40px;
  background-color: var(--gray-20);
  border-radius: 20px;
  padding: 0 0 0 16px;
}

.z-search-field>input {
  background-color: transparent;
  border: none;
  padding: 0 16px;
  margin: 0;
  flex: 1;
  height: 40px;
  box-sizing: border-box;
  border-radius: 0;
  -webkit-appearance: none;
  outline-offset: -2px;
}

.z-svg-icon {
  width: 24px;
  height: 24px;
  fill: var(--text-01);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
}

.clear-button.hidden {
  display: none;
}

.z-panel-stack {
  overflow: hidden;
  flex: 1;
  position: relative;
}

.z-toolbar {
  flex-flow: row nowrap;
  height: 64px;
  font-size: 18px;
  padding: 0 8px;
  color: var(--gray-100);
  align-items: center;
  border-bottom: var(--single-pixel) solid var(--gray-20);
  background: #F7F7F7;
  box-sizing: border-box;
}

.z-panel {
  flex-flow: column nowrap;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  contain: strict;
}

.z-panel .panel-body {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
}

.title-item {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  font-size: 18px;
  color: var(--text-01);
}

.z-panel.hidden {
  opacity: 0;
}

.back-button.hidden {
  visibility: hidden;
}

.z-file-list {
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 119px));
  align-content: start;
  grid-gap: 32px 8px;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.z-file-list-item {
  display: flex;
  flex-flow: column nowrap;
  height: 147px;
  padding: 0;
  border: none;
  contain: strict;
}

.z-file-list-item .icon-area {
  flex: 1;
  display: flex;
  flex-flow: column nowrap;
  justify-content: flex-end;
  margin: 0;
  overflow: hidden;
  position: relative;
}

.z-file-list-item .preview-container {
  align-self: center;
  display: flex;
  flex-flow: column nowrap;
  justify-content: flex-end;
  margin: 0;
  overflow: hidden;
  position: relative;
}

.z-file-list-item.is-video:not(.is-folder) .preview-container:before {
  content: '▶';
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  pointer-events: none;
}

.z-file-list.display_gallery .z-file-list-item.is-video:not(.is-folder) .preview-container:before {
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  font-size: 12px;
}

.z-file-list-item .folder-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.z-file-list-item .folder-badge .z-svg-icon {
  width: 14px;
  height: 14px;
  fill: white;
}

.z-file-list.display_gallery .z-file-list-item .folder-badge {
  display: none;
}

.z-file-list.display_gallery .z-file-list-item.is-folder .preview-container {
  padding: 12px;
  box-sizing: border-box;
}

.z-file-list.display_gallery .z-file-list-item .z-svg-icon {
  width: 64px;
  height: 64px;
}

.z-file-list.display_gallery .z-file-list-item.is-folder .preview {
  -webkit-mask-image: url(/static/folder_mask.svg);
  -webkit-mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-image: url(/static/folder_mask.svg);
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2));
}

.z-file-list.display_gallery .z-file-list-item.is-folder .text-area {
  background: none;
}

.z-file-list.display_gallery .z-file-list-item.is-folder .name {
  color: var(--text-01);
  text-shadow: none;
}

.z-file-list-item .text-area {
  flex: initial;
  border-bottom: none;
  justify-content: initial;
  height: 79px;
}

.z-file-list-item .extras {
  font-size: 12px;
  color: var(--gray-60);
  display: flex;
  flex-flow: column nowrap;
  text-align: center;
}

.z-file-list-item .z-svg-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto;
}

.z-file-list-item .name {
  font-size: 14px;
  text-align: center;
  margin-top: 8px;
  white-space: normal;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.z-file-list-item .preview {
  border-radius: 4px;
  border: var(--single-pixel) solid var(--gray-20);
  box-sizing: border-box;
  max-width: 68px;
  max-height: 68px;
  align-self: center;
  justify-self: center;
  display: block;
}

.z-file-view {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-flow: column nowrap;
  position: relative;
}

.z-image-view,
.z-video-player {
  flex: 1;
  position: relative;
  overflow: hidden;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.z-video-player .description {
  max-height: 30vh;
  overflow-y: auto;
}

.z-image-view .image-area,
.z-video-player .video-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  display: flex;
}

.z-image-view img,
.z-video-player video {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.z-video-player .video-area.fill-mode video {
  object-fit: cover;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
}

.overlay {
  display: flex;
  flex-flow: column nowrap;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  user-select: none;
  transition: opacity 0.3s ease-in-out;
}

.overlay.hidden {
  display: none;
}

.overlay .z-svg-icon {
  fill: white;
}

.z-video-player .skip-forward-button,
.z-video-player .skip-back-button {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  padding: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.z-video-player .skip-forward-button {
  margin-left: 48px;
}

.z-video-player .skip-back-button {
  margin-right: 48px;
}

.z-video-player .play-pause-button {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 40px;
  padding: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.z-video-player .play-pause-button:active,
.z-video-player .skip-forward-button:active,
.z-video-player .skip-back-button:active {
  background-color: rgba(0, 0, 0, 0.7);
}

.z-video-player .time {
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  font-size: 12px;
  position: absolute;
  bottom: 8px;
  right: 32px;
}

.overlay .top-area {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
}

.spacer {
  flex: 1;
}

.overlay .middle-area {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  flex: 1;
}

.z-image-view .overlay .bottom-area {
  margin-bottom: 44px;
}

.overlay .bottom-area {
  display: flex;
  flex-flow: column nowrap;
  padding: 0 32px;
}

.z-seek-bar {
  position: relative;
  height: 44px;
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;

  .bar-canvas {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

.z-seek-bar .bar {
  height: 8px;
  background-color: var(--gray-70);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.z-seek-bar .progress {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background-color: var(--gray-20);
  border-radius: 4px;
}

.z-carousel {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-flow: column nowrap;
  position: relative;
  touch-action: none;

  >.content {
    display: block;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
    will-change: transform;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }

  >.content>.previous-slide,
  >.content>.next-slide,
  >.content>.current-slide {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
  }

  >.content>.previous-slide {
    transform: translateX(-100%);
  }

  >.content>.next-slide {
    transform: translateX(100%);
  }

  &.is-vertical>.content>.previous-slide {
    transform: translateY(-100%);
  }

  &.is-vertical>.content>.next-slide {
    transform: translateY(100%);
  }

  >.content>.slide {
    flex: 1;
    display: flex;
    flex-flow: column nowrap;
    overflow: hidden;
    width: 100%;
    height: 100%;
  }
}

.z-menu {
  position: absolute;
  background-color: white;
  border: var(--single-pixel) solid var(--gray-20);
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 1000;
  min-width: 300px;
  color: var(--gray-100);
}

.z-menu-item {
  padding: 0 30px 0 15px;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  height: 63px;
  box-sizing: border-box;
  border-bottom: var(--single-pixel) solid var(--gray-20);
}

.z-menu-item .label {
  flex: 1;
}

.z-menu-item:hover {
  background-color: var(--gray-10);
}

.z-menu-item:last-of-type {
  border-bottom: none;
}

.z-menu .menu-group {
  border-bottom: 11px solid var(--gray-10);
}

.z-menu .menu-group:last-of-type {
  border-bottom: none;
}

.z-menu-item[checkable] {
  padding-left: 60px;
}

.z-menu-item[checked] {
  background-image: url(/static/carbon/icons/src/svg/32/checkmark.svg);
  background-position: 16px center;
  background-repeat: no-repeat;
  background-size: 24px;
}

.z-menu-item.asc::after {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  background-image: url(/static/carbon/icons/src/svg/32/chevron--sort--up.svg);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: 24px;
}

.z-menu-item.desc::after {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  background-image: url(/static/carbon/icons/src/svg/32/chevron--sort--down.svg);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: 24px;
}

.panel-header .z-progress-bar {
  margin: -2px 0 -2px 0;
}

.z-progress-bar {
  position: relative;
  height: 4px;
  display: block;
  width: 100%;
  background-color: #9ef0f0;
  border-radius: 2px;
  overflow: hidden;
}

.z-progress-bar .indeterminate {
  background-color: #009d9a;
}

.z-progress-bar .indeterminate::before {
  content: '';
  position: absolute;
  background-color: inherit;
  top: 0;
  left: 0;
  bottom: 0;
  will-change: left, right;
  animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
}

.z-progress-bar .indeterminate::after {
  content: '';
  position: absolute;
  background-color: inherit;
  top: 0;
  left: 0;
  bottom: 0;
  will-change: left, right;
  animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
  animation-delay: 1.15s;
}

.z-progress-bar.hidden {
  display: none;
}

@keyframes indeterminate {
  0% {
    left: -35%;
    right: 100%;
  }
  60% {
    left: 100%;
    right: -90%;
  }
  100% {
    left: 100%;
    right: -90%;
  }
}

@keyframes indeterminate-short {
  0% {
    left: -200%;
    right: 100%;
  }
  60% {
    left: 107%;
    right: -8%;
  }
  100% {
    left: 107%;
    right: -8%;
  }
}

.z-file-list .empty-warning {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-flow: column nowrap;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gray-60);
  font-size: 14px;
  text-align: center;
}

.z-file-list .empty-warning .z-svg-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  fill: var(--gray-60);
}

.search-field-item {
  flex: 1;
}

.overlay .z-toolbar {
  background-color: transparent;
  border-bottom: none;
  flex: 1;
}

.z-video-player.overlay .time,
.z-image-view .overlay .size {
  white-space: nowrap;
}

.z-video-player.overlay .title,
.z-image-view .overlay .title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.z-video-player .z-seek-bar {
  padding: 0 32px max(env(safe-area-inset-bottom, 0), 16px) 32px;
}

.z-menu-item[data-value="display_list"]::after,
.z-menu-item[data-value="display_grid"]::after,
.z-menu-item[data-value="display_gallery"]::after {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  background-position: center center;
  background-repeat: no-repeat;
}

.z-menu-item[data-value="display_list"]::after {
  background-image: url(/static/carbon/icons/src/svg/32/list.svg);
}

.z-menu-item[data-value="display_grid"]::after {
  background-image: url(/static/carbon/icons/src/svg/32/grid.svg);
}

.z-menu-item[data-value="display_gallery"]::after {
  background-image: url(/static/carbon/icons/src/svg/32/thumbnail--2.svg);
}

.z-file-list.display_list {
  grid-template-columns: 1fr;
  grid-gap: 0;
}

.z-file-list.display_list .z-file-list-item {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  padding: 0 8px;
  overflow: hidden;
  height: 91px;
  box-sizing: border-box;
}

.z-file-list.display_list .z-file-list-item .icon-area {
  flex: initial;
  display: grid;
  margin: 0 16px 0 8px;
  width: 68px;
  height: 68px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  justify-content: center;
}

.z-file-list.display_list .z-file-list-item .text-area {
  flex: 1;
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;
  overflow: hidden;
  align-self: stretch;
  border-bottom: var(--single-pixel) solid var(--gray-20);
  text-align: initial;
}

.z-file-list.display_list .z-file-list-item .name {
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: initial;
}

.z-file-list.display_list .z-file-list-item .extras {
  font-size: 12px;
  color: var(--gray-60);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: initial;
  display: flex;
  flex-flow: row nowrap;
  margin-top: 4px;
}

.z-file-list.display_list .z-file-list-item .extras .size::before {
  content: ' / ';
}

.z-file-list.display_list .z-file-list-item .icon {
  display: block;
  align-self: center;
  justify-self: center;
  font-size: 48px;
}

.z-file-list.display_gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  grid-gap: 2px;
}

.z-file-list.display_gallery .z-file-list-item {
  aspect-ratio: 1;
  height: initial;
  padding: 0;
  border: none;
  position: relative;
  display: grid;
}

.z-file-list.display_gallery .z-file-list-item .icon-area {
  display: grid;
  flex: initial;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.z-file-list.display_gallery .z-file-list-item .icon-area .preview-container {
  width: 100%;
  height: 100%;
  align-self: stretch;
}

.z-file-list.display_gallery .z-file-list-item .icon-area .preview {
  width: 100%;
  height: 100%;
  max-width: initial;
  max-height: initial;
  border: none;
  border-radius: 0;
  object-fit: cover;
}

.z-file-list.display_gallery .z-file-list-item.has-preview .text-area {
  /* display: none; */
}

.z-file-list.display_gallery .z-file-list-item .text-area {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: auto;
  padding: 24px 6px 4px 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35) 0%, transparent 100%);
  pointer-events: none;
}

.z-file-list.display_gallery .z-file-list-item:not(.has-preview) .text-area {
  background: none;
}

.z-file-list.display_gallery .z-file-list-item:not(.has-preview) .name {
  color: var(--text-01);
  text-shadow: none;
}

.z-file-list.display_gallery .z-file-list-item .name {
  color: white;
  font-size: 12px;
  margin-top: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  -webkit-line-clamp: 1;
}

.z-file-list.display_gallery .z-file-list-item .extras {
  display: none;
}

.z-global-video {
  align-self: stretch;
  flex: 1;
  display: flex;
  flex-flow: column nowrap;
  align-items: center;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.z-global-video video {
  width: 100%;
  height: 100%;
  display: block;
}

/* Twitter Card Styles */
.twitter-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 100%;
  color: white;
}

.twitter-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.twitter-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.twitter-card-author {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.twitter-card-name {
  font-weight: 600;
  font-size: 14px;
  color: white;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.twitter-card-handle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.twitter-card-content {
  font-size: 14px;
  line-height: 1.4;
  max-height: 4.2em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  color: white;
}

.twitter-card-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.twitter-card-media-count {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.twitter-card-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.twitter-card-verified {
  color: #1d9bf0;
  font-size: 14px;
  font-weight: bold;
}

.twitter-card-bio {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 2px;
  max-height: 2.4em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.twitter-card-followers {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}

.overlay-translation {
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  border-left: 2px solid rgba(255, 255, 255, 0.4);
  padding: 6px 8px;
  margin-top: 4px;
  border-radius: 4px;
}

.translation-title {
  font-size: 14px;
}

.translation-bio {
  font-size: 11px;
}

.z-video-player .description,
.z-image-view .description {
  max-height: 30vh;
  overflow-y: auto;
}

