.card.hasNotes,
.card.hasAttachments{
  padding-top: calc(14px * var(--card-scale, 1));
  padding-right: calc(10px * var(--card-scale, 1));
}
.card.hasNotes.hasAttachments{
  padding-right: calc(10px * var(--card-scale, 1));
}

.attachmentIcon {
  position: absolute;
  bottom: calc(1px * var(--card-scale, 1));
  right: calc(0px * var(--card-scale, 1));
  width: calc(17px * var(--card-scale, 1));
  height: calc(17px * var(--card-scale, 1));
  padding: calc(1.5px * var(--card-scale, 1));
  box-sizing: border-box;
  opacity: 0.95;
  color: #fff;
  background: linear-gradient(135deg, #ff6b6b, #f7b733 45%, #4facfe);
  border-radius: 50%;
  box-shadow: 0 calc(2px * var(--card-scale, 1)) calc(6px * var(--card-scale, 1)) rgba(0,0,0,0.18);
  pointer-events: auto;
  cursor: pointer;
  display: none;
}
.card.hasAttachments .attachmentIcon{
  display: block;
}
.card.hasAttachments:not(.hasNotes) .attachmentIcon{
  right: calc(0px * var(--card-scale, 1));
}
.attachmentIcon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.attachmentViewerOverlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 10px;
}
.attachmentViewerOverlay.is-preview-expanded{
  background: #050505;
  padding: 0;
}

.attachmentViewer{
  width: min(1400px, 98vw);
  height: min(900px, 96vh);
  max-height: 96vh;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 18px 40px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
}

.attachmentViewerHeader{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  font-weight: 600;
  cursor: grab;
}
.attachmentViewerHeader:active{
  cursor: grabbing;
}
.attachmentViewerHeader button{
  cursor: pointer;
}

.attachmentViewerHeader svg{
  width: 18px;
  height: 18px;
}

.attachmentViewerClose{
  margin-left: auto;
  border: none;
  background: rgba(0,0,0,0.05);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}

.attachmentViewerBody{
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px 12px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.attachmentViewerList{
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  padding-right: 6px;
}

.attachmentViewerItem{
  border: 1px solid rgba(0,0,0,0.1);
  background: #f7f7f7;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.attachmentViewerItem.is-active{
  background: #e9f2ff;
  border-color: #84b0ff;
}

.attachmentViewerPreview{
  background: #fafafa;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.attachmentViewerPreview.is-expanded{
  position: fixed;
  inset: 0;
  z-index: 10001;
  width: 100vw;
  height: 100vh;
  box-sizing: border-box;
  border-radius: 0;
  padding: 12px;
  background: #050505;
}
.attachmentViewerPreview:fullscreen{
  width: 100vw;
  height: 100vh;
  box-sizing: border-box;
  border-radius: 0;
  padding: 12px;
  background: #050505;
}
.attachmentViewerPreview:-webkit-full-screen{
  width: 100vw;
  height: 100vh;
  box-sizing: border-box;
  border-radius: 0;
  padding: 12px;
  background: #050505;
}

.attachmentViewerPreviewControls{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.attachmentViewerPreview:fullscreen .attachmentViewerPreviewControls,
.attachmentViewerPreview:-webkit-full-screen .attachmentViewerPreviewControls,
.attachmentViewerPreview.is-expanded .attachmentViewerPreviewControls{
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 10003;
  pointer-events: none;
}
.attachmentViewerPreview:fullscreen .attachmentViewerPreviewControls{
  color: #f5f5f5;
}
.attachmentViewerPreview:-webkit-full-screen .attachmentViewerPreviewControls{
  color: #f5f5f5;
}
.attachmentViewerPreview.is-expanded .attachmentViewerPreviewControls{
  color: #f5f5f5;
}

.attachmentViewerNav,
.attachmentViewerAction{
  border: 1px solid rgba(0,0,0,0.1);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  cursor: pointer;
}
.attachmentViewerRenameInput{
  flex: 1 1 160px;
  min-width: 120px;
  padding: 6px 8px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  font: inherit;
}
.attachmentDocxReviewModeSelect{
  min-width: 158px;
  padding: 6px 30px 6px 9px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  color: #202124;
  background: #fff;
  font: inherit;
  cursor: pointer;
}
.attachmentViewerPreview:fullscreen .attachmentDocxReviewModeSelect,
.attachmentViewerPreview:-webkit-full-screen .attachmentDocxReviewModeSelect,
.attachmentViewerPreview.is-expanded .attachmentDocxReviewModeSelect{
  border-color: rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.9);
  background-color: rgba(20,20,20,0.72);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  pointer-events: auto;
  backdrop-filter: blur(10px);
}
.attachmentViewerDeleteAction.is-confirming{
  border-color: #d23f3f;
  background: #fdecec;
  color: #b42318;
  font-weight: 600;
}
.attachmentViewerPreview:fullscreen .attachmentViewerNav,
.attachmentViewerPreview:-webkit-full-screen .attachmentViewerNav,
.attachmentViewerPreview.is-expanded .attachmentViewerNav{
  position: fixed;
  top: 50%;
  z-index: 10004;
  width: 52px;
  height: 76px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background: rgba(20,20,20,0.36);
  color: rgba(255,255,255,0.82);
  box-shadow: 0 10px 32px rgba(0,0,0,0.24);
  font-size: 42px;
  line-height: 1;
  transform: translateY(-50%);
  pointer-events: auto;
  backdrop-filter: blur(10px);
}
.attachmentViewerPreview:fullscreen .attachmentViewerNav:hover,
.attachmentViewerPreview:-webkit-full-screen .attachmentViewerNav:hover,
.attachmentViewerPreview.is-expanded .attachmentViewerNav:hover{
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.attachmentViewerPreview:fullscreen .attachmentViewerNav:disabled,
.attachmentViewerPreview:-webkit-full-screen .attachmentViewerNav:disabled,
.attachmentViewerPreview.is-expanded .attachmentViewerNav:disabled{
  display: none;
}
.attachmentViewerPreview:fullscreen .attachmentViewerNavPrev,
.attachmentViewerPreview:-webkit-full-screen .attachmentViewerNavPrev,
.attachmentViewerPreview.is-expanded .attachmentViewerNavPrev{
  left: 18px;
}
.attachmentViewerPreview:fullscreen .attachmentViewerNavNext,
.attachmentViewerPreview:-webkit-full-screen .attachmentViewerNavNext,
.attachmentViewerPreview.is-expanded .attachmentViewerNavNext{
  right: 18px;
}
.attachmentViewerPreview:fullscreen .attachmentViewerAction,
.attachmentViewerPreview:-webkit-full-screen .attachmentViewerAction,
.attachmentViewerPreview.is-expanded .attachmentViewerAction{
  border-color: rgba(255,255,255,0.16);
  background: rgba(20,20,20,0.34);
  color: rgba(255,255,255,0.84);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  pointer-events: auto;
  backdrop-filter: blur(10px);
}
.attachmentViewerPreview:fullscreen .attachmentViewerAction:hover,
.attachmentViewerPreview:-webkit-full-screen .attachmentViewerAction:hover,
.attachmentViewerPreview.is-expanded .attachmentViewerAction:hover{
  background: rgba(255,255,255,0.18);
  color: #fff;
}
.attachmentViewerCloseFullscreen{
  display: none;
}
.attachmentViewerPreview:fullscreen .attachmentViewerCloseFullscreen,
.attachmentViewerPreview:-webkit-full-screen .attachmentViewerCloseFullscreen,
.attachmentViewerPreview.is-expanded .attachmentViewerCloseFullscreen{
  display: inline-block;
}
.attachmentViewerPreview:fullscreen .attachmentViewerFullscreenAction,
.attachmentViewerPreview:-webkit-full-screen .attachmentViewerFullscreenAction,
.attachmentViewerPreview.is-expanded .attachmentViewerFullscreenAction{
  display: none;
}

.attachmentViewerNav:disabled,
.attachmentViewerAction:disabled{
  opacity: 0.5;
  cursor: default;
}

.attachmentViewerIndexLabel{
  margin-left: 6px;
  font-size: 0.9rem;
  color: #444;
}
.attachmentViewerPreview:fullscreen .attachmentViewerIndexLabel,
.attachmentViewerPreview:-webkit-full-screen .attachmentViewerIndexLabel,
.attachmentViewerPreview.is-expanded .attachmentViewerIndexLabel{
  flex: 0 0 auto;
  margin-left: 68px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(20,20,20,0.28);
  color: rgba(255,255,255,0.74);
  pointer-events: none;
  backdrop-filter: blur(10px);
}
.attachmentViewerCaption{
  flex: 1 1 220px;
  min-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  color: rgba(0,0,0,0.58);
  text-align: left;
}
.attachmentViewerPreview:fullscreen .attachmentViewerCaption,
.attachmentViewerPreview:-webkit-full-screen .attachmentViewerCaption,
.attachmentViewerPreview.is-expanded .attachmentViewerCaption{
  align-self: center;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(20,20,20,0.26);
  color: rgba(255,255,255,0.72);
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.attachmentViewerPreviewViewport{
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.attachmentViewerPreview:fullscreen .attachmentViewerPreviewViewport{
  overflow: hidden;
  background: #050505;
}
.attachmentViewerPreview:-webkit-full-screen .attachmentViewerPreviewViewport{
  overflow: hidden;
  background: #050505;
}
.attachmentViewerPreview.is-expanded .attachmentViewerPreviewViewport{
  overflow: hidden;
  background: #050505;
}
.attachmentViewerPreviewViewport.is-text{
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
}
.attachmentViewerPreviewViewport.is-docx{
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  background: #e8e8e8;
}
.attachmentViewerPreview.is-docx:fullscreen .attachmentViewerPreviewViewport,
.attachmentViewerPreview.is-docx:-webkit-full-screen .attachmentViewerPreviewViewport,
.attachmentViewerPreview.is-expanded.is-docx .attachmentViewerPreviewViewport{
  overflow: auto;
  background: #e8e8e8;
}

.attachmentDocxPreview{
  width: 100%;
  min-height: 100%;
  color: #111;
  text-align: left;
  --docx-review-rail-width: 280px;
  --docx-review-rail-gap: 18px;
}
.attachmentDocxPreview .attachmentDocx-wrapper{
  box-sizing: border-box;
  min-height: 100%;
}
.attachmentDocxPreview.has-docx-review .attachmentDocx-wrapper{
  padding: 30px calc(var(--docx-review-rail-width) + var(--docx-review-rail-gap) + 30px) 0 30px !important;
}
.attachmentDocxPreview.has-docx-review section.attachmentDocx{
  overflow: visible;
}
.attachmentDocxPreview .attachmentDocxSuggestion{
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  cursor: default;
  padding: 0 1px;
  transition: box-shadow 120ms ease, filter 120ms ease;
}
.attachmentDocxPreview ins.attachmentDocxSuggestion{
  color: #137333 !important;
  background: #e6f4ea !important;
  text-decoration-color: #34a853 !important;
  text-decoration-line: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 2px;
}
.attachmentDocxPreview ins.attachmentDocxSuggestion.is-final-view,
.attachmentDocxPreview ins.attachmentDocxSuggestion.is-final-view *{
  color: inherit !important;
  background: transparent !important;
  box-shadow: none !important;
  text-decoration: none !important;
}
.attachmentDocxPreview del.attachmentDocxSuggestion{
  color: #c5221f !important;
  background: #fce8e6 !important;
  text-decoration-color: #ea4335 !important;
  text-decoration-line: line-through !important;
  text-decoration-thickness: 2px !important;
}
.attachmentDocxPreview ins.attachmentDocxSuggestion *,
.attachmentDocxPreview del.attachmentDocxSuggestion *{
  color: inherit !important;
  text-decoration-color: inherit !important;
}
.attachmentDocxPreview .attachmentDocxSuggestion.is-review-active{
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.24);
  filter: saturate(1.08);
}
.attachmentDocxPreview .attachmentDocx-comment-ref{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0 2px;
  border-radius: 9px;
  color: #7a4f01;
  background: #fbbc04;
  font-size: 11px;
  line-height: 1;
  vertical-align: text-bottom;
  cursor: pointer;
  transition: box-shadow 120ms ease, transform 120ms ease;
}
.attachmentDocxPreview .attachmentDocx-comment-ref.is-review-active{
  box-shadow: 0 0 0 3px rgba(251, 188, 4, 0.3);
  transform: scale(1.08);
}
.attachmentDocxPreview .attachmentDocx-comment-popover.is-moved-to-review-rail{
  display: none !important;
}
.attachmentDocxReviewRail{
  position: absolute;
  top: 0;
  left: calc(100% + var(--docx-review-rail-gap));
  width: var(--docx-review-rail-width);
  height: 100%;
  z-index: 6;
  pointer-events: none;
}
.attachmentDocxReviewCard{
  appearance: none;
  position: absolute;
  left: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  max-height: 154px;
  padding: 10px 11px;
  overflow: hidden;
  border: 1px solid #dadce0;
  border-color: color-mix(in srgb, var(--review-accent) 35%, #dadce0);
  border-left: 4px solid var(--review-accent);
  border-radius: 9px;
  color: #202124;
  background: #fff;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.2), 0 2px 8px rgba(60, 64, 67, 0.12);
  font: 12px/1.35 Arial, sans-serif;
  text-align: left;
  pointer-events: auto;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.attachmentDocxReviewCard[hidden]{
  display: none !important;
}
.attachmentDocxReviewCard::before{
  content: "";
  position: absolute;
  top: 17px;
  right: 100%;
  width: var(--docx-review-rail-gap);
  border-top: 1px solid #bdc1c6;
  border-top-color: color-mix(in srgb, var(--review-accent) 58%, #dadce0);
}
.attachmentDocxReviewCard:hover,
.attachmentDocxReviewCard:focus-visible,
.attachmentDocxReviewCard.is-active{
  border-color: var(--review-accent);
  box-shadow: 0 2px 6px rgba(60, 64, 67, 0.24), 0 5px 14px rgba(60, 64, 67, 0.16);
  outline: none;
  transform: translateX(2px);
}
.attachmentDocxReviewHeading{
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  grid-template-areas:
    "avatar author"
    "avatar type";
  column-gap: 7px;
  align-items: center;
  min-width: 0;
}
.attachmentDocxReviewAvatar{
  grid-area: avatar;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: var(--review-accent);
  background: var(--review-tint);
  font-size: 12px;
  font-weight: 700;
}
.attachmentDocxReviewAuthor{
  grid-area: author;
  overflow: hidden;
  color: #202124;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachmentDocxReviewType{
  grid-area: type;
  color: #5f6368;
  font-size: 10px;
  letter-spacing: 0.02em;
}
.attachmentDocxReviewText{
  display: -webkit-box;
  overflow: hidden;
  color: #3c4043;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.attachmentDocxReviewDate{
  color: #80868b;
  font-size: 10px;
}
.attachmentDocxReviewRail.has-overflow .attachmentDocxReviewCard{
  max-height: 116px;
}
::highlight(attachmentDocx-comments){
  color: inherit;
  background: rgba(251, 188, 4, 0.32);
  text-decoration: underline;
  text-decoration-color: rgba(176, 96, 0, 0.62);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

@media (max-width: 900px){
  .attachmentDocxPreview{
    --docx-review-rail-width: 230px;
    --docx-review-rail-gap: 12px;
  }
}

.attachmentMarkdown{
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
}
.attachmentMarkdown .md-h1,
.attachmentMarkdown .md-h2,
.attachmentMarkdown .md-h3,
.attachmentMarkdown .md-h4{
  display: inline-block;
  margin: 0 6px 4px 0;
  font-weight: 700;
}
.attachmentMarkdown .md-h1{
  font-size: 20px;
  margin-bottom: 0.5em;
}
.attachmentMarkdown .md-h2{
  font-size: 17px;
  margin-bottom: 0.35em;
}
.attachmentMarkdown .md-h3{
  font-size: 15px;
  margin-bottom: 0.25em;
}
.attachmentMarkdown .md-h4{
  font-size: 14px;
  margin-bottom: 0.12em;
}
.attachmentMarkdown ul{
  margin: 2px 0 2px 14px;
  padding-left: 12px;
  list-style-type: disc;
}
.attachmentMarkdown li{
  margin: 0;
  padding: 0;
  line-height: 1.35;
}
.attachmentMarkdown .md-table-wrap{
  margin: 6px 0 2px;
  overflow-x: auto;
}
.attachmentMarkdown .md-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.attachmentMarkdown .md-table th,
.attachmentMarkdown .md-table td{
  border: 1px solid rgba(0,0,0,0.18);
  padding: 4px 6px;
  text-align: left;
  vertical-align: top;
}
.attachmentMarkdown .md-table th{
  background: rgba(0,0,0,0.06);
  font-weight: 700;
}
.attachmentMarkdown .md-hr{
  border: none;
  border-top: 1px solid rgba(0,0,0,0.2);
  margin: 8px 0;
}
.attachmentMarkdown .md-code-block{
  margin: 6px 0 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0,0,0,0.06);
  overflow-x: auto;
  white-space: pre;
}
.attachmentMarkdown .md-blockquote{
  margin: 6px 0;
  padding: 2px 0 2px 12px;
  border-left: 3px solid rgba(0,0,0,0.2);
  color: rgba(0,0,0,0.78);
}
.attachmentMarkdown .md-blockquote .md-blockquote{
  margin: 4px 0 0;
}
.attachmentMarkdown .md-code-block code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.attachmentViewerPreviewViewport img{
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}
.attachmentViewerPreview:fullscreen .attachmentViewerPreviewViewport img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}
.attachmentViewerPreview:-webkit-full-screen .attachmentViewerPreviewViewport img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}
.attachmentViewerPreview.is-expanded .attachmentViewerPreviewViewport img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}

.attachmentViewerPreviewViewport video{
  width: 100%;
  max-height: 100%;
  border-radius: 8px;
  background: #000;
}

.attachmentViewerPreviewViewport audio{
  width: 100%;
  max-width: 720px;
}

.attachmentAudioPreview{
  width: 100%;
  max-width: 760px;
  display: grid;
  gap: 10px;
}

.attachmentAudioControls{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.attachmentAudioTimeInput{
  min-width: 110px;
  padding: 6px 8px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  font: inherit;
}

.attachmentAudioSpeedLabel{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #333;
}

.attachmentAudioSpeedSelect{
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  padding: 5px 6px;
  font: inherit;
  background: #fff;
}

.attachmentAudioTimeLabel{
  margin-left: auto;
  font-size: 0.9rem;
  color: #444;
  font-variant-numeric: tabular-nums;
}

.attachmentAudioShortcutHint{
  font-size: 0.82rem;
  color: #555;
  line-height: 1.35;
}

.attachmentViewerPreviewViewport iframe{
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  border-radius: 8px;
  background: #fff;
}

.attachmentViewerError{
  max-width: 520px;
  text-align: left;
  padding: 12px;
  border: 1px solid rgba(0,0,0,0.1);
  background: #fff5f5;
  border-radius: 10px;
  color: #4a1f1f;
}

.attachmentViewerErrorTitle{
  font-weight: 600;
  margin-bottom: 6px;
}

.attachmentViewerErrorList{
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 0.92rem;
}
