body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f0f0f0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.phone-frame {
  width: 320px; 
  height: 640px;
  background: #fff;
  border-radius: 2em;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  border: 2px solid rgba(0,0,0,0.3); /* added outline */
}

/* Status bar */
.status-bar {
  height: 24px;
  background: #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65em;
  color: #555;
  padding: 0 15px;
  box-sizing: border-box;
}

.status-left, .status-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Home apps grid */
.home-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 70px;
  gap: 12px;
  padding: 15px;
  box-sizing: border-box;
  justify-items: center;
  align-items: center;
  overflow-y: auto;
}

/* App icons */
.app-icon {
  width: 55px; 
  height: 55px;
  border-radius: 15px;
  background: #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s;
}

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

.app-icon:hover {
  transform: scale(1.1);
}

/* Bottom dock with transparency */
.bottom-dock {
  height: 60px; 
  background: rgba(238, 238, 238, 0.65); /* 65% opacity */
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top-left-radius: 1.5em;
  border-top-right-radius: 1.5em;
  padding: 0 10px;
  box-sizing: border-box;
  position: relative;
  backdrop-filter: blur(10px);
}

/* Dock icons */
.bottom-dock .dock-icon {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  background: #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.15s;
  flex-shrink: 0;
  overflow: visible;
}

.bottom-dock .dock-icon img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
}

.bottom-dock .dock-icon:hover {
  transform: scale(1.1);
}

/* Notification dots */
.bottom-dock .dock-icon .notification {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 14px;
  height: 14px;
  background: red;
  border-radius: 50%;
  border: 2px solid #FFF;
  box-sizing: border-box;
  z-index: 10;
}

/* Header */
.email-header {
  background: #fff;
  border-bottom: 1px solid #ccc;
  padding: 1em;
  font-weight: bold;
  text-align: center;
  position: relative;
}

.email-header a {
  position: absolute;
  left: 2.5em; /* adjusted for menu icon */
  top: 50%;
  transform: translateY(-50%);
  color: #007aff;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  display: none; /* initially hidden */
}

#menuIcon {
  position: absolute;
  left: 0.8em;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 1.2em;
}

/* Menu overlay */
#menuOverlay {
  display: none;
  position: absolute;
  top: 50px;
  left: 0;
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #ccc;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.menu-item {
  padding: 0.75em 1em;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.menu-item:hover {
  background: #f0f0f0;
}

/* Body */
.email-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5em 0;
  position: relative;
}

/* Inbox email item */
.email-item {
  display: flex;
  flex-direction: column;
  padding: 0.75em 1em;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.email-item:hover {
  background: #f9f9f9;
}

.email-sender {
  font-weight: bold;
  font-size: 0.9em;
  display: flex;
  justify-content: space-between;
  color: #202124;
}

.sender-email {
  font-weight: normal;
  font-size: 0.8em;
  color: #5f6368;
  margin-left: 0.25em;
}

.email-subject {
  font-weight: bold;
  font-size: 0.85em;
  color: #202124;
  margin: 0.2em 0;
}

.email-preview {
  font-size: 0.8em;
  color: #5f6368;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-date {
  font-size: 0.75em;
  color: #5f6368;
  text-align: right;
  margin-top: 0.25em;
}

.unread .email-sender,
.unread .email-subject {
  font-weight: bold;
}

.read .email-sender,
.read .email-subject {
  font-weight: normal;
}

/* Solo email styles */
.solo-email {
  padding: 1em;
  overflow-y: auto;
}

.solo-email .email-sender,
.solo-email .sender-email,
.solo-email .email-time,
.solo-email .email-subject,
.solo-email .email-message {
  display: block;
  margin: 0.25em 0;
}

.solo-email .email-message {
  font-size: 0.85em;
  color: #202124;
  line-height: 1.4em;
}


/* SMS Header */
.sms-header {
  background: #fff;
  border-bottom: 1px solid #ccc;
  padding: 1em;
  font-weight: bold;
  text-align: center;
  position: relative;
}

.sms-header a {
  position: absolute;
  left: 0.8em;
  top: 50%;
  transform: translateY(-50%);
  color: #007aff;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  display: none;
}

.sms-header a:hover { text-decoration: underline; }

/* SMS Body */
.sms-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Inbox & Conversation */
.inbox-view, .conversation-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 0.5em;
}

.inbox-view { padding: 0.5em 0; }

.sms-item {
  display: flex;
  flex-direction: column;
  padding: 0.75em 1em;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.sms-item:hover { background: #f9f9f9; }

.sms-sender { font-weight: bold; font-size: 0.9em; color: #202124; }
.sms-preview { font-size: 0.8em; color: #5f6368; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sms-date { font-size: 0.75em; color: #5f6368; text-align: right; margin-top: 0.25em; }
.unread .sms-sender, .unread .sms-preview { font-weight: bold; }
.read .sms-sender, .read .sms-preview { font-weight: normal; }

/* Conversation bubbles with tails */
.conversation-view {
  flex: 1;
  padding: 0.75em 1em; 
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}

.smstextfirst, .smstextmiddle, .smstextlast,
.smsreplyfirst, .smsreplymiddle, .smsreplylast {
  display: inline-block;
  max-width: 70%;
  padding: 0.4em 0.9em;
  word-break: break-word;
  position: relative;
}

/* Incoming messages */
.smstextfirst { align-self: flex-start; background: #eee; color: #000; border-radius: 1em; }
.smstextmiddle { align-self: flex-start; background: #eee; color: #000; border-radius: 1em; }
.smstextlast { align-self: flex-start; background: #eee; color: #000; border-radius: 1em 1em 1em .2em; }

/* Outgoing messages */
.smsreplyfirst { align-self: flex-end; background: #007aff; color: #fff; border-radius: 1em; }
.smsreplymiddle { align-self: flex-end; background: #007aff; color: #fff; border-radius: 1em; }
.smsreplylast { align-self: flex-end; background: #007aff; color: #fff; border-radius: 1em 1em .2em 1em; }

/* Timestamp and read notes */
.message-date {
  font-size: 0.7em;
  color: #999;
  text-align: center;
  margin-bottom: 0.3em;
}

.read-note {
  font-size: 0.65em;
  color: #999;
  text-align: right;
  margin-top: 0.1em;
}

/* Reply box */
.reply-box {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0.5em 0.75em;
  border-top: 1px solid #ccc;
  background: #fafafa;
}

.reply-box input {
  flex: 1;
  padding: 0.5em 0.75em;
  border-radius: 1.25em;
  border: 1px solid #ccc;
  outline: none;
  font-size: 0.9em;
}

.reply-box .send-button {
  margin-left: 0.5em;
  color: #007aff;
  font-weight: bold;
  cursor: pointer;
}

.reply-box .attachment {
  margin-right: 0.5em;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #007aff;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  cursor: pointer;
  flex-shrink: 0;
}

/* Bottom navigation bar */
.nav-bar {
  height: 35px;
  background: #ddd;
  display: flex;
  justify-content: space-around;
  align-items: center;
  font-size: 1.2em;
  border-top: 1px solid #ccc;
}

.nav-bar div {
  cursor: pointer;
  user-select: none;
  width: 33%;
  text-align: center;
  transition: transform 0.15s;
}

.nav-bar div:hover {
  transform: scale(1.2);
}