:root {
  --bg: #121212;
  --bg-elev: #1a1a1a;
  --card: #1c1c1c;
  --line: #2e2e2e;
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --accent: #ff7a1a;
  --accent-ink: #1a0d00;
  --danger: #ff7a7a;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  --dock: 4.75rem;
  --radius: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0
    env(safe-area-inset-left);
}

.app {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 1.25rem 1rem 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page[hidden] {
  display: none;
}

.page-main {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.page-landing .app {
  display: flex;
  padding: 2rem 1.25rem;
}

.glg-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(18rem, 100%);
}

.glg-mark {
  margin: 0;
  font-family: "Black Ops One", Impact, "Arial Black", "Franklin Gothic Heavy", sans-serif;
  font-size: clamp(4.8rem, 28vw, 7.2rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3d3d3d;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 2rem;
  width: 100%;
  min-width: 12rem;
  height: 2.75rem;
  padding: 0 1.2rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.google-g {
  flex-shrink: 0;
}

.auth-error,
.invite-status {
  margin: 0.85rem 0 0;
  color: var(--danger);
  font-size: 0.88rem;
  text-align: center;
}

.invite-status {
  text-align: left;
}

.profile-email {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.invite-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.invite-panel[hidden] {
  display: none;
}

.invite-panel h2 {
  margin: 0;
  font-size: 1.2rem;
}

.invite-btn {
  width: 100%;
  padding: 0.8rem;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.invite-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.invite-list li {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 0.9rem;
  word-break: break-all;
}

.logout-btn {
  width: 100%;
  margin-top: 1.6rem;
}

.top {
  margin-bottom: 1.5rem;
}

h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card {
  display: grid;
  grid-template-columns: 5.4rem 1fr auto;
  gap: 0.9rem;
  align-items: stretch;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: inherit;
  text-align: left;
  box-shadow: var(--shadow);
  cursor: pointer;
  overflow: hidden;
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.date-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.25rem;
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
}

.date-box .weekday {
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.date-box .day {
  margin-top: 0.12rem;
  font-size: 0.92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1.15;
  white-space: nowrap;
}

.date-box.registered {
  background: #163d24;
  border-right-color: #1f4f30;
}

.card-body {
  padding: 0.9rem 0;
  min-width: 0;
}

.subject {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 650;
}

.meta {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.time {
  color: var(--text);
}

.chevron {
  align-self: center;
  padding-right: 0.9rem;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
}

.empty {
  margin-top: 3rem;
  text-align: center;
  color: var(--muted);
}

.dock {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.85rem;
  height: calc(var(--dock) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.dock[hidden] {
  display: none;
}

.fab {
  width: 3.4rem;
  height: 3.4rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.8rem;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(255, 122, 26, 0.28);
  cursor: pointer;
}

.fab:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.profile-btn {
  background: var(--bg-elev);
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-bar {
  margin-bottom: 1.1rem;
}

.back,
button.primary,
button.ghost,
button.danger {
  font: inherit;
  cursor: pointer;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 0.95rem;
}

.back-arrow {
  font-size: 1.15rem;
  line-height: 1;
}

.detail-card {
  padding: 1.2rem 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  color: #fff;
}

.detail h2 {
  margin: 0 0 1rem;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #fff;
}

.detail .row,
.detail .notes {
  margin: 0 0 0.7rem;
  font-size: 1.05rem;
  color: #fff;
}

.detail .row:last-child,
.detail .notes:last-child {
  margin-bottom: 0;
}

.detail strong {
  font-weight: 700;
}

.detail .notes {
  margin-top: 0.55rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.notes-card {
  margin-top: 0.75rem;
}

.people-card {
  margin-top: 0.75rem;
}

.people-list {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.people-list li {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 0.92rem;
}

.people-empty {
  color: var(--muted);
}

.detail-toolbar {
  margin-top: 1.25rem;
}

.register-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.85rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.register-btn.registered {
  background: #2f9e4a;
  color: #fff;
}

.register-btn svg {
  flex-shrink: 0;
}

.form-actions,
.detail-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.detail-actions {
  justify-content: center;
  align-items: center;
}

.detail-actions .edit {
  flex: none;
}

.cancel {
  flex: 1;
  padding: 0.8rem;
  border: 0;
  border-radius: var(--radius);
  background: #2a2a2a;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

form h2 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

label[hidden] {
  display: none;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
}

select {
  color-scheme: dark;
}

.date-wrap {
  position: relative;
  display: block;
}

.cal-icon {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  transform: translateY(-50%);
  cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='square' stroke-linejoin='miter'%3E%3Crect x='3' y='4.5' width='18' height='16.5'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E")
    center / 1.15rem 1.15rem no-repeat;
}

.date-wrap input[type="text"] {
  padding-right: 2.4rem;
}

.date-picker {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  border: 0;
  padding: 0;
  pointer-events: none;
}

input[type="date"] {
  color-scheme: dark;
}

.when-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.check {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--text);
}

.check input {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 0;
  accent-color: var(--accent);
}

textarea {
  resize: vertical;
}

.primary,
.ghost {
  flex: 1;
  padding: 0.8rem;
  border-radius: var(--radius);
  border: 0;
}

.primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
}

.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}

.trash {
  color: #e23b3b;
  flex: none;
  border: 2px solid #e23b3b;
}

.edit {
  color: #fff;
  border: 2px solid #fff;
}

.danger {
  flex: 1;
  padding: 0.8rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--danger);
}

body.page-inner .app {
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}

.confirm {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.72);
}

.confirm[hidden] {
  display: none;
}

.confirm-box {
  width: min(100%, 22rem);
  padding: 1.2rem 1.15rem 1.15rem;
  background: #1c1c1c;
  border: 1px solid var(--line);
  color: #fff;
}

.confirm-box p {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
}

.confirm .danger {
  background: #3a1515;
}
