:root {
  color-scheme: light;
  --page: #f4f3ef;
  --page-top: #fbfaf7;
  --surface: #fffefb;
  --surface-soft: #fbfaf6;
  --surface-hover: #f6f6f1;
  --ink: #22211f;
  --muted: #6f6d67;
  --soft: #a09d94;
  --line: #e5e1d9;
  --line-strong: #d0cabf;
  --accent: #446f84;
  --accent-soft: #eef6f8;
  --danger: #9c3f38;
  --danger-soft: #fbefed;
  --shadow: 0 28px 76px rgba(40, 37, 31, 0.09), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, var(--page-top) 0, var(--page) 245px, #f5f4f0 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  text-rendering: geometricPrecision;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

::selection {
  background: rgba(68, 111, 132, 0.18);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 22px 14px;
}

.topbar h1 {
  margin: 0;
  color: #1f1f1d;
  font-size: 40px;
  font-weight: 720;
  letter-spacing: 0;
  line-height: 0.95;
}

.suite-link {
  display: inline-flex;
  color: inherit;
  text-decoration: none;
}

.suite-mark {
  display: grid;
  grid-template-columns: repeat(2, 10px);
  grid-template-rows: repeat(2, 10px);
  gap: 5px;
  width: 42px;
  height: 42px;
  place-content: center;
  border: 1px solid rgba(64, 57, 47, 0.06);
  border-radius: 50%;
  background: #fff7e9;
  box-shadow: 0 9px 22px rgba(62, 53, 40, 0.09);
}

.suite-mark span {
  border-radius: 4px;
}

.suite-mark span:nth-child(1) { background: #7592c4; }
.suite-mark span:nth-child(2) { background: #e2b94e; }
.suite-mark span:nth-child(3) { background: #6ebaa6; }
.suite-mark span:nth-child(4) { background: #df8577; }

.app-icon {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 1px 0 rgba(42, 38, 32, 0.05));
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px 48px;
}

.table-shell {
  overflow: visible;
  border: 1px solid rgba(65, 58, 48, 0.2);
  border-radius: 9px;
  background: rgba(255, 254, 251, 0.9);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

th,
td {
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  height: 38px;
  padding: 0 15px;
  background: linear-gradient(180deg, rgba(251, 250, 246, 0.96), rgba(246, 244, 238, 0.96));
  color: #68665f;
  font-size: 13px;
  font-weight: 640;
  letter-spacing: 0;
  text-align: left;
  text-transform: lowercase;
}

th:first-child {
  border-top-left-radius: 9px;
}

th:last-child {
  border-top-right-radius: 9px;
}

th:first-child,
td:first-child {
  width: 28%;
  border-right: 1px solid var(--line);
}

td {
  padding: 10px 14px;
}

tbody tr {
  background: var(--surface);
}

tbody tr:hover td,
tbody tr:focus-within td {
  background: var(--surface-soft);
}

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

tbody tr:last-child td:first-child {
  border-bottom-left-radius: 9px;
}

tbody tr:last-child td:last-child {
  border-bottom-right-radius: 9px;
}

.item-cell {
  min-width: 0;
}

.item-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 7px;
  align-items: start;
}

.item-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  padding: 0 8px;
  outline: none;
  font-size: 15.5px;
  font-weight: 650;
}

.item-input:hover {
  background: rgba(246, 246, 241, 0.92);
}

.item-input:focus {
  border-color: rgba(68, 111, 132, 0.62);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(68, 111, 132, 0.12);
}

.item-input::placeholder,
.status-window::placeholder {
  color: var(--soft);
}

.add-item,
.menu-button,
.menu-delete,
.cancel-delete,
.confirm-delete,
.new-row-button {
  cursor: pointer;
}

.add-item {
  width: 30px;
  height: 34px;
  align-self: start;
  border: 1px solid rgba(68, 111, 132, 0.24);
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.add-item:hover {
  border-color: rgba(68, 111, 132, 0.42);
  background: #e4f1f5;
}

.item-actions {
  position: relative;
  align-self: start;
  opacity: 0.48;
  transition: opacity 140ms ease;
}

tr:hover .item-actions,
tr:focus-within .item-actions,
.item-actions:has([aria-expanded="true"]) {
  opacity: 1;
}

.menu-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  line-height: 1;
}

.menu-button:hover,
.menu-button[aria-expanded="true"] {
  border-color: var(--line);
  background: #f1f0eb;
  color: var(--ink);
}

.dot-stack {
  display: grid;
  gap: 3px;
}

.dot-stack span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.row-menu {
  position: absolute;
  z-index: 10;
  top: 35px;
  right: 0;
  width: 214px;
  padding: 7px;
  border: 1px solid rgba(66, 61, 53, 0.16);
  border-radius: 9px;
  background: #fffefb;
  box-shadow: 0 18px 38px rgba(37, 34, 29, 0.16);
}

.menu-delete,
.cancel-delete,
.confirm-delete {
  min-height: 32px;
  min-width: 0;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 650;
}

.menu-delete {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--danger);
  text-align: left;
}

.menu-delete:hover {
  background: var(--danger-soft);
}

.confirm-text {
  margin: 4px 4px 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 680;
  line-height: 1.28;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.cancel-delete {
  border: 1px solid var(--line);
  background: #fffefb;
  color: var(--muted);
}

.confirm-delete {
  border: 1px solid transparent;
  background: var(--danger);
  color: #fffaf6;
}

.cancel-delete:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.confirm-delete:hover {
  background: #80312c;
}

.new-item-row td {
  background: #fcfbf8;
}

.new-row-button-row td {
  height: 45px;
  padding: 7px 14px;
  background: linear-gradient(180deg, #fcfbf8, #faf8f3);
}

.new-row-cell {
  padding-right: 10px;
}

.new-row-status-cell {
  position: relative;
}

.new-row-status-cell::after {
  content: "";
  display: block;
  height: 100%;
  min-height: 28px;
  border-radius: 7px;
  background: rgba(255, 254, 251, 0.55);
}

.new-row-button {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 620;
  outline: none;
  padding: 0 8px 0 5px;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.new-row-button:hover,
.new-row-button:focus-visible {
  border-color: var(--line);
  background: #f0f4f5;
  color: var(--ink);
}

.new-row-plus {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(68, 111, 132, 0.24);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
  font-weight: 720;
  line-height: 1;
}

.new-status-window,
.new-item-input {
  border-color: var(--line);
  background: var(--surface);
}

.status-window {
  display: block;
  width: 100%;
  height: 112px;
  min-height: 112px;
  max-height: 112px;
  resize: none;
  overflow-y: auto;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffefc, #faf9f5);
  box-shadow:
    inset 0 0 0 1px rgba(69, 63, 53, 0.16),
    inset 0 1px 2px rgba(41, 37, 30, 0.05);
  color: var(--ink);
  padding: 10px 12px;
  line-height: 1.45;
  outline: none;
  white-space: pre-wrap;
}

.status-window:hover {
  box-shadow:
    inset 0 0 0 1px rgba(69, 63, 53, 0.24),
    inset 0 1px 2px rgba(41, 37, 30, 0.05);
}

.status-window:focus {
  background: var(--surface);
  box-shadow:
    inset 0 0 0 1px rgba(68, 111, 132, 0.72),
    0 0 0 3px rgba(68, 111, 132, 0.12);
}

.status-window::-webkit-scrollbar {
  width: 9px;
}

.status-window::-webkit-scrollbar-track {
  background: transparent;
}

.status-window::-webkit-scrollbar-thumb {
  background: #c8c4bc;
  border: 2px solid #fbfaf6;
  border-radius: 999px;
}

.gate-page {
  display: grid;
  place-items: center;
  padding: 20px;
}

.gate {
  width: min(100%, 410px);
  display: grid;
  gap: 16px;
  justify-items: start;
}

.gate h1 {
  margin: 0;
  font-size: 78px;
  font-weight: 720;
  letter-spacing: 0;
  line-height: 0.9;
}

.gate-form {
  width: 100%;
  display: grid;
  gap: 12px;
}

.gate-form input[type="password"] {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 14px;
  outline: none;
}

.gate-form input[type="password"]:focus {
  border-color: rgba(68, 111, 132, 0.66);
  box-shadow: 0 0 0 3px rgba(68, 111, 132, 0.12);
}

.remember {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.gate-form button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fffdf8;
  font-weight: 680;
  cursor: pointer;
}

.gate-form button:hover {
  background: #11110f;
}

.error {
  margin: 0;
  color: var(--danger);
  font-weight: 650;
}

@media (max-width: 720px) {
  .topbar {
    gap: 8px;
    padding: 20px 14px 13px;
  }

  .topbar h1 {
    font-size: 34px;
  }

  .suite-mark {
    width: 38px;
    height: 38px;
    grid-template-columns: repeat(2, 9px);
    grid-template-rows: repeat(2, 9px);
    gap: 4px;
  }

  .app-icon {
    width: 31px;
    height: 31px;
  }

  .shell {
    padding-inline: 10px;
    padding-bottom: 32px;
  }

  .table-shell {
    overflow: visible;
  }

  table {
    min-width: 100%;
  }

  th {
    height: 37px;
    padding-inline: 12px;
  }

  th:first-child,
  td:first-child {
    width: 36%;
  }

  td {
    padding: 8px 10px;
  }

  .item-wrap {
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 6px;
  }

  .item-input {
    font-size: 15px;
    padding-inline: 7px;
  }

  .item-actions {
    opacity: 1;
  }

  .row-menu {
    right: auto;
    left: 0;
    width: 188px;
  }

  .status-window {
    height: 104px;
    min-height: 104px;
    max-height: 104px;
  }

  .new-row-button-row td {
    height: 43px;
    padding: 7px 10px;
  }

  .new-row-button {
    min-height: 30px;
  }

  .gate h1 {
    font-size: 62px;
  }
}
