:root {
  font-family: Inter, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  color: #202020;
  background: #f4f4f1;
  --line: #ccc;
  --accent: #ff591b;
  line-height: 1.6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid #777;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
button:hover {
  background: #e5e5e0;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #111;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
header {
  background: #171717;
  color: #fafafa;
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 18px 26px;
  flex-wrap: wrap;
}
.brand {
  font-size: 24px;
  text-decoration: none;
  font-weight: 650;
}
.brand span {
  font-weight: 400;
  font-size: 16px;
}
#identity {
  margin-left: auto;
}
.simulation,
.meta,
.aside-note {
  font-size: 14px;
  color: #666;
}
.simulation {
  color: #ccc;
}
.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 85px);
}
aside {
  border-right: 1px solid var(--line);
  padding: 24px 18px;
}
aside select {
  width: 100%;
  margin: 8px 0;
}
nav {
  display: grid;
  gap: 6px;
  margin: 24px 0;
}
nav button {
  text-align: left;
  border-color: transparent;
}
nav button[aria-current='page'] {
  border-left: 3px solid var(--accent);
  background: #e8e8e3;
  font-weight: 650;
}
main {
  padding: 28px 36px;
  min-width: 0;
  max-width: 1400px;
  width: 100%;
  margin: auto;
}
.page-toolbar,
.actions,
.dialog-head,
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.activity-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 14px;
  margin-bottom: 18px;
}
.activity-bar button,
.notice-filters button {
  min-height: 44px;
}
#attention-button {
  font-weight: 650;
}
#activity-state {
  flex: 1 1 200px;
}
.attention-section {
  margin: 24px 0 32px;
}
.notice-filters {
  margin-bottom: 18px;
}
.notice-filters button[aria-pressed='true'] {
  border-color: var(--accent);
  box-shadow: inset 0 -3px var(--accent);
  font-weight: 650;
}
.page-toolbar {
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-toolbar h1 {
  margin: 0;
  font-size: 28px;
}
h2 {
  font-size: 21px;
}
h3 {
  font-size: 17px;
  margin: 0 0 8px;
}
.actions {
  margin: 16px 0;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}
.card,
.panel {
  border: 1px solid var(--line);
  padding: 20px;
  background: #fff;
  min-width: 0;
}
.card p {
  margin: 8px 0;
}
.card .actions {
  margin-bottom: 0;
}
.stack {
  display: grid;
  gap: 14px;
}
.section {
  margin-top: 30px;
}
.empty {
  padding: 24px;
  border: 1px dashed #aaa;
  color: #666;
}
.badge {
  display: inline-block;
  background: #ecece7;
  padding: 2px 8px;
  font-size: 13px;
}
.stagebar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-block: 1px solid var(--line);
  padding: 12px 0;
  margin: 16px 0;
}
.stagebar span {
  padding: 5px 12px;
}
.stagebar .active {
  background: #222;
  color: #fff;
}
label {
  display: block;
  font-weight: 500;
}
input:not([type='checkbox']),
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #aaa;
  background: #fff;
  color: #171717;
  padding: 10px;
  margin-top: 5px;
  min-height: 42px;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin-right: 8px;
}
.field {
  margin-bottom: 18px;
}
.field small {
  display: block;
  color: #666;
  font-weight: 400;
}
.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field.full {
  grid-column: 1/-1;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
dialog {
  border: 1px solid #777;
  padding: 26px;
  width: min(720px, calc(100% - 24px));
  max-height: 90dvh;
  overflow: auto;
  background: #fafaf7;
  color: #222;
}
dialog::backdrop {
  background: #0009;
}
.dialog-head {
  justify-content: space-between;
}
dialog h2 {
  margin: 0;
}
.dialog-head {
  margin-bottom: 16px;
}
#form-error,
#error {
  border-left: 4px solid #b42c18;
  background: #fff0e9;
  padding: 12px;
  white-space: pre-wrap;
}
#status:empty,
#form-state:empty {
  display: none;
}
#status {
  margin-bottom: 12px;
}
#leave-prompt {
  border-top: 1px solid #bbb;
  padding-top: 14px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  font-size: 14px;
}
.fact {
  margin: 10px 0;
}
.fact dt {
  font-size: 14px;
  color: #666;
}
.fact dd {
  margin: 2px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.invitation-state {
  font-weight: 650;
}
#session-members button {
  text-align: left;
  overflow-wrap: anywhere;
}
.invitation h3 {
  overflow-wrap: anywhere;
}
.project-context {
  margin-bottom: 20px;
}
.project-context > summary {
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
}
.discussion-thread {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--line);
}
.discussion-message {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.discussion-message:focus {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
.message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.list-table {
  width: 100%;
  border-collapse: collapse;
}
.list-table td,
.list-table th {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px;
  vertical-align: top;
}
.scroll {
  overflow: auto;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 10px;
  top: 10px;
  background: white;
  color: black;
  padding: 12px;
  z-index: 9;
}
.notice {
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  background: #eaeae5;
}
[hidden] {
  display: none !important;
}
@media (max-width: 700px) {
  header {
    padding: 14px;
    gap: 10px;
  }
  .brand {
    font-size: 21px;
  }
  .simulation {
    width: 100%;
  }
  #identity {
    margin: 0;
    flex: 1;
  }
  .shell {
    display: block;
  }
  aside {
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  aside nav {
    display: flex;
    overflow: auto;
    margin: 12px 0;
    gap: 4px;
  }
  nav button {
    white-space: nowrap;
  }
  aside .aside-note {
    display: none;
  }
  main {
    padding: 20px 14px;
  }
  .fields-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .page-toolbar h1 {
    font-size: 24px;
  }
  .card,
  .panel {
    padding: 16px;
  }
  dialog {
    padding: 18px;
  }
  .actions {
    gap: 8px;
  }
  .actions button {
    max-width: 100%;
  }
  .stagebar span {
    padding: 4px 7px;
  }
  .list-table {
    font-size: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
