:root {
  color-scheme: light;
  --bg: #eef7ff;
  --surface: #ffffff;
  --surface-soft: #f7fbff;
  --text: #102033;
  --muted: #607086;
  --line: #d5e4f2;
  --accent: #2f80ed;
  --accent-strong: #1c63c7;
  --accent-soft: #e5f1ff;
  --danger: #d14343;
  --danger-bg: #fff1f1;
  --focus: #3b91ff;
  --shadow: 0 18px 48px rgba(47, 128, 237, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(47, 128, 237, 0.14), transparent 38%),
    linear-gradient(315deg, rgba(125, 195, 255, 0.22), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: Avenir Next, Avenir, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

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

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: 3rem;
  font-weight: 600;
  line-height: 1.08;
  text-wrap: balance;
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
}

.status,
#count {
  min-width: max-content;
  color: var(--muted);
  font-size: 0.92rem;
}

.status.offline::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.45rem;
  border-radius: 999px;
  background: var(--danger);
  vertical-align: 0.03rem;
}

.kangaroo {
  margin-right: 0.18em;
  font-size: 0.8em;
}

.list-panel,
.table-section {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(213, 228, 242, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.list-panel {
  padding: 20px;
  margin-bottom: 18px;
}

.entry-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 0.9fr) minmax(140px, 0.9fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  outline: none;
  font-size: 0.98rem;
}

input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(59, 145, 255, 0.16);
}

.primary-button,
.delete-button {
  height: 46px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 150px;
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button span:first-child {
  font-size: 1.35rem;
  line-height: 1;
}

.table-section {
  overflow: hidden;
}

.table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.table-wrap {
  position: relative;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(213, 228, 242, 0.86);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th:first-child {
  width: 40%;
}

.text-row {
  cursor: pointer;
}

.text-row:hover {
  background: var(--surface-soft);
}

.text-row:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.edit-row td {
  background: var(--surface-soft);
}

.edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(0, 0.9fr) auto;
  gap: 10px;
  align-items: end;
  padding: 4px 0;
}

.edit-actions {
  display: flex;
  gap: 8px;
}

.delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  background: var(--danger-bg);
  color: var(--danger);
  padding: 0;
}

.delete-button:hover {
  background: #ffe0e0;
}

.done-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 0;
  cursor: pointer;
}

.done-button:hover {
  background: #d3e7ff;
}

.edit-actions .done-button,
.edit-actions .delete-button {
  width: 46px;
  min-width: 46px;
  height: 46px;
}

.delete-button svg,
.done-button svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.empty-state {
  display: none;
  padding: 34px 20px 38px;
  color: var(--muted);
  text-align: center;
}

.empty-state.visible {
  display: block;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 620px);
    padding-top: 18px;
    padding-bottom: 36px;
  }

  .page-header {
    align-items: start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
  }

  h1 {
    max-width: 100%;
    font-size: 2.15rem;
    line-height: 1.12;
  }

  .status {
    font-size: 0.88rem;
  }

  .list-panel {
    padding: 16px;
    margin-bottom: 14px;
  }

  .entry-form {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .primary-button {
    width: 100%;
  }

  .table-heading {
    padding: 15px 16px;
  }

  th,
  td {
    padding: 9px 10px;
  }

  th {
    font-size: 0.72rem;
  }

  td {
    font-size: 0.92rem;
  }

  .edit-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .edit-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 1.78rem;
  }

  .app-shell {
    width: min(100% - 16px, 620px);
  }

  .list-panel {
    padding: 14px;
  }

  th,
  td {
    padding: 9px 8px;
  }
}
