chromium/ash/webui/camera_app_ui/resources/css/main.css

/* Copyright 2019 The Chromium Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file. */

:root {
  color-scheme: only dark;

  --fast1-duration: 100ms;
  --fast2-duration: 200ms;
  --moderate1-duration: 250ms;
  --moderate2-duration: 500ms;
  --slow1-duration: 600ms;
  --slow2-duration: 1000ms;

  --standard-easing: cubic-bezier(0.4, 0, 0.2, 1);
  --enter-easing: cubic-bezier(0, 0, 0.2, 1);
  --exit-easing: cubic-bezier(0.4, 0, 1, 1);

  /* App specific settings */
  --big-icon: 48px;
  --bottom-line: 44px;
  --default-font-family: 'Google Sans', sans-serif;
  --fixed-width-font-family: 'Cousine', monospace;
  --left-line: 44px;
  --right-line: 50px;
  --small-icon: 40px;
  --top-line: 48px;

  /* From https://www.w3.org/TR/css-backgrounds-3/#corner-overlap. */
  --border-radius-rounded-with-short-side: 9999999px;

  /* These are calculated and overridden at runtime in views/camera/layout.ts */
  --preview-content-height: 0;
  --preview-content-left: 0;
  --preview-content-top: 0;
  --preview-content-width: 0;
  --preview-viewport-height: 0;
  --preview-viewport-width: 0;
}

html {
  height: 100%;  /* Required for printing. */
}

body {
  background: var(--cros-sys-app_base);
  bottom: 0;
  font-family: var(--default-font-family);
  height: 100%;
  left: 0;
  margin: 0;
  overflow: hidden;
  position: absolute;
  top: 0;
  /*
   * Disable pinch-to-zoom in CCA and allow the back gesture. Note that back
   * gesture is an OS-level gesture and can only be disabled by setting
   * `touch-action: none`.
   */
  touch-action: pan-left;
  width: 100%;
}

button,
input[type=radio],
input[type=checkbox],
label {
  background-color: transparent;
  border-radius: 4px;
  border-style: none;
  margin: 0;
  padding: 0;
  pointer-events: auto;
  position: relative;
}

input[type=radio],
input[type=checkbox] {
  -webkit-appearance: none;
}

[i18n-text] {
  user-select: none;
}

.buttons {
  align-items: center;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.buttons :is(button, input):enabled:active {
  transform: scale(1.07);
}

.buttons button,
.buttons input,
.menu-header .icon,
.menu-item .icon,
.menu-item.expandable::after {
  align-items: center;
  /* TODO(pihsun): Remove these two after all background image
   * usage are removed. */
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-shrink: 0;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.menu-item input.icon {
  outline-offset: -4px;
}
input[type=radio].icon {
  border-radius: 50%;
}

::-webkit-scrollbar {
  height: 0;
  width: 0;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: transparent;
  height: 0;
  width: 0;
}

.top-stripe {
  position: absolute;
  top: var(--top-line);
  transform: translateY(-50%);
}

.bottom-stripe {
  bottom: var(--bottom-line);
  position: absolute;
  transform: translateY(50%);
}

.left-stripe {
  left:  var(--left-line);
  opacity: 1;
  position: absolute;
  transform: translateX(-50%);
  transition: opacity var(--fast2-duration) var(--standard-easing);
  visibility: visible;
}

body.taking.video .left-stripe:not(#options-group),
body.taking.video #options-group :not(#open-ptz-panel) {
  opacity: 0;
  transition: visibility 0ms 225ms, opacity 225ms var(--standard-easing);
  visibility: hidden;
}

.right-stripe {
  position: absolute;
  right:  var(--right-line);
  transform: translateX(50%);
}

.vertical-center-stripe {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.top-stripe.right-stripe {
  transform: translate(50%, -50%);
}

.top-stripe.left-stripe {
  transform: translate(-50%, -50%);
}

.bottom-stripe.right-stripe {
  transform: translate(50%, 50%);
}

.bottom-stripe.left-stripe {
  transform: translate(-50%, 50%);
}

#shutters-group {
  bottom: var(--shutter-vertical-center);
  display: flex;
  flex-direction: column;
  transform: translate(50%, 50%);
}

body.tablet-landscape .actions-group {
  flex-direction: column-reverse;
}

mode-selector {
  left: calc(var(--left-line) * 2);
  right: calc(var(--right-line) * 2);

  body:is(.taking.video, .should-handle-intent-result, .doc-mode-reviewing) & {
    display: none;
  }
}

:is(#start-takephoto, #recordvideo, #video-snapshot):disabled {
  opacity: 0.38;
}

button.shutter {
  display: none;
  height: 60px;
  width: 60px;
  z-index: 1;  /* On top of transforming switch-mode buttons. */
}

body.video #recordvideo,
body:not(.taking):not(.video) #start-takephoto,
body:not(.timer):not(.video) #start-takephoto,
body.taking.timer:not(.video) #stop-takephoto {
  display: inline-block;
}

body:is(:not(.recording), .enable-gif-recording, .should-handle-intent-result) :is(#video-snapshot, #pause-recordvideo) {
  display: none;
}

#video-snapshot-holder {
  bottom: calc(var(--shutter-vertical-center) + 84px);
  transform: translate(50%, 50%);
}

#video-snapshot {
  height: 46px;
  width: 46px;
}

#start-takephoto,
#video-snapshot {
  position: relative;
}

:is(#start-takephoto, #video-snapshot) svg-wrapper {
  color: var(--cros-sys-inverse_surface);
  --secondary-color: var(--cros-sys-white);
}

:is(#start-takephoto, #video-snapshot, #stop-takephoto):enabled:hover::after {
  background: var(--cros-sys-hover_on_prominent);
  border-radius: 50%;
  content: '';
  display: block;
  inset: 0;
  position: absolute;
}

:is(#start-takephoto, #video-snapshot, #stop-takephoto):enabled:active
  svg-wrapper {
  color: var(--cros-sys-secondary);
}

body.taking #start-takephoto:active {
  transform: unset;
}

#stop-takephoto svg-wrapper {
  color: var(--cros-sys-inverse_surface);
  --secondary-color: var(--cros-sys-secondary_container);
}

#recordvideo-container {
  display: relative;
  /*
   * overflow: visible is needed since the progress bar for gif mode is larger
   * than the button. This can't be set on the button itself since the ripple
   * effect should be contained inside the button.
   */
  overflow: visible;
}

#recordvideo {
  --size: 60px;
}

#pause-recordvideo-holder {
  bottom: calc(var(--shutter-vertical-center) - 84px);
  transform: translate(50%, 50%);
}

#pause-recordvideo {
  --size: 46px;
}

#recordvideo,
#pause-recordvideo {
  --dot-size: 25%;
  --duration: 180ms;
  --square-delay: 45ms;
  --square-size: calc(100% / 3);

  background: var(--cros-sys-white);
  border-radius: 50%;
  height: var(--size);
  position: relative;
  transition: var(--duration) var(--standard-easing);
  width: var(--size);
}

:is(#recordvideo, #pause-recordvideo):hover::after {
  background: var(--cros-sys-hover_on_prominent);
  border-radius: 50%;
  content: '';
  display: block;
  inset: 0;
  position: absolute;
}

body.taking.video #recordvideo:hover::after {
  background: var(--cros-sys-hover_on_subtle);
}

#recordvideo .red-dot,
#pause-recordvideo .red-dot {
  background: var(--cros-ref-error40);
  border-radius: 50%;
  box-sizing: border-box;
  height: var(--dot-size);
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: var(--duration) var(--standard-easing);
  width: var(--dot-size);
}

body.taking.video #recordvideo .red-dot {
  height: var(--size);
  width: var(--size);
}

body:not(.recording-ui-paused).video #pause-recordvideo .red-dot {
  --dot-size: 0px;
}

#recordvideo .white-square {
  background: var(--cros-sys-white);
  border-radius: 2px;
  height: 0;
  left: 50%;
  opacity: 0;
  position: absolute;
  top: 50%;
  transition: var(--duration) var(--square-delay) var(--standard-easing);
  width: 0;
}

body.taking.video #recordvideo .white-square {
  height: var(--square-size);
  left: calc(50% - var(--square-size) / 2);
  opacity: 1;
  top: calc(50% - var(--square-size) / 2);
  width: var(--square-size);
}

#pause-recordvideo .two-bars {
  --bar-size: 20px;

  height: var(--bar-size);
  left: calc(50% - var(--bar-size) / 2);
  overflow: hidden;
  position: absolute;
  top: calc(50% - var(--bar-size) / 2);
  width: var(--bar-size);
}

#pause-recordvideo .two-bars svg-wrapper {
  color: var(--cros-sys-secondary_container);
}

body.video.recording.recording-ui-paused #recordvideo {
  --size: 46px;
}

body.video.recording-ui-paused #pause-recordvideo {
  --size: 60px;
}

body.video.recording-ui-paused #pause-recordvideo .two-bars {
  --bar-size: 0;
}

body.video.taking #recordvideo {
  /* Prevent white background shown outside red dot area (crbug.com/1125896) */
  background: transparent;
}

body:is(:not(.video), .record-type-gif, .record-type-time-lapse) #toggle-mic,
body:not(.multi-camera) switch-device-button {
  visibility: hidden;
}

#camera-mode {
  height: 40px;
  visibility: hidden;
  width: 40px;

  :is(svg-wrapper) {
    display: none;
  }
}

body:not(.scan):not(.video):not(.portrait) #camera-mode svg-wrapper.photo,
body.scan #camera-mode svg-wrapper.scan,
body.video #camera-mode svg-wrapper.video,
body.portrait #camera-mode svg-wrapper.portrait {
  display: unset;
}

body.mode-switching:not(.streaming) #camera-mode {
  visibility: visible;
}

#timer-tick-msg {
  color: var(--cros-sys-on_surface);
  font-size: 72px;
  visibility: hidden;
}

#timer-tick-msg.animate {
  opacity: 0.2;
  transform: scale(1.8, 1.8);
  transition: transform var(--moderate1-duration) ease-out,
              opacity var(--moderate1-duration) ease-out;
  visibility: visible;
}

body:is(.taking.video, .should-handle-intent-result, .doc-mode-reviewing) gallery-button {
  display: none;
}

.centered-overlay {
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

#options-group {
  --option-item-vpadding: 12px;
  --switch-device-gap: 32px;
  bottom: calc(var(--bottom-line) + (var(--big-icon) / 2) + var(--switch-device-gap) - var(--option-item-vpadding));
  flex-direction: column;
  transition: bottom var(--fast1-duration);
}

body:not(.multi-camera) #options-group,
body.taking.video #options-group {
  bottom: calc(var(--bottom-line) - var(--option-item-vpadding) - (var(--small-icon) / 2));
}

body.max-wnd #options-group {
  --option-item-vpadding: 18px;
  --switch-device-gap: 48px;
}

#options-group input,
#options-group button {
  margin: var(--option-item-vpadding) 0;
}

body:not(.enable-ptz) #open-ptz-panel {
  display: none;
}

#open-mirror-panel,
#open-grid-panel,
#open-timer-panel,
#open-ptz-panel,
#toggle-mic {
  border-radius: 12px;
}

#open-mirror-panel,
#open-grid-panel,
#toggle-mic {
  .on-icon {
    display: none;
  }
}

body:not(.mic) #toggle-mic {
  background: var(--cros-sys-error_container);
  .off-icon {
    color: var(--cros-sys-on_error_container);
  }
}

body.mirror #open-mirror-panel,
body.grid #open-grid-panel,
body:is(.timer-3s, .timer-10s) #open-timer-panel,
body.view-ptz-panel #open-ptz-panel {
  background: var(--cros-sys-primary_container);
}

body.mirror #open-mirror-panel,
body.grid #open-grid-panel,
body.mic #toggle-mic {
  .off-icon {
    display: none;
  }
  .on-icon {
    display: block;
  }
}

#open-timer-panel {
  .on-3s-icon,
  .on-10s-icon {
    display: none;
  }
}

body.timer-3s #open-timer-panel {
  .off-icon {
    display: none;
  }
  .on-3s-icon {
    display: block;
  }
}

body.timer-10s #open-timer-panel {
  .off-icon {
    display: none;
  }
  .on-10s-icon {
    display: block;
  }
}

body.scan #open-grid-panel,
body.scan #open-timer-panel,
body.scan #open-mirror-panel:disabled,
body.scan #settings-photo-aspect-ratio,
body.scan #settings-photo-resolution,
body.scan #settings-video-resolution,
body.scan #preview-grid {
  display: none;
}

body.should-handle-intent-result #open-settings {
  display: none;
}

body.doc-mode-reviewing #open-settings {
  visibility: hidden;
}

#view-camera,
#view-document-review,
#view-option-panel,
#view-ptz-panel,
#view-review,
#view-flash,
#view-low-storage-dialog,
#view-settings,
#view-photo-aspect-ratio-settings,
#view-photo-resolution-settings,
#view-super-res-intro-dialog,
#view-video-resolution-settings,
#view-expert-settings,
#view-warning,
#view-splash {
  bottom: 0;
  left: 0;
  opacity: 0;
  overflow: auto;
  position: absolute;
  right: 0;
  top: 0;
  visibility: hidden;
  /* Create stacking context for every view to prevent elements in former views
  from covering latter views. */
  z-index: 0;
}

body.view-camera #view-camera,
body.view-document-review #view-document-review,
body.view-option-panel #view-option-panel,
body.view-ptz-panel #view-ptz-panel,
body.view-review #view-review,
body.view-flash #view-flash,
body.view-low-storage-dialog #view-low-storage-dialog,
body.view-settings #view-settings,
body.view-photo-aspect-ratio-settings #view-photo-aspect-ratio-settings,
body.view-photo-resolution-settings #view-photo-resolution-settings,
body.view-super-res-intro-dialog #view-super-res-intro-dialog,
body.view-video-resolution-settings #view-video-resolution-settings,
body.view-expert-settings #view-expert-settings,
body.view-warning #view-warning,
body.view-splash #view-splash {
  opacity: 1;
  transition: opacity var(--fast1-duration);
  visibility: visible;
}

body.view-photo-aspect-ratio-settings #view-photo-aspect-ratio-settings,
body.view-photo-resolution-settings #view-photo-resolution-settings,
body.view-video-resolution-settings #view-video-resolution-settings,
body.view-expert-settings #view-expert-settings,
body.view-settings #view-settings {
  /* Avoid flicking for transition between settings. */
  transition: opacity 0ms;
}

body.view-photo-aspect-ratio-settings #view-settings,
html[dir=ltr] body.view-photo-aspect-ratio-settings .left-stripe,
html[dir=rtl] body.view-photo-aspect-ratio-settings .right-stripe,
html[dir=ltr] body.view-settings .left-stripe,
html[dir=rtl] body.view-settings .right-stripe,
body.view-photo-resolution-settings #view-settings,
html[dir=ltr] body.view-photo-resolution-settings .left-stripe,
html[dir=rtl] body.view-photo-resolution-settings .right-stripe,
body.view-video-resolution-settings #view-settings,
html[dir=ltr] body.view-video-resolution-settings .left-stripe,
html[dir=rtl] body.view-video-resolution-settings .right-stripe,
body.view-expert-settings #view-settings,
html[dir=ltr] body.view-expert-settings .left-stripe,
html[dir=rtl] body.view-expert-settings .right-stripe {
  opacity: 0;
}

#view-camera {
  --shutter-vertical-center: 180px;

  align-items: center;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

#preview-box {
  align-items: center;
  bottom: calc(var(--bottom-line) * 2);
  display: flex;
  justify-content: center;
  left: calc(var(--left-line) * 2);
  pointer-events: none;
  position: absolute;
  right: calc(var(--right-line) * 2);
  top: 0;
}

#preview-viewport {
  anchor-name: --preview-viewport;
  height: var(--preview-viewport-height);
  overflow: hidden;
  position: relative;
  width: var(--preview-viewport-width);
}

.preview-content {
  height: var(--preview-content-height);
  left: var(--preview-content-left);
  position: relative;
  top: var(--preview-content-top);
  width: var(--preview-content-width);
}

body.streaming .preview-content {
  pointer-events: auto;
}

body.mirror .preview-content ,
body.mirror #preview-focus,
body.mirror #preview-face-overlay,
body.mirror #preview-document-corner-overlay .corner-container {
  transform: scaleX(-1);
}

#preview-focus {
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

#preview-focus-aim {
  color: var(--cros-sys-ripple_primary);
  --secondary-color: var(--cros-sys-focus_ring);
  position: absolute;
  transform: translate(-50%, -50%);
}

#preview-face-overlay {
  pointer-events: none;
  position: absolute;
}

#preview-video {
  transition: opacity var(--fast2-duration) ease-in-out;
}

#preview-video.animate {
  opacity: 0;
}

body:not(.streaming) #preview-video {
  filter: blur(10px);
  /* Scale up to hide blurred edges. */
  transform: scale(1.03, 1.03);
}

body.mirror:not(.streaming) #preview-video {
  transform: scale(-1.03, 1.03);
}

body.use-fake-camera #view-expert-settings label.require-chromeos-vcd {
  display: none;
}

#expert-controls {
  font: var(--cros-body-1-font);
  left: 60px;
  position: absolute;
  text-align: left;  /* csschecker-disable-line left-right */
  top: 10px;
}

#expert-controls input[type=range] {
  vertical-align: middle;
}

.expert-control-row {
  margin-top: 5px;
}

#expert-controls .title {
  background-color: var(--cros-sys-primary);
  border-radius: 3px;
  color: var(--cros-sys-on_primary);
  display: inline;
  font-weight: bold;
  padding: 1px 3px 1px 3px;
}

#expert-controls input,
#expert-controls select {
  pointer-events: auto;
}

#expert-controls .metadata-row:not(.mode-on) .title {
  background: var(--cros-sys-inverse_surface);
  color: var(--cros-sys-inverse_on_surface);
}

#expert-controls .value {
  background: var(--cros-sys-base_elevated);
  border-radius: 3px;
  color: var(--cros-sys-on_surface);
  display: inline;
  padding: 1px 3px 1px 3px;
}

#expert-controls #preview-wb-gain-red {
  background: var(--cros-ref-red40);
}

#expert-controls #preview-wb-gain-blue {
  background: var(--cros-ref-blue40);
}

#preview-grid {
  bottom: 0;
  left: 0;
  opacity: 0.5;
  position: absolute;
  right: 0;
  top: 0;
  transition: visibility 500ms;
  visibility: hidden;
}

body:not(.streaming) #expert-controls,
body:not(.streaming) #open-settings,
body:not(.streaming) #options-group,
body:not(.streaming) #preview-focus,
body:not(.streaming) #toggle-mic {
  visibility: hidden;
}

body:not(.streaming) #preview-grid {
  display: none;
}

body:not(.expert) #settings-expert,
body:not(.expert) #expert-controls,
body:not(.show-metadata) #expert-controls>.metadata-row,
body:not(.video) #expert-controls>.video-option-row,
body:not(.custom-video-parameters) #expert-controls>.video-option-row {
  display: none;
}

#preview-grid-horizontal {
  border-bottom: 1px solid var(--cros-sys-white);
  border-top: 1px solid var(--cros-sys-white);
  height: 100%;
  left: 0;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

body.grid #preview-grid {
  visibility: visible;
}

body.grid.grid-4x4 #preview-grid-horizontal::before {
  border-bottom: 1px solid var(--cros-sys-white);
  content: '';
  height: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

body.grid.grid-3x3 #preview-grid-horizontal {
  height: 33.333%;
}

body.grid.grid-golden #preview-grid-horizontal {
  height: 23.607%;
}

body.grid.grid-4x4 #preview-grid-horizontal,
body.grid.grid-4x4 #preview-grid-horizontal::before {
  height: 50%;
}

#preview-grid-vertical {
  border-inline-end: 1px solid var(--cros-sys-white);
  border-inline-start: 1px solid var(--cros-sys-white);
  bottom: 0;
  left: 50%;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 100%;
}

body.grid-4x4 #preview-grid-vertical::before {
  border-right:  /* csschecker-disable-line left-right */
      1px solid var(--cros-sys-white);
  bottom: 0;
  content: '';
  left: 0;
  position: absolute;
  top: 0;
  width: 0;
}

body.grid.grid-3x3 #preview-grid-vertical {
  width: 33.333%;
}

body.grid.grid-golden #preview-grid-vertical {
  width: 23.607%;
}

body.grid.grid-4x4 #preview-grid-vertical,
body.grid.grid-4x4 #preview-grid-vertical::before {
  width: 50%;
}

#preview-grid-horizontal,
#preview-grid-horizontal::before {
  transition: height 500ms;
}

#preview-grid-vertical,
#preview-grid-vertical::before {
  transition: width 500ms;
}

record-time-chip {
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: var(--top-line);
  transform: translate(-50%, -50%);
}

/*
 * Since the [hidden] attribute is done by user agent style, and any change to
 * `display` will override it, add a rule to force `display: none` to element
 * with hidden attribute. Note that there's another possible value of
 * 'until-found' but we're not using it in CCA.
 *
 * See https://css-tricks.com/the-hidden-attribute-is-visibly-weak/
 */
[hidden] {
  display: none !important;
}

#spoken_msg {
  opacity: 0;
}

#toast {
  background: var(--cros-sys-base_elevated);
  border-radius: 16px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1), 0 4px 4px rgba(0, 0, 0, 0.2);
  color: var(--cros-sys-on_surface);
  font: var(--cros-body-0-font);
  opacity: 0;
  padding: 8px 16px;
  pointer-events: none;
  z-index: 100;
}

#toast.animate {
  animation: toast-shown 3000ms ease-out;
}

@keyframes toast-shown {
  0% {
    opacity: 0;
  }
  10%,
  90% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
  }
}

.menu {
  background: var(--cros-sys-base_elevated);
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 360px;
  overflow-y: scroll;
  position: absolute;
  top: 0;
}

.settings .menu-header,
.settings .menu-item {
  height: 64px;
}

.menu-header,
.menu-item {
  align-items: center;
  color: var(--cros-sys-on_surface);
  display: flex;
  flex-shrink: 0;
  justify-content: flex-start;
  text-align: initial;
}

.menu-item {
  font: var(--cros-body-2-font);
}

button.menu-item:hover,
label.menu-item:hover {
  background: var(--cros-sys-hover_on_subtle);
}

.settings .menu-item {
  padding-inline-start: 32px;
}

.menu-header {
  color: var(--cros-sys-on_surface);
  cursor: default;
  font: var(--cros-title-1-font);
  height: 72px;
  padding-inline-start: 16px;
  user-select: none;
}

.menu-item.resol-item {
  padding-inline-start: 64px;
}

.menu-item .description {
  color: var(--cros-sys-secondary);
  margin-top: 5px;
}

body:not(.has-front-camera) #settings-front-photores,
body:not(.has-front-camera) #settings-front-videores,
body:not(.has-back-camera) #settings-back-photores,
body:not(.has-back-camera) #settings-back-videores,
body:not(.has-front-camera):not(.has-back-camera) #builtin-photo-header,
body:not(.has-front-camera):not(.has-back-camera) #builtin-video-header {
  display: none;
}

.menu-item.resol-item .description span {
  display: inline;
}

.menu-item input::before {
  bottom: 13px;
  box-shadow: 0 0 0 2px var(--cros-sys-on_surface);
  content: '';
  left: 13px;
  position: absolute;
  right: 13px;
  top: 13px;
}

.menu-item input[type=radio]::before {
  border-radius: 50%;
}

.menu-item input:checked::before {
  background-clip: padding-box;
  background-color: var(--cros-sys-primary);
  border: 4px solid transparent;
  bottom: 12px;
  box-shadow: 0 0 0 1px var(--cros-sys-primary);
  left: 12px;
  right: 12px;
  top: 12px;
  transition: border-width var(--fast1-duration) ease-in;
}

button.menu-item {
  outline-offset: -3px;
}

.menu-header button.icon {
  /* Icon image is small enough and won't be covered by -1px */
  outline-offset: -1px;
}

html[dir=rtl] .menu-header .icon {
  transform: scale(-1, 1);
}

.menu-header .icon:hover {
  background-color: var(--cros-sys-hover_on_subtle);
}

#view-warning,
.dialog {
  align-items: center;
  display: flex;
  justify-content: center;
}

#view-warning {
  background: var(--cros-sys-app_base);
  color: var(--cros-sys-on_surface);
}

#view-warning #error-msg {
  font: var(--cros-body-0-font);
  text-align: center;
  white-space: pre-line;
}

.dialog {
  background: var(--cros-sys-scrim);
}

/*
 * The icon on the splash screen is not using either data-svg or
 * svg-wrapper, and is done with pure CSS, to avoid waiting on JS,
 * and minimize the time before app load and the icon is displayed.
 *
 * We also provide fallback value for the background colors to
 * minimize the flicker when JS is load, since the definition CSS
 * of dynamic color tokens is also loaded by JS.
 *
 * TODO(pihsun): Remove background color fallback when dynamic color is default
 * on, and the colors.css is moved into HTML.
 */
#view-splash {
  align-items: center;
  /* color-token-disable-next-line */
  background: var(--cros-sys-app_base, rgb(32, 33, 36));
  display: flex;
  justify-content: center;
}

#view-splash .icon {
  -webkit-mask: url(/images/camera_mode_photo.svg);
  /* color-token-disable-next-line */
  background: var(--cros-sys-on_surface, rgb(233, 234, 237));
  height: 40px;
  width: 40px;
}

.hidden {
  display: none;
}

.invisible {
  visibility: hidden;
}

.disabled {
  opacity: 0.38;
}

.panel {
  backdrop-filter: blur(10px);
  background: var(--cros-sys-base_elevated);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1), 0 4px 4px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

#option-panel {
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  position: absolute;
  width: 225px;
}

#option-title {
  color: var(--cros-sys-secondary);
  font: var(--cros-button-2-font);
  height: 20px;
  padding: 8px 20px;
}

#options-container {
  display: flex;
  flex-direction: column;
}

#options-container .menu-item {
  height: 40px;
  padding-inline-start: 6px;
}

#options-container .menu-item span {
  color: var(--cros-sys-on_surface);
  margin-inline-start: 4px;
}

body.video #settings-photo-aspect-ratio,
body.video #settings-photo-resolution {
  display: none;
}

body:not(.video) #settings-video-resolution {
  display: none;
}

.label-item {
  color: var(--cros-sys-secondary);
  font: var(--cros-button-2-font);
  margin: 9px 0 3px 0;
  padding-inline-start: 26px;
}

.resolution-option span {
  margin-inline-start: 4px;
}

.text-item {
  align-items: center;
  color: var(--cros-sys-secondary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  font: var(--cros-body-2-font);
  height: 64px;
  justify-content: center;
  padding-inline-end: 60px;
  padding-inline-start: 60px;
  text-align: initial;
}

.fps-buttons {
  height: 40px;
  position: absolute;
  right: 39px;
}

.fps-button {
  border-radius: 12px;
  height: 40px;
  margin-inline-end: 8px;
  margin-inline-start: 8px;
  width: 40px;
}

.fps-button.checked {
  background: var(--cros-sys-primary_container);
}

[tabindex] {
  outline: none; /* Prevent default focus ring style. */
}

[tabindex='0'] {
  outline-offset: 3px;
}

[tabindex='0']:focus-visible {
  outline: 2px solid var(--cros-sys-focus_ring);
}

.circle :is(button, input) {
  border-radius: 50%;
}

#nudge {
  align-items: center;
  background: var(--cros-sys-base_elevated);
  border-radius: var(--border-radius-rounded-with-short-side);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1), 0 4px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  position: absolute;
  top: 68px;  /* 8px below |record_time| element */
  z-index: 2;
}

#nudge .warning-icon {
  height: 20px;
  width: 20px;

  :is(svg-wrapper) {
    color: var(--cros-sys-warning);
  }
}

#nudge .warning-msg {
  color: var(--cros-sys-on_surface);
  font: var(--cros-body-2-font);
}

.low-storage-dialog-popup {
  background: var(--cros-sys-base_elevated);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  width: 320px;
}

.low-storage-dialog-popup .dialog-title {
  color: var(--cros-sys-on_surface);
  font: var(--cros-title-1-font);
}

.low-storage-dialog-popup .dialog-description {
  color: var(--cros-sys-secondary);
  font: var(--cros-body-2-font);
}

.low-storage-dialog-buttons {
  align-items: center;
  align-self: flex-end;
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.low-storage-dialog-buttons .dialog-negative-button {
  align-items: center;
  display: flex;
  gap: 8px;
}

.low-storage-dialog-buttons .external-link-icon {
  height: 20px;
  width: 20px;
}

#view-super-res-intro-dialog {
  --border-radius: 20px;

  align-items: flex-start;
  background: unset;
}

#view-super-res-intro-dialog .dialog-container {
  background-color: var(--cros-sys-base_elevated);
  border-radius: var(--border-radius);
  overflow: hidden;
  /* Align the dialog with the center of the camera preview */
  transform: translateY(calc(0.5*var(--preview-viewport-height) - 50%));
}

#super-res-dialog-illustration {
  background: var(--cros-sys-app_base);
}

#super-res-dialog-content {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 20px 32px 32px 32px;
  width: 416px;
}

#super-res-dialog-content .dialog-title {
  color: var(--cros-sys-on_surface);
  font: var(--cros-display-7-font);
}

#super-res-dialog-content .dialog-description {
  color: var(--cros-sys-secondary);
  font: var(--cros-body-2-font);
  margin-top: 16px;
}

#super-res-dialog-content .dialog-buttons {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  justify-content: flex-end;
}

#super-res-dialog-content .ptz-icon {
  display: inline-block;
  vertical-align: middle;
}

#open-ptz-panel:is(.notify-new-feature) #notify-super-res-indicator {
  background: var(--cros-sys-primary);
  border-radius: 50%;
  height: 6px;
  position: absolute;
  right: 0;
  top: 0;
  width: 6px;
}

#view-settings {
  background: var(--cros-sys-scrim);
}

body.hide-floating-ui-for-testing
  :is(#nudge, #toast, text-tooltip, .custom-toast, .no-document-toast) {
  /* TODO(b/289342383): Use CSS layering so we don't need to use !important. */
  display: none !important;
}

.snackbar {
  align-items: center;
  background: var(--cros-sys-inverse_surface);
  border-radius: 12px;
  /*
   * TODO(pihsun): Move the snackbar to the position as the design after jelly
   * is default on.
   */
  bottom: anchor(bottom);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  color: var(--cros-sys-inverse_on_surface);
  display: flex;
  font: var(--cros-body-2-font);
  height: 48px;
  left: anchor(left);
  margin: 4px;
  opacity: 0;
  padding: 14px 16px;
  pointer-events: none;
  position: absolute;
  position-anchor: --preview-viewport;
  width: 256px;
}

.snackbar.animate {
  animation: 3s show-snackbar linear;
}

@keyframes show-snackbar {
  0% {
    opacity: 0;
  }
  /* 100ms fade-in */
  3.33% {
    opacity: 1;
  }
  97.33% {
    opacity: 1;
  }
  /* 80ms fade-out */
  100% {
    opacity: 0;
  }
}

body:not(.photo) #settings-preview-ocr {
  display: none;
}

#settings-preview-ocr-option {
  align-items: center;
  display: flex;
  justify-content: center;
  margin-inline: auto 12px;
  position: relative;
}

#settings-preview-ocr-option svg-wrapper {
  color: transparent;
  height: 0;
  position: absolute;
  transition: all var(--fast1-duration) ease-in;
  width: 0;
}

/* Hide default check mark since it's using custom icon. */
#settings-preview-ocr-option input::before {
  background: transparent;
}

#settings-preview-ocr-option:has(input:checked) svg-wrapper {
  color: var(--cros-sys-primary);
  height: 14px;
  width: 14px;
}