/* File actions share the same edge, color and touch target across native and custom controls. */
:root {
  --premium-file-panel:var(--premium-panel,var(--panel,#fffefa));
  --premium-file-ink:var(--premium-ink,var(--ink,#14283a));
  --premium-file-accent:var(--brand-deep,var(--premium-accent,var(--accent,#086a73)));
  --premium-file-on-accent:var(--on-accent,#fff);
  --premium-file-tone:var(--brand-tone,var(--premium-accent,var(--accent,#258d9b)));
  --premium-file-surface:color-mix(in srgb,var(--premium-file-tone) 5%,var(--premium-file-panel));
  --premium-file-control:color-mix(in srgb,var(--premium-file-tone) 11%,var(--premium-file-panel));
  --premium-file-hover:color-mix(in srgb,var(--premium-file-tone) 18%,var(--premium-file-panel));
  --premium-file-line:color-mix(in srgb,var(--premium-file-tone) 23%,var(--premium-line,var(--line,#d9e3e5)));
  --premium-file-focus:var(--premium-file-accent);
}
:root[data-theme=dark] {
  --premium-file-panel:var(--premium-panel,var(--panel,#18272e));
  --premium-file-ink:var(--premium-ink,var(--ink,#eef5f6));
  --premium-file-accent:var(--brand-light,var(--premium-accent,var(--accent,#8ddad0)));
  --premium-file-on-accent:var(--on-accent,#172125);
  --premium-file-tone:var(--premium-file-accent);
  --premium-file-line:color-mix(in srgb,var(--premium-file-tone) 29%,var(--premium-line,var(--line,#344951)));
}

/* Native pickers remain native; many custom controls keep the input as an overlay. */
input[type=file]::file-selector-button {
  box-sizing:border-box;
  max-inline-size:100%;
  min-block-size:var(--ui-control-height,44px);
  margin-inline-end:var(--ui-space-2,8px);
  padding:.55rem .85rem;
  font:inherit;
  font-size:var(--ui-type-label,.875rem);
  font-weight:700;
  line-height:1.4;
  color:var(--premium-file-ink);
  background:var(--premium-file-control);
  border:1px solid var(--premium-file-line);
  border-radius:var(--ui-radius-sm,10px);
  cursor:pointer;
}
input[type=file]:disabled::file-selector-button {cursor:not-allowed}

/* Keep picker layout and clicks on their original label/input relationships. */
:is(.upload-box,.family-upload,.web-photo-upload) {
  color:var(--premium-file-ink);
  background:var(--premium-file-surface);
  border:1px solid var(--premium-file-line);
  border-radius:var(--ui-radius-md,14px);
}
.upload-box[data-profile-drop] {border-style:dashed}
.web-photo-upload {padding:var(--ui-space-3,12px)}
:is(.upload-box,.family-upload,.web-photo-upload) :is(strong,input) {min-inline-size:0}
:is(.upload-box,.family-upload,.web-photo-upload) :is(small,strong) {overflow-wrap:anywhere}
:is(.upload-box,.family-upload,.web-photo-upload) .icon {color:var(--premium-file-accent)}

:is(.message-file,.camera-upload-button,
    .media86-secondary-actions label,.composer84-options .composer-replace-all,
    .studio-media-choices label,.avatar-file-button,.reel-upload-cover):not(.primary) {
  color:var(--premium-file-ink);
  background:var(--premium-file-control);
  border:1px solid var(--premium-file-line);
  border-radius:var(--ui-radius-sm,10px);
}
:is(.composer84-media-actions,.upload84-media-actions)>.camera-upload-button {
  border-color:var(--premium-file-line);
  background:var(--premium-file-control);
}
:is(.studio-media-choices label,.meeting-library-dialog button[data-download]).primary {
  color:var(--premium-file-on-accent);
  background:var(--premium-file-accent);
  border-color:var(--premium-file-accent);
}
:is(.message-file,.avatar-file-button,.upload-box,.family-upload,.web-photo-upload,
    .media86-secondary-actions label,.composer-replace-all,.studio-media-choices label,
    .reel-upload-cover):has(input:focus-visible) {
  outline:2px solid var(--premium-file-focus);
  outline-offset:3px;
}

/* Match the quieter secondary action in recordings, exports, profile and download screens. */
:is(a[download],button[data-download],button[data-print-profile],
    button[data-action='print-local-resume'],button[data-action='record-save'],
    button[data-action='data-export'],button[data-action='reel-ai-export'],
    button[data-action='download-record'],button[data-action='download-snapshot'],
    button[name=draftAction][value=download]):not(.primary,.cw-btn--primary,[hidden]) {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:var(--ui-space-2,8px);
  box-sizing:border-box;
  min-block-size:var(--ui-control-height,44px);
  padding:.55rem .85rem;
  font-size:var(--ui-type-label,.875rem);
  font-weight:700;
  line-height:1.35;
  color:var(--premium-file-ink);
  background:var(--premium-file-control);
  border:1px solid var(--premium-file-line);
  border-radius:var(--ui-radius-sm,10px);
  text-decoration:none;
}
.voice-message-tools>a[download]:not([hidden]) {
  --voice-file-tint:color-mix(in srgb,var(--premium-file-tone),currentColor);
  color:inherit;
  font-size:var(--ui-type-caption,.8125rem);
  background:color-mix(in srgb,var(--voice-file-tint) 12%,transparent);
  border-color:color-mix(in srgb,var(--voice-file-tint) 29%,transparent);
  padding-inline:var(--ui-space-2,8px);
}
.meeting-library-dialog {box-shadow:var(--ui-shadow-lg,0 24px 64px #10182725)}
.meeting-library-dialog::backdrop {background:color-mix(in srgb,var(--brand-night,#102330) 60%,transparent);backdrop-filter:none}
.meeting-library-dialog [data-close] {
  width:var(--ui-control-height,44px);
  height:var(--ui-control-height,44px);
  border-radius:var(--ui-radius-sm,10px);
  background:var(--premium-file-control);
}
.meeting-record-card {
  margin-block:var(--ui-space-3,12px);
  padding:var(--ui-space-4,16px);
  border:1px solid var(--premium-file-line);
  border-radius:var(--ui-radius-md,14px);
  background:var(--premium-file-surface);
}
.meeting-record-card>:is(.button,.text-button) {margin-block:4px;margin-inline:0 var(--ui-space-2,8px)}
:is(input[type=file],a[download],button[data-download],button[data-print-profile]):focus-visible {
  outline:2px solid var(--premium-file-focus);
  outline-offset:3px;
}

@media (hover:hover) and (pointer:fine) {
  input[type=file]:not(:disabled)::file-selector-button:hover,
  :is(.upload-box,.family-upload,.web-photo-upload,.message-file,.avatar-file-button,
      .reel-upload-cover,.camera-upload-button,.media86-secondary-actions label,
      .composer84-options .composer-replace-all,.studio-media-choices label,
      a[download],button[data-download],button[data-print-profile],
      button[data-action='print-local-resume'],button[data-action='record-save'],
      button[data-action='data-export'],button[data-action='reel-ai-export'],
      button[data-action='download-record'],button[data-action='download-snapshot'],
      button[name=draftAction][value=download]):hover:not(.primary,.cw-btn--primary,:disabled,[aria-disabled=true]) {
    background:var(--premium-file-hover);
  }
  .voice-message-tools>a[download]:hover {background:color-mix(in srgb,var(--voice-file-tint) 20%,transparent)}
}
