/* A single owner of each perimeter: the frame, never frame + table + cells.
   Only the system-surfaces.js opt-in markers are affected; authored tables keep
   their own borders, colours, merged cells and editor resize behaviour. */
:root{--vial-surface-stroke:1px}
.vial-system-table-frame{
  border:var(--vial-surface-stroke) solid var(--line,#d8e0e8);
  background-clip:padding-box;
}
.vial-system-table-host:has(>.vial-system-table-frame){
  border:0;
  border-radius:0;
  background:transparent;
}
.vial-system-table-host>.vial-system-table-frame{margin-block:0}
.vial-system-table-frame>.vial-system-table{
  border:0!important;
  border-radius:0!important;
  border-collapse:separate!important;
  border-spacing:0!important;
}
.vial-system-table> :is(thead,tbody,tfoot)>tr> :is(th,td){
  border:0!important;
  border-bottom:var(--vial-surface-stroke) solid var(--line,#d8e0e8)!important;
}
.vial-system-table> :is(thead,tbody,tfoot):last-child>tr:last-child> :is(th,td){border-bottom:0!important}
/* Keep the journal's column grid, but not a second outer contour. */
@media(min-width:701px){
  .vial-system-table.gradebook-table> :is(thead,tbody,tfoot)>tr> :is(th,td):not(:last-child){
    border-inline-end:var(--vial-surface-stroke) solid var(--line,#d8e0e8)!important;
  }
}
/* Existing narrow layouts display records as cards, not a grid of cells. */
@media(max-width:700px){
  .vial-system-table.compact-course-gradebook>tbody>tr>td{border:0!important}
  .vial-system-table.compact-course-gradebook>tbody>tr:last-child{border-bottom:0;margin-bottom:0}
}
@container(max-width:600px){
  .vial-system-table.question-bank-table>tbody>tr> :is(th,td){border:0!important}
  .vial-system-table.question-bank-table>tbody>tr:last-child{border-bottom:0}
}
/* Radius and straight edges use the same native CSS stroke, not an outline or
   inset shadow. Do not clip blocks: menus and editing controls must stay visible. */
.vial-system-block{border-width:var(--vial-surface-stroke);background-clip:padding-box}
