:root {
  --bg: #f7f8f5;
  --side: #202724;
  --surface: #ffffff;
  --line: #dfe4df;
  --ink: #1c2421;
  --muted: #6b746f;
  --green: #2f7d64;
  --green-soft: #e8f2ee;
  --amber: #a86f1d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-panel {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(32, 39, 36, 0.06) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, #f8f9f6 0%, #eef2ed 100%);
  background-size: 72px 100%, auto;
}

.login-panel.hidden {
  display: none;
}

.login-stage {
  display: grid;
  width: min(430px, 100%);
}

.login-card {
  display: grid;
  gap: 17px;
  align-content: center;
  width: 100%;
  padding: 40px 38px 38px;
  border: 1px solid rgba(32, 39, 36, 0.1);
  border-top: 5px solid #d4b14a;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(28, 36, 33, 0.1);
}

.login-card h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  text-align: center;
}

.login-card-head {
  display: grid;
  justify-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.login-card-head img {
  width: 132px;
  max-width: 100%;
  margin-bottom: 2px;
}

.login-card-head small {
  display: block;
  color: #8a6411;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card label {
  display: grid;
  gap: 7px;
  font-weight: 700;
  color: #56625c;
}

.login-card input {
  min-height: 54px;
  padding: 0 15px;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  background: #fff;
  font-size: 16px;
}

.login-card input:focus {
  outline: 0;
  border-color: #dcb95f;
  box-shadow: 0 0 0 4px rgba(220, 185, 95, 0.2);
}

.login-card p {
  min-height: 20px;
  margin: 0;
  color: #a33b2d;
  font-weight: 700;
}

.login-card .primary-button {
  min-height: 54px;
  margin-top: 6px;
  border-radius: 8px;
  background: #2f7d64;
  box-shadow: 0 10px 24px rgba(47, 125, 100, 0.18);
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  background: var(--side);
  color: #fff;
}

.brand,
.account {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #dcb95f;
  color: #17201c;
  font-weight: 700;
}

.avatar {
  background: #eef4f1;
  color: var(--green);
}

.brand strong,
.brand small,
.account strong,
.account small {
  display: block;
}

.account small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

small,
p {
  color: var(--muted);
}

.side small {
  color: #b9c3be;
}

.account {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #dce4e0;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.nav button:disabled:hover {
  background: transparent;
  color: #dce4e0;
}

.main {
  display: grid;
  gap: 20px;
  align-content: start;
  padding: 28px;
}

[data-page-section].hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.page-head,
.toolbar,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-head p,
.section-title p {
  margin: 0 0 4px;
}

h1,
h2 {
  margin: 0;
  line-height: 1.35;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

.primary-button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

.alerts,
.compose,
.board,
.people,
.bot-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.alert-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.alert-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #f1dfba;
  border-radius: 8px;
  background: #fff8e9;
  color: var(--ink);
  font-size: 13px;
}

.alert-item time {
  color: var(--muted);
  white-space: nowrap;
}

.alert-history {
  display: grid;
  gap: 8px;
}

.alert-item.is-history {
  border-color: var(--line);
  background: #f7f8f5;
}

.history-toggle {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.history-toggle:hover {
  background: var(--green-soft);
}

.task-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 92px;
  padding: 12px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 220px;
  gap: 14px;
  align-items: end;
}

.target-add-button {
  min-width: 72px;
}

.recipient-panel {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}

.recipient-panel legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.recipient-type {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.recipient-type label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.recipient-type input {
  width: auto;
  height: auto;
}

.recipient-preview {
  display: grid;
  gap: 8px;
}

.recipient-preview > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

#recipientPreview,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.person-chip,
.tag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.person-chip button {
  margin-left: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
}

.search {
  width: min(360px, 100%);
}

.board .section-title {
  margin-bottom: 16px;
}

.list-head,
.task-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px 180px 150px 110px 230px;
  gap: 12px;
  align-items: center;
}

.list-head {
  margin-top: 18px;
  padding: 0 12px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.list-head span:not(:first-child) {
  justify-self: stretch;
  text-align: center;
}

.list-head.all-list-head,
.task-row.all-task-row {
  grid-template-columns: minmax(220px, 1.2fr) 108px 120px 142px 104px 84px 74px;
}

.list-head.all-list-head span {
  justify-self: stretch;
  text-align: center;
}

.list-head.all-list-head span:first-child {
  text-align: left;
}

.task-list {
  display: grid;
  gap: 8px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.calendar-nav,
.calendar-filter,
.calendar-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-nav strong {
  min-width: 110px;
  text-align: center;
}

.calendar-filter {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.calendar-filter button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.calendar-filter button.active {
  background: var(--green);
  color: #fff;
}

.calendar-legend {
  margin-top: 12px;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.calendar-legend span::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.calendar-legend .legend-all::before {
  background: #334155;
}

.calendar-legend .legend-department::before {
  background: #8a6411;
}

.calendar-legend .legend-person::before {
  background: #4f6fbd;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.calendar-weekday {
  min-height: 34px;
  padding: 8px;
  background: #eef3f0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.calendar-cell {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 158px;
  padding: 8px;
  background: #fff;
}

.calendar-cell.outside {
  background: #f3f5f1;
}

.calendar-cell.today {
  box-shadow: inset 0 0 0 2px rgba(47, 125, 100, 0.34);
}

.calendar-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calendar-day strong {
  font-size: 13px;
}

.calendar-day span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.calendar-events {
  display: grid;
  gap: 4px;
}

.calendar-event {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 6px 8px;
  border: 0;
  border-left: 4px solid var(--green);
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--ink);
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.calendar-event span {
  margin-right: 4px;
  color: var(--green);
  font-size: 11px;
}

.calendar-event.all {
  border-left-color: #334155;
  background: #eef2f7;
}

.calendar-event.department {
  border-left-color: #8a6411;
  background: #fff4d8;
}

.calendar-event.person {
  border-left-color: #4f6fbd;
  background: #eef3ff;
}

.calendar-more {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.task-row {
  min-height: 82px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.task-row:not(.all-task-row) > :not(.task-main):not(.task-thread) {
  display: grid;
  align-content: center;
  justify-self: stretch;
  justify-items: center;
  min-height: 38px;
  text-align: center;
}

.task-row:not(.all-task-row) > span:not(.task-actions):not(.task-main) b {
  display: block;
  width: 100%;
  text-align: center;
}

.task-row.all-task-row {
  min-height: 52px;
}

.task-row.all-task-row > :not(.task-main):not(.task-thread) {
  display: grid;
  align-content: center;
  justify-self: stretch;
  justify-items: center;
  text-align: center;
}

.task-row.all-task-row > b.all-meta,
.task-row.all-task-row > span.all-meta {
  min-height: 34px;
}

.task-row.all-task-row > span.all-meta b {
  display: block;
  width: 100%;
  text-align: center;
}

.task-row.all-task-row .status {
  width: 100%;
}

.task-row.all-task-row .task-actions {
  display: grid;
  grid-template-columns: minmax(64px, 1fr);
  justify-content: center;
  width: 100%;
}

.task-row.all-task-row .task-actions .small-button,
.task-row.all-task-row .task-actions .danger-button {
  width: 100%;
}

.task-row.all-task-row .task-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row.all-task-row.expanded .task-main span {
  overflow: visible;
  white-space: normal;
}

.task-row.all-task-row .task-thread {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  align-items: start;
  text-align: left;
}

.request-detail {
  display: grid;
  gap: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.detail-item {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-item strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.4;
}

.comment-column {
  display: grid;
  gap: 8px;
}

.comment-column h4,
.request-detail h4 {
  margin: 0;
  font-size: 13px;
}

.request-note-list {
  display: grid;
  gap: 8px;
}

.request-note {
  padding: 8px 10px;
  border: 1px solid #e6dfcf;
  border-radius: 8px;
  background: #fffaf0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.request-note strong {
  color: var(--ink);
}

.task-thread {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.comment-list {
  display: grid;
  gap: 6px;
}

.comment-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f7f8f5;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.comment-item strong {
  color: var(--ink);
}

.comment-form,
.request-note-form,
.delegate-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.comment-form input,
.request-note-form input,
.delegate-form input {
  min-width: 0;
}

.delegate-form {
  grid-template-columns: minmax(0, 1fr) 190px auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}

.delegate-form h4 {
  grid-column: 1 / -1;
}

.delegate-target-area {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
}

.delegate-target-area > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.delegate-target-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  max-height: 236px;
  overflow: auto;
  padding: 2px;
}

.delegate-target-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.delegate-target-card input {
  width: 17px;
  height: 17px;
}

.delegate-target-card span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.delegate-target-card strong,
.delegate-target-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delegate-target-card small {
  color: var(--muted);
  font-size: 11px;
}

.delegate-form label:first-of-type:not(.delegate-target-card) {
  grid-column: 1 / -1;
}

.workflow-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.workflow-list h4 {
  margin: 4px 0 0;
}

.workflow-node {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-left: calc(var(--depth) * 22px);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.workflow-node div:first-child {
  display: grid;
  gap: 3px;
}

.workflow-node span,
.workflow-node small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.workflow-node div:last-child {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.task-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(62px, 1fr));
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.task-actions .small-button,
.task-actions .danger-button {
  width: 100%;
}

.small-button,
.danger-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.small-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.danger-button {
  border-color: #efcbc6;
  color: #a13d34;
}

.task-main {
  display: grid;
  gap: 4px;
}

.task-main strong {
  line-height: 1.4;
}

.task-main span,
.task-row > span {
  color: var(--muted);
  font-size: 13px;
}

.task-row b {
  font-size: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  min-width: 82px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.status.waiting {
  background: #fff1d8;
  color: var(--amber);
}

.org-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.org-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}

.master-form,
.account-form {
  display: grid;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}

.master-form {
  grid-template-columns: 1fr 1fr auto;
}

.account-form {
  grid-template-columns: 1fr 1fr 1fr auto;
}

.master-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 8px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.master-chip button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: #f4e5e2;
  color: #9d3f36;
  font-weight: 800;
}

.master-chip button:disabled {
  background: #eef2ef;
  color: #9aa39e;
  cursor: not-allowed;
}

h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.account-tree {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.management-row,
.department-account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.department-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.department-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  padding: 12px 14px;
  border: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.department-title h3 {
  margin: 0;
}

.department-title small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.title-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toggle-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fafbf9;
  color: var(--green);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.department-group.open .department-title {
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.management-row,
.department-account-grid {
  padding: 12px;
}

.account-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid #cbd6d0;
  border-radius: 8px;
  background: #fff;
}

.account-card strong {
  display: block;
}

.account-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.account-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.lineworks-id-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin-top: 8px;
}

.credential-panel {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
}

.credential-panel span {
  margin: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.password-reset-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.lineworks-id-form input {
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.password-reset-form input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}

.password-reset-form button {
  width: 100%;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.account-card.executive {
  border-left-color: #d4a633;
  background: #fffaf0;
}

.account-card.manager {
  border-left-color: var(--green);
  background: #f7fbf9;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef3f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.role-pill.executive {
  background: #fff0c8;
  color: #8a6411;
}

.role-pill.manager {
  background: var(--green-soft);
  color: var(--green);
}

.bot-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  gap: 14px;
  margin-top: 16px;
}

.bot-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}

.bot-card h3,
.bot-log-head h3 {
  margin: 0;
}

.bot-card .primary-button {
  justify-self: start;
}

.bot-events {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.bot-events label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.bot-events input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bot-events span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.bot-events label.wide-event {
  grid-column: 1 / -1;
}

.bot-events span small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.bot-events span::before {
  content: "";
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #b9c7c0;
  border-radius: 5px;
  background: #fff;
}

.bot-events input:checked + span::before {
  content: "✓";
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.bot-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.bot-flow div {
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bot-flow span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bot-flow strong {
  display: block;
  margin-top: 4px;
}

.flow-arrow {
  color: var(--green);
  font-weight: 800;
}

.bot-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.bot-log {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.bot-log-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bot-log-item strong,
.bot-log-item span {
  display: block;
}

.bot-log-item > div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.empty {
  margin: 10px 0 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .login-card {
    padding: 32px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .side {
    padding: 16px;
  }

  .nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .nav button {
    text-align: center;
  }

  .list-head {
    display: none;
  }

  .task-row {
    grid-template-columns: 1fr 1fr;
  }

  .task-row.all-task-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-height: 54px;
  }

  .task-row.all-task-row .all-meta {
    display: none;
  }

  .task-row.all-task-row .status {
    align-self: center;
  }

  .task-row.all-task-row .task-actions {
    align-self: center;
    justify-content: end;
  }

  .task-row.all-task-row .task-thread,
  .detail-grid,
  .delegate-form {
    grid-template-columns: 1fr;
  }

  .comment-form,
  .request-note-form,
  .delegate-form {
    grid-template-columns: 1fr;
  }

  .master-form,
  .account-form,
  .bot-grid,
  .management-row,
  .department-account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 640px) {
  .login-panel {
    padding: 14px;
  }

  .login-card {
    padding: 24px;
  }

  .main {
    padding: 18px;
  }

  .page-head,
  .toolbar,
  .calendar-toolbar,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .form-row,
  .recipient-type,
  .task-row,
  .org-grid,
  .master-form,
  .account-form,
  .bot-grid,
  .bot-events,
  .bot-log-item,
  .workflow-node,
  .management-row,
  .department-account-grid {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .calendar-weekday {
    display: none;
  }

  .calendar-cell.outside {
    display: none;
  }

  .workflow-node {
    margin-left: calc(var(--depth) * 12px);
  }

  .bot-flow {
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    text-align: center;
  }
}
