@font-face {
  font-family: "Benzin";
  src: url("/webapp/Benzin-Semibold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #050505;
  --green: #58e326;
  --purple: #6d20ff;
  --deep-purple: #1c0738;
  --white: #ffffff;
  --muted: rgba(255, 255, 255, 0.58);
  --card: rgba(255, 255, 255, 0.08);
  --stroke: rgba(255, 255, 255, 0.14);
  --danger: #ff4d72;
  --glass: rgba(255, 255, 255, 0.065);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--white);
  background:
    radial-gradient(circle at 16% 8%, rgba(88, 227, 38, 0.24), transparent 26%),
    radial-gradient(circle at 88% 2%, rgba(109, 32, 255, 0.36), transparent 34%),
    linear-gradient(180deg, #050505 0%, #090612 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 14px calc(28px + env(safe-area-inset-bottom));
}

.hero {
  display: grid;
  gap: 14px;
  padding: 2px 0 14px;
}

h1 {
  margin: 0;
  font-family: "Benzin", Inter, system-ui, sans-serif;
  font-size: clamp(42px, 15vw, 82px);
  line-height: 0.84;
  font-weight: 700;
  letter-spacing: -0.08em;
}

.primary-button,
.submit-button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 18px;
  color: #071200;
  background: linear-gradient(135deg, #42e51d, #a4ff21);
  box-shadow: 0 14px 34px rgba(88, 227, 38, 0.18);
  font-weight: 950;
}

.primary-button {
  width: 100%;
  font-size: 16px;
}

.scope-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 46px;
  margin: 0 0 10px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.045);
}

.scope-switch[hidden] {
  display: none;
}

.scope-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(88, 227, 38, 0.2), rgba(109, 32, 255, 0.28));
  box-shadow: inset 0 0 0 1px rgba(88, 227, 38, 0.22);
  transition: transform 0.22s ease;
}

.scope-switch[data-scope="mine"] .scope-thumb {
  transform: translateX(100%);
}

.scope-option {
  position: relative;
  z-index: 1;
  border-radius: 13px;
  color: rgba(255, 255, 255, 0.56);
  background: transparent;
  font-size: 13px;
  font-weight: 950;
}

.scope-option.is-active {
  color: var(--white);
}

.filters {
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 5;
  display: grid;
  gap: 7px;
  padding: 4px 0 12px;
}

.filters[hidden] {
  display: none;
}

.filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
  font-weight: 900;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.filter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  color: rgba(255, 255, 255, 0.62);
}

.filter-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.filter-button.is-active .filter-icon {
  color: var(--green);
}

.filter-button.is-active {
  color: var(--white);
  border-color: rgba(88, 227, 38, 0.4);
  background: rgba(88, 227, 38, 0.105);
}

.filter-button:active,
.action-button:active,
.primary-button:active {
  transform: scale(0.98);
}

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

.todo-task {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.045)),
    rgba(10, 10, 10, 0.72);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
  animation: rise 0.28s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.todo-task.is-done {
  color: rgba(255, 255, 255, 0.52);
  border-color: rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.04);
  filter: grayscale(1);
}

.todo-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-top: 2px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.055);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.todo-check span {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 5px;
}

.todo-check.is-checked {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.09);
}

.todo-check.is-checked span::after {
  position: absolute;
  top: -1px;
  left: 4px;
  width: 5px;
  height: 12px;
  border-right: 2px solid rgba(255, 255, 255, 0.72);
  border-bottom: 2px solid rgba(255, 255, 255, 0.72);
  content: "";
  transform: rotate(42deg);
}

.todo-body {
  min-width: 0;
}

.todo-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
}

.todo-head h2 {
  margin: 0;
  color: var(--white);
  font-size: 17px;
  line-height: 1.13;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.todo-head p {
  display: -webkit-box;
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.54);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.todo-task.is-done h2,
.todo-task.is-done p,
.todo-task.is-done .task-grid,
.todo-task.is-done .pill,
.todo-task.is-done .action-button {
  color: rgba(255, 255, 255, 0.46);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid rgba(88, 227, 38, 0.25);
  border-radius: 999px;
  color: var(--green);
  background: rgba(88, 227, 38, 0.08);
  font-size: 10px;
  font-weight: 950;
  white-space: nowrap;
}

.pill.urgent {
  color: #ffdce5;
  border-color: rgba(255, 77, 114, 0.46);
  background: rgba(255, 77, 114, 0.12);
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 850;
}

.task-grid span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.047);
}

.task-grid .person-meta {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 6px;
  row-gap: 1px;
  align-items: center;
  min-height: 42px;
}

.person-meta .avatar {
  grid-row: 1 / 3;
}

.person-meta em {
  min-width: 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-grid b {
  min-width: 0;
  color: rgba(255, 255, 255, 0.82);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  object-fit: cover;
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  background: rgba(255, 255, 255, 0.08);
  font-size: 8px;
  font-weight: 950;
}

.status-dot::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  content: "";
}

.status-dot.in_progress::before {
  background: var(--purple);
}

.status-dot.done::before {
  background: rgba(255, 255, 255, 0.45);
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.action-button,
.mini-button,
.mode-button,
.remove-button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.075);
  font-size: 11px;
  font-weight: 950;
}

.action-button.purple {
  background: var(--purple);
}

.action-button.danger {
  color: #ffe6ed;
  background: rgba(255, 77, 114, 0.14);
}

.empty-state {
  padding: 34px 16px;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  text-align: center;
  font-weight: 850;
}

.empty-state.compact {
  padding: 14px;
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
}

.modal.is-open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
}

.task-form,
.proof-form {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  gap: 12px;
  width: min(100%, 720px);
  max-height: 92vh;
  margin: 0 auto;
  padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  border: 1px solid var(--stroke);
  border-radius: 26px 26px 0 0;
  background: linear-gradient(150deg, #111111, #08060f 72%);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.34);
  overflow-y: auto;
}

.form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 950;
}

.ghost-icon {
  width: 40px;
  height: 40px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.07);
  font-size: 27px;
  line-height: 1;
}

label {
  display: grid;
  gap: 7px;
}

label > span,
.section-head span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 15px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.075);
  outline: none;
}

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

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

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(88, 227, 38, 0.72);
  box-shadow: 0 0 0 3px rgba(88, 227, 38, 0.1);
}

select option {
  color: #101010;
}

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

.person-option {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}

.person-option.is-selected {
  border-color: rgba(88, 227, 38, 0.62);
  background: rgba(88, 227, 38, 0.11);
}

.person-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-head small,
.switch-row small,
.muted-line {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  font-weight: 760;
}

.reminders {
  display: grid;
  gap: 8px;
}

.reminder-row {
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr) 34px;
  gap: 7px;
}

.mode-button.is-manual {
  color: #071200;
  background: var(--green);
}

.remove-button {
  width: 34px;
  padding: 0;
  color: rgba(255, 255, 255, 0.8);
}

.switch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
  align-items: center;
  gap: 12px;
}

.switch-row input {
  display: none;
}

.switch-row i {
  position: relative;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.switch-row i::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  content: "";
  transition: transform 0.2s ease, background 0.2s ease;
}

.switch-row input:checked + i {
  background: rgba(88, 227, 38, 0.28);
}

.switch-row input:checked + i::after {
  background: var(--green);
  transform: translateX(20px);
}

.weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.weekday {
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.055);
  font-size: 11px;
  font-weight: 950;
}

.weekday.is-selected {
  color: #071200;
  border-color: transparent;
  background: var(--green);
}

.proof-copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.42;
  font-weight: 760;
}

.file-box {
  min-height: 64px;
  align-items: center;
  justify-items: center;
  padding: 14px;
  border: 1px dashed rgba(88, 227, 38, 0.36);
  border-radius: 18px;
  color: var(--green);
  background: rgba(88, 227, 38, 0.06);
  font-weight: 900;
}

.file-box input {
  display: none;
}

.submit-button {
  width: 100%;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 14px;
  z-index: 30;
  display: none;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 14px;
  border: 1px solid rgba(88, 227, 38, 0.28);
  border-radius: 17px;
  color: var(--white);
  background: rgba(12, 12, 12, 0.96);
  font-size: 13px;
  font-weight: 850;
}

.toast.is-visible {
  display: block;
}

@media (max-width: 390px) {
  .app {
    padding-right: 10px;
    padding-left: 10px;
  }

  h1 {
    font-size: 58px;
  }

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

  .person-list {
    grid-template-columns: 1fr;
  }

  .reminder-row {
    grid-template-columns: 1fr 1fr 34px;
  }

  .filter-button {
    font-size: 11px;
  }
}
