@font-face {
  font-family: "VK Sans Display";
  src: local("VK Sans Display Regular"), local("VKSansDisplay-Regular");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "VK Sans Display";
  src: local("VK Sans Display Medium"), local("VKSansDisplay-Medium");
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  --display-font: "VK Sans Display", "Mail Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-font: Arial, sans-serif;
  --canvas: #f6f7f8;
  --surface: #ffffff;
  --ink: #2c2d2e;
  --muted: #686b74;
  --line: #00103d1f;
  --line-soft: #00103d14;
  --wash: #00103d0f;
  --active: #00103d14;
  --accent: #0077ff;
  --accent-text: #0070f0;
  --accent-hover: #005fcf;
  --accent-soft: #0077ff1a;
  --danger: #b92b46;
  --button-radius: 8px;
  --surface-radius: 12px;
  --dialog-radius: 16px;
  --header-height: 62px;
  --dialog-shadow: 0 10px 36px #00103d14, 0 6px 20px #00103d0f, 0 6px 12px #00103d0f, 0 0 6px #00103d0f;
  font: 400 15px/20px var(--text-font);
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; }
button, input, select { font: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 7px 15px; border: 1px solid transparent; border-radius: var(--button-radius);
  background: var(--wash); color: var(--ink); text-decoration: none;
  font: 500 15px/20px var(--display-font); cursor: pointer;
}
button:hover, .button:hover { background: var(--active); }
button:active, .button:active { background: #00103d1f; }
button:disabled { cursor: wait; opacity: .55; }
button.primary { background: var(--accent-text); color: var(--surface); }
button.primary:hover { background: var(--accent-hover); }
button.primary:active { background: #0054b9; }
.subtle { background: transparent; color: var(--ink); }
.subtle:hover { background: var(--wash); }
.subtle:active { background: var(--active); }
button.danger { color: var(--danger); }
button.danger:hover { background: #b92b4610; }
button.destructive { color: var(--surface); background: var(--danger); }
button.destructive:hover { background: #a3203a; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display-font); font-weight: 500; }
h1 { font-size: 28px; line-height: 32px; }
h2 { font-size: 24px; line-height: 28px; }
h3 { font-size: 15px; line-height: 20px; }
p { line-height: 20px; }
small, .muted { color: var(--muted); }
small { font-size: 13px; line-height: 18px; }
label { display: block; font: 500 15px/20px var(--display-font); margin: 0 0 6px; }
input, select {
  width: 100%; min-height: 40px; padding: 9px 12px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--button-radius);
}
input:focus, select:focus { border-color: var(--accent); outline-offset: 0; }
input::placeholder { color: var(--muted); }
input[type=file] { padding: 6px; }
input::file-selector-button {
  margin-inline-end: 8px; padding: 6px 10px; border: 0; border-radius: 6px;
  background: var(--wash); color: var(--ink); font: 500 13px/18px var(--display-font);
}
.icon { display: block; flex: none; }
.action-icon { width: 20px; height: 20px; background: currentColor; mask: var(--action-icon) center / contain no-repeat; }
.icon-copy { --action-icon: url("/icons/copy.svg"); width: 16px; height: 16px; }
.icon-delete { --action-icon: url("/icons/delete.svg"); }
.icon-edit { --action-icon: url("/icons/edit.svg"); }
.icon-external { --action-icon: url("/icons/external.svg"); width: 16px; height: 16px; }
.icon-history { --action-icon: url("/icons/history.svg"); }
.icon-info { --action-icon: url("/icons/info.svg"); }
.icon-key { --action-icon: url("/icons/key.svg"); }
.icon-link { --action-icon: url("/icons/link.svg"); width: 16px; height: 16px; }
.icon-more { --action-icon: url("/icons/more.svg"); }
.icon-upload { --action-icon: url("/icons/upload.svg"); }
.icon-button { width: 36px; height: 36px; padding: 5px; flex: none; }
.icon-label { display: flex; align-items: center; gap: 6px; }

.brand {
  display: flex; align-items: center; flex: none;
}
.brand img { display: block; object-fit: contain; object-position: left center; }
.sign-in {
  display: grid; min-height: 100dvh; grid-template-columns: minmax(0, 420px); place-content: center; padding: 20px;
}
.entry-card {
  width: 100%; padding: clamp(22px, 5vw, 32px); border-radius: var(--dialog-radius);
  background: var(--surface); box-shadow: var(--dialog-shadow);
}
.entry-card h1 { font-size: 24px; line-height: 28px; margin: 24px 0 8px; }
.entry-card > p { color: var(--muted); }
.entry-card form { margin-top: 24px; }
.entry-card button.primary { margin-top: 14px; width: 100%; }
.entry-card .action-row { margin-top: 8px; }
.notice { color: var(--muted); font-size: 13px; line-height: 18px; }
.notice:not(:empty) { margin-top: 8px; }
.notice.error { color: var(--danger); }
#workspace-notice:not(:empty) {
  position: fixed; z-index: 2; inset: auto 16px 16px auto; max-width: min(27rem, calc(100% - 32px));
  margin: 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--button-radius); box-shadow: var(--dialog-shadow);
}
#pin, #code { letter-spacing: .25em; font-variant-numeric: tabular-nums; }

.studio-header {
  min-height: var(--header-height); display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px 24px; padding: 12px 24px; background: var(--canvas); border-bottom: 1px solid var(--line-soft);
}
.studio-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.studio-header .nav-item { border-radius: 18px; padding-inline: 13px; }
.studio-header .nav-item.current { color: var(--accent-text); background: var(--accent-soft); }
.account-area { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.storage-summary { display: grid; gap: 1px; color: var(--muted); font-size: 12px; line-height: 16px; white-space: nowrap; }
.storage-summary strong { color: var(--ink); font-size: 13px; }
.studio-header .sign-out { color: var(--muted); }
.workspace { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100dvh - var(--header-height)); }
aside { padding: 22px 16px; }
.aside-heading { padding: 0 12px 10px; color: var(--muted); font: 500 13px/18px var(--display-font); }
.tree { padding: 0; margin: 0; list-style-type: none; }
.tree .tree { padding-left: 12px; }
.tree .button, aside .new-folder { width: 100%; justify-content: start; padding: 7px 11px; gap: 8px; text-align: start; }
.tree .button span { min-width: 0; overflow-wrap: anywhere; }
.tree .button.active { background: var(--active); }
aside .new-folder { color: var(--muted); margin-top: 8px; }

.content { width: min(100%, 1240px); padding: clamp(16px, 3vw, 32px); margin: 0 auto; }
.catalog { padding-left: 8px; }
.topline { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 14px; }
.topline h1 { overflow-wrap: anywhere; }
.crumbs { color: var(--muted); font-size: 13px; line-height: 18px; margin-bottom: 6px; overflow-wrap: anywhere; }
.crumbs a { text-underline-offset: 2px; }
.folder-heading { display: flex; align-items: center; gap: 8px; }
.folder-heading > button { flex: none; }
.action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.list {
  --row-columns: [name] minmax(0, 1.5fr) [state] minmax(103px, .7fr) [author] minmax(68px, .55fr)
    [updated] minmax(108px, .7fr) [quick] 144px;
  margin: 16px 0 0; border-radius: var(--surface-radius); background: var(--surface); overflow: hidden;
}
.list.selectable { --selection-column: [select] 22px; }
.list-head, .list-item {
  display: grid; grid-template-columns: var(--selection-column,) var(--row-columns);
  align-items: center; column-gap: 10px; padding: 8px 16px;
}
.list-head { min-height: 40px; color: var(--muted); font: 500 13px/18px var(--display-font); }
.list-item { min-height: 54px; border-top: 1px solid var(--line-soft); }
.list-item:hover { background: #00103d05; }
.list-item.selected, .list-item.selected:hover { background: var(--accent-soft); }
.row-file { min-width: 0; }
.list-item .row-folder { display: flex; align-items: center; gap: 10px; min-width: 0; }
.list-item .row-folder { justify-self: start; padding: 3px 4px 3px 0; text-align: start; }
.row-select { display: flex; align-items: center; gap: 8px; }
.row-select input { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--accent-text); cursor: pointer; }
.select-all-label { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.row-name { font-weight: 700; overflow-wrap: anywhere; }
.subline { display: block; font-size: 13px; line-height: 18px; color: var(--muted); overflow-wrap: anywhere; }
.row-author, .row-date { min-width: 0; overflow-wrap: anywhere; }
.row-actions { grid-column: quick; display: flex; justify-content: flex-end; align-items: center; }
.row-actions .icon-button { color: #000; }
.row-actions .icon-button:disabled { cursor: default; opacity: .33; background: transparent; }
.row-menu {
  position: fixed; inset: auto; width: 208px; max-width: calc(100vw - 16px); margin: 0; padding: 4px;
  border: 1px solid var(--line-soft); border-radius: var(--button-radius); box-shadow: var(--dialog-shadow);
  color: var(--ink); background: var(--surface);
}
.row-menu button, .row-menu .button { width: 100%; justify-content: start; padding-inline: 10px; }
.selection-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.selection-bar[hidden], .upload-progress[hidden] { display: none; }
.selection-bar span { margin-right: 4px; color: var(--muted); }
.status {
  display: inline-flex; align-items: center; justify-self: start; padding: 3px 8px; border-radius: 8px;
  color: var(--muted); background: var(--wash); font-size: 13px; line-height: 18px; white-space: nowrap;
}
.status.live { color: var(--accent-text); background: var(--accent-soft); }
.empty { padding: 32px 20px; color: var(--muted); text-align: center; }
.catalog-empty { display: grid; justify-items: center; align-content: center; gap: 12px; min-height: 250px; }
.catalog-empty h2 { font-size: 20px; line-height: 26px; color: var(--ink); }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); }

dialog {
  max-height: 90dvh; width: min(calc(100% - 32px), 540px); padding: 24px;
  border-radius: var(--dialog-radius); border: 0; color: var(--ink); background: var(--surface); box-shadow: var(--dialog-shadow);
}
dialog::backdrop { background: #00103d55; }
.dialog-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 12px; }
.dialog-controls { display: flex; align-items: center; gap: 2px; flex: none; }
.dialog-head h2 { min-width: 0; overflow-wrap: anywhere; }
.dialog-head h2[tabindex="-1"]:focus { outline: none; }
.field { margin-bottom: 14px; }
.prototype-card { width: min(calc(100% - 32px), 584px); padding: clamp(16px, 4vw, 28px); }
.prototype-card .dialog-head { margin-bottom: 6px; }
.card-meta { margin-bottom: 18px; overflow-wrap: anywhere; font-size: 13px; }
.prototype-guest-access { padding: 14px 16px; border-radius: 12px; background: #f5f7fa; }
.prototype-guest-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.current-pin { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; }
.current-pin code {
  padding: 4px 8px; border-radius: var(--button-radius); background: var(--wash); color: var(--ink);
  font: 700 15px/20px var(--text-font); letter-spacing: .12em; font-variant-numeric: tabular-nums;
}
.prototype-guest-actions, .prototype-guest-draft, .prototype-guest-access form { margin-top: 12px; }
.prototype-guest-actions [data-guest-access-toggle] { margin-inline-start: auto; padding-inline: 8px; color: var(--accent-text); font-size: 13px; }
.prototype-guest-draft p { font-size: 13px; }
.prototype-guest-settings { margin-top: 12px; border-top: 1px solid var(--line-soft); }
.prototype-guest-settings [data-off] { margin-top: 4px; padding-inline: 8px; }
.pin-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.pin-field { flex: 1 1 130px; }
.pin-controls button { min-height: 40px; }
.pin-value { font-size: 24px; font-weight: 700; line-height: 32px; letter-spacing: .22em; font-variant-numeric: tabular-nums; }
.pin-change { margin-top: 12px; }
.confirm-form { margin-top: 18px; }
.confirm-form .action-row { justify-content: flex-end; }
.card-agent { margin-top: 8px; }
.card-row {
  width: 100%; min-height: 48px; display: grid; grid-template-columns: minmax(0, 1fr) auto 12px;
  align-items: center; gap: 8px; padding: 8px 6px; border: 0; border-radius: var(--button-radius);
  color: var(--ink); font: 500 15px/20px var(--display-font); text-align: start; cursor: pointer;
}
.card-row:hover { background: var(--wash); }
.card-row-label { display: flex; align-items: center; gap: 9px; min-width: 0; }
.card-row-label .icon { color: var(--muted); }
.card-row-meta, .card-agent-status { color: var(--muted); font: 400 13px/18px var(--text-font); }
.card-agent-status { grid-column: 2; max-width: 260px; text-align: end; overflow-wrap: anywhere; }
.card-agent-status.error { color: var(--danger); }
.card-chevron {
  grid-column: 3; justify-self: center; width: 7px; height: 7px; border: solid var(--muted);
  border-width: 1.5px 1.5px 0 0; transform: rotate(45deg);
}
.history-disclosure { border-top: 1px solid var(--line-soft); }
.history-disclosure summary { list-style: none; }
.history-disclosure summary::-webkit-details-marker { display: none; }
.history-disclosure[open] .card-chevron { transform: rotate(135deg); }
.history-content { padding: 4px 6px 6px; }
.history-limit { margin-bottom: 12px; font-size: 13px; }
.field-hint, .otp-hint { margin-top: 8px; font-size: 13px; line-height: 18px; }
.agent-activity, [data-command-fallback]:not(:empty) { margin: 10px 0; font-size: 13px; color: var(--muted); }
.agent-activity:empty { margin: 0; }
.history { margin: 0; padding: 0; list-style: none; }
.history li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 10px 0; overflow-wrap: anywhere;
}
.history li + li { border-top: 1px solid var(--line-soft); }
.history li:first-child { padding-top: 0; }
.history li:last-child { padding-bottom: 0; }
.history li div { flex: 1 1 210px; min-width: 0; }
.history li .subline { margin-top: 2px; }
.history li button { padding-inline: 10px; font-size: 13px; }
.aux-form { padding: 16px; background: var(--surface); border-radius: var(--surface-radius); margin-top: 16px; }
.aux-row {
  display: grid; align-items: center; grid-template-columns: minmax(0, 1fr) auto; margin: 0; padding: 12px 16px;
  gap: 8px; border-bottom: 1px solid var(--line-soft);
}
.aux-row:last-child { border-bottom: 0; }
.aux-row > div { overflow-wrap: anywhere; }
.audit-filter { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.audit-filter label { margin: 0; }
.audit-filter select { width: min(100%, 320px); min-width: 0; }
.monitor-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-block: 16px; }
.monitor-toolbar select { min-width: 120px; }
.monitor-toolbar button { min-height: 40px; }
.monitor-toolbar span { align-self: flex-end; padding-block: 9px; font-size: 13px; }
.monitor-section { margin-block-start: 24px; }
.monitor-section h2, .monitor-attention h2 { font-size: 19px; line-height: 24px; }
.monitor-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.monitor-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 0 0; }
.monitor-tile { min-width: 0; padding: 13px 14px; border-radius: var(--surface-radius); background: var(--surface); overflow-wrap: anywhere; }
.monitor-tile dt { color: var(--muted); font-size: 13px; }
.monitor-tile dd { margin: 4px 0 0; font: 500 17px/22px var(--display-font); font-variant-numeric: tabular-nums; }
.monitor-tile p, .monitor-caption { margin-block-start: 5px; color: var(--muted); font-size: 13px; line-height: 18px; }
.monitor-tile.attention dd { color: var(--danger); }
.monitor-attention { padding: 13px 16px; border-radius: var(--surface-radius); background: #fff4e5; color: #724500; }
.monitor-attention ul { margin: 8px 0 0; padding-inline-start: 20px; }
.monitor-table { margin-top: 10px; border-radius: var(--surface-radius); overflow-x: auto; background: var(--surface); }
.monitor-table table { width: 100%; min-width: 395px; border-collapse: collapse; text-align: start; }
.monitor-table th, .monitor-table td { padding: 8px 10px; text-align: start; font-size: 13px; }
.monitor-table thead { color: var(--muted); }
.monitor-table tbody tr { border-block-start: 1px solid var(--line-soft); }
.monitor-table tbody th { font-weight: 400; }
.monitor-table td { font-variant-numeric: tabular-nums; }

@media (max-width: 840px) {
  .monitor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 440px) {
  .monitor-tile { padding: 10px; }
  .monitor-tile dd { font-size: 15px; line-height: 20px; }
}
.agent-command {
  display: block; width: 100%; min-height: 140px; margin: 12px 0; padding: 10px; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--button-radius); background: var(--wash); color: var(--ink); font: inherit;
}
.upload-progress { margin-top: 14px; }
progress { display: block; width: 100%; height: 8px; accent-color: var(--accent-text); }
.upload-progress p, .viewer-loading p { color: var(--muted); margin-top: 10px; }
.viewer { height: 100dvh; }
.viewer iframe { display: block; border: 0; width: 100%; height: 100%; }
.viewer-loading {
  position: fixed; inset: 0; display: grid; place-content: center;
  grid-template-columns: minmax(0, 360px); padding: 18px; background: var(--canvas);
}
.viewer-loading h1 { margin: 0 0 16px; }
.viewer-loading button { margin-top: 12px; }
.viewer-loading button[hidden] { display: none; }
.studio-preview { height: 100dvh; display: flex; flex-direction: column; }
.preview-header {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px clamp(12px, 3vw, 32px); background: var(--surface); border-bottom: 1px solid var(--line-soft);
}
.preview-header h1 { font-size: 19px; line-height: 24px; overflow-wrap: anywhere; }
.preview-header .button { flex: none; }
.studio-preview .viewer { position: relative; flex: 1; height: auto; min-height: 0; }
.studio-preview .viewer-loading { position: absolute; }

@media (max-width: 960px) {
  .list-head { display: none; }
  .selectable .list-head { display: flex; }
  .selectable .list-head > :not(.row-select) { display: none; }
  .select-all-label { position: static; clip-path: none; width: auto; height: auto; margin: 0; }
  .list-item {
    grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px;
    grid-template-areas: "name state" "author updated" "quick quick";
  }
  .list-item:has(.row-select) {
    grid-template-columns: 22px minmax(0, 1fr) auto;
    grid-template-areas: "select name state" ". author updated" ". quick quick";
  }
  .list-item.folder-row { grid-template-areas: "name quick"; }
  .list-item.folder-row:has(.row-select) { grid-template-areas: "select name quick"; }
  .list-item .row-select { grid-area: select; }
  .row-file, .row-folder { grid-area: name; }
  .list-item .status { grid-area: state; justify-self: end; }
  .row-author { grid-area: author; }
  .row-date { grid-area: updated; text-align: end; }
  .row-actions { grid-area: quick; }
}

@media (max-width: 720px) {
  .studio-header { padding: 8px 16px; gap: 6px 12px; }
  .studio-header nav { order: 1; width: 100%; }
  .studio-header .nav-item { min-height: 36px; padding-inline: 9px; font-size: 13px; }
  .workspace { display: block; }
  aside { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
  aside .new-folder { width: auto; margin-top: 4px; }
  .aside-heading { padding: 0 0 4px; }
  .tree > li { display: inline-block; vertical-align: top; max-width: 100%; }
  .tree .tree { padding-left: 6px; }
  .catalog { padding: 16px; }
  h1 { font-size: 24px; line-height: 28px; }
  .list-head, .list-item { padding-inline: 12px; }
  .list-item:first-child { border-top: 0; }
  dialog { padding: 18px; }
}

@media (max-width: 550px) {
  .card-agent .card-row { grid-template-columns: minmax(0, 1fr) 12px; column-gap: 8px; row-gap: 3px; }
  .card-agent .card-row-label { grid-column: 1; }
  .card-agent .card-chevron { grid-area: 1 / 2; }
  .card-agent-status { grid-column: 1; max-width: none; padding-inline-start: 29px; text-align: start; }
  .card-agent-status:empty { display: none; }
  .prototype-guest-actions [data-guest-access-toggle] { margin-inline-start: 0; }
}
