*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  background: rgba(236, 253, 245, 0.95);
  color: #0f172a;
  line-height: 1.45;
}

.shell {
  margin: 0 auto;
  min-height: 100dvh;
  max-width: 32rem;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  padding-top: env(safe-area-inset-top, 0px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(167, 243, 208, 0.6);
  background: rgba(236, 253, 245, 0.95);
  backdrop-filter: blur(8px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.topbar-text {
  min-width: 0;
}

.topbar-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-sub {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main {
  flex: 1;
  padding: 1rem;
}

.bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  border-top: 1px solid rgba(167, 243, 208, 0.85);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

.bottomnav-inner {
  margin: 0 auto;
  max-width: 32rem;
  display: flex;
  gap: 0.25rem;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 48px;
  padding: 0.35rem 0.25rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.65);
}

.nav-item.is-active {
  background: #fff;
  color: #065f46;
  box-shadow: 0 4px 24px -4px rgb(0 0 0 / 0.08), 0 2px 8px -4px rgb(0 0 0 / 0.04);
}

.nav-ico {
  font-size: 1.1rem;
  line-height: 1;
}

.card {
  border-radius: 1.5rem;
  background: #fff;
  padding: 1.25rem;
  box-shadow: 0 4px 24px -4px rgb(0 0 0 / 0.08), 0 2px 8px -4px rgb(0 0 0 / 0.04);
  border: 1px solid rgba(167, 243, 208, 0.55);
}

.card h1,
.card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.card p {
  margin: 0;
  font-size: 0.875rem;
  color: #475569;
}

.card-muted {
  background: rgba(236, 253, 245, 0.55);
  border-style: dashed;
}

.grid-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.grid-links a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 1.5rem;
  background: #fff;
  border: 1px solid rgba(167, 243, 208, 0.55);
  box-shadow: 0 4px 24px -4px rgb(0 0 0 / 0.08), 0 2px 8px -4px rgb(0 0 0 / 0.04);
  text-decoration: none;
  color: inherit;
  transition: transform 0.1s, background 0.15s;
}

.grid-links a:active {
  transform: scale(0.99);
}

.grid-links a:hover {
  background: rgba(236, 253, 245, 0.45);
}

.grid-links a.muted {
  background: rgba(236, 253, 245, 0.35);
}

.link-emoji {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: rgba(167, 243, 208, 0.65);
  font-size: 1.5rem;
}

.link-body {
  min-width: 0;
}

.link-title {
  font-weight: 600;
  color: #0f172a;
}

.link-desc {
  font-size: 0.875rem;
  color: #64748b;
}

.link-arrow {
  margin-left: auto;
  color: #94a3b8;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.65rem 1rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  width: 100%;
  margin-top: 1.5rem;
  min-height: 52px;
  font-size: 1rem;
  background: #16a34a;
  color: #fff;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.btn-primary:hover {
  background: #15803d;
}

.btn-primary:active {
  transform: scale(0.99);
}

.btn-ghost {
  flex-shrink: 0;
  min-height: auto;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border: 1px solid rgba(167, 243, 208, 0.9);
  color: #064e3b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.login-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 1.25rem;
}

.login-inner {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
}

.login-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.login-icon {
  margin: 0 auto 1rem;
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 4px 24px -4px rgb(0 0 0 / 0.08);
  border: 1px solid rgba(167, 243, 208, 0.65);
  font-size: 2rem;
}

.login-hero h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.login-hero p {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: #475569;
}

.form-card {
  border-radius: 1.5rem;
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 4px 24px -4px rgb(0 0 0 / 0.08);
  border: 1px solid rgba(167, 243, 208, 0.65);
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
}

label + label {
  margin-top: 1rem;
}

input[type="email"],
input[type="password"] {
  margin-top: 0.35rem;
  width: 100%;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: rgba(248, 250, 252, 0.85);
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border 0.15s, box-shadow 0.15s, background 0.15s;
}

input:focus {
  border-color: #4ade80;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.25);
}

.alert {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.875rem;
}

.hint {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.7rem;
  color: #64748b;
}

.hint code {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 0.35rem;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.space-y {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-inline {
  width: auto;
  margin-top: 0;
  min-height: 48px;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.btn-secondary {
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
  background: #f8fafc;
}

.btn-danger {
  width: 100%;
  margin-top: 0;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: #fee2e2;
}

.form-card-page h1 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.stack-form {
  margin-top: 0.5rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.danger-zone {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px dashed #fecaca;
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  margin-top: 0.35rem;
  width: 100%;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: rgba(248, 250, 252, 0.85);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border 0.15s, box-shadow 0.15s, background 0.15s;
}

textarea {
  resize: vertical;
  min-height: 4rem;
}

select {
  min-height: 48px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-weight: 500;
}

.checkbox-row input {
  width: auto;
  margin: 0;
}

.muted {
  color: #64748b;
  font-size: 0.875rem;
}

.muted.small {
  font-size: 0.8rem;
  margin: 0 0 0.75rem;
}

.msg-ok {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 0.875rem;
}

.item-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.item-list.compact {
  margin-top: 0.5rem;
}

.item-list__row {
  border-bottom: 1px solid #f1f5f9;
}

.item-list__row:last-child {
  border-bottom: none;
}

.item-list__link {
  display: block;
  padding: 0.85rem 0;
  text-decoration: none;
  color: inherit;
}

.item-list__link:active {
  opacity: 0.92;
}

.item-list__title {
  display: block;
  font-weight: 600;
  color: #0f172a;
}

.item-list__meta {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.2rem;
}

.item-list__static {
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.item-list__static:last-child {
  border-bottom: none;
}

.lines-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #ecfdf5;
}

.lines-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.lines-head {
  display: none;
}

.line-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

@media (min-width: 480px) {
  .line-row {
    grid-template-columns: 1.4fr 0.5fr 0.7fr;
    align-items: end;
  }
}

.grid-eyes {
  display: grid;
  gap: 1rem;
  margin-top: 0.5rem;
}

@media (min-width: 480px) {
  .grid-eyes {
    grid-template-columns: 1fr 1fr;
  }
}

.eye-block {
  border-radius: 1rem;
  padding: 0.75rem;
  background: rgba(236, 253, 245, 0.6);
  border: 1px solid rgba(167, 243, 208, 0.5);
}

.eye-title {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.card .alert a {
  color: #047857;
  font-weight: 600;
}
