:root {
  --syority-bg: #F4F6F9;
  --syority-card-bg: #FFFFFF;
  --syority-text-primary: #0B1F3A;
  --syority-text-secondary: #4A5568;
  --syority-accent: #1B5EBE;
  --syority-accent-hover: #154A96;
  --syority-border: #E2E8F0;
  --syority-danger: #9B2C2C;
  --syority-ok: #1F7A4D;
  --syority-focus-ring: rgba(27, 94, 190, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--syority-bg);
  color: var(--syority-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

.skip {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: #fff;
  padding: 0.4rem 0.7rem;
}

.skip:focus { top: 0.5rem; z-index: 5; }

a { color: var(--syority-accent); }
a:focus, button:focus, input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--syority-focus-ring);
  outline-offset: 2px;
}

.top, .nav, main { padding: 1rem 1.25rem; }

.top {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border-bottom: 1px solid var(--syority-border);
}

.brand img { display: block; height: 48px; width: auto; }
.brand-text { display: flex; flex-direction: column; }
.brand-text span { color: var(--syority-text-secondary); font-size: 0.9rem; }
.who { margin: 0; color: var(--syority-text-secondary); }
.sign-out { }
.session-links { margin-left: auto; display: flex; gap: 1rem; align-items: center; }
.avatar, .avatar-image {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  object-fit: cover;
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #E8EEF7;
  color: var(--syority-accent);
  font-weight: 700;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: #fff;
  border-bottom: 1px solid var(--syority-border);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.nav a {
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
}

.nav a[aria-current="page"] {
  background: var(--syority-accent);
  color: #fff;
}

main { max-width: 1100px; }

h1 { font-size: 1.6rem; margin: 0 0 1rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card, table, form.panel, .login-card, section.confirm, .empty {
  background: var(--syority-card-bg);
  border: 1px solid var(--syority-border);
  border-radius: 8px;
}

.card { padding: 1rem; }
.card span { display: block; color: var(--syority-text-secondary); font-size: 0.85rem; }
.card strong { font-size: 1.6rem; }
.card-link { display: block; border-radius: 8px; color: inherit; text-decoration: none; cursor: pointer; }
.card-link:hover .card { border-color: var(--syority-accent); box-shadow: 0 2px 8px rgba(11, 31, 58, 0.08); }
.card-link:focus, .card-link:focus-visible { outline: 3px solid var(--syority-focus-ring); outline-offset: 3px; }
.card .open { display: inline-block; margin-top: 0.35rem; font-style: normal; font-size: 0.75rem; font-weight: 650; color: var(--syority-accent); }
.connection-card h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.connection-card dl { margin: 0; }
.connection-card dt { color: var(--syority-text-secondary); font-size: 0.85rem; margin-top: 0.55rem; }
.connection-card dd { margin: 0; }
.connection-card p { margin: 0.75rem 0 0; }
.connection-card .actions { margin-top: 0.9rem; }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--syority-border); vertical-align: top; }
th { font-size: 0.85rem; color: var(--syority-text-secondary); }

.filters, .actions, .row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.filters { margin-bottom: 1rem; }
label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
input, select, textarea {
  font: inherit;
  padding: 0.45rem 0.55rem;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  min-width: 12rem;
}

button, .button {
  background: var(--syority-accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}

button:hover, .button:hover { background: var(--syority-accent-hover); }
.button.secondary, button.secondary { background: #fff; color: var(--syority-text-primary); border: 1px solid var(--syority-border); }
button.danger { background: var(--syority-danger); }

.banner { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.banner.error { background: #FDECEC; color: var(--syority-danger); }
.banner.notice { background: #E8F6EE; color: var(--syority-ok); }

.empty, .login-card, section.confirm, form.panel { padding: 1.25rem; }
.login-card { max-width: 28rem; margin: 3rem auto; }
.entry { max-width: 40rem; margin: 4rem auto; text-align: center; }
.entry img { height: 64px; width: auto; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.choice {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #fff;
  color: var(--syority-text-primary);
  border: 1px solid var(--syority-border);
  border-radius: 8px;
  padding: 1.25rem 1rem;
  text-decoration: none;
}
.choice strong { font-size: 1.15rem; color: var(--syority-accent); }
.choice span { color: var(--syority-text-secondary); }
.choice:hover { border-color: var(--syority-accent); }
.choice:focus { outline: 3px solid var(--syority-focus-ring); outline-offset: 2px; }
.muted { color: var(--syority-text-secondary); }
.status { font-weight: 650; }
.pager { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
dl.meta { display: grid; grid-template-columns: 12rem 1fr; gap: 0.35rem 1rem; }
section.confirm { border: 1px solid var(--syority-border); max-width: 36rem; }

@media (max-width: 800px) {
  .cards, .choices { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; }
  .session-links, .sign-out { margin-left: 0; }
  dl.meta { grid-template-columns: 1fr; }
  input, select { min-width: 0; width: 100%; }
  table { display: block; overflow-x: auto; }
}

/* =========================================================
   SYORITY Identity Responsive UI
   ========================================================= */

:root {
  --syority-radius: 10px;
  --syority-shadow: 0 2px 10px rgba(11, 31, 58, 0.045);
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
}

.top {
  min-height: 76px;
  padding: 0.75rem clamp(1rem, 2.5vw, 2.5rem);
  flex-wrap: wrap;
}

.brand img {
  display: block;
  width: clamp(125px, 12vw, 180px);
  height: auto;
  max-height: 48px;
  object-fit: contain;
}

.brand-text {
  min-width: 120px;
}

.who {
  margin-left: auto;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.session-links {
  margin-left: auto;
  white-space: nowrap;
}

.nav {
  position: relative;
  z-index: 10;
  padding: 0.55rem clamp(1rem, 2.5vw, 2.5rem);
  gap: 0.35rem;
  align-items: center;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.5rem 0.75rem;
  border-radius: 7px;
  font-size: 0.91rem;
  white-space: nowrap;
}

.nav a:hover {
  background: #edf3fc;
}

.nav a[aria-current="page"] {
  background: var(--syority-accent);
  color: #fff;
}

main {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 2rem);
}

main > * {
  min-width: 0;
}

h1 {
  line-height: 1.25;
}

h2 {
  line-height: 1.3;
}

.cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card,
form.panel,
.empty,
section.confirm,
.login-card {
  border-radius: var(--syority-radius);
  box-shadow: var(--syority-shadow);
}

.card {
  min-width: 0;
}

.scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--syority-radius);
}

table {
  min-width: 620px;
}

th,
td {
  overflow-wrap: anywhere;
}

input,
select,
textarea {
  max-width: 100%;
  min-height: 42px;
}

textarea {
  width: 100%;
}

button,
.button {
  min-height: 40px;
  font-weight: 600;
}

form.panel {
  display: grid;
  gap: 0.85rem;
}

form.panel label {
  width: 100%;
  min-width: 0;
}

form.panel input,
form.panel select,
form.panel textarea {
  width: 100%;
  min-width: 0;
}

.filters {
  align-items: end;
}

.filters label {
  min-width: min(100%, 180px);
}

.filters input,
.filters select {
  width: 100%;
}

.actions {
  align-items: center;
}

.actions button,
.actions .button {
  margin: 0;
}

.login-card {
  width: min(100%, 460px);
  margin: clamp(1.5rem, 6vh, 4rem) auto;
}

.login-card img {
  display: block;
  width: min(220px, 75%);
  height: auto;
  margin: 0 auto 1.25rem;
}

.entry {
  width: min(100%, 760px);
  margin: clamp(2rem, 8vh, 5rem) auto;
}

.entry img {
  max-width: min(220px, 75%);
  height: auto;
}

.banner {
  overflow-wrap: anywhere;
}

dl.meta {
  grid-template-columns: minmax(130px, 12rem) minmax(0, 1fr);
}

.nav-toggle {
  display: none;
}

/* Tablet */
@media (max-width: 1024px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top {
    gap: 0.75rem;
  }

  .who {
    flex-basis: 100%;
    order: 5;
    margin: 0;
  }

  .nav {
    gap: 0.2rem;
  }

  .nav a {
    font-size: 0.87rem;
  }
}

/* Mobile */
@media (max-width: 700px) {
  .top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    padding: 0.8rem 1rem;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .brand img {
    width: 130px;
    max-height: 38px;
  }

  .brand-text {
    grid-column: 1;
    grid-row: 2;
  }

  .brand-text strong {
    font-size: 0.95rem;
  }

  .brand-text span {
    font-size: 0.8rem;
  }

  .who {
    grid-column: 1 / -1;
    grid-row: 3;
    font-size: 0.82rem;
  }

  .session-links {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    gap: 0.65rem;
    font-size: 0.88rem;
  }

  .nav-toggle {
    display: inline-flex;
    grid-column: 2;
    grid-row: 2;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 40px;
    border: 1px solid var(--syority-border);
    border-radius: 7px;
    background: #fff;
    color: var(--syority-text-primary);
  }

  .nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0.6rem 1rem;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    width: 100%;
    white-space: normal;
    padding: 0.7rem 0.8rem;
  }

  main {
    padding: 1rem;
  }

  .cards,
  .choices {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 0.9rem;
  }

  .filters,
  .actions,
  .row {
    align-items: stretch;
    flex-direction: column;
  }

  .filters label,
  .actions > *,
  .row > * {
    width: 100%;
  }

  input,
  select,
  textarea {
    width: 100%;
    min-width: 0;
  }

  button,
  .button {
    text-align: center;
  }

  dl.meta {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  dl.meta dd {
    margin: 0 0 0.65rem;
    overflow-wrap: anywhere;
  }

  .pager {
    flex-wrap: wrap;
  }

  .login-card,
  .entry {
    margin: 1.25rem auto;
  }
}

/* Small phones */
@media (max-width: 380px) {
  main {
    padding: 0.75rem;
  }

  .top {
    padding: 0.7rem;
  }

  .session-links {
    font-size: 0.8rem;
  }

  h1 {
    font-size: 1.35rem;
  }
}

/* Mail Integration and Utility Styles */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 1rem 0;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid var(--syority-border);
  border-radius: 4px;
}

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

@media (max-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.button-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.button-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}

.field-hint {
  display: block;
  font-size: 0.85rem;
  color: var(--syority-text-secondary);
  margin-top: 0.25rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
  cursor: pointer;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 3px;
  text-transform: uppercase;
}

.status-success {
  background: #e6f4ea;
  color: #137333;
}

.status-warning {
  background: #fef7e0;
  color: #b06000;
}

.status-danger {
  background: #fce8e6;
  color: #c5221f;
}

.status-muted {
  background: #f1f3f4;
  color: #5f6368;
}

