#workspace-dialog[data-tool] {
  width: min(560px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), 0 28px 80px -20px #000c;
}

#workspace-dialog:is([data-tool="shot"], [data-tool="lingue"], [data-tool="replay"]) {
  width: min(820px, calc(100vw - 32px));
}

#workspace-dialog[data-tool] #workspace-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 30px);
}

#workspace-dialog[data-tool] .workspace-header {
  display: flex;
  flex: none;
  align-items: flex-start;
  gap: 13px;
  padding: 19px 22px 16px;
  background: #ffffff05;
  border-bottom: 1px solid #ffffff15;
}

.workspace-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--o-ffab74, #ffab74) 13.7%, transparent);
  color: var(--o-ffc597, #ffc597);
}

#workspace-dialog[data-tool] h1 { font-size: 20px; letter-spacing: -.02em; }
#workspace-dialog[data-tool] .workspace-subtitle { margin: 0; overflow-wrap: anywhere; }
#workspace-dialog[data-tool] .workspace-items {
  min-height: 0;
  margin: 0;
  padding: 16px 22px;
  overflow: auto;
  overscroll-behavior: contain;
}
#workspace-dialog[data-tool] .workspace-status { margin: 0; padding: 8px 22px; background: #ffffff05; }
#workspace-dialog[data-tool] .dialog-actions {
  flex: none;
  margin: 0;
  padding: 11px 22px;
  border-top: 1px solid #ffffff15;
}
#workspace-dialog[data-tool] :is(.workspace-row small, .twin-original) { overflow-wrap: anywhere; }
#workspace-dialog[data-tool] .workspace-row { flex-wrap: wrap; }

.shot-stage {
  min-width: 0;
  padding: 10px;
  border: 1px solid #ffffff18;
  border-radius: 12px;
  background: var(--glass-well);
}

.shot-preview {
  display: block;
  max-width: 100%;
  max-height: clamp(140px, calc(100vh - 255px), 600px);
  margin: 0 auto;
  border-radius: 3px;
  cursor: crosshair;
  touch-action: none;
}

.page-tool-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
}

.shot-modes { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--glass-well); }
.shot-modes .action { border-color: transparent; background: transparent; }
.shot-modes .action[aria-pressed="true"] { border-color: color-mix(in srgb, var(--o-ffab74, #ffab74) 42%, transparent); background: color-mix(in srgb, var(--o-ffab74, #ffab74) 13.7%, transparent); color: var(--o-ffcfab, #ffcfab); }
.shot-dimensions { margin-left: auto; color: #b9c3d7; font-size: 12px; font-variant-numeric: tabular-nums; }

.tool-field { display: grid; gap: 5px; min-width: 0; }
.tool-field > span, .twin-label { font-size: 11.5px; font-weight: 700; color: #b7c2d9; }
.tool-field :is(input, select, textarea) { min-width: 0; }
#workspace-dialog[data-tool] .tool-field { margin: 0; }
.twin-controls { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 10px; }
.twin-controls details { grid-column: 1 / -1; padding: 8px 0; }
.twin-controls summary { cursor: pointer; color: #c4cde0; font-size: 13px; }
#workspace-dialog[data-tool] .twin-controls textarea {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  resize: vertical;
  border: 1px solid #ffffff28;
  border-radius: 8px;
  background: var(--glass-well);
  color: inherit;
  font: inherit;
}

.twin-reader { display: grid; gap: 7px; min-width: 0; }
.twin-reader article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px 13px;
  background: #ffffff07;
  border: 1px solid #ffffff12;
  border-radius: 10px;
}
.twin-reader article:has(pre) { grid-template-columns: minmax(0, 1fr); }
.twin-original, .twin-translation { margin: 4px 0 0; font-size: 13px; line-height: 1.5; }
.twin-result {
  min-width: 0;
  padding-left: 13px;
  border-left: 1px solid #ffffff1a;
}
.twin-reader pre {
  overflow: auto;
  margin: 0;
  white-space: pre;
}
.twin-translation {
  color: var(--o-ffcfaf, #ffcfaf);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.twin-result .action { margin-top: 5px; }
.replay-controls > input { flex: 1; width: auto; min-width: 120px; }

.together-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.together-card {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 9px;
  padding: 13px;
  border: 1px solid #ffffff18;
  border-radius: 12px;
  background: #ffffff08;
}
.together-card h2, .together-card p { margin: 0; }
.together-card h2 { font-size: 14px; }
.together-card p { color: #c1cbe0; font-size: 12.5px; line-height: 1.45; }
.together-card .tool-field { width: 100%; }

@media (max-width: 650px) {
  #workspace-dialog[data-tool] :is(.workspace-header, .workspace-items, .workspace-status, .dialog-actions) { padding-left: 14px; padding-right: 14px; }
  .twin-reader article { gap: 9px; }
}

@media (max-width: 470px) {
  .twin-reader article, .together-grid { grid-template-columns: minmax(0, 1fr); }
  .twin-result { padding: 8px 0 0; border-left: 0; border-top: 1px solid #ffffff1a; }
}

.address-tools .tool.together-active {
  color: var(--o-ff975f, #ff975f);
}

body[data-site-light="true"] .address-tools .tool.together-active {
  color: var(--o-a94a15, #a94a15);
}

.together-proposal {
  box-shadow: inset 0 0 0 2px currentColor;
}

.together-sharing { box-shadow: inset 0 0 0 1.5px currentColor; }

#together-pane {
  position: fixed;
  z-index: 3;
  top: calc(var(--tabs) + var(--toolbar) + var(--bookmarks));
  right: 0;
  bottom: 0;
  width: var(--panel);
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: #f3f0fa;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-left: 1px solid #ffffff24;
}

.together-pane-head, .together-pane-actions {
  display: flex;
  flex: none;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  padding: 9px 12px;
}
.together-pane-head > span { display: grid; flex: 1; min-width: 0; gap: 2px; font-size: 13px; }
.together-pane-head small { color: #bac5da; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.together-pane-preview { display: grid; flex: 1; min-height: 0; place-items: center; background: var(--glass-well); }
.together-pane-preview img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.together-pane-preview p { padding: 14px; margin: 0; color: #bac5da; font-size: 13px; text-align: center; }

/* Dialogs with their symbol (workspace.js, data-side): on the left one column, its content centred as one block: the
   title (the first word large, the rest below as wide as it), the explanation; on the right the
   content, the status and the buttons. */
#workspace-dialog[data-side="true"] { width: min(760px, calc(100vw - 32px)); max-width: calc(100vw - 32px); padding: 0; overflow: hidden; border-radius: 22px; }
#workspace-dialog[data-side="true"]:is([data-tool="shot"], [data-tool="lingue"], [data-tool="replay"]) { width: min(1040px, calc(100vw - 32px)); }
#workspace-dialog[data-side="true"] #workspace-form { display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  max-height: calc(100vh - 30px); }
#workspace-dialog[data-side="true"] #workspace-form > * { grid-column: 2; }
#workspace-dialog[data-side="true"] #workspace-form > header.workspace-header { grid-column: 1; grid-row: 1 / -1; display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 0; padding: 28px 20px; text-align: center; border: 0; border-right: 1px solid #ffffff1a; background: linear-gradient(180deg, #ffffff14, #ffffff06 60%, #ffffff0a);
  box-shadow: inset -1px 0 #0000001f; }
#workspace-dialog[data-side="true"] header.workspace-header > div { display: contents; }
/* The symbol, small, in the window's top left corner. */
#workspace-dialog[data-side="true"] #workspace-form > header.workspace-header { position: relative; }
#workspace-dialog[data-side="true"] .workspace-mark { position: absolute; top: 16px; left: 18px; width: auto; height: auto; margin: 0; padding: 0; border-radius: 0;
  background: none; box-shadow: none; color: var(--o-ffb27e, #ffb27e); }
#workspace-dialog[data-side="true"] .workspace-mark .icon { width: 18px; height: 18px; }
#workspace-dialog[data-side="true"] header.workspace-header h1 { margin: 0; max-width: 100%; font-size: 34px; line-height: 1; letter-spacing: -.03em; }
#workspace-dialog[data-side="true"] :is(.workspace-title-main, .workspace-title-rest) { display: table; margin: 0 auto; white-space: nowrap; }
#workspace-dialog[data-side="true"] .workspace-title-main { font-weight: 650; font-size: clamp(22px, calc(300px / var(--title-length, 6)), 38px); }
#workspace-dialog[data-side="true"] .workspace-title-rest { margin-top: 4px; font-weight: 550; letter-spacing: -.01em; }
#workspace-dialog[data-side="true"] .workspace-subtitle { margin: 14px 0 0; padding: 0; font-size: 13px; line-height: 1.45; }
#workspace-dialog[data-side="true"] #workspace-name-label { grid-row: 1; margin: 18px 24px 0; }
#workspace-dialog[data-side="true"] #workspace-color-label { grid-row: 2; margin: 14px 24px 0; }
#workspace-dialog[data-side="true"] .workspace-items { grid-row: 3; min-height: 0; margin: 0; padding: 22px 24px 18px; overflow: auto; overscroll-behavior: contain; }
#workspace-dialog[data-side="true"] .workspace-status { grid-row: 4; margin: 0; padding: 0 24px 10px; background: none; }
#workspace-dialog[data-side="true"] .workspace-status:empty { display: none; }
#workspace-dialog[data-side="true"] .dialog-actions { grid-row: 5; margin: 0; padding: 12px 24px 16px; border-top: 1px solid #ffffff15; }
@media (max-width: 640px) {
  #workspace-dialog[data-side="true"] #workspace-form { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  #workspace-dialog[data-side="true"] #workspace-form > *, #workspace-dialog[data-side="true"] #workspace-form > header.workspace-header { grid-column: 1; grid-row: auto; }
  #workspace-dialog[data-side="true"] #workspace-form > header.workspace-header { border-right: 0; border-bottom: 1px solid #ffffff1a; padding: 20px; }
}
