.office-drive-dialog {
  box-sizing: border-box;
  width: min(62rem, calc(100vw - 1.5rem));
  max-width: none;
  max-height: min(88dvh, 56rem);
  padding: 0;
  overflow-y: auto;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
}

.office-drive-header,
.office-drive-categories,
.office-drive-filter,
.office-drive-controls,
.office-drive-path,
.office-drive-form {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
}

.office-drive-header {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-block: .75rem;
}

.office-drive-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.office-drive-categories {
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.office-drive-category,
.office-drive-path-button,
.office-drive-info {
  border: 1px solid transparent;
  border-radius: .3rem;
  padding: .35rem .5rem;
  background: transparent;
  color: inherit;
  font: inherit;
  white-space: nowrap;
}

.office-drive-category[aria-pressed="true"],
.office-drive-category:hover,
.office-drive-path-button:hover,
.office-drive-info:hover {
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--ink);
}

.office-drive-category[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  font-weight: 650;
}

.office-drive-filter {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) repeat(3, minmax(7rem, auto));
  align-items: end;
}

.office-drive-field {
  min-width: 0;
  display: grid;
  gap: .25rem;
  font-size: .8rem;
}

.office-drive-field :is(input, select) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0;
}

.office-drive-controls,
.office-drive-form {
  align-items: end;
  flex-wrap: wrap;
}

.office-drive-form[hidden] { display: none; }

.office-drive-form .office-drive-field { flex: 1 1 12rem; }

.office-drive-path {
  min-height: 1.5rem;
  padding-block: 0;
  overflow-x: auto;
  font-size: .85rem;
  color: var(--muted, var(--ink));
}

.office-drive-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .75rem;
  padding: .6rem 1rem 1rem;
}

.office-drive-content:has(.office-drive-details:not([hidden])) {
  grid-template-columns: minmax(0, 1.5fr) minmax(13rem, 1fr);
}

.office-drive-list {
  max-height: min(49dvh, 32rem);
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0 0 .4rem;
  scrollbar-gutter: stable;
}

.office-drive-status { margin: .5rem 0; font-size: .85rem; color: var(--muted, var(--ink)); }

.office-drive-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 2.8rem;
  border-block-end: 1px solid var(--line);
}

.office-drive-file {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  align-items: center;
  gap: .6rem;
  padding: .35rem .45rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.office-drive-file:hover {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.office-drive-file-kind {
  display: grid;
  place-content: center;
  box-sizing: border-box;
  min-height: 1.7rem;
  border: 1px solid color-mix(in srgb, var(--kind, var(--accent)) 45%, transparent);
  border-radius: .2rem;
  background: color-mix(in srgb, var(--kind, var(--accent)) 10%, transparent);
  font-size: .6rem;
  font-weight: 750;
  letter-spacing: .015em;
}

.office-drive-file-kind[data-kind="folder"] {
  border: 0;
  background: transparent;
  color: color-mix(in srgb, #ab7315 80%, var(--ink));
}

.office-drive-file-kind svg {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
}

.office-drive-file-kind[data-kind="xlsx"] { --kind: #2b7e54; }
.office-drive-file-kind[data-kind="pdf"] { --kind: #b74759; }
.office-drive-file-kind[data-kind="pptx"] { --kind: #b96535; }
.office-drive-file-kind[data-kind="png"] { --kind: #7951ab; }
.office-drive-file-kind[data-kind="zip"] { --kind: #437083; }
.office-drive-file-kind[data-kind="notes"] { --kind: #8e6919; }

.office-drive-file-text {
  display: grid;
  min-width: 0;
  gap: .15rem;
}

.office-drive-file-text :is(strong,small) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.office-drive-file-text small { color: var(--muted, var(--ink)); }

.office-drive-info { margin-inline-end: .15rem; font-size: .8rem; }

.office-drive-details {
  align-self: start;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  overflow-wrap: anywhere;
}

.office-drive-detail-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: .4rem;
}

.office-drive-detail-header h3 { margin: .35rem 0 0; font-size: 1rem; }

.office-drive-details dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .3rem .65rem;
  margin-block: .5rem .75rem;
  font-size: .8rem;
}

.office-drive-details dd { margin: 0; }

.office-drive-details dt { color: var(--muted, var(--ink)); }

.office-drive-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

@media (max-width: 44rem) {
  .office-drive-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .office-drive-content:has(.office-drive-details:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .office-drive-details { grid-row: 1; }
  .office-drive-list { max-height: 38dvh; }
}
