:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #eef4f8;
  --border: #cfd9e3;
  --text: #15202b;
  --muted: #637282;
  --primary: #246bfe;
  --primary-strong: #1b50c9;
  --danger: #be2d3a;
  --danger-strong: #941f2a;
  --success: #16724a;
  --warning: #9a6500;
  --shadow: 0 18px 50px rgba(34, 48, 72, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.workspace {
  display: grid;
  gap: 18px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 32px;
  font-weight: 700;
}

h2 {
  font-size: 17px;
}

.status {
  min-width: 108px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.status.joining,
.status.leaving {
  border-color: #e0b660;
  color: var(--warning);
  background: #fff7e5;
}

.status.active {
  border-color: #8fc8ad;
  color: var(--success);
  background: #e9f7f0;
}

.status.error {
  border-color: #e39aa2;
  color: var(--danger);
  background: #fff0f2;
}

.panel,
.calendar-panel,
.log-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.field-group {
  display: grid;
  gap: 8px;
}

label {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  color: var(--text);
  background: #fbfdff;
  line-height: 1.45;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

input {
  min-height: 44px;
}

textarea:focus,
input:focus {
  outline: 3px solid rgba(36, 107, 254, 0.18);
  border-color: var(--primary);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.split-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.45fr);
  gap: 12px;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-weight: 600;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.primary {
  background: var(--primary);
  color: #ffffff;
}

.primary:hover:not(:disabled) {
  background: var(--primary-strong);
}

.danger {
  background: var(--danger);
  color: #ffffff;
}

.danger:hover:not(:disabled) {
  background: var(--danger-strong);
}

.ghost {
  min-height: 34px;
  border-color: var(--border);
  background: var(--surface);
  color: var(--muted);
}

.icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.metric span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  min-height: 24px;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.calendar-panel {
  padding: 16px;
}

.calendar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.calendar-header p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

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

.calendar-grid div {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}

.calendar-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.calendar-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.meeting-list-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

.meeting-list {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfdff;
  font-size: 14px;
}

.meeting-list th,
.meeting-list td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.meeting-list th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}

.meeting-list tr:last-child td {
  border-bottom: 0;
}

.approval-status {
  display: inline-block;
  min-width: 92px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.approval-status.approved {
  border-color: #8fc8ad;
  color: var(--success);
  background: #e9f7f0;
}

.approval-status.pending {
  border-color: #e0b660;
  color: var(--warning);
  background: #fff7e5;
}

.approval-status.rejected,
.approval-status.expired {
  border-color: #e39aa2;
  color: var(--danger);
  background: #fff0f2;
}

.log-panel {
  overflow: hidden;
}

.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 13px 16px;
}

.log {
  min-height: 150px;
  max-height: 300px;
  margin: 0;
  padding: 10px 16px 16px 38px;
  overflow: auto;
  background: #fbfdff;
}

.log li {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.35;
}

.log code {
  color: var(--text);
  font-family: Consolas, "Courier New", monospace;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1080px);
    padding: 18px 0;
  }

  .header {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 26px;
  }

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

  .calendar-header {
    flex-direction: column;
  }

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

  .split-fields {
    grid-template-columns: 1fr;
  }

  .actions button {
    width: 100%;
  }
}
