:root {
  color-scheme: light dark;
  --bg: var(--tg-theme-bg-color, #f4f6f8);
  --text: var(--tg-theme-text-color, #17212b);
  --hint: var(--tg-theme-hint-color, #6b7785);
  --link: var(--tg-theme-link-color, #2481cc);
  --button: var(--tg-theme-button-color, #2481cc);
  --button-text: var(--tg-theme-button-text-color, #ffffff);
  --surface: var(--tg-theme-secondary-bg-color, #ffffff);
  --line: rgba(123, 135, 148, 0.22);
  --ok: #31a66a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 18px 14px 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 2px 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--link);
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: 0;
}

h2 {
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 23px;
}

.panel {
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.panel-title span {
  min-width: 32px;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--button) 14%, transparent);
  color: var(--button);
  font-weight: 700;
  text-align: center;
}

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

.task-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 9px;
  align-items: start;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.task-marker {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 2px solid var(--hint);
  border-radius: 50%;
}

.task-content {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.task-content strong {
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}

.task-content small {
  color: var(--hint);
  font-size: 12px;
  line-height: 1.25;
}

.task-form {
  display: grid;
  gap: 12px;
}

.assignee-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--hint);
  font-size: 13px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.primary-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--button);
  color: var(--button-text);
  font-size: 16px;
  font-weight: 700;
}

.secondary-button {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--button);
  border-radius: 8px;
  background: transparent;
  color: var(--button);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

.assignee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.assignee-row strong {
  overflow-wrap: anywhere;
}

.delete-button {
  align-self: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(212, 60, 85, 0.36);
  border-radius: 8px;
  background: transparent;
  color: #d43c55;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.task-form.is-disabled,
.assignee-form.is-disabled {
  opacity: 0.62;
}

.empty {
  padding: 10px 0 2px;
  color: var(--hint);
  font-size: 14px;
}

.status {
  min-height: 22px;
  padding: 2px 4px 0;
  color: var(--hint);
  font-size: 13px;
}

.status.is-error {
  color: #d43c55;
}

@media (min-width: 640px) {
  .app-shell {
    padding-top: 28px;
  }

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

  .task-form label:first-child,
  .task-form label:nth-child(2),
  .task-form label:nth-child(3),
  .primary-button {
    grid-column: 1 / -1;
  }
}
