/* Shared workspace tools; semantic tokens follow theme.css and brand.css. */
@media (max-width: 520px) {
  .workspace .file-list th,
  .workspace .file-list td {
    padding: 10px 6px;
  }
  .workspace .file-list th:last-child,
  .workspace .file-list td:last-child {
    width: 124px;
    min-width: 124px;
  }
  .workspace .file-list .row-actions .icon-button {
    min-width: 30px;
    width: 30px;
    padding: 4px;
  }
  .workspace .file-list .row-menu > summary {
    min-width: 30px;
    width: 30px;
    padding: 4px;
  }
  .workspace .file-list .file-name-cell > div {
    min-width: 0;
  }
  .workspace .file-list .file-name-cell a {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .workspace .header-tools {
    flex-shrink: 0;
  }
}
@media (max-width: 380px) {
  .workspace .brand-text {
    display: none;
  }
  .workspace .brand {
    flex: 0 0 34px;
    width: 34px;
  }
  .workspace .header-tools .icon-btn {
    width: 36px;
    min-width: 36px;
  }
  .workspace .user-chip {
    padding: 3px;
  }
}
.workspace-dialog {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 24px;
  width: min(560px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  box-shadow: var(--shadow);
  overflow: auto;
  box-sizing: border-box;
}
.workspace-dialog::backdrop {
  background: #11082a66;
}
.workspace-dialog h2 {
  font-size: 24px;
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}
.tool-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  color: var(--muted);
}
.tool-top h2 {
  margin: 0;
}
.tool-top button {
  flex: none;
  font-size: 24px;
}
.workspace-dialog.preview-dialog {
  width: min(1100px, calc(100vw - 32px));
}
.workspace-dialog.info-dialog {
  margin: 16px 16px 16px auto;
  width: min(420px, calc(100vw - 32px));
  height: calc(100dvh - 32px);
}
.tool-filename {
  overflow-wrap: anywhere;
}
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 24px;
}
.tool-actions > * {
  min-height: 40px;
}
.quick-frame {
  width: 100%;
  height: 65dvh;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--surface-2);
}
.quick-image,
.quick-media {
  display: block;
  max-width: 100%;
  max-height: 65dvh;
  margin: auto;
}
.quick-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--surface-2);
  padding: 20px;
  border-radius: var(--r-ctl);
  max-height: 65dvh;
  overflow: auto;
}
.upload-items {
  list-style: none;
  padding: 0;
}
/* file information panel (drive/_file_panel.html) */
.fi-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.fi-head > div {
  min-width: 0;
}
.fi-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}
.fi-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.fi-type {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--tint);
  color: var(--accent);
}
.fi-type .icon {
  width: 22px;
  height: 22px;
}
.fi-actions {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}
.fi-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
}
.fi-actions .primary {
  flex: 1 1 auto;
}
.fi-actions .secondary {
  flex: 1 1 auto;
  background: var(--surface);
}
.fi-actions .secondary .icon {
  width: 17px;
  height: 17px;
  margin: 0;
  color: var(--accent);
}
.fi-actions .fi-square {
  flex: 0 0 42px;
  padding: 0;
}
.fi-desc {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.fi-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}
.fi-facts {
  margin: 0;
  padding: 0;
}
.fi-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.fi-facts > div:last-child {
  border-bottom: 1px solid var(--line);
}
.fi-facts dt {
  flex: none;
  color: var(--muted);
}
.fi-facts dd {
  min-width: 0;
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.fi-facts a {
  color: var(--accent);
  text-decoration: none;
}
.fi-title {
  margin: 18px 0 8px;
  font-size: 14px;
}
.fi-versions {
  margin: 0;
  padding: 0;
  list-style: none;
}
.fi-versions li {
  display: flex;
  gap: 10px;
  padding: 6px 0;
}
.fi-versions li > span {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.fi-versions li:first-child > span {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--surface);
}
.fi-versions strong {
  display: block;
  font-size: 13px;
}
.fi-versions small {
  color: var(--muted);
  font-size: 12px;
}
.file-table .row-menu .menu-panel {
  min-width: 270px;
}
.menu-panel .danger-text,
.menu-panel .danger-text .icon {
  color: var(--danger-text);
}
.simple-share details {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.simple-share summary {
  cursor: pointer;
  min-height: 28px;
}
.simple-share small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}
.simple-share button.primary {
  width: 100%;
}
.workspace-dialog textarea,
.workspace-dialog input,
.workspace-dialog select {
  max-width: 100%;
  box-sizing: border-box;
}
.workspace-dialog textarea {
  width: 100%;
  resize: vertical;
  min-height: 80px;
}
.file-detail-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.file-detail-layout > * {
  min-width: 0;
}
.simple-share select,
.simple-share input,
.simple-share textarea {
  max-width: 100%;
  box-sizing: border-box;
}
.share-row > div {
  min-width: 0;
}
.share-row {
  flex-wrap: wrap;
}
.copy-field {
  min-width: 0;
  max-width: 100%;
}
.copy-field input {
  min-width: 0;
}
.pin-folder {
  margin-left: auto;
  flex: none;
  font-size: 24px;
  min-width: 40px;
  min-height: 40px;
}
.pin-folder[aria-pressed="true"] {
  color: var(--accent);
}
.folder-card > div {
  min-width: 0;
}
.pins-empty {
  display: block;
  padding: 8px 12px;
  font-size: 12px;
}
.side-nav [data-project-pin] span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile-tools {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
  flex-wrap: wrap;
}
.suggest-host {
  position: relative;
}
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  min-width: 0;
  z-index: 60;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--surface);
  box-shadow: var(--shadow);
  max-height: 55dvh;
  overflow: auto;
}
.search-suggestions[hidden] {
  display: none;
}
.search-suggestions a {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  min-height: 40px;
  color: var(--ink);
  text-decoration: none;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}
.search-suggestions a span {
  min-width: 0;
  flex: 1;
}
.search-suggestions small {
  color: var(--muted);
  flex: none;
}
.search-suggestions a:hover,
.search-suggestions [aria-selected="true"] {
  background: var(--tint);
  color: var(--accent);
}
.search-suggestions p {
  padding: 10px;
  margin: 0;
  color: var(--muted);
}
.mobile-search-toggle {
  display: none;
}
.search-clear {
  position: absolute;
  right: 3px;
  top: 3px;
  min-height: 40px;
  width: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.suggest-host input {
  padding-right: 40px !important;
}
.workspace-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 20px;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
}
.workspace-notice[hidden] {
  display: none;
}
:is(.workspace-dialog, .search-suggestions) :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:is(.workspace-dialog, .search-suggestions) :is(input, select, textarea):focus-visible {
  outline-offset: 0;
}
@media (max-width: 900px) {
  .workspace .header-tools {
    margin-left: auto;
  }
  .workspace-dialog {
    padding: 18px;
  }
  .workspace .file-toolbar {
    flex-wrap: wrap;
  }
  .workspace .file-toolbar .search-input {
    flex-basis: 100%;
  }
  .workspace .dropzone {
    padding: 12px 16px;
    margin: 12px 0;
  }
  .dropzone > p.small {
    display: none;
  }
  .workspace .dropzone p {
    margin: 0;
  }
  .file-detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 520px) {
  .mobile-search-toggle {
    display: inline-flex;
  }
  .workspace .header-tools {
    gap: 2px;
  }
  .workspace .header-search.search-open {
    display: flex !important;
    position: absolute;
    top: var(--hd);
    left: 0;
    right: 0;
    margin: 0;
    padding: 10px 16px;
    background: var(--surface);
    max-width: none;
    box-sizing: border-box;
    z-index: 70;
  }
  .workspace .header-search.search-open .search-suggestions {
    left: 16px;
    right: 16px;
  }
  .workspace .header-search.search-open .search-clear {
    right: 18px;
    top: 13px;
  }
  .workspace .header-search.search-open > svg {
    left: 30px;
  }
  .row-actions {
    gap: 0 !important;
  }
  .row-actions .icon-button {
    min-width: 34px;
    width: 34px;
    padding: 6px;
  }
  .file-table .file-name-cell {
    gap: 6px;
  }
  .file-table .type-icon {
    display: none;
  }
  .workspace-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 16px;
  }
  .workspace-dialog.info-dialog {
    margin: 8px;
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
  }
  .file-toolbar select {
    flex: 1;
    min-width: 0;
  }
  .workspace .brand {
    min-width: 0;
  }
  .workspace .header-tools .user-name {
    display: none;
  }
  .workspace .header-tools .btn-create span {
    display: none;
  }
  .workspace .header-tools .btn-create {
    min-width: 36px;
    width: 36px;
    padding: 6px;
  }
  .workspace .brand {
    flex: 1;
    width: auto;
    padding-left: 4px;
  }
  .workspace .brand-mark {
    width: 28px;
  }
  .workspace .brand-text b {
    font-size: 17px;
  }
  .workspace .brand-text small {
    font-size: 8px;
  }
  .workspace .header {
    padding-right: 8px;
  }
  .workspace .header .menu-toggle {
    margin-right: 4px;
  }
}

@media (max-width: 380px) {
  .workspace .brand-text {
    display: none;
  }
  .workspace .brand {
    flex: 0 0 34px;
    width: 34px;
  }
  .workspace .header-tools .icon-btn {
    width: 36px;
    min-width: 36px;
  }
  .workspace .user-chip {
    padding: 3px;
  }
}

.resize-none {
  resize: none !important;
  overflow: auto;
}
[data-uploads-open] {
  position: relative;
}
[data-upload-count]:empty {
  display: none;
}
[data-upload-count]:not(:empty) {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 10px;
  background: var(--accent);
  color: var(--surface);
  border-radius: 20px;
  padding: 1px 4px;
}
@media (max-width: 620px) {
  .workspace .dropzone {
    display: none;
  }
  .heading-actions > .pin-current {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
  }
  .workspace .file-toolbar select {
    font-size: 12px;
    padding-left: 8px;
    padding-right: 22px;
  }
}

@media (max-width: 520px) {
  .row-actions > a.icon-button {
    display: none;
  }
  .workspace .file-list .row-actions .icon-button,
  .workspace .file-list .row-menu > summary {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 8px;
  }
}

@media (max-width: 900px) {
  .workspace .file-list {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
  }
  .workspace .file-list .col-aux {
    display: none;
  }
  .workspace .file-list th,
  .workspace .file-list td {
    padding: 10px 6px;
  }
  .workspace .file-list .check-col {
    width: 28px;
    min-width: 28px;
  }
  .workspace .file-list th:last-child,
  .workspace .file-list td:last-child {
    width: 184px;
    min-width: 184px;
  }
  .workspace .file-name-cell > div {
    min-width: 0;
  }
  .workspace .file-name-cell a {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
@media (max-width: 520px) {
  .workspace .file-list th:last-child,
  .workspace .file-list td:last-child {
    width: 124px;
    min-width: 124px;
  }
}
