:root {
  --bg: #FFFFFF;
  --text: #000000;
  --pill: #F2F2F2;
  --pill-hover: #E8E8E8;
  --muted: #666666;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
}

html, body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
  overflow-x: hidden;
}

::selection {
  background: #000000;
  color: #FFFFFF;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: #000000;
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 99999;
  opacity: 0;
  transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
  will-change: transform;
}

.cursor-ring {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 99998;
  opacity: 0;
  transition: width 0.25s ease, height 0.25s ease, opacity 0.2s ease;
  will-change: transform;
}

body.cursor-hover .cursor-dot {
  width: 10px;
  height: 10px;
}

body.cursor-hover .cursor-ring {
  width: 38px;
  height: 38px;
  border-color: #000000;
}

@media (hover: none) and (pointer: coarse) {
  .cursor-dot, .cursor-ring {
    display: none !important;
  }
}

.mono {
  font-family: var(--font-mono);
}

.gate-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  width: 100%;
}

.gate-box {
  width: 100%;
  max-width: 380px;
}

.gate-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: #000000;
  margin-bottom: 24px;
}

.gate-tabs {
  display: flex;
  gap: 18px;
  margin-bottom: 22px;
}

.gate-tab-btn {
  background: transparent;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 0;
}

.gate-tab-btn.active {
  color: #000000;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.portal-app {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  padding: 14px 24px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.brand-header {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #000000;
  text-decoration: none;
  white-space: nowrap;
}

.header-user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user-tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  width: 100%;
}

.header-nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  background: transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  padding: 6px 0;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
}

.nav-link.active {
  font-weight: 700;
  color: #000000;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.content-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  width: 100%;
}

.clean-hero {
  padding: 16px 0 24px;
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: #000000;
}

.portal-view {
  display: none;
}

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

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.view-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #000000;
}

.btn-plain {
  background: #000000;
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 9999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-height: 42px;
}

.btn-plain:active {
  transform: scale(0.98);
}

.btn-text {
  background: transparent;
  color: #000000;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.btn-text:active {
  opacity: 0.7;
}

.field-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: #000000;
}

.field-input, .field-select, .field-textarea {
  width: 100%;
  background: var(--pill);
  padding: 12px 14px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 16px;
  color: #000000;
  -webkit-appearance: none;
  appearance: none;
}

.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.field-textarea {
  resize: vertical;
  line-height: 1.45;
}

.simple-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.simple-row {
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.simple-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  width: 100%;
}

.simple-row-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.simple-row-title {
  font-size: 16px;
  font-weight: 700;
  color: #000000;
  line-height: 1.35;
  word-break: break-word;
}

.simple-row-meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.simple-row-desc {
  font-size: 14px;
  color: #000000;
  line-height: 1.5;
  word-break: break-word;
}

.event-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 8px 0;
  width: 100%;
}

.event-title {
  font-size: 15.5px;
  font-weight: 600;
  color: #000000;
  line-height: 1.35;
  flex: 1;
}

.event-date {
  font-size: 13.5px;
  font-weight: 600;
  color: #000000;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  background: var(--pill);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  color: #000000;
  cursor: pointer;
  padding: 7px 16px;
  border-radius: 9999px;
  white-space: nowrap;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.filter-btn.active {
  background: #000000;
  color: #FFFFFF;
  font-weight: 600;
}

.slot-card {
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.slot-meta {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.slot-title {
  font-size: 16px;
  font-weight: 700;
  color: #000000;
  line-height: 1.35;
}

.slot-details {
  font-size: 14px;
  font-weight: 500;
  color: #000000;
}

.slot-status {
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: underline;
  margin-top: 2px;
}

.status-tag {
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
  padding: 4px 0;
}

.status-tag.absent {
  text-decoration: line-through;
  color: var(--muted);
}

.filters-grid {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
}

.form-row-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.modal-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-wrap.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #FFFFFF;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 26px;
  border-radius: 14px;
  margin: auto;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
}

.toast-box {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  pointer-events: none;
  max-width: 90vw;
}

.toast-msg {
  background: #000000;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 9999px;
  pointer-events: auto;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.messages-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0;
  width: 100%;
}

.msg-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.msg-item.me {
  align-items: flex-end;
}

.msg-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.msg-bubble {
  font-size: 14.5px;
  line-height: 1.45;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--pill);
  color: #000000;
  max-width: 85%;
  word-break: break-word;
}

.msg-item.me .msg-bubble {
  background: #000000;
  color: #FFFFFF;
  border-bottom-right-radius: 2px;
}

.message-form-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  width: 100%;
}

.skill-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  background: var(--pill);
  padding: 3px 8px;
  border-radius: 6px;
  margin-right: 6px;
  margin-bottom: 4px;
}

@media (max-width: 768px) {
  .site-header {
    padding: 12px 16px 6px;
    gap: 8px;
  }
  .brand-header {
    font-size: 17px;
  }
  .header-nav {
    gap: 16px;
  }
  .nav-link {
    font-size: 14px;
    padding: 4px 0;
  }
  .content-wrap {
    padding: 14px 16px 70px;
  }
  .clean-hero {
    padding: 10px 0 18px;
  }
  .hero-title {
    font-size: 28px;
  }
  .view-title {
    font-size: 20px;
  }
  .modal-card {
    padding: 22px 18px;
  }
}

@media (max-width: 600px) {
  .view-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }
  .filters-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .form-row-pair {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .message-form-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .message-form-wrap button {
    width: 100%;
    min-height: 44px;
  }
  .modal-wrap {
    padding: 12px;
    align-items: flex-start;
  }
  .modal-card {
    padding: 20px 16px;
    margin-top: 24px;
    max-height: calc(100dvh - 48px);
  }
}
