/* Web-only surface changes. The file tree, editor, diff, and execution
   controls remain the shared workbench implementation. */
html[data-shiyan-platform="web"] #browserAddressBar,
html[data-shiyan-platform="web"] #bottomTerminal,
html[data-shiyan-platform="web"] .v21-terminal-tool,
html[data-shiyan-platform="web"] .browser-start [data-workspace-temporary],
html[data-shiyan-platform="web"] .browser-start [data-workspace-tool="terminal"],
html[data-shiyan-platform="web"] .browser-start [data-workspace-tool="history"],
html[data-shiyan-platform="web"] .browser-start [data-workspace-tool="bookmarks"],
html[data-shiyan-platform="web"] .browser-start [data-workspace-tool="downloads"],
html[data-shiyan-platform="web"] .browser-start [data-workspace-tool="settings"],
html[data-shiyan-platform="web"] .browser-manager [data-workspace-tool="terminal"],
html[data-shiyan-platform="web"] .browser-manager [data-workspace-tool="history"],
html[data-shiyan-platform="web"] .browser-manager [data-workspace-tool="bookmarks"],
html[data-shiyan-platform="web"] .browser-manager [data-workspace-tool="downloads"],
html[data-shiyan-platform="web"] .browser-manager [data-workspace-tool="settings"] {
  display: none !important;
}

html[data-shiyan-platform="web"] #rightWorkspace { min-width: 0; }
html[data-shiyan-platform="web"] .v2-file-directory { min-width: 0; }
html[data-shiyan-platform="web"] .web-remote-controls {
  position: relative;
  flex: 0 0 auto;
  padding: 6px 8px;
  margin: 0;
  border-bottom: 1px solid var(--border, rgba(128,128,128,.16));
}
html[data-shiyan-platform="web"] .web-project-bar { display:flex; align-items:center; gap:4px; min-width:0; }
html[data-shiyan-platform="web"] .web-project-bar > select {
  flex:1; min-width:0; width:0; height:28px; padding:3px 5px;
  border:0; border-radius:5px; background:transparent; color:var(--text,inherit);
  font:inherit; font-size:12px; text-overflow:ellipsis; cursor:pointer;
}
html[data-shiyan-platform="web"] .web-project-add,
html[data-shiyan-platform="web"] .web-project-menu > summary {
  display:flex; align-items:center; justify-content:center;
  width:26px; height:28px; padding:0; border:0; border-radius:5px;
  background:transparent; color:var(--secondary,inherit); cursor:pointer; font:inherit;
}
html[data-shiyan-platform="web"] .web-project-add { font-size:18px; }
html[data-shiyan-platform="web"] .web-project-menu > summary { list-style:none; font-size:18px; }
html[data-shiyan-platform="web"] .web-project-menu > summary::-webkit-details-marker { display:none; }
html[data-shiyan-platform="web"] .web-project-menu[open] > summary,
html[data-shiyan-platform="web"] .web-project-bar > select:hover,
html[data-shiyan-platform="web"] .web-project-add:hover { background:rgba(128,128,128,.09); }
html[data-shiyan-platform="web"] .web-project-menu-body {
  position:absolute; z-index:25; right:8px; top:36px; width:min(220px,calc(100% - 16px));
  box-sizing:border-box; display:flex; flex-direction:column; gap:3px; padding:8px;
  background:var(--popover); color:var(--text); border:1px solid var(--line);
  border-radius:9px; box-shadow:0 8px 24px rgba(0,0,0,.12);
}
html[data-shiyan-platform="web"] .web-project-menu-body > button,
html[data-shiyan-platform="web"] .web-project-menu-body > a {
  display:block; padding:6px; text-align:left; text-decoration:none; color:inherit;
  font:inherit; font-size:12px; border-radius:4px;
}
html[data-shiyan-platform="web"] .web-project-menu-body > a:hover,
html[data-shiyan-platform="web"] .web-project-menu-body > button:hover { background:rgba(128,128,128,.09); }
html[data-shiyan-platform="web"] .web-project-bar :focus-visible { outline:2px solid var(--accent,#488bcb); outline-offset:1px; }
html[data-shiyan-platform="web"] .web-remote-state {
  margin:2px 2px 0; font-size:11px; line-height:16px; color:var(--secondary,inherit);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
html[data-shiyan-platform="web"] .web-remote-state[hidden],
html[data-shiyan-platform="web"] .web-project-menu:not([open]) > .web-project-menu-body,
html[data-shiyan-platform="web"] [data-web-open][hidden] { display:none!important; }
html[data-shiyan-platform="web"] .web-remote-controls form footer { display:flex; align-items:center; gap:6px; }
html[data-shiyan-platform="web"] .web-control-field,
html[data-shiyan-platform="web"] .web-remote-controls form label {
  display: block;
  margin: 6px 0;
  color: var(--secondary, inherit);
  font-size: 11px;
}
html[data-shiyan-platform="web"] .web-control-field select,
html[data-shiyan-platform="web"] .web-remote-controls form input,
html[data-shiyan-platform="web"] .web-remote-controls form select {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 30px;
  margin-top: 3px;
  padding: 4px 7px;
  color: inherit;
  background: var(--v2-input, rgba(128,128,128,.08));
  border: 1px solid var(--border, rgba(128,128,128,.25));
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
}
html[data-shiyan-platform="web"] .web-remote-controls button:disabled { opacity: .42; cursor: default; }
html[data-shiyan-platform="web"] .web-project-menu-body > .web-danger { color: var(--danger, #b42318); }
html[data-shiyan-platform="web"] .web-path-field { display: flex; align-items: end; gap: 5px; }
html[data-shiyan-platform="web"] .web-path-field input { min-width: 0; flex: 1; }
html[data-shiyan-platform="web"] .web-path-field button { flex: 0 0 auto; white-space: nowrap; }
html[data-shiyan-platform="web"] .web-remote-form-error { color: var(--danger, #b42318); font-size: 12px; line-height: 1.4; }
html[data-shiyan-platform="web"] .web-document-reader { background: #fff; }
html[data-shiyan-platform="web"] .web-project-modal .web-project-form { max-width: 460px; }
html[data-shiyan-platform="web"] .web-project-modal .web-project-form header button { font-size: 20px; line-height: 1; }

@media (max-width: 700px) {
  html[data-shiyan-platform="web"] .v2-file-directory { min-width: 0; }
}

/* Native workbench tabs, restricted to files/execution/changes. */
html[data-shiyan-platform="web"] #addWorkspaceTab {display:none!important;}
html[data-shiyan-platform="web"] .browser-start .browser-shortcuts,
html[data-shiyan-platform="web"] .browser-start h3:nth-of-type(2) {display:none!important;}

/* Inner file columns can shrink; the outer panel uses the shared draggable layout. */
html[data-shiyan-platform="web"] .v2-file-body {
  grid-template-columns: minmax(0, 1fr) min(42%, 218px);
}
html[data-shiyan-platform="web"] .v2-file-pane.v2-directory-hidden .v2-file-body {
  grid-template-columns: minmax(0, 1fr) 0;
}
html[data-shiyan-platform="web"] .v2-file-directory { min-width: 0; }
html[data-shiyan-platform="web"] .v2-file-empty { min-width: 0; max-width: 100%; padding: 12px; box-sizing: border-box; }
html[data-shiyan-platform="web"] .v2-file-empty strong { white-space: nowrap; }
html[data-shiyan-platform="web"] .v2-file-empty span { max-width: 100%; }

/* Remote project dialog follows the shared workbench dialog tokens and scale. */
html[data-shiyan-platform="web"] .web-project-modal .web-project-form {
  box-sizing: border-box;
  width: min(360px, calc(100vw - 32px));
  max-width: 360px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--popover);
  color: var(--text);
  box-shadow: 0 14px 45px #11192721;
  font: inherit;
}
html[data-shiyan-platform="web"] .web-project-form header { margin-bottom: 15px; gap: 12px; }
html[data-shiyan-platform="web"] .web-project-form header h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.4; }
html[data-shiyan-platform="web"] .web-project-form header button {
  display: grid; place-items: center; width: 28px; height: 28px; min-height: 28px;
  padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--secondary);
  font: inherit; font-size: 20px; cursor: pointer;
}
html[data-shiyan-platform="web"] .web-project-form > label {
  display: flex; flex-direction: column; gap: 7px; margin: 13px 0;
  font-size: 12px; line-height: 1.4; color: var(--secondary);
}
html[data-shiyan-platform="web"] .web-project-form :is(input, select) {
  box-sizing: border-box; width: 100%; min-width: 0; height: 34px; margin: 0;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--soft-fill); color: var(--text); font: inherit; font-size: 13px;
  line-height: normal; outline: none; transition: border-color .15s, box-shadow .15s;
}
html[data-shiyan-platform="web"] .web-project-form select {
  appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%2386878d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
html[data-shiyan-platform="web"] .web-project-form input::placeholder { color: var(--muted); }
html[data-shiyan-platform="web"] .web-project-form .web-path-field { display: flex; align-items: center; gap: 8px; min-width: 0; }
html[data-shiyan-platform="web"] .web-project-form .web-path-field input { flex: 1; width: 0; }
html[data-shiyan-platform="web"] .web-project-form :is(.wb-text-button, .wb-secondary, .wb-primary) {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-height: 32px; margin: 0; padding: 6px 10px; border: 1px solid transparent;
  border-radius: 6px; font: inherit; font-size: 12.5px; line-height: 18px;
  white-space: nowrap; cursor: pointer; transition: background-color .15s, opacity .15s;
}
html[data-shiyan-platform="web"] .web-project-form :is(.wb-text-button, .wb-secondary) {
  background: var(--soft-fill); color: var(--text); border-color: var(--line);
}
html[data-shiyan-platform="web"] .web-project-form .wb-primary { background: var(--accent); color: #fff; }
html[data-shiyan-platform="web"] .web-project-form footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
html[data-shiyan-platform="web"] .web-project-form button:not(:disabled):hover { filter: brightness(.96); }
html[data-shiyan-platform="web"] .web-project-form header button:hover { background: var(--soft-fill); }
html[data-shiyan-platform="web"] .web-project-form :is(input, select):focus-visible {
  border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent);
}
html[data-shiyan-platform="web"] .web-project-form button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html[data-shiyan-platform="web"] .web-project-form :disabled { opacity: .45; cursor: default; }
@media (prefers-reduced-motion: reduce) {
  html[data-shiyan-platform="web"] .web-project-form :is(input, select, button) { transition: none; }
}

/* Project menu glyph spans must not inherit the label's flex-grow. */
html[data-shiyan-platform="web"] #v2Popup.v2-project-options > button > :is(.wb-icon, .session-menu-icon) {
  display: block;
  box-sizing: border-box;
  width: 15px;
  min-width: 15px;
  max-width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin: 0;
  align-self: center;
}
html[data-shiyan-platform="web"] #v2Popup.v2-project-options > button {
  justify-content: flex-start;
  align-items: center;
  gap: 7px;
  text-align: left;
}
html[data-shiyan-platform="web"] #v2Popup.v2-project-options > button > span:not(.wb-icon):not(.session-menu-icon) {
  flex: 1 1 0;
  min-width: 0;
  text-align: left;
}

/* Keep tab icons fixed so masked span glyphs cannot stretch like title spans. */
html[data-shiyan-platform="web"] #rightWorkspace .workspace-tab {
  justify-content: flex-start;
  text-align: left;
  gap: 7px;
  padding-inline: 8px;
}
html[data-shiyan-platform="web"] #rightWorkspace .workspace-tab > .wb-icon {
  display: block;
  flex: 0 0 15px;
  width: 15px;
  min-width: 15px;
  max-width: 15px;
  height: 15px;
  margin: 0;
}
html[data-shiyan-platform="web"] #rightWorkspace .workspace-tab > span:not(.wb-icon) {
  flex: 1 1 0;
  min-width: 0;
  text-align: left;
}

/* Make only the project-row more action legible when its row is revealed. */
html[data-shiyan-platform="web"] .v2-project-header:is(:hover, :focus-within) [data-project-more] {
  color: var(--text);
  opacity: 1;
}
html[data-shiyan-platform="web"] .v2-project-header [data-project-more] > .wb-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  opacity: 1;
}

/* Use the same light/dark tokens as the existing workbench popovers. */
html[data-shiyan-platform="web"] .web-project-menu-body .web-control-field select {
  color: var(--text);
  background: var(--soft-fill);
  border-color: var(--line);
}
html[data-shiyan-platform="web"] .web-project-menu-body > :is(button, a):not(:disabled):hover {
  background: var(--v22-hover, var(--subtle-fill));
}
html[data-shiyan-platform="web"] .web-project-menu-body > :is(button, a):focus-visible {
  background: var(--v22-hover, var(--subtle-fill));
  outline-offset: -2px;
}
