:root {
  color-scheme: light;
  --paper: #f5f2e9;
  --card: #fffcf5;
  --ink: #172b26;
  --muted: #4b5e55;
  --line: #cdd3c6;
  --accent: #215244;
  --dark: #17382f;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.5 ui-sans-serif, -apple-system, sans-serif; }
button, input { font: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid #aa4e27; outline-offset: 4px; }
.shell { max-width: 1120px; margin-inline: auto; padding-inline: 32px; }
.site-head { background: var(--dark); color: #f8f3e6; }
.masthead { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.masthead .site-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 36px; padding: 5px 10px; border-radius: 6px; color: #c3d2c8; text-decoration: none; font-size: 14px; }
.site-nav a:hover { color: white; }
.site-nav a[aria-current="page"] { background: #344d42; color: #e7f8ee; }
.masthead .header-actions { margin-left: auto; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 650; }
.brand-mark {
  display: block; width: 32px; height: 32px; object-fit: cover;
  border: 1px solid #a9c3b2; border-radius: 8px;
}
.text-button { padding: 6px 0; background: none; border: 0; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.intro { padding: 68px 0 32px; }
h1 { font: 500 clamp(46px, 8vw, 82px)/1.02 var(--serif); letter-spacing: -.055em; margin: 0 0 16px; }
.intro p, .login > p { margin: 0; color: var(--muted); font-size: 17px; }
.connection-list { border-top: 2px solid var(--ink); }
.connection { scroll-margin-top: 16px; border-bottom: 1px solid var(--line); }
.connection-row {
  display: grid; align-items: center; grid-template-columns: minmax(240px, 2fr) 1fr 1fr auto;
  column-gap: 24px; padding: 24px 16px;
}
.provider { min-width: 0; display: flex; align-items: center; gap: 16px; }
.provider h2 { margin: 0; font: 600 24px/1.2 var(--serif); }
.provider p { margin: 5px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.provider-mark {
  display: grid; flex: 0 0 46px; height: 46px; place-items: center;
  border: 1px solid currentColor; border-radius: 8px; font-weight: 700; font-size: 20px;
}
.calendar { color: #315b8b; background: #e6edf4; }
.todoist { color: #963b31; background: #f8ebe4; }
.notion { color: #313b34; background: #e9e9df; font-family: var(--serif); }
.connection-meta { display: flex; align-items: flex-start; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
.status { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 650; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #869488; }
.status.connected::before { background: #258455; }
.status.attention::before { background: #bc5829; }
.access-on { font-weight: 650; color: var(--accent); }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 8px 14px; border: 1px solid #a4b0a4; border-radius: 5px;
  color: var(--ink); background: var(--card); cursor: pointer; font-weight: 650; text-decoration: none;
}
.button:hover { background: #e7ede1; }
.button.primary { background: var(--accent); color: white; border-color: var(--accent); }
.button.primary:hover { background: var(--dark); }
.button.plain { background: transparent; border-color: transparent; }
.button.danger { color: #923e31; }
.connection-details { padding: 24px; background: var(--card); border: 1px solid var(--line); border-bottom: 0; }
.action-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.editor { display: grid; justify-items: start; gap: 10px; max-width: 520px; margin-top: 24px; }
.editor label { font-weight: 700; }
.editor p { margin: 0; color: var(--muted); }
.editor input { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid #a4b0a4; border-radius: 5px; background: white; color: var(--ink); }
.editor input[type="checkbox"] { width: auto; margin: 0 6px 0 0; }
.editor textarea { box-sizing: border-box; width: 100%; padding: 10px 12px; resize: vertical; }
.notice { margin: 0 0 16px; padding: 12px 16px; border-left: 3px solid var(--accent); background: #e6eee1; }
.notice.error { border-color: #923e31; background: #f8ebe4; }
.usage { max-width: 620px; padding: 32px 16px 56px; }
.usage h2 { font: 600 23px var(--serif); margin: 0 0 8px; }
.usage p { margin: 0; color: var(--muted); }
code { color: var(--ink); background: #e7ebdf; padding: 2px 5px; border-radius: 3px; }
.login { max-width: 620px; padding-top: 88px; }
.login .notice { margin-top: 18px; }
@media (max-width: 800px) {
  .connection-row { grid-template-columns: minmax(180px, 1fr) auto; gap: 14px 16px; }
  .provider { grid-column: 1; }
  .connection-meta { grid-row: 2; }
  .access { grid-column: 2; }
  .connection-row > .button { grid-column: 2; grid-row: 1; }
}
@media (max-width: 480px) {
  .shell { padding-inline: 18px; }
  .intro { padding-top: 46px; }
  .connection-row { padding-inline: 0; }
  .provider { gap: 9px; }
  .provider h2 { font-size: 21px; }
  .provider-mark { flex-basis: 36px; height: 36px; font-size: 16px; }
  .connection-details { padding: 16px; }
}
@media (max-width: 650px) {
  .masthead:has(.site-nav) { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding-block: 9px; }
  .masthead .site-nav { grid-column: 1 / -1; grid-row: 2; }
  .masthead .header-actions { grid-column: 2; grid-row: 1; }
}
