:root{
  --navy:#173a5e;
  --blue:#2f6fa5;
  --light:#eaf4fb;
  --line:#bfd7e8;
  --ink:#17324a;
  --muted:#647b8f;
  --white:#ffffff;
  --bg:#f5f8fb;
  --red:#9b3c3c;
}

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  font-family:Arial, Helvetica, sans-serif;
  color:var(--ink);
  background:var(--bg);
}

button,
input,
textarea{
  font:inherit;
}

button{
  border:0;
  border-radius:9px;
  padding:10px 14px;
  font-weight:800;
  cursor:pointer;
}

button:disabled{
  opacity:.45;
  cursor:not-allowed;
}

input,
textarea{
  width:100%;
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--white);
  color:var(--ink);
  padding:11px 12px;
  outline:none;
}

textarea{
  resize:vertical;
  line-height:1.45;
}

input:focus,
textarea:focus{
  border-color:var(--blue);
  box-shadow:0 0 0 3px rgba(47,111,165,.09);
}

.app{
  max-width:1000px;
  margin:0 auto;
  min-height:100vh;
  background:var(--white);
  box-shadow:0 0 28px rgba(18,52,77,.08);
}

.site-header{
  padding:22px 24px 18px;
  text-align:center;
  background:var(--light);
  border-bottom:1px solid var(--line);
}

.site-header h1{
  margin:0;
  font-size:34px;
  color:var(--navy);
  letter-spacing:.4px;
}

.subtitle{
  margin:5px 0 0;
  font-weight:700;
  color:var(--navy);
}

.top-actions{
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:16px;
}

.top-actions button,
#printActionBtn{
  background:var(--white);
  color:var(--navy);
  border:1px solid var(--line);
}

main{
  padding:24px;
}

.meeting-sheet{
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  background:var(--white);
}

.sheet-title{
  padding:16px 18px;
  background:var(--navy);
  color:var(--white);
  font-size:24px;
  font-weight:800;
}

.meeting-details,
.agenda-section{
  padding:18px;
}

.meeting-details{
  border-bottom:1px solid var(--line);
}

.meta-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px 18px;
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
}

.full{
  grid-column:1 / -1;
}

label{
  font-size:12px;
  font-weight:800;
  color:var(--blue);
  text-transform:uppercase;
  letter-spacing:.3px;
}

.agenda-section h2{
  margin:0 0 14px;
  color:var(--navy);
  font-size:22px;
}

.agenda-item{
  margin-bottom:16px;
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
  background:var(--white);
}

.agenda-item:last-child{
  margin-bottom:0;
}

.agenda-head{
  display:grid;
  grid-template-columns:48px 1fr;
  align-items:center;
  background:var(--navy);
}

.agenda-number{
  color:var(--white);
  font-size:18px;
  font-weight:800;
  text-align:center;
  border-right:1px solid rgba(255,255,255,.25);
  padding:14px 8px;
}

.agenda-title{
  margin:9px 11px;
  padding:11px 12px;
  background:var(--white);
  border-radius:8px;
  color:var(--ink);
  font-weight:800;
}

.agenda-body{
  padding:14px;
  display:grid;
  gap:12px;
}

.topic-recording{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  padding:10px;
  background:var(--light);
  border:1px solid var(--line);
  border-radius:9px;
}

.start-recording{
  background:var(--red);
  color:var(--white);
}

.stop-recording{
  background:var(--navy);
  color:var(--white);
}

.record-status{
  flex:1;
  min-width:180px;
  padding:9px 11px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--white);
  font-size:14px;
}

[id^="purpose-"]{
  min-height:120px;
  background:#fbfdff;
}

[id^="minutes-"]{
  min-height:120px;
}

[id^="decision-"],
[id^="action-"]{
  min-height:80px;
}

.action-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) 150px 160px;
  gap:12px;
  align-items:start;
}

.action-field{
  min-width:0;
}

.action-summary{
  margin-top:26px;
  padding-top:18px;
  border-top:3px solid var(--navy);
}

.action-summary-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:10px;
}

.action-summary-head h2{
  margin:0;
  color:var(--navy);
  font-size:24px;
}

table{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
}

th{
  padding:10px;
  background:var(--navy);
  color:var(--white);
  text-align:left;
  font-size:12px;
  text-transform:uppercase;
}

td{
  padding:10px;
  border:1px solid var(--line);
  vertical-align:top;
  word-break:break-word;
}

th:nth-child(1),
td:nth-child(1){
  width:20%;
}

th:nth-child(3),
td:nth-child(3),
th:nth-child(4),
td:nth-child(4){
  width:18%;
}

@media(max-width:760px){
  body{
    background:var(--white);
  }

  .app{
    box-shadow:none;
  }

  .site-header{
    padding:18px 14px 16px;
  }

  .site-header h1{
    font-size:30px;
  }

  main{
    padding:14px;
  }

  .meeting-details,
  .agenda-section{
    padding:14px;
  }

  .meta-grid,
  .action-grid{
    grid-template-columns:1fr;
  }

  .full{
    grid-column:auto;
  }

  .topic-recording{
    display:grid;
    grid-template-columns:1fr;
  }

  .topic-recording button{
    width:100%;
  }

  .record-status{
    min-width:0;
  }

  .agenda-head{
    grid-template-columns:42px 1fr;
  }

  .agenda-title{
    margin:8px;
    padding:10px;
  }

  .action-summary{
    overflow-x:auto;
  }

  table{
    min-width:680px;
    font-size:13px;
  }
}

@media print{
  @page{
    margin:12mm;
  }

  body{
    background:var(--white);
  }

  .app{
    max-width:none;
    box-shadow:none;
  }

  .site-header{
    padding:0 0 10px;
    background:var(--white);
    border-bottom:0;
  }

  .top-actions,
  .topic-recording,
  #printActionBtn{
    display:none !important;
  }

  main{
    padding:0;
  }

  .meeting-sheet{
    border:0;
  }

  .meeting-details,
  .agenda-section{
    padding-left:0;
    padding-right:0;
  }

  .agenda-item{
    break-inside:avoid;
  }

  .action-summary{
    break-inside:avoid;
  }

  input,
  textarea{
    border:0 !important;
    box-shadow:none !important;
    padding-left:0;
    padding-right:0;
    background:var(--white) !important;
    color:var(--ink);
  }

  textarea{
    overflow:visible;
  }

  .agenda-title{
    border:1px solid var(--line);
  }

  body.print-action-summary-only .site-header,
  body.print-action-summary-only .meeting-sheet{
    display:none !important;
  }

  body.print-action-summary-only main{
    padding:0;
  }

  body.print-action-summary-only .action-summary{
    display:block !important;
    margin:0;
    padding:0;
    border-top:0;
  }

  body.print-action-summary-only .action-summary-head{
    display:block;
    margin-bottom:12px;
  }

  body.print-action-summary-only #printActionBtn{
    display:none !important;
  }
}