:root {
  color-scheme: light;
  --bg: #f7efe5;
  --surface: #fffaf3;
  --surface-strong: #ffffff;
  --text: #2c241d;
  --muted: #817469;
  --soft: #ece0d4;
  --line: #eadfd3;
  --accent: #f5b84c;
  --accent-strong: #e89a2e;
  --green: #8fa867;
  --green-soft: #e8efd9;
  --rose-soft: #f8ded5;
  --lilac-soft: #eee3fa;
  --shadow: 0 18px 48px rgba(85, 62, 38, 0.14);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(245, 184, 76, 0.23), transparent 26rem),
    linear-gradient(180deg, #f7efe5 0%, #f3e9de 100%);
  color: var(--text);
  overflow-x: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  background: rgba(255, 250, 243, 0.62);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.app-view {
  min-height: 100vh;
  padding: 22px 18px 104px;
}

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

.brand-title {
  margin: 0;
  font-size: 27px;
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f8c55e, #97aa69);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(159, 118, 55, 0.22);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  flex: 0 0 auto;
}

.avatar::after {
  content: "Фото";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: -2px;
  min-width: 0;
  padding: 2px 0;
  border-radius: 999px;
  background: rgba(45, 38, 31, 0.86);
  color: #fffaf3;
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar input {
  display: none;
}

.hero-card {
  padding: 22px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(245, 184, 76, 0.96), rgba(248, 205, 106, 0.78)),
    #f5b84c;
  color: #3a2a14;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero-card::after {
  content: "";
  width: 128px;
  height: 128px;
  border-radius: 44px;
  background: rgba(255, 255, 255, 0.22);
  position: absolute;
  right: -36px;
  top: -34px;
  transform: rotate(18deg);
}

.hero-card h2,
.panel h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.18;
  letter-spacing: 0;
}

.hero-card p,
.panel p {
  margin: 8px 0 0;
  color: rgba(58, 42, 20, 0.74);
  line-height: 1.45;
  font-size: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.button {
  min-height: 46px;
  border-radius: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  font-weight: 750;
  font-size: 14px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.button:active {
  transform: translateY(1px) scale(0.99);
}

.button.primary {
  background: #2d261f;
  color: #fffaf3;
  box-shadow: 0 12px 20px rgba(43, 34, 26, 0.18);
}

.button.secondary {
  background: rgba(255, 250, 243, 0.76);
  color: #3a2a14;
}

.button.green {
  background: var(--green);
  color: white;
}

.notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--green-soft);
  color: #566b3b;
  font-size: 13px;
  font-weight: 760;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.18;
}

.section-head button {
  background: transparent;
  color: var(--green);
  font-size: 13px;
  font-weight: 750;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.panel,
.meeting-card,
.request-card,
.form-card {
  border: 1px solid rgba(234, 223, 211, 0.82);
  background: rgba(255, 250, 243, 0.92);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 28px rgba(78, 57, 38, 0.08);
}

.panel {
  padding: 18px;
}

.metric {
  padding: 16px;
  min-height: 106px;
}

.metric strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.meeting-card,
.request-card {
  padding: 16px;
  margin-bottom: 12px;
}

.type-editor-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
}

.meeting-type-editor {
  display: grid;
  gap: 12px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.title {
  font-size: 16px;
  line-height: 1.25;
  margin: 0;
  font-weight: 780;
}

.meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.status {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.status.pending {
  background: #fff0cb;
  color: #9a6417;
}

.status.confirmed {
  background: var(--green-soft);
  color: #566b3b;
}

.status.needs {
  background: var(--lilac-soft);
  color: #6e578b;
}

.status.closed {
  background: var(--rose-soft);
  color: #9d5949;
}

.tabs,
.date-strip,
.chips {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.meeting-type-grid {
  flex-wrap: wrap;
  overflow: visible;
}

.tabs::-webkit-scrollbar,
.date-strip::-webkit-scrollbar,
.chips::-webkit-scrollbar {
  display: none;
}

.tab,
.date-pill,
.chip {
  flex: 0 0 auto;
  min-height: 38px;
  border-radius: 15px;
  background: rgba(255, 250, 243, 0.74);
  color: var(--muted);
  padding: 0 13px;
  font-size: 13px;
  font-weight: 730;
  border: 1px solid rgba(234, 223, 211, 0.82);
}

.tab.active,
.date-pill.active,
.chip.active {
  background: #2d261f;
  color: #fffaf3;
  border-color: #2d261f;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.slot {
  min-height: 44px;
  border-radius: 15px;
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 760;
  border: 1px solid var(--line);
}

.slot.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  font-size: 13px;
  font-weight: 780;
  color: #5a4e43;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

.field.compact textarea {
  min-height: 70px;
}

.field textarea::placeholder,
.blacklist-form input::placeholder,
.exception-row input::placeholder {
  color: rgba(129, 116, 105, 0.72);
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field.compact {
  margin-bottom: 0;
}

.form-card {
  padding: 16px;
}

.chat {
  display: grid;
  gap: 10px;
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}

.chat-input input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.settings-block {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

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

.weekday,
.exception-pill {
  min-height: 38px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 780;
}

.weekday.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.settings-summary {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.38;
}

.time-grid,
.exception-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}

.time-slot {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
}

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

.exception-row input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.blacklist-form {
  display: grid;
  gap: 10px;
}

.blacklist-form input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.exception-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.exception-pill {
  padding: 0 12px;
}

.stepper {
  display: grid;
  grid-template-columns: 74px 1fr 74px;
  gap: 10px;
  align-items: center;
}

.stepper strong {
  min-height: 46px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 18px;
}

.bubble {
  max-width: 84%;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.42;
}

.bubble.owner {
  background: var(--green-soft);
  justify-self: start;
}

.bubble.user {
  background: #fff0cb;
  justify-self: end;
}

.owner-chat {
  margin-top: 12px;
}

.owner-clarify {
  margin-top: 12px;
}

.owner-clarify textarea {
  min-height: 76px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(calc(100% - 28px), 432px);
  min-height: 70px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  border: 1px solid rgba(234, 223, 211, 0.86);
  border-radius: 25px;
  background: rgba(255, 250, 243, 0.92);
  box-shadow: 0 18px 40px rgba(72, 55, 39, 0.15);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.nav-item {
  border-radius: 19px;
  color: var(--muted);
  background: transparent;
  display: grid;
  place-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 760;
}

.nav-item svg {
  width: 21px;
  height: 21px;
  stroke-width: 2;
}

.nav-item.active {
  background: #2d261f;
  color: #fffaf3;
}

.empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
}

.mode-switch {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.mode-switch button {
  flex: 1;
}

@media (max-width: 360px) {
  .app-view {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand-title {
    font-size: 24px;
  }

  .slot-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-actions {
    flex-direction: column;
  }

  .topbar {
    align-items: flex-start;
  }

  .mode-switch {
    flex-wrap: wrap;
  }

  .time-slot,
  .exception-row {
    grid-template-columns: 1fr;
  }

  .weekday-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .chat-input {
    grid-template-columns: 1fr;
  }
}
