:root {
  --pink: #f06292;
  --pink-strong: #e64f84;
  --pink-soft: #fff5f8;
  --pink-line: #f3dde5;
  --ink: #333333;
  --muted: #8f8f8f;
  --card: #ffffff;
  --shadow: 0 18px 45px rgba(214, 76, 126, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #fff7fa 0%, #ffeaf1 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  margin: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.phone-frame {
  position: relative;
  width: min(430px, 100%);
  min-height: 820px;
  overflow: hidden;
  border: 1px solid rgba(240, 98, 146, 0.18);
  border-radius: 34px;
  background: var(--pink-soft);
  box-shadow: var(--shadow);
}

.status-pill {
  margin: 18px auto 0;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--pink);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.tab-view {
  display: none;
  padding: 20px 18px 92px;
}

.tab-view.active {
  display: block;
}

.hero {
  padding: 14px 4px 8px;
}

.eyebrow,
.section-label,
.card span {
  margin: 0;
  color: var(--pink);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 32px;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

h3 {
  margin-bottom: 6px;
  font-size: 18px;
}

p,
small {
  color: var(--muted);
  line-height: 1.55;
}

.grid.two,
.member-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.member-grid {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.mode-screen {
  display: none;
  padding: 20px 18px 36px;
}

.mode-screen.active {
  display: block;
}

.mode-screen.active ~ .tab-view,
.mode-screen.active ~ .tabbar {
  display: none;
}

.mode-hero {
  padding-top: 38px;
}

.mode-options {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.mode-panel,
.join-card {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.mode-card {
  display: grid;
  width: 100%;
  gap: 8px;
  border: 1px solid var(--pink-line);
  border-radius: 8px;
  padding: 20px;
  text-align: left;
  background: #fff;
  box-shadow: 0 10px 24px rgba(240, 98, 146, 0.1);
}

.mode-card span {
  color: var(--pink);
  font-size: 13px;
  font-weight: 800;
}

.mode-card strong {
  font-size: 22px;
}

.mode-card.friends span {
  color: #4f7ddf;
}

.mode-card.friends {
  border-color: #dfe7ff;
}

.card {
  border: 1px solid var(--pink-line);
  border-radius: 8px;
  padding: 16px;
  background: var(--card);
  box-shadow: 0 8px 20px rgba(240, 98, 146, 0.08);
}

.shift-card {
  min-height: 126px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shift-card strong {
  font-size: 24px;
}

.shift-card.partner span {
  color: #6c8ae4;
}

.shift-card.friend span {
  color: #4f7ddf;
}

.highlight-card {
  margin-top: 14px;
  color: #fff;
  border: none;
  background: linear-gradient(135deg, var(--pink) 0%, #ff8ab3 100%);
}

.highlight-card span,
.highlight-card p {
  color: rgba(255, 255, 255, 0.86);
}

.highlight-card h2 {
  font-size: 28px;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.quick-actions button,
.mini-button,
form button,
menu button {
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  background: var(--pink);
  font-weight: 700;
}

.secondary-button,
.switch-mode-button {
  border: 1px solid var(--pink-line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--pink);
  background: #fff;
  font-weight: 700;
}

.form-message {
  min-height: 20px;
  margin-bottom: 0;
  color: var(--pink-strong);
  font-size: 13px;
  font-weight: 700;
}

.switch-mode-button {
  width: 100%;
  margin-top: 12px;
}

.quick-actions button:nth-child(even),
menu button:first-child {
  color: var(--pink);
  background: #fff;
  border: 1px solid var(--pink-line);
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0 18px;
}

.mini-button {
  flex: 0 0 auto;
  padding: 9px 13px;
}

.month-bar {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.month-bar button {
  border: 1px solid var(--pink-line);
  border-radius: 8px;
  height: 38px;
  color: var(--pink);
  background: #fff;
  font-size: 24px;
}

.month-bar strong {
  text-align: center;
  font-size: 18px;
}

.week-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.week-row {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.day-cell {
  min-height: 96px;
  border: 1px solid var(--pink-line);
  border-radius: 8px;
  padding: 7px 5px;
  background: #fff;
}

.day-cell.muted {
  opacity: 0.35;
}

.day-cell.together {
  border-color: var(--pink);
  background: #fff0f5;
}

.day-cell.today {
  box-shadow: inset 0 0 0 2px var(--pink);
}

.date-number {
  font-weight: 800;
}

.shift-line {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 6px;
  padding: 3px 4px;
  color: #666;
  background: #f8f8f8;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.more-line {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.shift-line.day {
  color: #ad7111;
  background: #fff5da;
}

.shift-line.night {
  color: #4d5ca8;
  background: #eef1ff;
}

.shift-line.rest {
  color: #20925a;
  background: #eafaf1;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ddd;
}

.dot.day {
  background: #ffd56b;
}

.dot.night {
  background: #7f8ee8;
}

.dot.rest {
  background: #62d493;
}

.dot.together {
  background: var(--pink);
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.list-item p {
  margin-bottom: 0;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--pink);
  background: #fff0f5;
  font-size: 12px;
  font-weight: 700;
}

.form-card {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--pink-line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

.compact {
  margin-top: 12px;
}

.group-card {
  display: grid;
  gap: 10px;
}

.invite-code {
  border: 1px dashed var(--pink);
  border-radius: 8px;
  padding: 14px;
  color: var(--pink-strong);
  background: #fff7fa;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 4px;
  text-align: center;
}

.member-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.member-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--pink-line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fffafb;
}

.member-row strong {
  font-size: 15px;
}

.member-row small {
  flex: 0 0 auto;
}

.tabbar {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--pink-line);
  background: rgba(255, 255, 255, 0.96);
}

.tabbar button {
  border: 0;
  padding: 14px 4px 16px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.tabbar button.active {
  color: var(--pink);
}

dialog {
  width: min(390px, calc(100vw - 32px));
  border: 0;
  border-radius: 14px;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(50, 30, 40, 0.36);
}

.dialog-card {
  display: grid;
  gap: 14px;
  border-radius: 14px;
  padding: 18px;
  background: #fff;
}

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

.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--pink);
  background: #fff0f5;
  font-size: 22px;
  line-height: 1;
}

#dialogFields {
  display: grid;
  gap: 11px;
}

menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
}

@media (max-width: 520px) {
  .app-shell {
    padding: 0;
  }

  .phone-frame {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
  }

  h1 {
    font-size: 29px;
  }
}
